From e08f35af6ac7c41a99d3d34a2374edb0e03a17d0 Mon Sep 17 00:00:00 2001 From: Noah Prince Date: Fri, 19 Jul 2024 14:16:15 -0700 Subject: [PATCH 01/63] Orgs, net ids, and routing manager working --- Anchor.toml | 2 + Cargo.lock | 19 + .../src/heliumCommonResolver.ts | 2 + .../helium-entity-manager-sdk/src/pdas.ts | 12 + .../src/resolvers.ts | 10 +- packages/helium-vote-service/.env | 4 + packages/iot-routing-manager-sdk/package.json | 47 + .../iot-routing-manager-sdk/src/constants.ts | 5 + packages/iot-routing-manager-sdk/src/index.ts | 29 + packages/iot-routing-manager-sdk/src/pdas.ts | 56 + .../iot-routing-manager-sdk/src/resolvers.ts | 60 + .../iot-routing-manager-sdk/tsconfig.cjs.json | 7 + .../iot-routing-manager-sdk/tsconfig.esm.json | 8 + .../iot-routing-manager-sdk/tsconfig.json | 20 + .../iot-routing-manager-sdk/yarn.deploy.lock | 2044 +++++++++++++++++ packages/rewards-oracle-faucet-service/.env | 3 + .../initialize_shared_merkle_v0.rs | 83 + .../instructions/issue_program_entity_v0.rs | 60 +- .../src/instructions/mod.rs | 4 + .../swap_shared_merkle_tree_v0.rs | 81 + programs/helium-entity-manager/src/lib.rs | 11 + programs/helium-entity-manager/src/state.rs | 20 + programs/iot-routing-manager/Cargo.toml | 37 + programs/iot-routing-manager/Xargo.toml | 2 + programs/iot-routing-manager/src/error.rs | 11 + .../initialize_devaddr_constraint_v0.rs | 62 + .../src/instructions/initialize_net_id_v0.rs | 42 + .../initialize_organization_v0.rs | 202 ++ .../initialize_routing_manager_v0.rs | 175 ++ .../src/instructions/mod.rs | 9 + programs/iot-routing-manager/src/lib.rs | 61 + programs/iot-routing-manager/src/state.rs | 98 + .../instructions/initialize_subscriber_v0.rs | 1 + .../src/instructions/issue_carrier_nft_v0.rs | 1 + tests/helium-entity-manager.ts | 14 +- tests/iot-routing-manager.ts | 220 ++ tests/mobile-entity-manager.ts | 1 + tests/utils/fixtures.ts | 48 +- tsconfig.json | 3 + yarn.lock | 15 + 40 files changed, 3570 insertions(+), 19 deletions(-) create mode 100644 packages/helium-vote-service/.env create mode 100644 packages/iot-routing-manager-sdk/package.json create mode 100644 packages/iot-routing-manager-sdk/src/constants.ts create mode 100644 packages/iot-routing-manager-sdk/src/index.ts create mode 100644 packages/iot-routing-manager-sdk/src/pdas.ts create mode 100644 packages/iot-routing-manager-sdk/src/resolvers.ts create mode 100644 packages/iot-routing-manager-sdk/tsconfig.cjs.json create mode 100644 packages/iot-routing-manager-sdk/tsconfig.esm.json create mode 100644 packages/iot-routing-manager-sdk/tsconfig.json create mode 100644 packages/iot-routing-manager-sdk/yarn.deploy.lock create mode 100644 packages/rewards-oracle-faucet-service/.env create mode 100644 programs/helium-entity-manager/src/instructions/initialize_shared_merkle_v0.rs create mode 100644 programs/helium-entity-manager/src/instructions/swap_shared_merkle_tree_v0.rs create mode 100644 programs/iot-routing-manager/Cargo.toml create mode 100644 programs/iot-routing-manager/Xargo.toml create mode 100644 programs/iot-routing-manager/src/error.rs create mode 100644 programs/iot-routing-manager/src/instructions/initialize_devaddr_constraint_v0.rs create mode 100644 programs/iot-routing-manager/src/instructions/initialize_net_id_v0.rs create mode 100644 programs/iot-routing-manager/src/instructions/initialize_organization_v0.rs create mode 100644 programs/iot-routing-manager/src/instructions/initialize_routing_manager_v0.rs create mode 100644 programs/iot-routing-manager/src/instructions/mod.rs create mode 100644 programs/iot-routing-manager/src/lib.rs create mode 100644 programs/iot-routing-manager/src/state.rs create mode 100644 tests/iot-routing-manager.ts diff --git a/Anchor.toml b/Anchor.toml index 394eaaea1..cc02df868 100644 --- a/Anchor.toml +++ b/Anchor.toml @@ -17,6 +17,7 @@ fanout = "fanqeMu3fw8R4LwKNbahPtYXJsyLL6NXyfe2BqzhfB6" mobile_entity_manager = "memMa1HG4odAFmUbGWfPwS1WWfK95k99F2YTkGvyxZr" hexboosting = "hexbnKYoA2GercNNhHUCCfrTRWrHjT6ujKPXTa5NPqJ" no_emit = "noEmmgLmQdk6DLiPV8CSwQv3qQDyGEhz9m5A4zhtByv" +iot_routing_manager = "irtjLnjCMmyowq2m3KWqpuFB3M9gdNA9A4t4d6VWmzB" [workspace] members = [ @@ -34,6 +35,7 @@ members = [ "programs/mobile-entity-manager", "programs/hexboosting", "programs/no-emit", + "programs/iot-routing-manager", ] [registry] diff --git a/Cargo.lock b/Cargo.lock index d7ad9f9bd..59125bb4f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2238,6 +2238,25 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "iot-routing-manager" +version = "0.1.2" +dependencies = [ + "account-compression-cpi", + "anchor-lang", + "anchor-spl", + "angry-purple-tiger", + "bs58 0.3.1", + "bubblegum-cpi", + "bytemuck", + "default-env", + "helium-entity-manager", + "helium-sub-daos", + "mpl-token-metadata", + "shared-utils", + "solana-security-txt", +] + [[package]] name = "ipnet" version = "2.8.0" diff --git a/packages/anchor-resolvers/src/heliumCommonResolver.ts b/packages/anchor-resolvers/src/heliumCommonResolver.ts index 1ec207865..a78dad512 100644 --- a/packages/anchor-resolvers/src/heliumCommonResolver.ts +++ b/packages/anchor-resolvers/src/heliumCommonResolver.ts @@ -28,6 +28,8 @@ export const heliumCommonResolver = resolveIndividual(async ({ path }) => { return new PublicKey("1azyuavdMyvsivtNxPoz6SucD18eDHeXzFCUPq5XU7w"); case "noEmitProgram": return new PublicKey("noEmmgLmQdk6DLiPV8CSwQv3qQDyGEhz9m5A4zhtByv"); + case "heliumEntityManagerProgram": + return new PublicKey("hemjuPXBpNvggtaUnN1MwT3wrdhttKEfosTcc2P9Pg8"); default: return; } diff --git a/packages/helium-entity-manager-sdk/src/pdas.ts b/packages/helium-entity-manager-sdk/src/pdas.ts index 2d3fb0b72..d3e4dc489 100644 --- a/packages/helium-entity-manager-sdk/src/pdas.ts +++ b/packages/helium-entity-manager-sdk/src/pdas.ts @@ -50,6 +50,18 @@ export const dataOnlyEscrowKey = (dataOnly: PublicKey, programId: PublicKey = PR programId, ); +export const sharedMerkleKey = ( + proofSize: number, + programId: PublicKey = PROGRAM_ID +) => { + const proofSizeBuffer = Buffer.alloc(1); + proofSizeBuffer.writeUint8(proofSize); + return PublicKey.findProgramAddressSync( + [Buffer.from("shared_merkle", "utf-8"), proofSizeBuffer], + programId + ); +}; + export const makerKey = (dao: PublicKey, name: String, programId: PublicKey = PROGRAM_ID) => PublicKey.findProgramAddressSync( [Buffer.from("maker", "utf-8"), dao.toBuffer(), Buffer.from(name, "utf-8")], diff --git a/packages/helium-entity-manager-sdk/src/resolvers.ts b/packages/helium-entity-manager-sdk/src/resolvers.ts index 4456f4205..1fdbded8c 100644 --- a/packages/helium-entity-manager-sdk/src/resolvers.ts +++ b/packages/helium-entity-manager-sdk/src/resolvers.ts @@ -10,7 +10,7 @@ import { } from "@solana/spl-token"; import { PublicKey } from "@solana/web3.js"; import { init } from "./init"; -import { iotInfoKey, keyToAssetKey, mobileInfoKey, programApprovalKey } from "./pdas"; +import { iotInfoKey, keyToAssetKey, mobileInfoKey, programApprovalKey, sharedMerkleKey } from "./pdas"; import { notEmittedKey } from "@helium/no-emit-sdk"; export const heliumEntityManagerResolvers = combineResolvers( @@ -151,6 +151,14 @@ export const heliumEntityManagerResolvers = combineResolvers( ); } }), + resolveIndividual(async ({ path, args }) => { + if ( + path[path.length - 1] === "sharedMerkle" && + args[0].proofSize + ) { + return sharedMerkleKey(args[0].proofSize)[0]; + } + }), ataResolver({ instruction: "issueIotOperationsFundV0", account: "recipientAccount", diff --git a/packages/helium-vote-service/.env b/packages/helium-vote-service/.env new file mode 100644 index 000000000..4d4fecb52 --- /dev/null +++ b/packages/helium-vote-service/.env @@ -0,0 +1,4 @@ +PGDATABASE=postgres +PGUSER=postgres +PGPASSWORD=postgres +SOLANA_URL=https://solana-rpc.web.test-helium.com?session-key=Pluto diff --git a/packages/iot-routing-manager-sdk/package.json b/packages/iot-routing-manager-sdk/package.json new file mode 100644 index 000000000..e9a0988b0 --- /dev/null +++ b/packages/iot-routing-manager-sdk/package.json @@ -0,0 +1,47 @@ +{ + "name": "@helium/iot-routing-manager-sdk", + "publishConfig": { + "access": "public", + "registry": "https://registry.npmjs.org/" + }, + "license": "Apache-2.0", + "version": "0.8.7", + "description": "Interface to the iot-routing-manager smart contract", + "repository": { + "type": "git", + "url": "https://github.com/helium/helium-program-libary" + }, + "main": "./lib/cjs/index.js", + "module": "./lib/esm/src/index.js", + "types": "./lib/types/src/index.d.ts", + "sideEffects": false, + "files": [ + "lib" + ], + "exports": { + "import": "./lib/esm/src/index.js", + "require": "./lib/cjs/index.js", + "types": "./lib/types/src/index.d.ts" + }, + "scripts": { + "format": "prettier --write \"src/**/*.{ts,tsx}\"", + "precommit": "npx git-format-staged -f 'prettier --ignore-unknown --stdin --stdin-filepath \"{}\"' .", + "clean": "npx shx mkdir -p lib && npx shx rm -rf lib", + "package": "npx shx mkdir -p lib/cjs lib/esm", + "prebuild": "npm run clean && npm run package" + }, + "dependencies": { + "@coral-xyz/anchor": "^0.28.0", + "@helium/anchor-resolvers": "^0.8.7", + "@helium/helium-entity-manager-sdk": "^0.8.7", + "bn.js": "^5.2.0", + "bs58": "^4.0.1" + }, + "devDependencies": { + "git-format-staged": "^2.1.3", + "ts-loader": "^9.2.3", + "ts-node": "^10.9.1", + "typescript": "^5.2.2" + }, + "gitHead": "5a8bf0b7b88e5934ef8d774e686f7c95804fbb8d" +} diff --git a/packages/iot-routing-manager-sdk/src/constants.ts b/packages/iot-routing-manager-sdk/src/constants.ts new file mode 100644 index 000000000..e415c014f --- /dev/null +++ b/packages/iot-routing-manager-sdk/src/constants.ts @@ -0,0 +1,5 @@ +import { PublicKey } from "@solana/web3.js"; + +export const PROGRAM_ID = new PublicKey( + "irtjLnjCMmyowq2m3KWqpuFB3M9gdNA9A4t4d6VWmzB" +); diff --git a/packages/iot-routing-manager-sdk/src/index.ts b/packages/iot-routing-manager-sdk/src/index.ts new file mode 100644 index 000000000..50f94038d --- /dev/null +++ b/packages/iot-routing-manager-sdk/src/index.ts @@ -0,0 +1,29 @@ +import { IotRoutingManager } from "@helium/idls/lib/types/iot_routing_manager"; +import { AnchorProvider, Idl, Program } from "@coral-xyz/anchor"; +import { PublicKey } from "@solana/web3.js"; +import { PROGRAM_ID } from "./constants"; +import { lazyDistributorResolvers } from "./resolvers"; + +export * from "./constants"; +export * from "./pdas"; +export * from "./resolvers"; + +export async function init( + provider: AnchorProvider, + programId: PublicKey = PROGRAM_ID, + idl?: Idl | null, +): Promise> { + if (!idl) { + idl = await Program.fetchIdl(programId, provider); + } + const iotRoutingManager = new Program( + idl as IotRoutingManager, + programId, + provider, + undefined, + () => { + return lazyDistributorResolvers; + } + ) as Program; + return iotRoutingManager; +} diff --git a/packages/iot-routing-manager-sdk/src/pdas.ts b/packages/iot-routing-manager-sdk/src/pdas.ts new file mode 100644 index 000000000..32aa9b688 --- /dev/null +++ b/packages/iot-routing-manager-sdk/src/pdas.ts @@ -0,0 +1,56 @@ +import { PublicKey } from "@solana/web3.js"; +import { PROGRAM_ID } from "./constants"; +import BN from "bn.js"; + + +export function routingManagerKey( + subDao: PublicKey, + programId: PublicKey = PROGRAM_ID +): [PublicKey, number] { + return PublicKey.findProgramAddressSync( + [Buffer.from("routing_manager", "utf-8"), subDao.toBuffer()], + programId + ); +} + +export function organizationKey( + routingManager: PublicKey, + oui: BN, + programId: PublicKey = PROGRAM_ID +): [PublicKey, number] { + const ouiBuffer = Buffer.alloc(8) + ouiBuffer.writeBigUint64LE(BigInt(oui.toString())) + return PublicKey.findProgramAddressSync( + [Buffer.from("organization", "utf-8"), routingManager.toBuffer(), ouiBuffer], + programId + ); +} + + +export function netIdKey( + routingManager: PublicKey, + id: BN, + programId: PublicKey = PROGRAM_ID +): [PublicKey, number] { + const idBuffer = Buffer.alloc(8); + idBuffer.writeBigUint64LE(BigInt(id.toString())); + return PublicKey.findProgramAddressSync( + [ + Buffer.from("net_id", "utf-8"), + routingManager.toBuffer(), + idBuffer, + ], + programId + ); +} + +export function organizationDelegateKey( + organization: PublicKey, + delegate: PublicKey, + programId: PublicKey = PROGRAM_ID +): [PublicKey, number] { + return PublicKey.findProgramAddressSync( + [Buffer.from("organization_delegate", "utf-8"), organization.toBuffer(), delegate.toBuffer()], + programId + ); +} diff --git a/packages/iot-routing-manager-sdk/src/resolvers.ts b/packages/iot-routing-manager-sdk/src/resolvers.ts new file mode 100644 index 000000000..6027255b6 --- /dev/null +++ b/packages/iot-routing-manager-sdk/src/resolvers.ts @@ -0,0 +1,60 @@ +import { Accounts } from "@coral-xyz/anchor"; +import { heliumCommonResolver } from "@helium/anchor-resolvers"; +import { + ataResolver, + combineResolvers, + resolveIndividual, +} from "@helium/anchor-resolvers"; +import { PublicKey } from "@solana/web3.js"; +import { netIdKey, organizationKey } from "./pdas"; +import { PROGRAM_ID } from "./constants"; +import { heliumEntityManagerResolvers, keyToAssetKey, programApprovalKey, sharedMerkleKey } from "@helium/helium-entity-manager-sdk"; + +export const lazyDistributorResolvers = combineResolvers( + heliumCommonResolver, + heliumEntityManagerResolvers, + ataResolver({ + instruction: "initializeRoutingManagerV0", + account: "tokenAccount", + mint: "collection", + owner: "routingManager", + }), + resolveIndividual(async ({ args, path, accounts }) => { + if ( + args[0] && + args[0].netId && + path[path.length - 1] == "netId" && + accounts.routingManager + ) { + return netIdKey(accounts.routingManager as PublicKey, args[0].netId)[0]; + } else if ( + args[0] && + args[0].oui && + path[path.length - 1] === "organization" && + accounts.routingManager + ) { + return organizationKey( + accounts.routingManager as PublicKey, + args[0].oui + )[0]; + } else if (path[path.length - 1] == "programApproval" && accounts.dao) { + return programApprovalKey(accounts.dao as PublicKey, PROGRAM_ID)[0]; + } else if ( + path[path.length - 1] === "keyToAsset" && + args[args.length - 1] && + args[args.length - 1].oui && + accounts.dao + ) { + return ( + await keyToAssetKey( + accounts.dao as PublicKey, + `OUI_${args[args.length - 1].oui}`, + "utf-8" + ) + )[0]; + } else if (path[path.length - 1] === "sharedMerkle") { + return sharedMerkleKey(3)[0] + } + }) +); + diff --git a/packages/iot-routing-manager-sdk/tsconfig.cjs.json b/packages/iot-routing-manager-sdk/tsconfig.cjs.json new file mode 100644 index 000000000..950b2365f --- /dev/null +++ b/packages/iot-routing-manager-sdk/tsconfig.cjs.json @@ -0,0 +1,7 @@ +{ + "extends": "../../tsconfig.cjs.json", + "include": ["src"], + "compilerOptions": { + "outDir": "lib/cjs" + } +} \ No newline at end of file diff --git a/packages/iot-routing-manager-sdk/tsconfig.esm.json b/packages/iot-routing-manager-sdk/tsconfig.esm.json new file mode 100644 index 000000000..f2835b2e5 --- /dev/null +++ b/packages/iot-routing-manager-sdk/tsconfig.esm.json @@ -0,0 +1,8 @@ +{ + "extends": "../../tsconfig.esm.json", + "include": ["src"], + "compilerOptions": { + "outDir": "lib/esm", + "declarationDir": "lib/types" + } +} \ No newline at end of file diff --git a/packages/iot-routing-manager-sdk/tsconfig.json b/packages/iot-routing-manager-sdk/tsconfig.json new file mode 100644 index 000000000..20acdaa8e --- /dev/null +++ b/packages/iot-routing-manager-sdk/tsconfig.json @@ -0,0 +1,20 @@ +{ + "extends": "../../tsconfig.root.json", + "references": [ + { + "path": "../idls" + }, + { + "path": "../anchor-resolvers" + }, + { + "path": "../circuit-breaker-sdk" + }, + { + "path": "./tsconfig.cjs.json" + }, + { + "path": "./tsconfig.esm.json" + } + ] +} diff --git a/packages/iot-routing-manager-sdk/yarn.deploy.lock b/packages/iot-routing-manager-sdk/yarn.deploy.lock new file mode 100644 index 000000000..f430dacb0 --- /dev/null +++ b/packages/iot-routing-manager-sdk/yarn.deploy.lock @@ -0,0 +1,2044 @@ +# This file is generated by running "yarn install" inside your project. +# Manual changes might be lost - proceed with caution! + +__metadata: + version: 6 + cacheKey: 8 + +"@babel/runtime@npm:^7.17.2, @babel/runtime@npm:^7.22.6": + version: 7.22.11 + resolution: "@babel/runtime@npm:7.22.11" + dependencies: + regenerator-runtime: "npm:^0.14.0" + checksum: a5cd6683a8fcdb8065cb1677f221e22f6c67ec8f15ad1d273b180b93ab3bd86c66da2c48f500d4e72d8d2cfa85ff4872a3f350e5aa3855630036af5da765c001 + languageName: node + linkType: hard + +"@babel/runtime@npm:^7.23.4": + version: 7.24.1 + resolution: "@babel/runtime@npm:7.24.1" + dependencies: + regenerator-runtime: ^0.14.0 + checksum: 5c8f3b912ba949865f03b3cf8395c60e1f4ebd1033fbd835bdfe81b6cac8a87d85bc3c7aded5fcdf07be044c9ab8c818f467abe0deca50020c72496782639572 + languageName: node + linkType: hard + +"@coral-xyz/anchor@npm:^0.28.0": + version: 0.28.0 + resolution: "@coral-xyz/anchor@npm:0.28.0" + dependencies: + "@coral-xyz/borsh": "npm:^0.28.0" + "@solana/web3.js": "npm:^1.68.0" + base64-js: "npm:^1.5.1" + bn.js: "npm:^5.1.2" + bs58: "npm:^4.0.1" + buffer-layout: "npm:^1.2.2" + camelcase: "npm:^6.3.0" + cross-fetch: "npm:^3.1.5" + crypto-hash: "npm:^1.3.0" + eventemitter3: "npm:^4.0.7" + js-sha256: "npm:^0.9.0" + pako: "npm:^2.0.3" + snake-case: "npm:^3.0.4" + superstruct: "npm:^0.15.4" + toml: "npm:^3.0.0" + checksum: 58b3677b5b2ce2c779045184ce4a0ef696966a6a58f41c1c56f6f178db0491acecb6ec677ce0502f0b382a2c724f9c2860d82cc88601784d556d95fbeda415e5 + languageName: node + linkType: hard + +"@coral-xyz/borsh@npm:^0.28.0": + version: 0.28.0 + resolution: "@coral-xyz/borsh@npm:0.28.0" + dependencies: + bn.js: "npm:^5.1.2" + buffer-layout: "npm:^1.2.0" + peerDependencies: + "@solana/web3.js": ^1.68.0 + checksum: bc2b06b777f9ed43d3b886d2350826bd44d5b932c4fd4471af5956e8755236f5854938c890ee4986d88f61d1439e1d84e715c43dcb6dca4e76198c1ce8dc7a58 + languageName: node + linkType: hard + +"@cspotcode/source-map-support@npm:^0.8.0": + version: 0.8.1 + resolution: "@cspotcode/source-map-support@npm:0.8.1" + dependencies: + "@jridgewell/trace-mapping": "npm:0.3.9" + checksum: 5718f267085ed8edb3e7ef210137241775e607ee18b77d95aa5bd7514f47f5019aa2d82d96b3bf342ef7aa890a346fa1044532ff7cc3009e7d24fce3ce6200fa + languageName: node + linkType: hard + +"@helium/anchor-resolvers@^0.8.7": + version: 0.0.0-use.local + resolution: "@helium/anchor-resolvers@workspace:packages/anchor-resolvers" + dependencies: + "@solana/spl-token": ^0.3.8 + "@solana/web3.js": ^1.78.8 + git-format-staged: ^2.1.3 + ts-loader: ^9.2.3 + typescript: ^5.2.2 + peerDependencies: + "@coral-xyz/anchor": ^0.28.0 + languageName: unknown + linkType: soft + +"@helium/iot-routing-manager-sdk@workspace:.": + version: 0.0.0-use.local + resolution: "@helium/iot-routing-manager-sdk@workspace:." + dependencies: + "@coral-xyz/anchor": ^0.28.0 + "@helium/anchor-resolvers": ^0.8.7 + bn.js: ^5.2.0 + bs58: ^4.0.1 + git-format-staged: ^2.1.3 + ts-loader: ^9.2.3 + ts-node: ^10.9.1 + typescript: ^5.2.2 + languageName: unknown + linkType: soft + +"@isaacs/cliui@npm:^8.0.2": + version: 8.0.2 + resolution: "@isaacs/cliui@npm:8.0.2" + dependencies: + string-width: "npm:^5.1.2" + string-width-cjs: "npm:string-width@^4.2.0" + strip-ansi: "npm:^7.0.1" + strip-ansi-cjs: "npm:strip-ansi@^6.0.1" + wrap-ansi: "npm:^8.1.0" + wrap-ansi-cjs: "npm:wrap-ansi@^7.0.0" + checksum: 4a473b9b32a7d4d3cfb7a614226e555091ff0c5a29a1734c28c72a182c2f6699b26fc6b5c2131dfd841e86b185aea714c72201d7c98c2fba5f17709333a67aeb + languageName: node + linkType: hard + +"@jridgewell/resolve-uri@npm:^3.0.3": + version: 3.1.1 + resolution: "@jridgewell/resolve-uri@npm:3.1.1" + checksum: f5b441fe7900eab4f9155b3b93f9800a916257f4e8563afbcd3b5a5337b55e52bd8ae6735453b1b745457d9f6cdb16d74cd6220bbdd98cf153239e13f6cbb653 + languageName: node + linkType: hard + +"@jridgewell/sourcemap-codec@npm:^1.4.10": + version: 1.4.15 + resolution: "@jridgewell/sourcemap-codec@npm:1.4.15" + checksum: b881c7e503db3fc7f3c1f35a1dd2655a188cc51a3612d76efc8a6eb74728bef5606e6758ee77423e564092b4a518aba569bbb21c9bac5ab7a35b0c6ae7e344c8 + languageName: node + linkType: hard + +"@jridgewell/trace-mapping@npm:0.3.9": + version: 0.3.9 + resolution: "@jridgewell/trace-mapping@npm:0.3.9" + dependencies: + "@jridgewell/resolve-uri": "npm:^3.0.3" + "@jridgewell/sourcemap-codec": "npm:^1.4.10" + checksum: d89597752fd88d3f3480845691a05a44bd21faac18e2185b6f436c3b0fd0c5a859fbbd9aaa92050c4052caf325ad3e10e2e1d1b64327517471b7d51babc0ddef + languageName: node + linkType: hard + +"@noble/curves@npm:^1.0.0": + version: 1.2.0 + resolution: "@noble/curves@npm:1.2.0" + dependencies: + "@noble/hashes": "npm:1.3.2" + checksum: bb798d7a66d8e43789e93bc3c2ddff91a1e19fdb79a99b86cd98f1e5eff0ee2024a2672902c2576ef3577b6f282f3b5c778bebd55761ddbb30e36bf275e83dd0 + languageName: node + linkType: hard + +"@noble/curves@npm:^1.2.0": + version: 1.4.0 + resolution: "@noble/curves@npm:1.4.0" + dependencies: + "@noble/hashes": 1.4.0 + checksum: 0014ff561d16e98da4a57e2310a4015e4bdab3b1e1eafcd18d3f9b955c29c3501452ca5d702fddf8ca92d570bbeadfbe53fe16ebbd81a319c414f739154bb26b + languageName: node + linkType: hard + +"@noble/hashes@npm:1.3.2, @noble/hashes@npm:^1.3.1": + version: 1.3.2 + resolution: "@noble/hashes@npm:1.3.2" + checksum: fe23536b436539d13f90e4b9be843cc63b1b17666a07634a2b1259dded6f490be3d050249e6af98076ea8f2ea0d56f578773c2197f2aa0eeaa5fba5bc18ba474 + languageName: node + linkType: hard + +"@noble/hashes@npm:1.4.0, @noble/hashes@npm:^1.3.3": + version: 1.4.0 + resolution: "@noble/hashes@npm:1.4.0" + checksum: 8ba816ae26c90764b8c42493eea383716396096c5f7ba6bea559993194f49d80a73c081f315f4c367e51bd2d5891700bcdfa816b421d24ab45b41cb03e4f3342 + languageName: node + linkType: hard + +"@npmcli/fs@npm:^3.1.0": + version: 3.1.0 + resolution: "@npmcli/fs@npm:3.1.0" + dependencies: + semver: "npm:^7.3.5" + checksum: a50a6818de5fc557d0b0e6f50ec780a7a02ab8ad07e5ac8b16bf519e0ad60a144ac64f97d05c443c3367235d337182e1d012bbac0eb8dbae8dc7b40b193efd0e + languageName: node + linkType: hard + +"@pkgjs/parseargs@npm:^0.11.0": + version: 0.11.0 + resolution: "@pkgjs/parseargs@npm:0.11.0" + checksum: 6ad6a00fc4f2f2cfc6bff76fb1d88b8ee20bc0601e18ebb01b6d4be583733a860239a521a7fbca73b612e66705078809483549d2b18f370eb346c5155c8e4a0f + languageName: node + linkType: hard + +"@solana/buffer-layout-utils@npm:^0.2.0": + version: 0.2.0 + resolution: "@solana/buffer-layout-utils@npm:0.2.0" + dependencies: + "@solana/buffer-layout": "npm:^4.0.0" + "@solana/web3.js": "npm:^1.32.0" + bigint-buffer: "npm:^1.1.5" + bignumber.js: "npm:^9.0.1" + checksum: 9284242245b18b49577195ba7548263850be865a4a2d183944fa01bb76382039db589aab8473698e9bb734b515ada9b4d70db0a72e341c5d567c59b83d6d0840 + languageName: node + linkType: hard + +"@solana/buffer-layout@npm:^4.0.0, @solana/buffer-layout@npm:^4.0.1": + version: 4.0.1 + resolution: "@solana/buffer-layout@npm:4.0.1" + dependencies: + buffer: "npm:~6.0.3" + checksum: bf846888e813187243d4008a7a9f58b49d16cbd995b9d7f1b72898aa510ed77b1ce5e8468e7b2fd26dd81e557a4e74a666e21fccb95f123c1f740d41138bbacd + languageName: node + linkType: hard + +"@solana/spl-token@npm:^0.3.8": + version: 0.3.8 + resolution: "@solana/spl-token@npm:0.3.8" + dependencies: + "@solana/buffer-layout": "npm:^4.0.0" + "@solana/buffer-layout-utils": "npm:^0.2.0" + buffer: "npm:^6.0.3" + peerDependencies: + "@solana/web3.js": ^1.47.4 + checksum: 01f4f87112b0ad277701a3bcb8e03069b69449b92724b17959107686731082bfd3475b5f105e1e8f04badd2e810a43d5ef811744ced5178eea1232de8fd75147 + languageName: node + linkType: hard + +"@solana/web3.js@npm:^1.32.0, @solana/web3.js@npm:^1.68.0": + version: 1.78.4 + resolution: "@solana/web3.js@npm:1.78.4" + dependencies: + "@babel/runtime": "npm:^7.22.6" + "@noble/curves": "npm:^1.0.0" + "@noble/hashes": "npm:^1.3.1" + "@solana/buffer-layout": "npm:^4.0.0" + agentkeepalive: "npm:^4.3.0" + bigint-buffer: "npm:^1.1.5" + bn.js: "npm:^5.2.1" + borsh: "npm:^0.7.0" + bs58: "npm:^4.0.1" + buffer: "npm:6.0.3" + fast-stable-stringify: "npm:^1.0.0" + jayson: "npm:^4.1.0" + node-fetch: "npm:^2.6.12" + rpc-websockets: "npm:^7.5.1" + superstruct: "npm:^0.14.2" + checksum: e1c44c6cbec87cdfd4d6d23b4241b746e14ed3a9ca73d596693758d91ac825cecf579345da3b0b7bb5e54b6794791bc0eac02cadf11f1ec79e859b6536f26f11 + languageName: node + linkType: hard + +"@solana/web3.js@npm:^1.78.8": + version: 1.91.3 + resolution: "@solana/web3.js@npm:1.91.3" + dependencies: + "@babel/runtime": ^7.23.4 + "@noble/curves": ^1.2.0 + "@noble/hashes": ^1.3.3 + "@solana/buffer-layout": ^4.0.1 + agentkeepalive: ^4.5.0 + bigint-buffer: ^1.1.5 + bn.js: ^5.2.1 + borsh: ^0.7.0 + bs58: ^4.0.1 + buffer: 6.0.3 + fast-stable-stringify: ^1.0.0 + jayson: ^4.1.0 + node-fetch: ^2.7.0 + rpc-websockets: ^7.5.1 + superstruct: ^0.14.2 + checksum: 5b251915057368d0615d6a6f0de7b4d4129c3d0643599551c0a342125601418634851b633a47d19da481973406f0f2928fa4bf1a2c57fb19914e69fd5b81c302 + languageName: node + linkType: hard + +"@tootallnate/once@npm:2": + version: 2.0.0 + resolution: "@tootallnate/once@npm:2.0.0" + checksum: ad87447820dd3f24825d2d947ebc03072b20a42bfc96cbafec16bff8bbda6c1a81fcb0be56d5b21968560c5359a0af4038a68ba150c3e1694fe4c109a063bed8 + languageName: node + linkType: hard + +"@tsconfig/node10@npm:^1.0.7": + version: 1.0.9 + resolution: "@tsconfig/node10@npm:1.0.9" + checksum: a33ae4dc2a621c0678ac8ac4bceb8e512ae75dac65417a2ad9b022d9b5411e863c4c198b6ba9ef659e14b9fb609bbec680841a2e84c1172df7a5ffcf076539df + languageName: node + linkType: hard + +"@tsconfig/node12@npm:^1.0.7": + version: 1.0.11 + resolution: "@tsconfig/node12@npm:1.0.11" + checksum: 5ce29a41b13e7897a58b8e2df11269c5395999e588b9a467386f99d1d26f6c77d1af2719e407621412520ea30517d718d5192a32403b8dfcc163bf33e40a338a + languageName: node + linkType: hard + +"@tsconfig/node14@npm:^1.0.0": + version: 1.0.3 + resolution: "@tsconfig/node14@npm:1.0.3" + checksum: 19275fe80c4c8d0ad0abed6a96dbf00642e88b220b090418609c4376e1cef81bf16237bf170ad1b341452feddb8115d8dd2e5acdfdea1b27422071163dc9ba9d + languageName: node + linkType: hard + +"@tsconfig/node16@npm:^1.0.2": + version: 1.0.4 + resolution: "@tsconfig/node16@npm:1.0.4" + checksum: 202319785901f942a6e1e476b872d421baec20cf09f4b266a1854060efbf78cde16a4d256e8bc949d31e6cd9a90f1e8ef8fb06af96a65e98338a2b6b0de0a0ff + languageName: node + linkType: hard + +"@types/connect@npm:^3.4.33": + version: 3.4.35 + resolution: "@types/connect@npm:3.4.35" + dependencies: + "@types/node": "npm:*" + checksum: fe81351470f2d3165e8b12ce33542eef89ea893e36dd62e8f7d72566dfb7e448376ae962f9f3ea888547ce8b55a40020ca0e01d637fab5d99567673084542641 + languageName: node + linkType: hard + +"@types/node@npm:*": + version: 20.5.7 + resolution: "@types/node@npm:20.5.7" + checksum: fc284c8e16ddc04569730d58e87eae349eb1c3dd9020cb79a1862d9d9add6f04e7367a236f3252db8db2572f90278e250f4cd43d27d264972b54394eaba1ed76 + languageName: node + linkType: hard + +"@types/node@npm:^12.12.54": + version: 12.20.55 + resolution: "@types/node@npm:12.20.55" + checksum: e4f86785f4092706e0d3b0edff8dca5a13b45627e4b36700acd8dfe6ad53db71928c8dee914d4276c7fd3b6ccd829aa919811c9eb708a2c8e4c6eb3701178c37 + languageName: node + linkType: hard + +"@types/ws@npm:^7.4.4": + version: 7.4.7 + resolution: "@types/ws@npm:7.4.7" + dependencies: + "@types/node": "npm:*" + checksum: b4c9b8ad209620c9b21e78314ce4ff07515c0cadab9af101c1651e7bfb992d7fd933bd8b9c99d110738fd6db523ed15f82f29f50b45510288da72e964dedb1a3 + languageName: node + linkType: hard + +"JSONStream@npm:^1.3.5": + version: 1.3.5 + resolution: "JSONStream@npm:1.3.5" + dependencies: + jsonparse: "npm:^1.2.0" + through: "npm:>=2.2.7 <3" + bin: + JSONStream: ./bin.js + checksum: 2605fa124260c61bad38bb65eba30d2f72216a78e94d0ab19b11b4e0327d572b8d530c0c9cc3b0764f727ad26d39e00bf7ebad57781ca6368394d73169c59e46 + languageName: node + linkType: hard + +"abbrev@npm:^1.0.0": + version: 1.1.1 + resolution: "abbrev@npm:1.1.1" + checksum: a4a97ec07d7ea112c517036882b2ac22f3109b7b19077dc656316d07d308438aac28e4d9746dc4d84bf6b1e75b4a7b0a5f3cb30592419f128ca9a8cee3bcfa17 + languageName: node + linkType: hard + +"acorn-walk@npm:^8.1.1": + version: 8.2.0 + resolution: "acorn-walk@npm:8.2.0" + checksum: 1715e76c01dd7b2d4ca472f9c58968516a4899378a63ad5b6c2d668bba8da21a71976c14ec5f5b75f887b6317c4ae0b897ab141c831d741dc76024d8745f1ad1 + languageName: node + linkType: hard + +"acorn@npm:^8.4.1": + version: 8.10.0 + resolution: "acorn@npm:8.10.0" + bin: + acorn: bin/acorn + checksum: 538ba38af0cc9e5ef983aee196c4b8b4d87c0c94532334fa7e065b2c8a1f85863467bb774231aae91613fcda5e68740c15d97b1967ae3394d20faddddd8af61d + languageName: node + linkType: hard + +"agent-base@npm:6, agent-base@npm:^6.0.2": + version: 6.0.2 + resolution: "agent-base@npm:6.0.2" + dependencies: + debug: "npm:4" + checksum: f52b6872cc96fd5f622071b71ef200e01c7c4c454ee68bc9accca90c98cfb39f2810e3e9aa330435835eedc8c23f4f8a15267f67c6e245d2b33757575bdac49d + languageName: node + linkType: hard + +"agentkeepalive@npm:^4.2.1, agentkeepalive@npm:^4.3.0, agentkeepalive@npm:^4.5.0": + version: 4.5.0 + resolution: "agentkeepalive@npm:4.5.0" + dependencies: + humanize-ms: "npm:^1.2.1" + checksum: 13278cd5b125e51eddd5079f04d6fe0914ac1b8b91c1f3db2c1822f99ac1a7457869068997784342fe455d59daaff22e14fb7b8c3da4e741896e7e31faf92481 + languageName: node + linkType: hard + +"aggregate-error@npm:^3.0.0": + version: 3.1.0 + resolution: "aggregate-error@npm:3.1.0" + dependencies: + clean-stack: "npm:^2.0.0" + indent-string: "npm:^4.0.0" + checksum: 1101a33f21baa27a2fa8e04b698271e64616b886795fd43c31068c07533c7b3facfcaf4e9e0cab3624bd88f729a592f1c901a1a229c9e490eafce411a8644b79 + languageName: node + linkType: hard + +"ansi-regex@npm:^5.0.1": + version: 5.0.1 + resolution: "ansi-regex@npm:5.0.1" + checksum: 2aa4bb54caf2d622f1afdad09441695af2a83aa3fe8b8afa581d205e57ed4261c183c4d3877cee25794443fde5876417d859c108078ab788d6af7e4fe52eb66b + languageName: node + linkType: hard + +"ansi-regex@npm:^6.0.1": + version: 6.0.1 + resolution: "ansi-regex@npm:6.0.1" + checksum: 1ff8b7667cded1de4fa2c9ae283e979fc87036864317da86a2e546725f96406746411d0d85e87a2d12fa5abd715d90006de7fa4fa0477c92321ad3b4c7d4e169 + languageName: node + linkType: hard + +"ansi-styles@npm:^4.0.0, ansi-styles@npm:^4.1.0": + version: 4.3.0 + resolution: "ansi-styles@npm:4.3.0" + dependencies: + color-convert: "npm:^2.0.1" + checksum: 513b44c3b2105dd14cc42a19271e80f386466c4be574bccf60b627432f9198571ebf4ab1e4c3ba17347658f4ee1711c163d574248c0c1cdc2d5917a0ad582ec4 + languageName: node + linkType: hard + +"ansi-styles@npm:^6.1.0": + version: 6.2.1 + resolution: "ansi-styles@npm:6.2.1" + checksum: ef940f2f0ced1a6347398da88a91da7930c33ecac3c77b72c5905f8b8fe402c52e6fde304ff5347f616e27a742da3f1dc76de98f6866c69251ad0b07a66776d9 + languageName: node + linkType: hard + +"aproba@npm:^1.0.3 || ^2.0.0": + version: 2.0.0 + resolution: "aproba@npm:2.0.0" + checksum: 5615cadcfb45289eea63f8afd064ab656006361020e1735112e346593856f87435e02d8dcc7ff0d11928bc7d425f27bc7c2a84f6c0b35ab0ff659c814c138a24 + languageName: node + linkType: hard + +"are-we-there-yet@npm:^3.0.0": + version: 3.0.1 + resolution: "are-we-there-yet@npm:3.0.1" + dependencies: + delegates: "npm:^1.0.0" + readable-stream: "npm:^3.6.0" + checksum: 52590c24860fa7173bedeb69a4c05fb573473e860197f618b9a28432ee4379049336727ae3a1f9c4cb083114601c1140cee578376164d0e651217a9843f9fe83 + languageName: node + linkType: hard + +"arg@npm:^4.1.0": + version: 4.1.3 + resolution: "arg@npm:4.1.3" + checksum: 544af8dd3f60546d3e4aff084d451b96961d2267d668670199692f8d054f0415d86fc5497d0e641e91546f0aa920e7c29e5250e99fc89f5552a34b5d93b77f43 + languageName: node + linkType: hard + +"balanced-match@npm:^1.0.0": + version: 1.0.2 + resolution: "balanced-match@npm:1.0.2" + checksum: 9706c088a283058a8a99e0bf91b0a2f75497f185980d9ffa8b304de1d9e58ebda7c72c07ebf01dadedaac5b2907b2c6f566f660d62bd336c3468e960403b9d65 + languageName: node + linkType: hard + +"base-x@npm:^3.0.2": + version: 3.0.9 + resolution: "base-x@npm:3.0.9" + dependencies: + safe-buffer: "npm:^5.0.1" + checksum: 957101d6fd09e1903e846fd8f69fd7e5e3e50254383e61ab667c725866bec54e5ece5ba49ce385128ae48f9ec93a26567d1d5ebb91f4d56ef4a9cc0d5a5481e8 + languageName: node + linkType: hard + +"base64-js@npm:^1.3.1, base64-js@npm:^1.5.1": + version: 1.5.1 + resolution: "base64-js@npm:1.5.1" + checksum: 669632eb3745404c2f822a18fc3a0122d2f9a7a13f7fb8b5823ee19d1d2ff9ee5b52c53367176ea4ad093c332fd5ab4bd0ebae5a8e27917a4105a4cfc86b1005 + languageName: node + linkType: hard + +"bigint-buffer@npm:^1.1.5": + version: 1.1.5 + resolution: "bigint-buffer@npm:1.1.5" + dependencies: + bindings: "npm:^1.3.0" + node-gyp: "npm:latest" + checksum: d010c9f57758bcdaccb435d88b483ffcc95fe8bbc6e7fb3a44fb5221f29c894ffaf4a3c5a4a530e0e7d6608203c2cde9b79ee4f2386cd6d4462d1070bc8c9f4e + languageName: node + linkType: hard + +"bignumber.js@npm:^9.0.1": + version: 9.1.2 + resolution: "bignumber.js@npm:9.1.2" + checksum: 582c03af77ec9cb0ebd682a373ee6c66475db94a4325f92299621d544aa4bd45cb45fd60001610e94aef8ae98a0905fa538241d9638d4422d57abbeeac6fadaf + languageName: node + linkType: hard + +"bindings@npm:^1.3.0": + version: 1.5.0 + resolution: "bindings@npm:1.5.0" + dependencies: + file-uri-to-path: "npm:1.0.0" + checksum: 65b6b48095717c2e6105a021a7da4ea435aa8d3d3cd085cb9e85bcb6e5773cf318c4745c3f7c504412855940b585bdf9b918236612a1c7a7942491de176f1ae7 + languageName: node + linkType: hard + +"bn.js@npm:^5.1.2, bn.js@npm:^5.2.0, bn.js@npm:^5.2.1": + version: 5.2.1 + resolution: "bn.js@npm:5.2.1" + checksum: 3dd8c8d38055fedfa95c1d5fc3c99f8dd547b36287b37768db0abab3c239711f88ff58d18d155dd8ad902b0b0cee973747b7ae20ea12a09473272b0201c9edd3 + languageName: node + linkType: hard + +"borsh@npm:^0.7.0": + version: 0.7.0 + resolution: "borsh@npm:0.7.0" + dependencies: + bn.js: "npm:^5.2.0" + bs58: "npm:^4.0.0" + text-encoding-utf-8: "npm:^1.0.2" + checksum: e98bfb5f7cfb820819c2870b884dac58dd4b4ce6a86c286c8fbf5c9ca582e73a8c6094df67e81a28c418ff07a309c6b118b2e27fdfea83fd92b8100c741da0b5 + languageName: node + linkType: hard + +"brace-expansion@npm:^1.1.7": + version: 1.1.11 + resolution: "brace-expansion@npm:1.1.11" + dependencies: + balanced-match: "npm:^1.0.0" + concat-map: "npm:0.0.1" + checksum: faf34a7bb0c3fcf4b59c7808bc5d2a96a40988addf2e7e09dfbb67a2251800e0d14cd2bfc1aa79174f2f5095c54ff27f46fb1289fe2d77dac755b5eb3434cc07 + languageName: node + linkType: hard + +"brace-expansion@npm:^2.0.1": + version: 2.0.1 + resolution: "brace-expansion@npm:2.0.1" + dependencies: + balanced-match: "npm:^1.0.0" + checksum: a61e7cd2e8a8505e9f0036b3b6108ba5e926b4b55089eeb5550cd04a471fe216c96d4fe7e4c7f995c728c554ae20ddfc4244cad10aef255e72b62930afd233d1 + languageName: node + linkType: hard + +"braces@npm:^3.0.2": + version: 3.0.2 + resolution: "braces@npm:3.0.2" + dependencies: + fill-range: "npm:^7.0.1" + checksum: e2a8e769a863f3d4ee887b5fe21f63193a891c68b612ddb4b68d82d1b5f3ff9073af066c343e9867a393fe4c2555dcb33e89b937195feb9c1613d259edfcd459 + languageName: node + linkType: hard + +"bs58@npm:^4.0.0, bs58@npm:^4.0.1": + version: 4.0.1 + resolution: "bs58@npm:4.0.1" + dependencies: + base-x: "npm:^3.0.2" + checksum: b3c5365bb9e0c561e1a82f1a2d809a1a692059fae016be233a6127ad2f50a6b986467c3a50669ce4c18929dcccb297c5909314dd347a25a68c21b68eb3e95ac2 + languageName: node + linkType: hard + +"buffer-layout@npm:^1.2.0, buffer-layout@npm:^1.2.2": + version: 1.2.2 + resolution: "buffer-layout@npm:1.2.2" + checksum: e5809ba275530bf4e52fd09558b7c2111fbda5b405124f581acf364261d9c154e271800271898cd40473f9bcbb42c31584efb04219bde549d3460ca4bafeaa07 + languageName: node + linkType: hard + +"buffer@npm:6.0.3, buffer@npm:^6.0.3, buffer@npm:~6.0.3": + version: 6.0.3 + resolution: "buffer@npm:6.0.3" + dependencies: + base64-js: "npm:^1.3.1" + ieee754: "npm:^1.2.1" + checksum: 5ad23293d9a731e4318e420025800b42bf0d264004c0286c8cc010af7a270c7a0f6522e84f54b9ad65cbd6db20b8badbfd8d2ebf4f80fa03dab093b89e68c3f9 + languageName: node + linkType: hard + +"bufferutil@npm:^4.0.1": + version: 4.0.7 + resolution: "bufferutil@npm:4.0.7" + dependencies: + node-gyp: "npm:latest" + node-gyp-build: "npm:^4.3.0" + checksum: f75aa87e3d1b99b87a95f60a855e63f70af07b57fb8443e75a2ddfef2e47788d130fdd46e3a78fd7e0c10176082b26dfbed970c5b8632e1cc299cafa0e93ce45 + languageName: node + linkType: hard + +"cacache@npm:^17.0.0": + version: 17.1.4 + resolution: "cacache@npm:17.1.4" + dependencies: + "@npmcli/fs": "npm:^3.1.0" + fs-minipass: "npm:^3.0.0" + glob: "npm:^10.2.2" + lru-cache: "npm:^7.7.1" + minipass: "npm:^7.0.3" + minipass-collect: "npm:^1.0.2" + minipass-flush: "npm:^1.0.5" + minipass-pipeline: "npm:^1.2.4" + p-map: "npm:^4.0.0" + ssri: "npm:^10.0.0" + tar: "npm:^6.1.11" + unique-filename: "npm:^3.0.0" + checksum: b7751df756656954a51201335addced8f63fc53266fa56392c9f5ae83c8d27debffb4458ac2d168a744a4517ec3f2163af05c20097f93d17bdc2dc8a385e14a6 + languageName: node + linkType: hard + +"camelcase@npm:^6.3.0": + version: 6.3.0 + resolution: "camelcase@npm:6.3.0" + checksum: 8c96818a9076434998511251dcb2761a94817ea17dbdc37f47ac080bd088fc62c7369429a19e2178b993497132c8cbcf5cc1f44ba963e76782ba469c0474938d + languageName: node + linkType: hard + +"chalk@npm:^4.1.0": + version: 4.1.2 + resolution: "chalk@npm:4.1.2" + dependencies: + ansi-styles: "npm:^4.1.0" + supports-color: "npm:^7.1.0" + checksum: fe75c9d5c76a7a98d45495b91b2172fa3b7a09e0cc9370e5c8feb1c567b85c4288e2b3fded7cfdd7359ac28d6b3844feb8b82b8686842e93d23c827c417e83fc + languageName: node + linkType: hard + +"chownr@npm:^2.0.0": + version: 2.0.0 + resolution: "chownr@npm:2.0.0" + checksum: c57cf9dd0791e2f18a5ee9c1a299ae6e801ff58fee96dc8bfd0dcb4738a6ce58dd252a3605b1c93c6418fe4f9d5093b28ffbf4d66648cb2a9c67eaef9679be2f + languageName: node + linkType: hard + +"clean-stack@npm:^2.0.0": + version: 2.2.0 + resolution: "clean-stack@npm:2.2.0" + checksum: 2ac8cd2b2f5ec986a3c743935ec85b07bc174d5421a5efc8017e1f146a1cf5f781ae962618f416352103b32c9cd7e203276e8c28241bbe946160cab16149fb68 + languageName: node + linkType: hard + +"color-convert@npm:^2.0.1": + version: 2.0.1 + resolution: "color-convert@npm:2.0.1" + dependencies: + color-name: "npm:~1.1.4" + checksum: 79e6bdb9fd479a205c71d89574fccfb22bd9053bd98c6c4d870d65c132e5e904e6034978e55b43d69fcaa7433af2016ee203ce76eeba9cfa554b373e7f7db336 + languageName: node + linkType: hard + +"color-name@npm:~1.1.4": + version: 1.1.4 + resolution: "color-name@npm:1.1.4" + checksum: b0445859521eb4021cd0fb0cc1a75cecf67fceecae89b63f62b201cca8d345baf8b952c966862a9d9a2632987d4f6581f0ec8d957dfacece86f0a7919316f610 + languageName: node + linkType: hard + +"color-support@npm:^1.1.3": + version: 1.1.3 + resolution: "color-support@npm:1.1.3" + bin: + color-support: bin.js + checksum: 9b7356817670b9a13a26ca5af1c21615463b500783b739b7634a0c2047c16cef4b2865d7576875c31c3cddf9dd621fa19285e628f20198b233a5cfdda6d0793b + languageName: node + linkType: hard + +"commander@npm:^2.20.3": + version: 2.20.3 + resolution: "commander@npm:2.20.3" + checksum: ab8c07884e42c3a8dbc5dd9592c606176c7eb5c1ca5ff274bcf907039b2c41de3626f684ea75ccf4d361ba004bbaff1f577d5384c155f3871e456bdf27becf9e + languageName: node + linkType: hard + +"concat-map@npm:0.0.1": + version: 0.0.1 + resolution: "concat-map@npm:0.0.1" + checksum: 902a9f5d8967a3e2faf138d5cb784b9979bad2e6db5357c5b21c568df4ebe62bcb15108af1b2253744844eb964fc023fbd9afbbbb6ddd0bcc204c6fb5b7bf3af + languageName: node + linkType: hard + +"console-control-strings@npm:^1.1.0": + version: 1.1.0 + resolution: "console-control-strings@npm:1.1.0" + checksum: 8755d76787f94e6cf79ce4666f0c5519906d7f5b02d4b884cf41e11dcd759ed69c57da0670afd9236d229a46e0f9cf519db0cd829c6dca820bb5a5c3def584ed + languageName: node + linkType: hard + +"create-require@npm:^1.1.0": + version: 1.1.1 + resolution: "create-require@npm:1.1.1" + checksum: a9a1503d4390d8b59ad86f4607de7870b39cad43d929813599a23714831e81c520bddf61bcdd1f8e30f05fd3a2b71ae8538e946eb2786dc65c2bbc520f692eff + languageName: node + linkType: hard + +"cross-fetch@npm:^3.1.5": + version: 3.1.8 + resolution: "cross-fetch@npm:3.1.8" + dependencies: + node-fetch: "npm:^2.6.12" + checksum: 78f993fa099eaaa041122ab037fe9503ecbbcb9daef234d1d2e0b9230a983f64d645d088c464e21a247b825a08dc444a6e7064adfa93536d3a9454b4745b3632 + languageName: node + linkType: hard + +"cross-spawn@npm:^7.0.0": + version: 7.0.3 + resolution: "cross-spawn@npm:7.0.3" + dependencies: + path-key: "npm:^3.1.0" + shebang-command: "npm:^2.0.0" + which: "npm:^2.0.1" + checksum: 671cc7c7288c3a8406f3c69a3ae2fc85555c04169e9d611def9a675635472614f1c0ed0ef80955d5b6d4e724f6ced67f0ad1bb006c2ea643488fcfef994d7f52 + languageName: node + linkType: hard + +"crypto-hash@npm:^1.3.0": + version: 1.3.0 + resolution: "crypto-hash@npm:1.3.0" + checksum: a3a507e0d2b18fbd2da8088a1c62d0c53c009a99bbfa6d851cac069734ffa546922fa51bdd776d006459701cdda873463e5059ece3431aca048fd99e7573d138 + languageName: node + linkType: hard + +"debug@npm:4, debug@npm:^4.3.3": + version: 4.3.4 + resolution: "debug@npm:4.3.4" + dependencies: + ms: "npm:2.1.2" + peerDependenciesMeta: + supports-color: + optional: true + checksum: 3dbad3f94ea64f34431a9cbf0bafb61853eda57bff2880036153438f50fb5a84f27683ba0d8e5426bf41a8c6ff03879488120cf5b3a761e77953169c0600a708 + languageName: node + linkType: hard + +"delay@npm:^5.0.0": + version: 5.0.0 + resolution: "delay@npm:5.0.0" + checksum: 62f151151ecfde0d9afbb8a6be37a6d103c4cb24f35a20ef3fe56f920b0d0d0bb02bc9c0a3084d0179ef669ca332b91155f2ee4d9854622cd2cdba5fc95285f9 + languageName: node + linkType: hard + +"delegates@npm:^1.0.0": + version: 1.0.0 + resolution: "delegates@npm:1.0.0" + checksum: a51744d9b53c164ba9c0492471a1a2ffa0b6727451bdc89e31627fdf4adda9d51277cfcbfb20f0a6f08ccb3c436f341df3e92631a3440226d93a8971724771fd + languageName: node + linkType: hard + +"diff@npm:^4.0.1": + version: 4.0.2 + resolution: "diff@npm:4.0.2" + checksum: f2c09b0ce4e6b301c221addd83bf3f454c0bc00caa3dd837cf6c127d6edf7223aa2bbe3b688feea110b7f262adbfc845b757c44c8a9f8c0c5b15d8fa9ce9d20d + languageName: node + linkType: hard + +"dot-case@npm:^3.0.4": + version: 3.0.4 + resolution: "dot-case@npm:3.0.4" + dependencies: + no-case: "npm:^3.0.4" + tslib: "npm:^2.0.3" + checksum: a65e3519414856df0228b9f645332f974f2bf5433370f544a681122eab59e66038fc3349b4be1cdc47152779dac71a5864f1ccda2f745e767c46e9c6543b1169 + languageName: node + linkType: hard + +"eastasianwidth@npm:^0.2.0": + version: 0.2.0 + resolution: "eastasianwidth@npm:0.2.0" + checksum: 7d00d7cd8e49b9afa762a813faac332dee781932d6f2c848dc348939c4253f1d4564341b7af1d041853bc3f32c2ef141b58e0a4d9862c17a7f08f68df1e0f1ed + languageName: node + linkType: hard + +"emoji-regex@npm:^8.0.0": + version: 8.0.0 + resolution: "emoji-regex@npm:8.0.0" + checksum: d4c5c39d5a9868b5fa152f00cada8a936868fd3367f33f71be515ecee4c803132d11b31a6222b2571b1e5f7e13890156a94880345594d0ce7e3c9895f560f192 + languageName: node + linkType: hard + +"emoji-regex@npm:^9.2.2": + version: 9.2.2 + resolution: "emoji-regex@npm:9.2.2" + checksum: 8487182da74aabd810ac6d6f1994111dfc0e331b01271ae01ec1eb0ad7b5ecc2bbbbd2f053c05cb55a1ac30449527d819bbfbf0e3de1023db308cbcb47f86601 + languageName: node + linkType: hard + +"encoding@npm:^0.1.13": + version: 0.1.13 + resolution: "encoding@npm:0.1.13" + dependencies: + iconv-lite: "npm:^0.6.2" + checksum: bb98632f8ffa823996e508ce6a58ffcf5856330fde839ae42c9e1f436cc3b5cc651d4aeae72222916545428e54fd0f6aa8862fd8d25bdbcc4589f1e3f3715e7f + languageName: node + linkType: hard + +"enhanced-resolve@npm:^5.0.0": + version: 5.15.0 + resolution: "enhanced-resolve@npm:5.15.0" + dependencies: + graceful-fs: "npm:^4.2.4" + tapable: "npm:^2.2.0" + checksum: fbd8cdc9263be71cc737aa8a7d6c57b43d6aa38f6cc75dde6fcd3598a130cc465f979d2f4d01bb3bf475acb43817749c79f8eef9be048683602ca91ab52e4f11 + languageName: node + linkType: hard + +"env-paths@npm:^2.2.0": + version: 2.2.1 + resolution: "env-paths@npm:2.2.1" + checksum: 65b5df55a8bab92229ab2b40dad3b387fad24613263d103a97f91c9fe43ceb21965cd3392b1ccb5d77088021e525c4e0481adb309625d0cb94ade1d1fb8dc17e + languageName: node + linkType: hard + +"err-code@npm:^2.0.2": + version: 2.0.3 + resolution: "err-code@npm:2.0.3" + checksum: 8b7b1be20d2de12d2255c0bc2ca638b7af5171142693299416e6a9339bd7d88fc8d7707d913d78e0993176005405a236b066b45666b27b797252c771156ace54 + languageName: node + linkType: hard + +"es6-promise@npm:^4.0.3": + version: 4.2.8 + resolution: "es6-promise@npm:4.2.8" + checksum: 95614a88873611cb9165a85d36afa7268af5c03a378b35ca7bda9508e1d4f1f6f19a788d4bc755b3fd37c8ebba40782018e02034564ff24c9d6fa37e959ad57d + languageName: node + linkType: hard + +"es6-promisify@npm:^5.0.0": + version: 5.0.0 + resolution: "es6-promisify@npm:5.0.0" + dependencies: + es6-promise: "npm:^4.0.3" + checksum: fbed9d791598831413be84a5374eca8c24800ec71a16c1c528c43a98e2dadfb99331483d83ae6094ddb9b87e6f799a15d1553cebf756047e0865c753bc346b92 + languageName: node + linkType: hard + +"eventemitter3@npm:^4.0.7": + version: 4.0.7 + resolution: "eventemitter3@npm:4.0.7" + checksum: 1875311c42fcfe9c707b2712c32664a245629b42bb0a5a84439762dd0fd637fc54d078155ea83c2af9e0323c9ac13687e03cfba79b03af9f40c89b4960099374 + languageName: node + linkType: hard + +"exponential-backoff@npm:^3.1.1": + version: 3.1.1 + resolution: "exponential-backoff@npm:3.1.1" + checksum: 3d21519a4f8207c99f7457287291316306255a328770d320b401114ec8481986e4e467e854cb9914dd965e0a1ca810a23ccb559c642c88f4c7f55c55778a9b48 + languageName: node + linkType: hard + +"eyes@npm:^0.1.8": + version: 0.1.8 + resolution: "eyes@npm:0.1.8" + checksum: c31703a92bf36ba75ee8d379ee7985c24ee6149f3a6175f44cec7a05b178c38bce9836d3ca48c9acb0329a960ac2c4b2ead4e60cdd4fe6e8c92cad7cd6913687 + languageName: node + linkType: hard + +"fast-stable-stringify@npm:^1.0.0": + version: 1.0.0 + resolution: "fast-stable-stringify@npm:1.0.0" + checksum: ef1203d246a7e8ac15e2bfbda0a89fa375947bccf9f7910be0ea759856dbe8ea5024a0d8cc2cceabe18a9cb67e95927b78bb6173a3ae37ec55a518cf36e5244b + languageName: node + linkType: hard + +"file-uri-to-path@npm:1.0.0": + version: 1.0.0 + resolution: "file-uri-to-path@npm:1.0.0" + checksum: b648580bdd893a008c92c7ecc96c3ee57a5e7b6c4c18a9a09b44fb5d36d79146f8e442578bc0e173dc027adf3987e254ba1dfd6e3ec998b7c282873010502144 + languageName: node + linkType: hard + +"fill-range@npm:^7.0.1": + version: 7.0.1 + resolution: "fill-range@npm:7.0.1" + dependencies: + to-regex-range: "npm:^5.0.1" + checksum: cc283f4e65b504259e64fd969bcf4def4eb08d85565e906b7d36516e87819db52029a76b6363d0f02d0d532f0033c9603b9e2d943d56ee3b0d4f7ad3328ff917 + languageName: node + linkType: hard + +"foreground-child@npm:^3.1.0": + version: 3.1.1 + resolution: "foreground-child@npm:3.1.1" + dependencies: + cross-spawn: "npm:^7.0.0" + signal-exit: "npm:^4.0.1" + checksum: 139d270bc82dc9e6f8bc045fe2aae4001dc2472157044fdfad376d0a3457f77857fa883c1c8b21b491c6caade9a926a4bed3d3d2e8d3c9202b151a4cbbd0bcd5 + languageName: node + linkType: hard + +"fs-minipass@npm:^2.0.0": + version: 2.1.0 + resolution: "fs-minipass@npm:2.1.0" + dependencies: + minipass: "npm:^3.0.0" + checksum: 1b8d128dae2ac6cc94230cc5ead341ba3e0efaef82dab46a33d171c044caaa6ca001364178d42069b2809c35a1c3c35079a32107c770e9ffab3901b59af8c8b1 + languageName: node + linkType: hard + +"fs-minipass@npm:^3.0.0": + version: 3.0.3 + resolution: "fs-minipass@npm:3.0.3" + dependencies: + minipass: "npm:^7.0.3" + checksum: 8722a41109130851d979222d3ec88aabaceeaaf8f57b2a8f744ef8bd2d1ce95453b04a61daa0078822bc5cd21e008814f06fe6586f56fef511e71b8d2394d802 + languageName: node + linkType: hard + +"fs.realpath@npm:^1.0.0": + version: 1.0.0 + resolution: "fs.realpath@npm:1.0.0" + checksum: 99ddea01a7e75aa276c250a04eedeffe5662bce66c65c07164ad6264f9de18fb21be9433ead460e54cff20e31721c811f4fb5d70591799df5f85dce6d6746fd0 + languageName: node + linkType: hard + +"gauge@npm:^4.0.3": + version: 4.0.4 + resolution: "gauge@npm:4.0.4" + dependencies: + aproba: "npm:^1.0.3 || ^2.0.0" + color-support: "npm:^1.1.3" + console-control-strings: "npm:^1.1.0" + has-unicode: "npm:^2.0.1" + signal-exit: "npm:^3.0.7" + string-width: "npm:^4.2.3" + strip-ansi: "npm:^6.0.1" + wide-align: "npm:^1.1.5" + checksum: 788b6bfe52f1dd8e263cda800c26ac0ca2ff6de0b6eee2fe0d9e3abf15e149b651bd27bf5226be10e6e3edb5c4e5d5985a5a1a98137e7a892f75eff76467ad2d + languageName: node + linkType: hard + +"git-format-staged@npm:^2.1.3": + version: 2.1.3 + resolution: "git-format-staged@npm:2.1.3" + bin: + git-format-staged: git-format-staged + checksum: 749da68f0d9bf24db53b87a5f1613fc1a8790801d7c3ccb31d02b94d99f4cf2450126ef565f16adcc0649fbbf90dc44b4f009d4f99ff8a26921ba754bdb09b31 + languageName: node + linkType: hard + +"glob@npm:^10.2.2": + version: 10.3.3 + resolution: "glob@npm:10.3.3" + dependencies: + foreground-child: "npm:^3.1.0" + jackspeak: "npm:^2.0.3" + minimatch: "npm:^9.0.1" + minipass: "npm:^5.0.0 || ^6.0.2 || ^7.0.0" + path-scurry: "npm:^1.10.1" + bin: + glob: dist/cjs/src/bin.js + checksum: 29190d3291f422da0cb40b77a72fc8d2c51a36524e99b8bf412548b7676a6627489528b57250429612b6eec2e6fe7826d328451d3e694a9d15e575389308ec53 + languageName: node + linkType: hard + +"glob@npm:^7.1.3, glob@npm:^7.1.4": + version: 7.2.3 + resolution: "glob@npm:7.2.3" + dependencies: + fs.realpath: "npm:^1.0.0" + inflight: "npm:^1.0.4" + inherits: "npm:2" + minimatch: "npm:^3.1.1" + once: "npm:^1.3.0" + path-is-absolute: "npm:^1.0.0" + checksum: 29452e97b38fa704dabb1d1045350fb2467cf0277e155aa9ff7077e90ad81d1ea9d53d3ee63bd37c05b09a065e90f16aec4a65f5b8de401d1dac40bc5605d133 + languageName: node + linkType: hard + +"graceful-fs@npm:^4.2.4, graceful-fs@npm:^4.2.6": + version: 4.2.11 + resolution: "graceful-fs@npm:4.2.11" + checksum: ac85f94da92d8eb6b7f5a8b20ce65e43d66761c55ce85ac96df6865308390da45a8d3f0296dd3a663de65d30ba497bd46c696cc1e248c72b13d6d567138a4fc7 + languageName: node + linkType: hard + +"has-flag@npm:^4.0.0": + version: 4.0.0 + resolution: "has-flag@npm:4.0.0" + checksum: 261a1357037ead75e338156b1f9452c016a37dcd3283a972a30d9e4a87441ba372c8b81f818cd0fbcd9c0354b4ae7e18b9e1afa1971164aef6d18c2b6095a8ad + languageName: node + linkType: hard + +"has-unicode@npm:^2.0.1": + version: 2.0.1 + resolution: "has-unicode@npm:2.0.1" + checksum: 1eab07a7436512db0be40a710b29b5dc21fa04880b7f63c9980b706683127e3c1b57cb80ea96d47991bdae2dfe479604f6a1ba410106ee1046a41d1bd0814400 + languageName: node + linkType: hard + +"http-cache-semantics@npm:^4.1.1": + version: 4.1.1 + resolution: "http-cache-semantics@npm:4.1.1" + checksum: 83ac0bc60b17a3a36f9953e7be55e5c8f41acc61b22583060e8dedc9dd5e3607c823a88d0926f9150e571f90946835c7fe150732801010845c72cd8bbff1a236 + languageName: node + linkType: hard + +"http-proxy-agent@npm:^5.0.0": + version: 5.0.0 + resolution: "http-proxy-agent@npm:5.0.0" + dependencies: + "@tootallnate/once": "npm:2" + agent-base: "npm:6" + debug: "npm:4" + checksum: e2ee1ff1656a131953839b2a19cd1f3a52d97c25ba87bd2559af6ae87114abf60971e498021f9b73f9fd78aea8876d1fb0d4656aac8a03c6caa9fc175f22b786 + languageName: node + linkType: hard + +"https-proxy-agent@npm:^5.0.0": + version: 5.0.1 + resolution: "https-proxy-agent@npm:5.0.1" + dependencies: + agent-base: "npm:6" + debug: "npm:4" + checksum: 571fccdf38184f05943e12d37d6ce38197becdd69e58d03f43637f7fa1269cf303a7d228aa27e5b27bbd3af8f09fd938e1c91dcfefff2df7ba77c20ed8dfc765 + languageName: node + linkType: hard + +"humanize-ms@npm:^1.2.1": + version: 1.2.1 + resolution: "humanize-ms@npm:1.2.1" + dependencies: + ms: "npm:^2.0.0" + checksum: 9c7a74a2827f9294c009266c82031030eae811ca87b0da3dceb8d6071b9bde22c9f3daef0469c3c533cc67a97d8a167cd9fc0389350e5f415f61a79b171ded16 + languageName: node + linkType: hard + +"iconv-lite@npm:^0.6.2": + version: 0.6.3 + resolution: "iconv-lite@npm:0.6.3" + dependencies: + safer-buffer: "npm:>= 2.1.2 < 3.0.0" + checksum: 3f60d47a5c8fc3313317edfd29a00a692cc87a19cac0159e2ce711d0ebc9019064108323b5e493625e25594f11c6236647d8e256fbe7a58f4a3b33b89e6d30bf + languageName: node + linkType: hard + +"ieee754@npm:^1.2.1": + version: 1.2.1 + resolution: "ieee754@npm:1.2.1" + checksum: 5144c0c9815e54ada181d80a0b810221a253562422e7c6c3a60b1901154184f49326ec239d618c416c1c5945a2e197107aee8d986a3dd836b53dffefd99b5e7e + languageName: node + linkType: hard + +"imurmurhash@npm:^0.1.4": + version: 0.1.4 + resolution: "imurmurhash@npm:0.1.4" + checksum: 7cae75c8cd9a50f57dadd77482359f659eaebac0319dd9368bcd1714f55e65badd6929ca58569da2b6494ef13fdd5598cd700b1eba23f8b79c5f19d195a3ecf7 + languageName: node + linkType: hard + +"indent-string@npm:^4.0.0": + version: 4.0.0 + resolution: "indent-string@npm:4.0.0" + checksum: 824cfb9929d031dabf059bebfe08cf3137365e112019086ed3dcff6a0a7b698cb80cf67ccccde0e25b9e2d7527aa6cc1fed1ac490c752162496caba3e6699612 + languageName: node + linkType: hard + +"inflight@npm:^1.0.4": + version: 1.0.6 + resolution: "inflight@npm:1.0.6" + dependencies: + once: "npm:^1.3.0" + wrappy: "npm:1" + checksum: f4f76aa072ce19fae87ce1ef7d221e709afb59d445e05d47fba710e85470923a75de35bfae47da6de1b18afc3ce83d70facf44cfb0aff89f0a3f45c0a0244dfd + languageName: node + linkType: hard + +"inherits@npm:2, inherits@npm:^2.0.3": + version: 2.0.4 + resolution: "inherits@npm:2.0.4" + checksum: 4a48a733847879d6cf6691860a6b1e3f0f4754176e4d71494c41f3475553768b10f84b5ce1d40fbd0e34e6bfbb864ee35858ad4dd2cf31e02fc4a154b724d7f1 + languageName: node + linkType: hard + +"ip@npm:^2.0.0": + version: 2.0.0 + resolution: "ip@npm:2.0.0" + checksum: cfcfac6b873b701996d71ec82a7dd27ba92450afdb421e356f44044ed688df04567344c36cbacea7d01b1c39a4c732dc012570ebe9bebfb06f27314bca625349 + languageName: node + linkType: hard + +"is-fullwidth-code-point@npm:^3.0.0": + version: 3.0.0 + resolution: "is-fullwidth-code-point@npm:3.0.0" + checksum: 44a30c29457c7fb8f00297bce733f0a64cd22eca270f83e58c105e0d015e45c019491a4ab2faef91ab51d4738c670daff901c799f6a700e27f7314029e99e348 + languageName: node + linkType: hard + +"is-lambda@npm:^1.0.1": + version: 1.0.1 + resolution: "is-lambda@npm:1.0.1" + checksum: 93a32f01940220532e5948538699ad610d5924ac86093fcee83022252b363eb0cc99ba53ab084a04e4fb62bf7b5731f55496257a4c38adf87af9c4d352c71c35 + languageName: node + linkType: hard + +"is-number@npm:^7.0.0": + version: 7.0.0 + resolution: "is-number@npm:7.0.0" + checksum: 456ac6f8e0f3111ed34668a624e45315201dff921e5ac181f8ec24923b99e9f32ca1a194912dc79d539c97d33dba17dc635202ff0b2cf98326f608323276d27a + languageName: node + linkType: hard + +"isexe@npm:^2.0.0": + version: 2.0.0 + resolution: "isexe@npm:2.0.0" + checksum: 26bf6c5480dda5161c820c5b5c751ae1e766c587b1f951ea3fcfc973bafb7831ae5b54a31a69bd670220e42e99ec154475025a468eae58ea262f813fdc8d1c62 + languageName: node + linkType: hard + +"isomorphic-ws@npm:^4.0.1": + version: 4.0.1 + resolution: "isomorphic-ws@npm:4.0.1" + peerDependencies: + ws: "*" + checksum: d7190eadefdc28bdb93d67b5f0c603385aaf87724fa2974abb382ac1ec9756ed2cfb27065cbe76122879c2d452e2982bc4314317f3d6c737ddda6c047328771a + languageName: node + linkType: hard + +"jackspeak@npm:^2.0.3": + version: 2.3.1 + resolution: "jackspeak@npm:2.3.1" + dependencies: + "@isaacs/cliui": "npm:^8.0.2" + "@pkgjs/parseargs": "npm:^0.11.0" + dependenciesMeta: + "@pkgjs/parseargs": + optional: true + checksum: 34ea4d618d8d36ac104fe1053c85dfb6a63306cfe87e157ef42f18a7aa30027887370a4e163dd4993e45c6bf8a8ae003bf8476fdb8538e8ee5cd1938c27b15d0 + languageName: node + linkType: hard + +"jayson@npm:^4.1.0": + version: 4.1.0 + resolution: "jayson@npm:4.1.0" + dependencies: + "@types/connect": "npm:^3.4.33" + "@types/node": "npm:^12.12.54" + "@types/ws": "npm:^7.4.4" + JSONStream: "npm:^1.3.5" + commander: "npm:^2.20.3" + delay: "npm:^5.0.0" + es6-promisify: "npm:^5.0.0" + eyes: "npm:^0.1.8" + isomorphic-ws: "npm:^4.0.1" + json-stringify-safe: "npm:^5.0.1" + uuid: "npm:^8.3.2" + ws: "npm:^7.4.5" + bin: + jayson: bin/jayson.js + checksum: 86464322fbdc6db65d2bb4fc278cb6c86fad5c2a506065490d39459f09ba0d30f2b4fb740b33828a1424791419b6c8bd295dc54d361a4ad959bf70cc62b1ca7e + languageName: node + linkType: hard + +"js-sha256@npm:^0.9.0": + version: 0.9.0 + resolution: "js-sha256@npm:0.9.0" + checksum: ffad54b3373f81581e245866abfda50a62c483803a28176dd5c28fd2d313e0bdf830e77dac7ff8afd193c53031618920f3d98daf21cbbe80082753ab639c0365 + languageName: node + linkType: hard + +"json-stringify-safe@npm:^5.0.1": + version: 5.0.1 + resolution: "json-stringify-safe@npm:5.0.1" + checksum: 48ec0adad5280b8a96bb93f4563aa1667fd7a36334f79149abd42446d0989f2ddc58274b479f4819f1f00617957e6344c886c55d05a4e15ebb4ab931e4a6a8ee + languageName: node + linkType: hard + +"jsonparse@npm:^1.2.0": + version: 1.3.1 + resolution: "jsonparse@npm:1.3.1" + checksum: 6514a7be4674ebf407afca0eda3ba284b69b07f9958a8d3113ef1005f7ec610860c312be067e450c569aab8b89635e332cee3696789c750692bb60daba627f4d + languageName: node + linkType: hard + +"lower-case@npm:^2.0.2": + version: 2.0.2 + resolution: "lower-case@npm:2.0.2" + dependencies: + tslib: "npm:^2.0.3" + checksum: 83a0a5f159ad7614bee8bf976b96275f3954335a84fad2696927f609ddae902802c4f3312d86668722e668bef41400254807e1d3a7f2e8c3eede79691aa1f010 + languageName: node + linkType: hard + +"lru-cache@npm:^6.0.0": + version: 6.0.0 + resolution: "lru-cache@npm:6.0.0" + dependencies: + yallist: "npm:^4.0.0" + checksum: f97f499f898f23e4585742138a22f22526254fdba6d75d41a1c2526b3b6cc5747ef59c5612ba7375f42aca4f8461950e925ba08c991ead0651b4918b7c978297 + languageName: node + linkType: hard + +"lru-cache@npm:^7.7.1": + version: 7.18.3 + resolution: "lru-cache@npm:7.18.3" + checksum: e550d772384709deea3f141af34b6d4fa392e2e418c1498c078de0ee63670f1f46f5eee746e8ef7e69e1c895af0d4224e62ee33e66a543a14763b0f2e74c1356 + languageName: node + linkType: hard + +"lru-cache@npm:^9.1.1 || ^10.0.0": + version: 10.0.1 + resolution: "lru-cache@npm:10.0.1" + checksum: 06f8d0e1ceabd76bb6f644a26dbb0b4c471b79c7b514c13c6856113879b3bf369eb7b497dad4ff2b7e2636db202412394865b33c332100876d838ad1372f0181 + languageName: node + linkType: hard + +"make-error@npm:^1.1.1": + version: 1.3.6 + resolution: "make-error@npm:1.3.6" + checksum: b86e5e0e25f7f777b77fabd8e2cbf15737972869d852a22b7e73c17623928fccb826d8e46b9951501d3f20e51ad74ba8c59ed584f610526a48f8ccf88aaec402 + languageName: node + linkType: hard + +"make-fetch-happen@npm:^11.0.3": + version: 11.1.1 + resolution: "make-fetch-happen@npm:11.1.1" + dependencies: + agentkeepalive: "npm:^4.2.1" + cacache: "npm:^17.0.0" + http-cache-semantics: "npm:^4.1.1" + http-proxy-agent: "npm:^5.0.0" + https-proxy-agent: "npm:^5.0.0" + is-lambda: "npm:^1.0.1" + lru-cache: "npm:^7.7.1" + minipass: "npm:^5.0.0" + minipass-fetch: "npm:^3.0.0" + minipass-flush: "npm:^1.0.5" + minipass-pipeline: "npm:^1.2.4" + negotiator: "npm:^0.6.3" + promise-retry: "npm:^2.0.1" + socks-proxy-agent: "npm:^7.0.0" + ssri: "npm:^10.0.0" + checksum: 7268bf274a0f6dcf0343829489a4506603ff34bd0649c12058753900b0eb29191dce5dba12680719a5d0a983d3e57810f594a12f3c18494e93a1fbc6348a4540 + languageName: node + linkType: hard + +"micromatch@npm:^4.0.0": + version: 4.0.5 + resolution: "micromatch@npm:4.0.5" + dependencies: + braces: "npm:^3.0.2" + picomatch: "npm:^2.3.1" + checksum: 02a17b671c06e8fefeeb6ef996119c1e597c942e632a21ef589154f23898c9c6a9858526246abb14f8bca6e77734aa9dcf65476fca47cedfb80d9577d52843fc + languageName: node + linkType: hard + +"minimatch@npm:^3.1.1": + version: 3.1.2 + resolution: "minimatch@npm:3.1.2" + dependencies: + brace-expansion: "npm:^1.1.7" + checksum: c154e566406683e7bcb746e000b84d74465b3a832c45d59912b9b55cd50dee66e5c4b1e5566dba26154040e51672f9aa450a9aef0c97cfc7336b78b7afb9540a + languageName: node + linkType: hard + +"minimatch@npm:^9.0.1": + version: 9.0.3 + resolution: "minimatch@npm:9.0.3" + dependencies: + brace-expansion: "npm:^2.0.1" + checksum: 253487976bf485b612f16bf57463520a14f512662e592e95c571afdab1442a6a6864b6c88f248ce6fc4ff0b6de04ac7aa6c8bb51e868e99d1d65eb0658a708b5 + languageName: node + linkType: hard + +"minipass-collect@npm:^1.0.2": + version: 1.0.2 + resolution: "minipass-collect@npm:1.0.2" + dependencies: + minipass: "npm:^3.0.0" + checksum: 14df761028f3e47293aee72888f2657695ec66bd7d09cae7ad558da30415fdc4752bbfee66287dcc6fd5e6a2fa3466d6c484dc1cbd986525d9393b9523d97f10 + languageName: node + linkType: hard + +"minipass-fetch@npm:^3.0.0": + version: 3.0.4 + resolution: "minipass-fetch@npm:3.0.4" + dependencies: + encoding: "npm:^0.1.13" + minipass: "npm:^7.0.3" + minipass-sized: "npm:^1.0.3" + minizlib: "npm:^2.1.2" + dependenciesMeta: + encoding: + optional: true + checksum: af7aad15d5c128ab1ebe52e043bdf7d62c3c6f0cecb9285b40d7b395e1375b45dcdfd40e63e93d26a0e8249c9efd5c325c65575aceee192883970ff8cb11364a + languageName: node + linkType: hard + +"minipass-flush@npm:^1.0.5": + version: 1.0.5 + resolution: "minipass-flush@npm:1.0.5" + dependencies: + minipass: "npm:^3.0.0" + checksum: 56269a0b22bad756a08a94b1ffc36b7c9c5de0735a4dd1ab2b06c066d795cfd1f0ac44a0fcae13eece5589b908ecddc867f04c745c7009be0b566421ea0944cf + languageName: node + linkType: hard + +"minipass-pipeline@npm:^1.2.4": + version: 1.2.4 + resolution: "minipass-pipeline@npm:1.2.4" + dependencies: + minipass: "npm:^3.0.0" + checksum: b14240dac0d29823c3d5911c286069e36d0b81173d7bdf07a7e4a91ecdef92cdff4baaf31ea3746f1c61e0957f652e641223970870e2353593f382112257971b + languageName: node + linkType: hard + +"minipass-sized@npm:^1.0.3": + version: 1.0.3 + resolution: "minipass-sized@npm:1.0.3" + dependencies: + minipass: "npm:^3.0.0" + checksum: 79076749fcacf21b5d16dd596d32c3b6bf4d6e62abb43868fac21674078505c8b15eaca4e47ed844985a4514854f917d78f588fcd029693709417d8f98b2bd60 + languageName: node + linkType: hard + +"minipass@npm:^3.0.0": + version: 3.3.6 + resolution: "minipass@npm:3.3.6" + dependencies: + yallist: "npm:^4.0.0" + checksum: a30d083c8054cee83cdcdc97f97e4641a3f58ae743970457b1489ce38ee1167b3aaf7d815cd39ec7a99b9c40397fd4f686e83750e73e652b21cb516f6d845e48 + languageName: node + linkType: hard + +"minipass@npm:^5.0.0": + version: 5.0.0 + resolution: "minipass@npm:5.0.0" + checksum: 425dab288738853fded43da3314a0b5c035844d6f3097a8e3b5b29b328da8f3c1af6fc70618b32c29ff906284cf6406b6841376f21caaadd0793c1d5a6a620ea + languageName: node + linkType: hard + +"minipass@npm:^5.0.0 || ^6.0.2 || ^7.0.0, minipass@npm:^7.0.3": + version: 7.0.3 + resolution: "minipass@npm:7.0.3" + checksum: 6f1614f5b5b55568a46bca5fec0e7c46dac027691db27d0e1923a8192866903144cd962ac772c0e9f89b608ea818b702709c042bce98e190d258847d85461531 + languageName: node + linkType: hard + +"minizlib@npm:^2.1.1, minizlib@npm:^2.1.2": + version: 2.1.2 + resolution: "minizlib@npm:2.1.2" + dependencies: + minipass: "npm:^3.0.0" + yallist: "npm:^4.0.0" + checksum: f1fdeac0b07cf8f30fcf12f4b586795b97be856edea22b5e9072707be51fc95d41487faec3f265b42973a304fe3a64acd91a44a3826a963e37b37bafde0212c3 + languageName: node + linkType: hard + +"mkdirp@npm:^1.0.3": + version: 1.0.4 + resolution: "mkdirp@npm:1.0.4" + bin: + mkdirp: bin/cmd.js + checksum: a96865108c6c3b1b8e1d5e9f11843de1e077e57737602de1b82030815f311be11f96f09cce59bd5b903d0b29834733e5313f9301e3ed6d6f6fba2eae0df4298f + languageName: node + linkType: hard + +"ms@npm:2.1.2": + version: 2.1.2 + resolution: "ms@npm:2.1.2" + checksum: 673cdb2c3133eb050c745908d8ce632ed2c02d85640e2edb3ace856a2266a813b30c613569bf3354fdf4ea7d1a1494add3bfa95e2713baa27d0c2c71fc44f58f + languageName: node + linkType: hard + +"ms@npm:^2.0.0": + version: 2.1.3 + resolution: "ms@npm:2.1.3" + checksum: aa92de608021b242401676e35cfa5aa42dd70cbdc082b916da7fb925c542173e36bce97ea3e804923fe92c0ad991434e4a38327e15a1b5b5f945d66df615ae6d + languageName: node + linkType: hard + +"negotiator@npm:^0.6.3": + version: 0.6.3 + resolution: "negotiator@npm:0.6.3" + checksum: b8ffeb1e262eff7968fc90a2b6767b04cfd9842582a9d0ece0af7049537266e7b2506dfb1d107a32f06dd849ab2aea834d5830f7f4d0e5cb7d36e1ae55d021d9 + languageName: node + linkType: hard + +"no-case@npm:^3.0.4": + version: 3.0.4 + resolution: "no-case@npm:3.0.4" + dependencies: + lower-case: "npm:^2.0.2" + tslib: "npm:^2.0.3" + checksum: 0b2ebc113dfcf737d48dde49cfebf3ad2d82a8c3188e7100c6f375e30eafbef9e9124aadc3becef237b042fd5eb0aad2fd78669c20972d045bbe7fea8ba0be5c + languageName: node + linkType: hard + +"node-fetch@npm:^2.6.12, node-fetch@npm:^2.7.0": + version: 2.7.0 + resolution: "node-fetch@npm:2.7.0" + dependencies: + whatwg-url: "npm:^5.0.0" + peerDependencies: + encoding: ^0.1.0 + peerDependenciesMeta: + encoding: + optional: true + checksum: d76d2f5edb451a3f05b15115ec89fc6be39de37c6089f1b6368df03b91e1633fd379a7e01b7ab05089a25034b2023d959b47e59759cb38d88341b2459e89d6e5 + languageName: node + linkType: hard + +"node-gyp-build@npm:^4.3.0": + version: 4.6.1 + resolution: "node-gyp-build@npm:4.6.1" + bin: + node-gyp-build: bin.js + node-gyp-build-optional: optional.js + node-gyp-build-test: build-test.js + checksum: c3676d337b36803bc7792e35bf7fdcda7cdcb7e289b8f9855a5535702a82498eb976842fefcf487258c58005ca32ce3d537fbed91280b04409161dcd7232a882 + languageName: node + linkType: hard + +"node-gyp@npm:latest": + version: 9.4.0 + resolution: "node-gyp@npm:9.4.0" + dependencies: + env-paths: "npm:^2.2.0" + exponential-backoff: "npm:^3.1.1" + glob: "npm:^7.1.4" + graceful-fs: "npm:^4.2.6" + make-fetch-happen: "npm:^11.0.3" + nopt: "npm:^6.0.0" + npmlog: "npm:^6.0.0" + rimraf: "npm:^3.0.2" + semver: "npm:^7.3.5" + tar: "npm:^6.1.2" + which: "npm:^2.0.2" + bin: + node-gyp: bin/node-gyp.js + checksum: 78b404e2e0639d64e145845f7f5a3cb20c0520cdaf6dda2f6e025e9b644077202ea7de1232396ba5bde3fee84cdc79604feebe6ba3ec84d464c85d407bb5da99 + languageName: node + linkType: hard + +"nopt@npm:^6.0.0": + version: 6.0.0 + resolution: "nopt@npm:6.0.0" + dependencies: + abbrev: "npm:^1.0.0" + bin: + nopt: bin/nopt.js + checksum: 82149371f8be0c4b9ec2f863cc6509a7fd0fa729929c009f3a58e4eb0c9e4cae9920e8f1f8eb46e7d032fec8fb01bede7f0f41a67eb3553b7b8e14fa53de1dac + languageName: node + linkType: hard + +"npmlog@npm:^6.0.0": + version: 6.0.2 + resolution: "npmlog@npm:6.0.2" + dependencies: + are-we-there-yet: "npm:^3.0.0" + console-control-strings: "npm:^1.1.0" + gauge: "npm:^4.0.3" + set-blocking: "npm:^2.0.0" + checksum: ae238cd264a1c3f22091cdd9e2b106f684297d3c184f1146984ecbe18aaa86343953f26b9520dedd1b1372bc0316905b736c1932d778dbeb1fcf5a1001390e2a + languageName: node + linkType: hard + +"once@npm:^1.3.0": + version: 1.4.0 + resolution: "once@npm:1.4.0" + dependencies: + wrappy: "npm:1" + checksum: cd0a88501333edd640d95f0d2700fbde6bff20b3d4d9bdc521bdd31af0656b5706570d6c6afe532045a20bb8dc0849f8332d6f2a416e0ba6d3d3b98806c7db68 + languageName: node + linkType: hard + +"p-map@npm:^4.0.0": + version: 4.0.0 + resolution: "p-map@npm:4.0.0" + dependencies: + aggregate-error: "npm:^3.0.0" + checksum: cb0ab21ec0f32ddffd31dfc250e3afa61e103ef43d957cc45497afe37513634589316de4eb88abdfd969fe6410c22c0b93ab24328833b8eb1ccc087fc0442a1c + languageName: node + linkType: hard + +"pako@npm:^2.0.3": + version: 2.1.0 + resolution: "pako@npm:2.1.0" + checksum: 71666548644c9a4d056bcaba849ca6fd7242c6cf1af0646d3346f3079a1c7f4a66ffec6f7369ee0dc88f61926c10d6ab05da3e1fca44b83551839e89edd75a3e + languageName: node + linkType: hard + +"path-is-absolute@npm:^1.0.0": + version: 1.0.1 + resolution: "path-is-absolute@npm:1.0.1" + checksum: 060840f92cf8effa293bcc1bea81281bd7d363731d214cbe5c227df207c34cd727430f70c6037b5159c8a870b9157cba65e775446b0ab06fd5ecc7e54615a3b8 + languageName: node + linkType: hard + +"path-key@npm:^3.1.0": + version: 3.1.1 + resolution: "path-key@npm:3.1.1" + checksum: 55cd7a9dd4b343412a8386a743f9c746ef196e57c823d90ca3ab917f90ab9f13dd0ded27252ba49dbdfcab2b091d998bc446f6220cd3cea65db407502a740020 + languageName: node + linkType: hard + +"path-scurry@npm:^1.10.1": + version: 1.10.1 + resolution: "path-scurry@npm:1.10.1" + dependencies: + lru-cache: "npm:^9.1.1 || ^10.0.0" + minipass: "npm:^5.0.0 || ^6.0.2 || ^7.0.0" + checksum: e2557cff3a8fb8bc07afdd6ab163a92587884f9969b05bbbaf6fe7379348bfb09af9ed292af12ed32398b15fb443e81692047b786d1eeb6d898a51eb17ed7d90 + languageName: node + linkType: hard + +"picomatch@npm:^2.3.1": + version: 2.3.1 + resolution: "picomatch@npm:2.3.1" + checksum: 050c865ce81119c4822c45d3c84f1ced46f93a0126febae20737bd05ca20589c564d6e9226977df859ed5e03dc73f02584a2b0faad36e896936238238b0446cf + languageName: node + linkType: hard + +"promise-retry@npm:^2.0.1": + version: 2.0.1 + resolution: "promise-retry@npm:2.0.1" + dependencies: + err-code: "npm:^2.0.2" + retry: "npm:^0.12.0" + checksum: f96a3f6d90b92b568a26f71e966cbbc0f63ab85ea6ff6c81284dc869b41510e6cdef99b6b65f9030f0db422bf7c96652a3fff9f2e8fb4a0f069d8f4430359429 + languageName: node + linkType: hard + +"readable-stream@npm:^3.6.0": + version: 3.6.2 + resolution: "readable-stream@npm:3.6.2" + dependencies: + inherits: "npm:^2.0.3" + string_decoder: "npm:^1.1.1" + util-deprecate: "npm:^1.0.1" + checksum: bdcbe6c22e846b6af075e32cf8f4751c2576238c5043169a1c221c92ee2878458a816a4ea33f4c67623c0b6827c8a400409bfb3cf0bf3381392d0b1dfb52ac8d + languageName: node + linkType: hard + +"regenerator-runtime@npm:^0.14.0": + version: 0.14.0 + resolution: "regenerator-runtime@npm:0.14.0" + checksum: 1c977ad82a82a4412e4f639d65d22be376d3ebdd30da2c003eeafdaaacd03fc00c2320f18120007ee700900979284fc78a9f00da7fb593f6e6eeebc673fba9a3 + languageName: node + linkType: hard + +"retry@npm:^0.12.0": + version: 0.12.0 + resolution: "retry@npm:0.12.0" + checksum: 623bd7d2e5119467ba66202d733ec3c2e2e26568074923bc0585b6b99db14f357e79bdedb63cab56cec47491c4a0da7e6021a7465ca6dc4f481d3898fdd3158c + languageName: node + linkType: hard + +"rimraf@npm:^3.0.2": + version: 3.0.2 + resolution: "rimraf@npm:3.0.2" + dependencies: + glob: "npm:^7.1.3" + bin: + rimraf: bin.js + checksum: 87f4164e396f0171b0a3386cc1877a817f572148ee13a7e113b238e48e8a9f2f31d009a92ec38a591ff1567d9662c6b67fd8818a2dbbaed74bc26a87a2a4a9a0 + languageName: node + linkType: hard + +"rpc-websockets@npm:^7.5.1": + version: 7.6.0 + resolution: "rpc-websockets@npm:7.6.0" + dependencies: + "@babel/runtime": "npm:^7.17.2" + bufferutil: "npm:^4.0.1" + eventemitter3: "npm:^4.0.7" + utf-8-validate: "npm:^5.0.2" + uuid: "npm:^8.3.2" + ws: "npm:^8.5.0" + dependenciesMeta: + bufferutil: + optional: true + utf-8-validate: + optional: true + checksum: af2b254f65985610bd354e8e13de07b5a36010b94672b0b5a9d226b9bb1b8b17d01c63221cad97263845888f3610e55867a32e4c0017dfb92fddf89417c4cb6c + languageName: node + linkType: hard + +"safe-buffer@npm:^5.0.1, safe-buffer@npm:~5.2.0": + version: 5.2.1 + resolution: "safe-buffer@npm:5.2.1" + checksum: b99c4b41fdd67a6aaf280fcd05e9ffb0813654894223afb78a31f14a19ad220bba8aba1cb14eddce1fcfb037155fe6de4e861784eb434f7d11ed58d1e70dd491 + languageName: node + linkType: hard + +"safer-buffer@npm:>= 2.1.2 < 3.0.0": + version: 2.1.2 + resolution: "safer-buffer@npm:2.1.2" + checksum: cab8f25ae6f1434abee8d80023d7e72b598cf1327164ddab31003c51215526801e40b66c5e65d658a0af1e9d6478cadcb4c745f4bd6751f97d8644786c0978b0 + languageName: node + linkType: hard + +"semver@npm:^7.3.4, semver@npm:^7.3.5": + version: 7.5.4 + resolution: "semver@npm:7.5.4" + dependencies: + lru-cache: "npm:^6.0.0" + bin: + semver: bin/semver.js + checksum: 12d8ad952fa353b0995bf180cdac205a4068b759a140e5d3c608317098b3575ac2f1e09182206bf2eb26120e1c0ed8fb92c48c592f6099680de56bb071423ca3 + languageName: node + linkType: hard + +"set-blocking@npm:^2.0.0": + version: 2.0.0 + resolution: "set-blocking@npm:2.0.0" + checksum: 6e65a05f7cf7ebdf8b7c75b101e18c0b7e3dff4940d480efed8aad3a36a4005140b660fa1d804cb8bce911cac290441dc728084a30504d3516ac2ff7ad607b02 + languageName: node + linkType: hard + +"shebang-command@npm:^2.0.0": + version: 2.0.0 + resolution: "shebang-command@npm:2.0.0" + dependencies: + shebang-regex: "npm:^3.0.0" + checksum: 6b52fe87271c12968f6a054e60f6bde5f0f3d2db483a1e5c3e12d657c488a15474121a1d55cd958f6df026a54374ec38a4a963988c213b7570e1d51575cea7fa + languageName: node + linkType: hard + +"shebang-regex@npm:^3.0.0": + version: 3.0.0 + resolution: "shebang-regex@npm:3.0.0" + checksum: 1a2bcae50de99034fcd92ad4212d8e01eedf52c7ec7830eedcf886622804fe36884278f2be8be0ea5fde3fd1c23911643a4e0f726c8685b61871c8908af01222 + languageName: node + linkType: hard + +"signal-exit@npm:^3.0.7": + version: 3.0.7 + resolution: "signal-exit@npm:3.0.7" + checksum: a2f098f247adc367dffc27845853e9959b9e88b01cb301658cfe4194352d8d2bb32e18467c786a7fe15f1d44b233ea35633d076d5e737870b7139949d1ab6318 + languageName: node + linkType: hard + +"signal-exit@npm:^4.0.1": + version: 4.1.0 + resolution: "signal-exit@npm:4.1.0" + checksum: 64c757b498cb8629ffa5f75485340594d2f8189e9b08700e69199069c8e3070fb3e255f7ab873c05dc0b3cec412aea7402e10a5990cb6a050bd33ba062a6c549 + languageName: node + linkType: hard + +"smart-buffer@npm:^4.2.0": + version: 4.2.0 + resolution: "smart-buffer@npm:4.2.0" + checksum: b5167a7142c1da704c0e3af85c402002b597081dd9575031a90b4f229ca5678e9a36e8a374f1814c8156a725d17008ae3bde63b92f9cfd132526379e580bec8b + languageName: node + linkType: hard + +"snake-case@npm:^3.0.4": + version: 3.0.4 + resolution: "snake-case@npm:3.0.4" + dependencies: + dot-case: "npm:^3.0.4" + tslib: "npm:^2.0.3" + checksum: 0a7a79900bbb36f8aaa922cf111702a3647ac6165736d5dc96d3ef367efc50465cac70c53cd172c382b022dac72ec91710608e5393de71f76d7142e6fd80e8a3 + languageName: node + linkType: hard + +"socks-proxy-agent@npm:^7.0.0": + version: 7.0.0 + resolution: "socks-proxy-agent@npm:7.0.0" + dependencies: + agent-base: "npm:^6.0.2" + debug: "npm:^4.3.3" + socks: "npm:^2.6.2" + checksum: 720554370154cbc979e2e9ce6a6ec6ced205d02757d8f5d93fe95adae454fc187a5cbfc6b022afab850a5ce9b4c7d73e0f98e381879cf45f66317a4895953846 + languageName: node + linkType: hard + +"socks@npm:^2.6.2": + version: 2.7.1 + resolution: "socks@npm:2.7.1" + dependencies: + ip: "npm:^2.0.0" + smart-buffer: "npm:^4.2.0" + checksum: 259d9e3e8e1c9809a7f5c32238c3d4d2a36b39b83851d0f573bfde5f21c4b1288417ce1af06af1452569cd1eb0841169afd4998f0e04ba04656f6b7f0e46d748 + languageName: node + linkType: hard + +"ssri@npm:^10.0.0": + version: 10.0.5 + resolution: "ssri@npm:10.0.5" + dependencies: + minipass: "npm:^7.0.3" + checksum: 0a31b65f21872dea1ed3f7c200d7bc1c1b91c15e419deca14f282508ba917cbb342c08a6814c7f68ca4ca4116dd1a85da2bbf39227480e50125a1ceffeecb750 + languageName: node + linkType: hard + +"string-width-cjs@npm:string-width@^4.2.0, string-width@npm:^1.0.2 || 2 || 3 || 4, string-width@npm:^4.1.0, string-width@npm:^4.2.3": + version: 4.2.3 + resolution: "string-width@npm:4.2.3" + dependencies: + emoji-regex: "npm:^8.0.0" + is-fullwidth-code-point: "npm:^3.0.0" + strip-ansi: "npm:^6.0.1" + checksum: e52c10dc3fbfcd6c3a15f159f54a90024241d0f149cf8aed2982a2d801d2e64df0bf1dc351cf8e95c3319323f9f220c16e740b06faecd53e2462df1d2b5443fb + languageName: node + linkType: hard + +"string-width@npm:^5.0.1, string-width@npm:^5.1.2": + version: 5.1.2 + resolution: "string-width@npm:5.1.2" + dependencies: + eastasianwidth: "npm:^0.2.0" + emoji-regex: "npm:^9.2.2" + strip-ansi: "npm:^7.0.1" + checksum: 7369deaa29f21dda9a438686154b62c2c5f661f8dda60449088f9f980196f7908fc39fdd1803e3e01541970287cf5deae336798337e9319a7055af89dafa7193 + languageName: node + linkType: hard + +"string_decoder@npm:^1.1.1": + version: 1.3.0 + resolution: "string_decoder@npm:1.3.0" + dependencies: + safe-buffer: "npm:~5.2.0" + checksum: 8417646695a66e73aefc4420eb3b84cc9ffd89572861fe004e6aeb13c7bc00e2f616247505d2dbbef24247c372f70268f594af7126f43548565c68c117bdeb56 + languageName: node + linkType: hard + +"strip-ansi-cjs@npm:strip-ansi@^6.0.1, strip-ansi@npm:^6.0.0, strip-ansi@npm:^6.0.1": + version: 6.0.1 + resolution: "strip-ansi@npm:6.0.1" + dependencies: + ansi-regex: "npm:^5.0.1" + checksum: f3cd25890aef3ba6e1a74e20896c21a46f482e93df4a06567cebf2b57edabb15133f1f94e57434e0a958d61186087b1008e89c94875d019910a213181a14fc8c + languageName: node + linkType: hard + +"strip-ansi@npm:^7.0.1": + version: 7.1.0 + resolution: "strip-ansi@npm:7.1.0" + dependencies: + ansi-regex: "npm:^6.0.1" + checksum: 859c73fcf27869c22a4e4d8c6acfe690064659e84bef9458aa6d13719d09ca88dcfd40cbf31fd0be63518ea1a643fe070b4827d353e09533a5b0b9fd4553d64d + languageName: node + linkType: hard + +"superstruct@npm:^0.14.2": + version: 0.14.2 + resolution: "superstruct@npm:0.14.2" + checksum: c5c4840f432da82125b923ec45faca5113217e83ae416e314d80eae012b8bb603d2e745025d173450758d116348820bc7028157f8c9a72b6beae879f94b837c0 + languageName: node + linkType: hard + +"superstruct@npm:^0.15.4": + version: 0.15.5 + resolution: "superstruct@npm:0.15.5" + checksum: 6d1f5249fee789424b7178fa0a1ffb2ace629c5480c39505885bd8c0046a4ff8b267569a3442fa53b8c560a7ba6599cf3f8af94225aebeb2cf6023f7dd911050 + languageName: node + linkType: hard + +"supports-color@npm:^7.1.0": + version: 7.2.0 + resolution: "supports-color@npm:7.2.0" + dependencies: + has-flag: "npm:^4.0.0" + checksum: 3dda818de06ebbe5b9653e07842d9479f3555ebc77e9a0280caf5a14fb877ffee9ed57007c3b78f5a6324b8dbeec648d9e97a24e2ed9fdb81ddc69ea07100f4a + languageName: node + linkType: hard + +"tapable@npm:^2.2.0": + version: 2.2.1 + resolution: "tapable@npm:2.2.1" + checksum: 3b7a1b4d86fa940aad46d9e73d1e8739335efd4c48322cb37d073eb6f80f5281889bf0320c6d8ffcfa1a0dd5bfdbd0f9d037e252ef972aca595330538aac4d51 + languageName: node + linkType: hard + +"tar@npm:^6.1.11, tar@npm:^6.1.2": + version: 6.1.15 + resolution: "tar@npm:6.1.15" + dependencies: + chownr: "npm:^2.0.0" + fs-minipass: "npm:^2.0.0" + minipass: "npm:^5.0.0" + minizlib: "npm:^2.1.1" + mkdirp: "npm:^1.0.3" + yallist: "npm:^4.0.0" + checksum: f23832fceeba7578bf31907aac744ae21e74a66f4a17a9e94507acf460e48f6db598c7023882db33bab75b80e027c21f276d405e4a0322d58f51c7088d428268 + languageName: node + linkType: hard + +"text-encoding-utf-8@npm:^1.0.2": + version: 1.0.2 + resolution: "text-encoding-utf-8@npm:1.0.2" + checksum: ec4c15d50e738c5dba7327ad432ebf0725ec75d4d69c0bd55609254c5a3bc5341272d7003691084a0a73d60d981c8eb0e87603676fdb6f3fed60f4c9192309f9 + languageName: node + linkType: hard + +"through@npm:>=2.2.7 <3": + version: 2.3.8 + resolution: "through@npm:2.3.8" + checksum: a38c3e059853c494af95d50c072b83f8b676a9ba2818dcc5b108ef252230735c54e0185437618596c790bbba8fcdaef5b290405981ffa09dce67b1f1bf190cbd + languageName: node + linkType: hard + +"to-regex-range@npm:^5.0.1": + version: 5.0.1 + resolution: "to-regex-range@npm:5.0.1" + dependencies: + is-number: "npm:^7.0.0" + checksum: f76fa01b3d5be85db6a2a143e24df9f60dd047d151062d0ba3df62953f2f697b16fe5dad9b0ac6191c7efc7b1d9dcaa4b768174b7b29da89d4428e64bc0a20ed + languageName: node + linkType: hard + +"toml@npm:^3.0.0": + version: 3.0.0 + resolution: "toml@npm:3.0.0" + checksum: 5d7f1d8413ad7780e9bdecce8ea4c3f5130dd53b0a4f2e90b93340979a137739879d7b9ce2ce05c938b8cc828897fe9e95085197342a1377dd8850bf5125f15f + languageName: node + linkType: hard + +"tr46@npm:~0.0.3": + version: 0.0.3 + resolution: "tr46@npm:0.0.3" + checksum: 726321c5eaf41b5002e17ffbd1fb7245999a073e8979085dacd47c4b4e8068ff5777142fc6726d6ca1fd2ff16921b48788b87225cbc57c72636f6efa8efbffe3 + languageName: node + linkType: hard + +"ts-loader@npm:^9.2.3": + version: 9.4.4 + resolution: "ts-loader@npm:9.4.4" + dependencies: + chalk: "npm:^4.1.0" + enhanced-resolve: "npm:^5.0.0" + micromatch: "npm:^4.0.0" + semver: "npm:^7.3.4" + peerDependencies: + typescript: "*" + webpack: ^5.0.0 + checksum: 8e5e6b839b0edfa40d2156c880d88ccab58226894ea5978221bc48c7db3215e2e856bfd0093f148e925a2befc42d6c94cafa9a994a7da274541efaa916012b63 + languageName: node + linkType: hard + +"ts-node@npm:^10.9.1": + version: 10.9.1 + resolution: "ts-node@npm:10.9.1" + dependencies: + "@cspotcode/source-map-support": "npm:^0.8.0" + "@tsconfig/node10": "npm:^1.0.7" + "@tsconfig/node12": "npm:^1.0.7" + "@tsconfig/node14": "npm:^1.0.0" + "@tsconfig/node16": "npm:^1.0.2" + acorn: "npm:^8.4.1" + acorn-walk: "npm:^8.1.1" + arg: "npm:^4.1.0" + create-require: "npm:^1.1.0" + diff: "npm:^4.0.1" + make-error: "npm:^1.1.1" + v8-compile-cache-lib: "npm:^3.0.1" + yn: "npm:3.1.1" + peerDependencies: + "@swc/core": ">=1.2.50" + "@swc/wasm": ">=1.2.50" + "@types/node": "*" + typescript: ">=2.7" + peerDependenciesMeta: + "@swc/core": + optional: true + "@swc/wasm": + optional: true + bin: + ts-node: dist/bin.js + ts-node-cwd: dist/bin-cwd.js + ts-node-esm: dist/bin-esm.js + ts-node-script: dist/bin-script.js + ts-node-transpile-only: dist/bin-transpile.js + ts-script: dist/bin-script-deprecated.js + checksum: 090adff1302ab20bd3486e6b4799e90f97726ed39e02b39e566f8ab674fd5bd5f727f43615debbfc580d33c6d9d1c6b1b3ce7d8e3cca3e20530a145ffa232c35 + languageName: node + linkType: hard + +"tslib@npm:^2.0.3": + version: 2.6.2 + resolution: "tslib@npm:2.6.2" + checksum: 329ea56123005922f39642318e3d1f0f8265d1e7fcb92c633e0809521da75eeaca28d2cf96d7248229deb40e5c19adf408259f4b9640afd20d13aecc1430f3ad + languageName: node + linkType: hard + +"typescript@npm:^5.2.2": + version: 5.2.2 + resolution: "typescript@npm:5.2.2" + bin: + tsc: bin/tsc + tsserver: bin/tsserver + checksum: 7912821dac4d962d315c36800fe387cdc0a6298dba7ec171b350b4a6e988b51d7b8f051317786db1094bd7431d526b648aba7da8236607febb26cf5b871d2d3c + languageName: node + linkType: hard + +"typescript@patch:typescript@^5.2.2#~builtin": + version: 5.2.2 + resolution: "typescript@patch:typescript@npm%3A5.2.2#~builtin::version=5.2.2&hash=f3b441" + bin: + tsc: bin/tsc + tsserver: bin/tsserver + checksum: 0f4da2f15e6f1245e49db15801dbee52f2bbfb267e1c39225afdab5afee1a72839cd86000e65ee9d7e4dfaff12239d28beaf5ee431357fcced15fb08583d72ca + languageName: node + linkType: hard + +"unique-filename@npm:^3.0.0": + version: 3.0.0 + resolution: "unique-filename@npm:3.0.0" + dependencies: + unique-slug: "npm:^4.0.0" + checksum: 8e2f59b356cb2e54aab14ff98a51ac6c45781d15ceaab6d4f1c2228b780193dc70fae4463ce9e1df4479cb9d3304d7c2043a3fb905bdeca71cc7e8ce27e063df + languageName: node + linkType: hard + +"unique-slug@npm:^4.0.0": + version: 4.0.0 + resolution: "unique-slug@npm:4.0.0" + dependencies: + imurmurhash: "npm:^0.1.4" + checksum: 0884b58365af59f89739e6f71e3feacb5b1b41f2df2d842d0757933620e6de08eff347d27e9d499b43c40476cbaf7988638d3acb2ffbcb9d35fd035591adfd15 + languageName: node + linkType: hard + +"utf-8-validate@npm:^5.0.2": + version: 5.0.10 + resolution: "utf-8-validate@npm:5.0.10" + dependencies: + node-gyp: "npm:latest" + node-gyp-build: "npm:^4.3.0" + checksum: 5579350a023c66a2326752b6c8804cc7b39dcd251bb088241da38db994b8d78352e388dcc24ad398ab98385ba3c5ffcadb6b5b14b2637e43f767869055e46ba6 + languageName: node + linkType: hard + +"util-deprecate@npm:^1.0.1": + version: 1.0.2 + resolution: "util-deprecate@npm:1.0.2" + checksum: 474acf1146cb2701fe3b074892217553dfcf9a031280919ba1b8d651a068c9b15d863b7303cb15bd00a862b498e6cf4ad7b4a08fb134edd5a6f7641681cb54a2 + languageName: node + linkType: hard + +"uuid@npm:^8.3.2": + version: 8.3.2 + resolution: "uuid@npm:8.3.2" + bin: + uuid: dist/bin/uuid + checksum: 5575a8a75c13120e2f10e6ddc801b2c7ed7d8f3c8ac22c7ed0c7b2ba6383ec0abda88c905085d630e251719e0777045ae3236f04c812184b7c765f63a70e58df + languageName: node + linkType: hard + +"v8-compile-cache-lib@npm:^3.0.1": + version: 3.0.1 + resolution: "v8-compile-cache-lib@npm:3.0.1" + checksum: 78089ad549e21bcdbfca10c08850022b22024cdcc2da9b168bcf5a73a6ed7bf01a9cebb9eac28e03cd23a684d81e0502797e88f3ccd27a32aeab1cfc44c39da0 + languageName: node + linkType: hard + +"webidl-conversions@npm:^3.0.0": + version: 3.0.1 + resolution: "webidl-conversions@npm:3.0.1" + checksum: c92a0a6ab95314bde9c32e1d0a6dfac83b578f8fa5f21e675bc2706ed6981bc26b7eb7e6a1fab158e5ce4adf9caa4a0aee49a52505d4d13c7be545f15021b17c + languageName: node + linkType: hard + +"whatwg-url@npm:^5.0.0": + version: 5.0.0 + resolution: "whatwg-url@npm:5.0.0" + dependencies: + tr46: "npm:~0.0.3" + webidl-conversions: "npm:^3.0.0" + checksum: b8daed4ad3356cc4899048a15b2c143a9aed0dfae1f611ebd55073310c7b910f522ad75d727346ad64203d7e6c79ef25eafd465f4d12775ca44b90fa82ed9e2c + languageName: node + linkType: hard + +"which@npm:^2.0.1, which@npm:^2.0.2": + version: 2.0.2 + resolution: "which@npm:2.0.2" + dependencies: + isexe: "npm:^2.0.0" + bin: + node-which: ./bin/node-which + checksum: 1a5c563d3c1b52d5f893c8b61afe11abc3bab4afac492e8da5bde69d550de701cf9806235f20a47b5c8fa8a1d6a9135841de2596535e998027a54589000e66d1 + languageName: node + linkType: hard + +"wide-align@npm:^1.1.5": + version: 1.1.5 + resolution: "wide-align@npm:1.1.5" + dependencies: + string-width: "npm:^1.0.2 || 2 || 3 || 4" + checksum: d5fc37cd561f9daee3c80e03b92ed3e84d80dde3365a8767263d03dacfc8fa06b065ffe1df00d8c2a09f731482fcacae745abfbb478d4af36d0a891fad4834d3 + languageName: node + linkType: hard + +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": + version: 7.0.0 + resolution: "wrap-ansi@npm:7.0.0" + dependencies: + ansi-styles: "npm:^4.0.0" + string-width: "npm:^4.1.0" + strip-ansi: "npm:^6.0.0" + checksum: a790b846fd4505de962ba728a21aaeda189b8ee1c7568ca5e817d85930e06ef8d1689d49dbf0e881e8ef84436af3a88bc49115c2e2788d841ff1b8b5b51a608b + languageName: node + linkType: hard + +"wrap-ansi@npm:^8.1.0": + version: 8.1.0 + resolution: "wrap-ansi@npm:8.1.0" + dependencies: + ansi-styles: "npm:^6.1.0" + string-width: "npm:^5.0.1" + strip-ansi: "npm:^7.0.1" + checksum: 371733296dc2d616900ce15a0049dca0ef67597d6394c57347ba334393599e800bab03c41d4d45221b6bc967b8c453ec3ae4749eff3894202d16800fdfe0e238 + languageName: node + linkType: hard + +"wrappy@npm:1": + version: 1.0.2 + resolution: "wrappy@npm:1.0.2" + checksum: 159da4805f7e84a3d003d8841557196034155008f817172d4e986bd591f74aa82aa7db55929a54222309e01079a65a92a9e6414da5a6aa4b01ee44a511ac3ee5 + languageName: node + linkType: hard + +"ws@npm:^7.4.5": + version: 7.5.9 + resolution: "ws@npm:7.5.9" + peerDependencies: + bufferutil: ^4.0.1 + utf-8-validate: ^5.0.2 + peerDependenciesMeta: + bufferutil: + optional: true + utf-8-validate: + optional: true + checksum: c3c100a181b731f40b7f2fddf004aa023f79d64f489706a28bc23ff88e87f6a64b3c6651fbec3a84a53960b75159574d7a7385709847a62ddb7ad6af76f49138 + languageName: node + linkType: hard + +"ws@npm:^8.5.0": + version: 8.13.0 + resolution: "ws@npm:8.13.0" + peerDependencies: + bufferutil: ^4.0.1 + utf-8-validate: ">=5.0.2" + peerDependenciesMeta: + bufferutil: + optional: true + utf-8-validate: + optional: true + checksum: 53e991bbf928faf5dc6efac9b8eb9ab6497c69feeb94f963d648b7a3530a720b19ec2e0ec037344257e05a4f35bd9ad04d9de6f289615ffb133282031b18c61c + languageName: node + linkType: hard + +"yallist@npm:^4.0.0": + version: 4.0.0 + resolution: "yallist@npm:4.0.0" + checksum: 343617202af32df2a15a3be36a5a8c0c8545208f3d3dfbc6bb7c3e3b7e8c6f8e7485432e4f3b88da3031a6e20afa7c711eded32ddfb122896ac5d914e75848d5 + languageName: node + linkType: hard + +"yn@npm:3.1.1": + version: 3.1.1 + resolution: "yn@npm:3.1.1" + checksum: 2c487b0e149e746ef48cda9f8bad10fc83693cd69d7f9dcd8be4214e985de33a29c9e24f3c0d6bcf2288427040a8947406ab27f7af67ee9456e6b84854f02dd6 + languageName: node + linkType: hard diff --git a/packages/rewards-oracle-faucet-service/.env b/packages/rewards-oracle-faucet-service/.env new file mode 100644 index 000000000..fca0da9bc --- /dev/null +++ b/packages/rewards-oracle-faucet-service/.env @@ -0,0 +1,3 @@ +PGUSER=postgres +PGDATABASE=postgres +PGPASSWORD=postgres diff --git a/programs/helium-entity-manager/src/instructions/initialize_shared_merkle_v0.rs b/programs/helium-entity-manager/src/instructions/initialize_shared_merkle_v0.rs new file mode 100644 index 000000000..134f502ba --- /dev/null +++ b/programs/helium-entity-manager/src/instructions/initialize_shared_merkle_v0.rs @@ -0,0 +1,83 @@ +use account_compression_cpi::{program::SplAccountCompression, Noop}; +use anchor_lang::prelude::*; +use bubblegum_cpi::cpi::{accounts::CreateTree, create_tree}; +use bubblegum_cpi::program::Bubblegum; + +use crate::{shared_merkle_seeds, state::SharedMerkleV0}; + +#[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)] +pub struct InitializeSharedMerkleArgsV0 { + pub proof_size: u8, +} + +#[derive(Accounts)] +#[instruction(args: InitializeSharedMerkleArgsV0)] +pub struct InitializeSharedMerkleV0<'info> { + #[account(mut)] + pub payer: Signer<'info>, + #[account( + init, + seeds = [b"shared_merkle", &args.proof_size.to_le_bytes()[..]], + bump, + payer = payer, + space = 8 + SharedMerkleV0::INIT_SPACE + 32, + )] + pub shared_merkle: Account<'info, SharedMerkleV0>, + #[account( + mut, + seeds = [merkle_tree.key().as_ref()], + bump, + seeds::program = bubblegum_program.key() + )] + /// CHECK: Checked by cpi + pub tree_authority: AccountInfo<'info>, + /// CHECK: Checked by cpi + #[account(mut)] + pub merkle_tree: UncheckedAccount<'info>, + + pub system_program: Program<'info, System>, + pub log_wrapper: Program<'info, Noop>, + pub bubblegum_program: Program<'info, Bubblegum>, + pub compression_program: Program<'info, SplAccountCompression>, +} + +pub const STARTING_DEPTH: u32 = 17; +pub const BUFFER_SIZE: u32 = 64; + +fn div_ceil(dividend: u64, divisor: u64) -> u64 { + (dividend + divisor - 1) / divisor +} + +pub fn handler( + ctx: Context, + args: InitializeSharedMerkleArgsV0, +) -> Result<()> { + let depth = STARTING_DEPTH + args.proof_size as u32; + let total_lamports = ctx.accounts.merkle_tree.lamports() + ctx.accounts.tree_authority.lamports(); + ctx.accounts.shared_merkle.set_inner(SharedMerkleV0 { + proof_size: args.proof_size, + price_per_mint: div_ceil(total_lamports, 2u64.pow(depth) - 3), // because we can swap with 3 left + merkle_tree: ctx.accounts.merkle_tree.key(), + bump_seed: ctx.bumps["shared_merkle"], + }); + let signer_seeds = shared_merkle_seeds!(ctx.accounts.shared_merkle); + create_tree( + CpiContext::new_with_signer( + ctx.accounts.bubblegum_program.to_account_info().clone(), + CreateTree { + tree_authority: ctx.accounts.tree_authority.to_account_info().clone(), + merkle_tree: ctx.accounts.merkle_tree.to_account_info().clone(), + payer: ctx.accounts.payer.to_account_info().clone(), + tree_creator: ctx.accounts.shared_merkle.to_account_info().clone(), + log_wrapper: ctx.accounts.log_wrapper.to_account_info().clone(), + compression_program: ctx.accounts.compression_program.to_account_info().clone(), + system_program: ctx.accounts.system_program.to_account_info().clone(), + }, + &[signer_seeds], + ), + depth, + BUFFER_SIZE, + None, + )?; + Ok(()) +} diff --git a/programs/helium-entity-manager/src/instructions/issue_program_entity_v0.rs b/programs/helium-entity-manager/src/instructions/issue_program_entity_v0.rs index 8b7901af3..43e456c35 100644 --- a/programs/helium-entity-manager/src/instructions/issue_program_entity_v0.rs +++ b/programs/helium-entity-manager/src/instructions/issue_program_entity_v0.rs @@ -1,8 +1,10 @@ use crate::{constants::ENTITY_METADATA_URL, error::ErrorCode}; -use crate::{key_to_asset_seeds, state::*}; +use crate::{key_to_asset_seeds, shared_merkle_seeds, state::*}; use account_compression_cpi::{program::SplAccountCompression, Noop}; use anchor_lang::prelude::*; use anchor_lang::solana_program::hash::hash; +use anchor_lang::solana_program::program::invoke; +use anchor_lang::solana_program::system_instruction; use anchor_spl::token::Mint; use bubblegum_cpi::{ cpi::{accounts::MintToCollectionV1, mint_to_collection_v1}, @@ -103,6 +105,11 @@ pub struct IssueProgramEntityV0<'info> { pub bubblegum_program: Program<'info, Bubblegum>, pub compression_program: Program<'info, SplAccountCompression>, pub system_program: Program<'info, System>, + #[account( + mut, + has_one = merkle_tree + )] + pub shared_merkle: Option>, } impl<'info> IssueProgramEntityV0<'info> { @@ -113,7 +120,11 @@ impl<'info> IssueProgramEntityV0<'info> { leaf_owner: self.recipient.to_account_info(), merkle_tree: self.merkle_tree.to_account_info(), payer: self.payer.to_account_info(), - tree_delegate: self.program_approver.to_account_info(), + tree_delegate: self + .shared_merkle + .as_ref() + .map(|m| m.to_account_info()) + .unwrap_or(self.program_approver.to_account_info()), log_wrapper: self.log_wrapper.to_account_info(), compression_program: self.compression_program.to_account_info(), system_program: self.system_program.to_account_info(), @@ -203,14 +214,43 @@ pub fn handler(ctx: Context, args: IssueProgramEntityArgsV let mut key_to_asset_creator = ctx.accounts.key_to_asset.to_account_info(); key_to_asset_creator.is_signer = true; let key_to_asset_signer: &[&[u8]] = key_to_asset_seeds!(ctx.accounts.key_to_asset); - mint_to_collection_v1( - ctx - .accounts - .mint_to_collection_ctx() - .with_remaining_accounts(vec![creator, key_to_asset_creator]) - .with_signer(&[entity_creator_seeds[0], key_to_asset_signer]), - metadata, - )?; + if let Some(shared_merkle) = ctx.accounts.shared_merkle.as_ref() { + let shared_merkle_seeds = shared_merkle_seeds!(shared_merkle); + let transfer_instruction = system_instruction::transfer( + &ctx.accounts.payer.key(), + &shared_merkle.to_account_info().key(), + shared_merkle.price_per_mint, + ); + invoke( + &transfer_instruction, + &[ + ctx.accounts.payer.to_account_info(), + shared_merkle.to_account_info(), + ctx.accounts.system_program.to_account_info(), + ], + )?; + mint_to_collection_v1( + ctx + .accounts + .mint_to_collection_ctx() + .with_remaining_accounts(vec![creator, key_to_asset_creator]) + .with_signer(&[ + entity_creator_seeds[0], + key_to_asset_signer, + shared_merkle_seeds, + ]), + metadata, + )?; + } else { + mint_to_collection_v1( + ctx + .accounts + .mint_to_collection_ctx() + .with_remaining_accounts(vec![creator, key_to_asset_creator]) + .with_signer(&[entity_creator_seeds[0], key_to_asset_signer]), + metadata, + )?; + } Ok(()) } diff --git a/programs/helium-entity-manager/src/instructions/mod.rs b/programs/helium-entity-manager/src/instructions/mod.rs index 4612a289c..024f98bd0 100644 --- a/programs/helium-entity-manager/src/instructions/mod.rs +++ b/programs/helium-entity-manager/src/instructions/mod.rs @@ -3,6 +3,7 @@ pub mod approve_program_v0; pub mod initialize_data_only_v0; pub mod initialize_maker_v0; pub mod initialize_rewardable_entity_config_v0; +pub mod initialize_shared_merkle_v0; pub mod issue_data_only_entity_v0; pub mod issue_entity_v0; pub mod issue_iot_operations_fund_v0; @@ -15,6 +16,7 @@ pub mod revoke_maker_v0; pub mod revoke_program_v0; pub mod set_entity_active_v0; pub mod set_maker_tree_v0; +pub mod swap_shared_merkle_tree_v0; pub mod temp_pay_mobile_onboarding_fee_v0; pub mod temp_standardize_entity; pub mod update_data_only_tree_v0; @@ -29,6 +31,7 @@ pub use approve_program_v0::*; pub use initialize_data_only_v0::*; pub use initialize_maker_v0::*; pub use initialize_rewardable_entity_config_v0::*; +pub use initialize_shared_merkle_v0::*; pub use issue_data_only_entity_v0::*; pub use issue_entity_v0::*; pub use issue_iot_operations_fund_v0::*; @@ -41,6 +44,7 @@ pub use revoke_maker_v0::*; pub use revoke_program_v0::*; pub use set_entity_active_v0::*; pub use set_maker_tree_v0::*; +pub use swap_shared_merkle_tree_v0::*; pub use temp_pay_mobile_onboarding_fee_v0::*; pub use temp_standardize_entity::*; pub use update_data_only_tree_v0::*; diff --git a/programs/helium-entity-manager/src/instructions/swap_shared_merkle_tree_v0.rs b/programs/helium-entity-manager/src/instructions/swap_shared_merkle_tree_v0.rs new file mode 100644 index 000000000..57800d406 --- /dev/null +++ b/programs/helium-entity-manager/src/instructions/swap_shared_merkle_tree_v0.rs @@ -0,0 +1,81 @@ +use crate::{shared_merkle_seeds, state::*, BUFFER_SIZE, STARTING_DEPTH}; +use account_compression_cpi::{program::SplAccountCompression, Noop}; +use anchor_lang::prelude::*; +use bubblegum_cpi::{ + cpi::{accounts::CreateTree, create_tree}, + program::Bubblegum, + TreeConfig, +}; + +#[derive(Accounts)] +pub struct SwapSharedMerkleTreeV0<'info> { + #[account(mut)] + pub payer: Signer<'info>, + #[account(mut)] + pub shared_merkle: Box>, + #[account( + mut, + seeds = [shared_merkle.merkle_tree.key().as_ref()], + bump, + // Allow permissionlessly swapping trees when we're within 3 of full + constraint = tree_authority.num_minted > (tree_authority.total_mint_capacity - 3), + seeds::program = bubblegum_program.key() + )] + pub tree_authority: Box>, + #[account( + mut, + seeds = [new_merkle_tree.key().as_ref()], + bump, + seeds::program = bubblegum_program.key() + )] + /// CHECK: Checked by cpi + pub new_tree_authority: UncheckedAccount<'info>, + #[account(mut)] + /// CHECK: Checked by cpi + pub new_merkle_tree: AccountInfo<'info>, + + pub log_wrapper: Program<'info, Noop>, + pub system_program: Program<'info, System>, + pub bubblegum_program: Program<'info, Bubblegum>, + pub compression_program: Program<'info, SplAccountCompression>, +} + +pub fn handler(ctx: Context) -> Result<()> { + let signer_seeds: &[&[&[u8]]] = &[shared_merkle_seeds!(ctx.accounts.shared_merkle)]; + let depth = STARTING_DEPTH + ctx.accounts.shared_merkle.proof_size as u32; + + create_tree( + CpiContext::new_with_signer( + ctx.accounts.bubblegum_program.to_account_info().clone(), + CreateTree { + tree_authority: ctx.accounts.new_tree_authority.to_account_info().clone(), + merkle_tree: ctx.accounts.new_merkle_tree.to_account_info().clone(), + payer: ctx.accounts.payer.to_account_info().clone(), + tree_creator: ctx.accounts.shared_merkle.to_account_info().clone(), + log_wrapper: ctx.accounts.log_wrapper.to_account_info().clone(), + compression_program: ctx.accounts.compression_program.to_account_info().clone(), + system_program: ctx.accounts.system_program.to_account_info().clone(), + }, + signer_seeds, + ), + depth, + BUFFER_SIZE, + None, + )?; + ctx.accounts.shared_merkle.merkle_tree = ctx.accounts.new_merkle_tree.key(); + + let refund_lamports = + ctx.accounts.new_merkle_tree.lamports() + ctx.accounts.new_tree_authority.lamports(); + **ctx + .accounts + .shared_merkle + .to_account_info() + .try_borrow_mut_lamports()? -= refund_lamports; + **ctx + .accounts + .payer + .to_account_info() + .try_borrow_mut_lamports()? += refund_lamports; + + Ok(()) +} diff --git a/programs/helium-entity-manager/src/lib.rs b/programs/helium-entity-manager/src/lib.rs index 5ae721158..083e04585 100644 --- a/programs/helium-entity-manager/src/lib.rs +++ b/programs/helium-entity-manager/src/lib.rs @@ -32,6 +32,17 @@ security_txt! { pub mod helium_entity_manager { use super::*; + pub fn swap_shared_merkle_tree_v0(ctx: Context) -> Result<()> { + swap_shared_merkle_tree_v0::handler(ctx) + } + + pub fn initialize_shared_merkle_v0( + ctx: Context, + args: InitializeSharedMerkleArgsV0, + ) -> Result<()> { + initialize_shared_merkle_v0::handler(ctx, args) + } + pub fn initialize_rewardable_entity_config_v0( ctx: Context, args: InitializeRewardableEntityConfigArgsV0, diff --git a/programs/helium-entity-manager/src/state.rs b/programs/helium-entity-manager/src/state.rs index daec01135..9d884df97 100644 --- a/programs/helium-entity-manager/src/state.rs +++ b/programs/helium-entity-manager/src/state.rs @@ -331,3 +331,23 @@ macro_rules! key_to_asset_seeds { ] }; } + +#[account] +#[derive(Default, InitSpace)] +pub struct SharedMerkleV0 { + pub proof_size: u8, + pub price_per_mint: u64, + pub merkle_tree: Pubkey, + pub bump_seed: u8, +} + +#[macro_export] +macro_rules! shared_merkle_seeds { + ( $merkle:expr ) => { + &[ + b"shared_merkle".as_ref(), + &$merkle.proof_size.to_le_bytes()[..], + &[$merkle.bump_seed], + ] + }; +} diff --git a/programs/iot-routing-manager/Cargo.toml b/programs/iot-routing-manager/Cargo.toml new file mode 100644 index 000000000..9fdaed859 --- /dev/null +++ b/programs/iot-routing-manager/Cargo.toml @@ -0,0 +1,37 @@ +[package] +name = "iot-routing-manager" +version = "0.1.2" +description = "Created with Anchor" +edition = "2021" + +[lib] +crate-type = ["cdylib", "lib"] +name = "iot_routing_manager" + +[features] +devnet = [] +no-genesis = [] +no-entrypoint = [] +no-idl = [] +no-log-ix-name = [] +cpi = ["no-entrypoint"] +default = [] + +[profile.release] +overflow-checks = true + +[dependencies] +bs58 = "0.3.1" +anchor-lang = { workspace = true } +anchor-spl = { workspace = true } +bytemuck = "1.12.3" +angry-purple-tiger = "0.1.0" +mpl-token-metadata = { workspace = true } +bubblegum-cpi = { workspace = true } +account-compression-cpi = { workspace = true } +shared-utils = { workspace = true } +helium-entity-manager = { workspace = true } +helium-sub-daos = { workspace = true } +solana-security-txt = { workspace = true } +default-env = { workspace = true } + diff --git a/programs/iot-routing-manager/Xargo.toml b/programs/iot-routing-manager/Xargo.toml new file mode 100644 index 000000000..475fb71ed --- /dev/null +++ b/programs/iot-routing-manager/Xargo.toml @@ -0,0 +1,2 @@ +[target.bpfel-unknown-unknown.dependencies.std] +features = [] diff --git a/programs/iot-routing-manager/src/error.rs b/programs/iot-routing-manager/src/error.rs new file mode 100644 index 000000000..f852d9f06 --- /dev/null +++ b/programs/iot-routing-manager/src/error.rs @@ -0,0 +1,11 @@ +use anchor_lang::prelude::*; + +#[error_code] +pub enum ErrorCode { + #[msg("The carrier is not approved")] + CarrierNotApproved, + #[msg("Names, symbols and urls must be less than 32, 10, and 200 characters respectively")] + InvalidStringLength, + #[msg("Cannot swap tree until it is close to full")] + TreeNotFull, +} diff --git a/programs/iot-routing-manager/src/instructions/initialize_devaddr_constraint_v0.rs b/programs/iot-routing-manager/src/instructions/initialize_devaddr_constraint_v0.rs new file mode 100644 index 000000000..57ed04380 --- /dev/null +++ b/programs/iot-routing-manager/src/instructions/initialize_devaddr_constraint_v0.rs @@ -0,0 +1,62 @@ +use anchor_lang::prelude::*; + +use crate::{DevAddrConstraintV0, NetIdV0, OrganizationV0}; + +#[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)] +pub struct InitializeDevaddrConstraintArgsV0 { + pub num_blocks: u32, + /// Override the default start address for the devaddr constraint. + /// WARNING: This is dangerous and can create unvalidated overlap, + /// this should not happen under Helium managed net ids + pub start_addr: Option, +} + +#[derive(Accounts)] +#[instruction(args: InitializeDevaddrConstraintArgsV0)] +pub struct InitializeDevaddrConstraintV0<'info> { + #[account(mut)] + pub payer: Signer<'info>, + pub authority: Signer<'info>, + #[account( + has_one = authority, + )] + pub net_id: Box>, + #[account( + has_one = net_id + )] + pub organization: Box>, + #[account( + init, + payer = payer, + seeds = [b"devaddr_constraint", organization.key().as_ref(), &args.start_addr.unwrap_or(net_id.current_addr_offset).to_le_bytes()[..]], + bump, + space = 8 + DevAddrConstraintV0::INIT_SPACE + 60 + )] + pub devaddr_constraint: Box>, + pub system_program: Program<'info, System>, +} + +pub fn handler( + ctx: Context, + args: InitializeDevaddrConstraintArgsV0, +) -> Result<()> { + let start_addr = args + .start_addr + .unwrap_or(ctx.accounts.net_id.current_addr_offset); + let end_addr = start_addr + (args.num_blocks * 8) as u64; + if end_addr > ctx.accounts.net_id.current_addr_offset { + ctx.accounts.net_id.current_addr_offset = end_addr; + } + ctx + .accounts + .devaddr_constraint + .set_inner(DevAddrConstraintV0 { + routing_manager: ctx.accounts.net_id.routing_manager, + net_id: ctx.accounts.net_id.key(), + organization: ctx.accounts.organization.key(), + start_addr: start_addr, + end_addr, + bump_seed: ctx.bumps["devaddr_constraint"], + }); + Ok(()) +} diff --git a/programs/iot-routing-manager/src/instructions/initialize_net_id_v0.rs b/programs/iot-routing-manager/src/instructions/initialize_net_id_v0.rs new file mode 100644 index 000000000..8e07b6e66 --- /dev/null +++ b/programs/iot-routing-manager/src/instructions/initialize_net_id_v0.rs @@ -0,0 +1,42 @@ +use anchor_lang::prelude::*; + +use crate::{IotRoutingManagerV0, NetIdV0}; + +#[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)] +pub struct InitializeNetIdArgsV0 { + pub net_id: u64, +} + +#[derive(Accounts)] +#[instruction(args: InitializeNetIdArgsV0)] +pub struct InitializeNetIdV0<'info> { + #[account(mut)] + pub payer: Signer<'info>, + pub net_id_authority: Signer<'info>, + /// CHECK: The authority of the net id + pub authority: AccountInfo<'info>, + #[account( + has_one = net_id_authority + )] + pub routing_manager: Account<'info, IotRoutingManagerV0>, + #[account( + init, + payer = payer, + space = 8 + NetIdV0::INIT_SPACE + 60, + seeds = [b"net_id", routing_manager.key().as_ref(), &args.net_id.to_le_bytes()[..]], + bump, + )] + pub net_id: Account<'info, NetIdV0>, + pub system_program: Program<'info, System>, +} + +pub fn handler(ctx: Context, args: InitializeNetIdArgsV0) -> Result<()> { + ctx.accounts.net_id.set_inner(NetIdV0 { + id: args.net_id, + routing_manager: ctx.accounts.routing_manager.key(), + authority: ctx.accounts.authority.key(), + current_addr_offset: 0, + bump_seed: ctx.bumps["net_id"], + }); + Ok(()) +} diff --git a/programs/iot-routing-manager/src/instructions/initialize_organization_v0.rs b/programs/iot-routing-manager/src/instructions/initialize_organization_v0.rs new file mode 100644 index 000000000..341dca122 --- /dev/null +++ b/programs/iot-routing-manager/src/instructions/initialize_organization_v0.rs @@ -0,0 +1,202 @@ +use crate::{net_id_seeds, routing_manager_seeds, state::*}; +use account_compression_cpi::{program::SplAccountCompression, Noop}; +use anchor_lang::prelude::*; +use anchor_lang::solana_program::hash::hash; +use anchor_spl::token::Mint; +use bubblegum_cpi::program::Bubblegum; +use bubblegum_cpi::TreeConfig; +use helium_entity_manager::program::HeliumEntityManager; +use helium_entity_manager::{ + cpi::accounts::IssueProgramEntityV0, cpi::issue_program_entity_v0, ProgramApprovalV0, +}; +use helium_entity_manager::{IssueProgramEntityArgsV0, KeySerialization, SharedMerkleV0}; +use helium_sub_daos::{DaoV0, SubDaoV0}; + +#[cfg(feature = "devnet")] +pub const ENTITY_METADATA_URL: &str = "https://entities.nft.test-helium.com"; + +#[cfg(not(feature = "devnet"))] +pub const ENTITY_METADATA_URL: &str = "https://entities.nft.helium.io"; + +#[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)] +pub struct InitializeOrganizationArgsV0 { + pub oui: u64, + // Default escrow key is OUI_. For legacy OUIs, this can be overridden + pub escrow_key_override: Option, +} + +#[derive(Accounts)] +#[instruction(args: InitializeOrganizationArgsV0)] +pub struct InitializeOrganizationV0<'info> { + #[account(mut)] + pub payer: Signer<'info>, + #[account( + seeds = ["program_approval".as_bytes(), dao.key().as_ref(), crate::id().as_ref()], + seeds::program = helium_entity_manager_program.key(), + bump = program_approval.bump_seed, + )] + pub program_approval: Box>, + #[account( + has_one = collection, + has_one = sub_dao + )] + pub routing_manager: Box>, + #[account( + has_one = authority, + has_one = routing_manager, + )] + pub net_id: Box>, + pub oui_authority: Signer<'info>, + /// CHECK: The new authority for this OUI + pub authority: AccountInfo<'info>, + #[account( + init, + payer = payer, + seeds = ["organization".as_bytes(), routing_manager.key().as_ref(), &args.oui.to_le_bytes()[..]], + space = 8 + std::mem::size_of::() + args.escrow_key_override.map(|k| k.len()).unwrap_or(8) + 60, + bump + )] + pub organization: Box>, + pub collection: Box>, + /// CHECK: Handled by cpi + #[account( + mut, + seeds = ["metadata".as_bytes(), token_metadata_program.key().as_ref(), collection.key().as_ref()], + seeds::program = token_metadata_program.key(), + bump, + )] + pub collection_metadata: UncheckedAccount<'info>, + /// CHECK: Handled By cpi account + #[account( + seeds = ["metadata".as_bytes(), token_metadata_program.key().as_ref(), collection.key().as_ref(), "edition".as_bytes()], + seeds::program = token_metadata_program.key(), + bump, + )] + pub collection_master_edition: UncheckedAccount<'info>, + /// CHECK: Checked in cpi + #[account( + seeds = [b"entity_creator", dao.key().as_ref()], + seeds::program = helium_entity_manager_program.key(), + bump, + )] + pub entity_creator: UncheckedAccount<'info>, + pub dao: Box>, + #[account( + has_one = dao + )] + pub sub_dao: Box>, + #[account( + mut, + seeds = [ + "key_to_asset".as_bytes(), + dao.key().as_ref(), + &hash(format!("OUI_{}", args.oui).as_bytes()).to_bytes() + ], + seeds::program = helium_entity_manager_program.key(), + bump + )] + /// CHECK: Checked in cpi + pub key_to_asset: UncheckedAccount<'info>, + #[account( + mut, + seeds = [merkle_tree.key().as_ref()], + seeds::program = bubblegum_program.key(), + bump, + )] + pub tree_authority: Box>, + /// CHECK: Used in cpi + pub recipient: AccountInfo<'info>, + /// CHECK: Used in cpi + #[account(mut)] + pub merkle_tree: AccountInfo<'info>, + #[account( + seeds = ["collection_cpi".as_bytes()], + seeds::program = bubblegum_program.key(), + bump, + )] + /// CHECK: Used in cpi + pub bubblegum_signer: UncheckedAccount<'info>, + #[account( + mut, + seeds = ["shared_merkle".as_bytes(), &[3]], + seeds::program = helium_entity_manager_program.key(), + bump = shared_merkle.bump_seed, + has_one = merkle_tree + )] + pub shared_merkle: Box>, + + /// CHECK: Verified by constraint + #[account(address = mpl_token_metadata::ID)] + pub token_metadata_program: AccountInfo<'info>, + pub log_wrapper: Program<'info, Noop>, + pub bubblegum_program: Program<'info, Bubblegum>, + pub compression_program: Program<'info, SplAccountCompression>, + pub system_program: Program<'info, System>, + pub helium_entity_manager_program: Program<'info, HeliumEntityManager>, +} + +pub fn handler( + ctx: Context, + args: InitializeOrganizationArgsV0, +) -> Result<()> { + let seeds: &[&[&[u8]]] = &[ + routing_manager_seeds!(ctx.accounts.routing_manager), + net_id_seeds!(ctx.accounts.net_id), + ]; + let key = format!("OUI_{}", args.oui); + let escrow_key = args.escrow_key_override.unwrap_or(key.clone()); + + ctx.accounts.organization.set_inner(OrganizationV0 { + oui: args.oui, + routing_manager: ctx.accounts.routing_manager.key(), + authority: ctx.accounts.authority.key(), + escrow_key, + bump_seed: ctx.bumps["organization"], + net_id: ctx.accounts.net_id.key(), + }); + + let uri = format!( + "{}/v2/oui/{}", + ENTITY_METADATA_URL, + ctx.accounts.key_to_asset.key(), + ); + + issue_program_entity_v0( + CpiContext::new_with_signer( + ctx.accounts.helium_entity_manager_program.to_account_info(), + IssueProgramEntityV0 { + payer: ctx.accounts.payer.to_account_info(), + program_approver: ctx.accounts.net_id.to_account_info(), + program_approval: ctx.accounts.program_approval.to_account_info(), + collection_authority: ctx.accounts.routing_manager.to_account_info(), + collection: ctx.accounts.collection.to_account_info(), + collection_metadata: ctx.accounts.collection_metadata.to_account_info(), + collection_master_edition: ctx.accounts.collection_master_edition.to_account_info(), + entity_creator: ctx.accounts.entity_creator.to_account_info(), + dao: ctx.accounts.dao.to_account_info(), + key_to_asset: ctx.accounts.key_to_asset.to_account_info(), + tree_authority: ctx.accounts.tree_authority.to_account_info(), + recipient: ctx.accounts.recipient.to_account_info(), + merkle_tree: ctx.accounts.merkle_tree.to_account_info(), + bubblegum_signer: ctx.accounts.bubblegum_signer.to_account_info(), + token_metadata_program: ctx.accounts.token_metadata_program.to_account_info(), + log_wrapper: ctx.accounts.log_wrapper.to_account_info(), + bubblegum_program: ctx.accounts.bubblegum_program.to_account_info(), + compression_program: ctx.accounts.compression_program.to_account_info(), + system_program: ctx.accounts.system_program.to_account_info(), + shared_merkle: Some(ctx.accounts.shared_merkle.to_account_info()), + }, + seeds, + ), + IssueProgramEntityArgsV0 { + entity_key: key.as_bytes().to_vec(), + name: key, + symbol: String::from("OUI"), + approver_seeds: seeds[1].iter().map(|s| s.to_vec()).collect(), + key_serialization: KeySerialization::UTF8, + metadata_url: Some(uri), + }, + )?; + + Ok(()) +} diff --git a/programs/iot-routing-manager/src/instructions/initialize_routing_manager_v0.rs b/programs/iot-routing-manager/src/instructions/initialize_routing_manager_v0.rs new file mode 100644 index 000000000..4f7ee4f0f --- /dev/null +++ b/programs/iot-routing-manager/src/instructions/initialize_routing_manager_v0.rs @@ -0,0 +1,175 @@ +use crate::error::ErrorCode; +use crate::{routing_manager_seeds, state::*}; +use anchor_lang::prelude::*; +use anchor_spl::{ + associated_token::AssociatedToken, + token::{self, Mint, MintTo, Token, TokenAccount}, +}; +use helium_sub_daos::SubDaoV0; +use mpl_token_metadata::types::{CollectionDetails, DataV2}; +use shared_utils::create_metadata_accounts_v3; +use shared_utils::token_metadata::{ + create_master_edition_v3, CreateMasterEditionV3, CreateMetadataAccountsV3, + Metadata as MetadataProgram, +}; + +// 500m MOBILE +pub const CARRIER_STAKE_AMOUNT: u64 = 500_000_000_000_000; + +#[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)] +pub struct InitializeRoutingManagerArgsV0 { + pub metadata_url: String, +} + +#[derive(Accounts)] +#[instruction(args: InitializeRoutingManagerArgsV0)] +pub struct InitializeRoutingManagerV0<'info> { + #[account(mut)] + pub payer: Signer<'info>, + pub authority: Signer<'info>, + /// CHECK: Set on the struct + pub update_authority: UncheckedAccount<'info>, + /// CHECK: Set on the struct + pub net_id_authority: UncheckedAccount<'info>, + #[account( + init, + payer = payer, + space = 8 + 60 + IotRoutingManagerV0::INIT_SPACE, + seeds = ["routing_manager".as_bytes(), sub_dao.key().as_ref()], + bump, + )] + pub routing_manager: Box>, + #[account( + has_one = authority + )] + pub sub_dao: Box>, + #[account( + init, + payer = payer, + mint::decimals = 0, + mint::authority = routing_manager, + mint::freeze_authority = routing_manager, + seeds = ["collection".as_bytes(), routing_manager.key().as_ref()], + bump + )] + pub collection: Box>, + /// CHECK: Handled by cpi + #[account( + mut, + seeds = ["metadata".as_bytes(), token_metadata_program.key().as_ref(), collection.key().as_ref()], + seeds::program = token_metadata_program.key(), + bump, + )] + pub metadata: UncheckedAccount<'info>, + /// CHECK: Handled by cpi + #[account( + mut, + seeds = ["metadata".as_bytes(), token_metadata_program.key().as_ref(), collection.key().as_ref(), "edition".as_bytes()], + seeds::program = token_metadata_program.key(), + bump, + )] + pub master_edition: UncheckedAccount<'info>, + #[account( + init_if_needed, + payer = payer, + associated_token::mint = collection, + associated_token::authority = routing_manager, + )] + pub token_account: Box>, + + pub token_metadata_program: Program<'info, MetadataProgram>, + pub associated_token_program: Program<'info, AssociatedToken>, + pub system_program: Program<'info, System>, + pub token_program: Program<'info, Token>, + pub rent: Sysvar<'info, Rent>, +} + +impl<'info> InitializeRoutingManagerV0<'info> { + fn mint_ctx(&self) -> CpiContext<'_, '_, '_, 'info, MintTo<'info>> { + let cpi_accounts = MintTo { + mint: self.collection.to_account_info(), + to: self.token_account.to_account_info(), + authority: self.routing_manager.to_account_info(), + }; + CpiContext::new(self.token_program.to_account_info(), cpi_accounts) + } +} + +#[allow(deprecated)] +pub fn handler( + ctx: Context, + args: InitializeRoutingManagerArgsV0, +) -> Result<()> { + require!( + args.metadata_url.len() <= 200, + ErrorCode::InvalidStringLength + ); + + ctx.accounts.routing_manager.set_inner(IotRoutingManagerV0 { + update_authority: ctx.accounts.update_authority.key(), + net_id_authority: ctx.accounts.net_id_authority.key(), + collection: ctx.accounts.collection.key(), + // Initialized via set_carrier_tree + bump_seed: ctx.bumps["routing_manager"], + sub_dao: ctx.accounts.sub_dao.key(), + }); + + let signer_seeds: &[&[&[u8]]] = &[routing_manager_seeds!(ctx.accounts.routing_manager)]; + token::mint_to(ctx.accounts.mint_ctx().with_signer(signer_seeds), 1)?; + + create_metadata_accounts_v3( + CpiContext::new_with_signer( + ctx + .accounts + .token_metadata_program + .to_account_info() + .clone(), + CreateMetadataAccountsV3 { + metadata: ctx.accounts.metadata.to_account_info().clone(), + mint: ctx.accounts.collection.to_account_info().clone(), + mint_authority: ctx.accounts.routing_manager.to_account_info().clone(), + payer: ctx.accounts.payer.to_account_info().clone(), + update_authority: ctx.accounts.routing_manager.to_account_info().clone(), + system_program: ctx.accounts.system_program.to_account_info().clone(), + token_metadata_program: ctx.accounts.token_metadata_program.clone(), + }, + signer_seeds, + ), + DataV2 { + name: "IOT Routing Manager Collection".to_string(), + symbol: "RM".to_string(), + uri: args.metadata_url.clone(), + seller_fee_basis_points: 0, + creators: None, + collection: None, + uses: None, + }, + true, + Some(CollectionDetails::V1 { size: 0 }), + )?; + + create_master_edition_v3( + CpiContext::new_with_signer( + ctx + .accounts + .token_metadata_program + .to_account_info() + .clone(), + CreateMasterEditionV3 { + edition: ctx.accounts.master_edition.to_account_info().clone(), + mint: ctx.accounts.collection.to_account_info().clone(), + update_authority: ctx.accounts.routing_manager.to_account_info().clone(), + mint_authority: ctx.accounts.routing_manager.to_account_info().clone(), + metadata: ctx.accounts.metadata.to_account_info().clone(), + payer: ctx.accounts.payer.to_account_info().clone(), + token_program: ctx.accounts.token_program.to_account_info().clone(), + system_program: ctx.accounts.system_program.to_account_info().clone(), + token_metadata_program: ctx.accounts.token_metadata_program.clone(), + }, + signer_seeds, + ), + Some(0), + )?; + + Ok(()) +} diff --git a/programs/iot-routing-manager/src/instructions/mod.rs b/programs/iot-routing-manager/src/instructions/mod.rs new file mode 100644 index 000000000..cfbd89b12 --- /dev/null +++ b/programs/iot-routing-manager/src/instructions/mod.rs @@ -0,0 +1,9 @@ +pub mod initialize_devaddr_constraint_v0; +pub mod initialize_net_id_v0; +pub mod initialize_organization_v0; +pub mod initialize_routing_manager_v0; + +pub use initialize_devaddr_constraint_v0::*; +pub use initialize_net_id_v0::*; +pub use initialize_organization_v0::*; +pub use initialize_routing_manager_v0::*; diff --git a/programs/iot-routing-manager/src/lib.rs b/programs/iot-routing-manager/src/lib.rs new file mode 100644 index 000000000..f25532b6c --- /dev/null +++ b/programs/iot-routing-manager/src/lib.rs @@ -0,0 +1,61 @@ +use anchor_lang::prelude::*; +#[cfg(not(feature = "no-entrypoint"))] +use {default_env::default_env, solana_security_txt::security_txt}; + +declare_id!("irtjLnjCMmyowq2m3KWqpuFB3M9gdNA9A4t4d6VWmzB"); + +pub mod error; +pub mod instructions; +pub mod state; + +pub use instructions::*; +pub use state::*; + +#[cfg(not(feature = "no-entrypoint"))] +security_txt! { + name: "IOT Routing Manager", + project_url: "http://helium.com", + contacts: "email:hello@helium.foundation", + policy: "https://github.com/helium/helium-program-library/tree/master/SECURITY.md", + + + // Optional Fields + preferred_languages: "en", + source_code: "https://github.com/helium/helium-program-library/tree/master/programs/iot-routing-manager", + source_revision: default_env!("GITHUB_SHA", ""), + source_release: default_env!("GITHUB_REF_NAME", ""), + auditors: "Sec3" +} + +#[program] +pub mod iot_routing_manager { + use super::*; + + pub fn initialize_devaddr_constraint_v0( + ctx: Context, + args: InitializeDevaddrConstraintArgsV0, + ) -> Result<()> { + initialize_devaddr_constraint_v0::handler(ctx, args) + } + + pub fn initialize_net_id_v0( + ctx: Context, + args: InitializeNetIdArgsV0, + ) -> Result<()> { + initialize_net_id_v0::handler(ctx, args) + } + + pub fn initialize_organization_v0( + ctx: Context, + args: InitializeOrganizationArgsV0, + ) -> Result<()> { + initialize_organization_v0::handler(ctx, args) + } + + pub fn initialize_routing_manager_v0( + ctx: Context, + args: InitializeRoutingManagerArgsV0, + ) -> Result<()> { + initialize_routing_manager_v0::handler(ctx, args) + } +} diff --git a/programs/iot-routing-manager/src/state.rs b/programs/iot-routing-manager/src/state.rs new file mode 100644 index 000000000..bb6f26277 --- /dev/null +++ b/programs/iot-routing-manager/src/state.rs @@ -0,0 +1,98 @@ +use anchor_lang::prelude::*; + +#[account] +#[derive(Default, InitSpace)] +pub struct IotRoutingManagerV0 { + pub sub_dao: Pubkey, + pub update_authority: Pubkey, + pub net_id_authority: Pubkey, + pub collection: Pubkey, // The metaplex collection to be issued for Rewardable Entities + pub bump_seed: u8, +} + +#[macro_export] +macro_rules! routing_manager_seeds { + ( $manager:expr ) => { + &[ + b"routing_manager".as_ref(), + $manager.sub_dao.as_ref(), + &[$manager.bump_seed], + ] + }; +} + +#[account] +#[derive(Default)] +pub struct OrganizationV0 { + pub routing_manager: Pubkey, + pub net_id: Pubkey, + pub authority: Pubkey, + pub oui: u64, + pub escrow_key: String, + pub bump_seed: u8, +} + +#[macro_export] +macro_rules! organization_seeds { + ( $org:expr ) => { + &[ + b"organization".as_ref(), + $org.routing_manager.as_ref(), + &$org.oui.to_le_bytes()[..], + &[$org.bump_seed], + ] + }; +} + +#[account] +#[derive(Default, InitSpace)] +pub struct NetIdV0 { + pub routing_manager: Pubkey, + pub id: u64, + pub authority: Pubkey, + pub current_addr_offset: u64, + pub bump_seed: u8, +} + +#[macro_export] +macro_rules! net_id_seeds { + ( $net_id:expr ) => { + &[ + b"net_id".as_ref(), + $net_id.routing_manager.as_ref(), + &$net_id.id.to_le_bytes()[..], + &[$net_id.bump_seed], + ] + }; +} + +#[account] +#[derive(Default, InitSpace)] +pub struct DevAddrConstraintV0 { + pub routing_manager: Pubkey, + pub net_id: Pubkey, + pub organization: Pubkey, + pub start_addr: u64, + pub end_addr: u64, + pub bump_seed: u8, +} + +#[account] +#[derive(Default)] +pub struct OranizationDelegateV0 { + pub organization: Pubkey, + pub delegate: Pubkey, + pub bump_seed: u8, +} + +#[macro_export] +macro_rules! organization_delegate_seeds { + ( $delegate:expr ) => { + &[ + b"organization_delegate".as_ref(), + $delegate.organization.as_ref(), + $delegate.delegate.as_ref(), + &[$delegate.bump_seed], + ] + }; +} diff --git a/programs/mobile-entity-manager/src/instructions/initialize_subscriber_v0.rs b/programs/mobile-entity-manager/src/instructions/initialize_subscriber_v0.rs index 810a1fdf7..7dc61e26f 100644 --- a/programs/mobile-entity-manager/src/instructions/initialize_subscriber_v0.rs +++ b/programs/mobile-entity-manager/src/instructions/initialize_subscriber_v0.rs @@ -138,6 +138,7 @@ pub fn handler( bubblegum_program: ctx.accounts.bubblegum_program.to_account_info(), compression_program: ctx.accounts.compression_program.to_account_info(), system_program: ctx.accounts.system_program.to_account_info(), + shared_merkle: None, }, seeds, ), diff --git a/programs/mobile-entity-manager/src/instructions/issue_carrier_nft_v0.rs b/programs/mobile-entity-manager/src/instructions/issue_carrier_nft_v0.rs index 8493bbb2c..48634c944 100644 --- a/programs/mobile-entity-manager/src/instructions/issue_carrier_nft_v0.rs +++ b/programs/mobile-entity-manager/src/instructions/issue_carrier_nft_v0.rs @@ -132,6 +132,7 @@ pub fn handler(ctx: Context, args: IssueCarrierNftArgsV0) -> bubblegum_program: ctx.accounts.bubblegum_program.to_account_info(), compression_program: ctx.accounts.compression_program.to_account_info(), system_program: ctx.accounts.system_program.to_account_info(), + shared_merkle: None, }, seeds, ), diff --git a/tests/helium-entity-manager.ts b/tests/helium-entity-manager.ts index 62abdc310..0d6b6e49e 100644 --- a/tests/helium-entity-manager.ts +++ b/tests/helium-entity-manager.ts @@ -3,7 +3,7 @@ import { Program } from "@coral-xyz/anchor"; import { Keypair as HeliumKeypair } from "@helium/crypto"; import { init as initDataCredits } from "@helium/data-credits-sdk"; import { init as initHeliumSubDaos } from "@helium/helium-sub-daos-sdk"; -import { notEmittedKey, init as initBurn } from "@helium/no-emit-sdk"; +import { init as initBurn, notEmittedKey } from "@helium/no-emit-sdk"; import { Asset, AssetProof, @@ -15,7 +15,7 @@ import { toBN, } from "@helium/spl-utils"; import { AddGatewayV1 } from "@helium/transactions"; -import { getAssociatedTokenAddressSync, getAccount } from "@solana/spl-token"; +import { getAccount, getAssociatedTokenAddressSync } from "@solana/spl-token"; import { ComputeBudgetProgram, Keypair, @@ -35,18 +35,18 @@ import { } from "../packages/helium-entity-manager-sdk/src"; import { DataCredits } from "../target/types/data_credits"; import { HeliumEntityManager } from "../target/types/helium_entity_manager"; -import { NoEmit } from "../target/types/no_emit"; import { HeliumSubDaos } from "../target/types/helium_sub_daos"; +import { NoEmit } from "../target/types/no_emit"; import { initTestDao, initTestSubdao } from "./utils/daos"; import { DC_FEE, + MAKER_STAKING_FEE, ensureDCIdl, - ensureHSDIdl, ensureHEMIdl, + ensureHSDIdl, initTestDataCredits, initTestMaker, - initTestRewardableEntityConfig, - MAKER_STAKING_FEE, + initTestRewardableEntityConfig } from "./utils/fixtures"; // @ts-ignore import bs58 from "bs58"; @@ -56,6 +56,7 @@ import { helium } from "@helium/proto"; // @ts-ignore import axios from "axios"; +import { keyToAssetKey } from "@helium/helium-entity-manager-sdk"; import { MerkleTree, SPL_ACCOUNT_COMPRESSION_PROGRAM_ID, @@ -65,7 +66,6 @@ import { BN } from "bn.js"; import chaiAsPromised from "chai-as-promised"; import { createMockCompression } from "./utils/compression"; import { loadKeypair } from "./utils/solana"; -import { keyToAssetKey } from "@helium/helium-entity-manager-sdk"; chai.use(chaiAsPromised); diff --git a/tests/iot-routing-manager.ts b/tests/iot-routing-manager.ts new file mode 100644 index 000000000..3acf202d8 --- /dev/null +++ b/tests/iot-routing-manager.ts @@ -0,0 +1,220 @@ +import * as anchor from "@coral-xyz/anchor"; +import { Program } from "@coral-xyz/anchor"; +import { init as initDataCredits } from "@helium/data-credits-sdk"; +import { init as initHeliumSubDaos } from "@helium/helium-sub-daos-sdk"; +import { + SystemProgram, + Keypair, + PublicKey, + ComputeBudgetProgram, +} from "@solana/web3.js"; +import chai from "chai"; +import { init as initIotRoutingManager } from "../packages/iot-routing-manager-sdk/src"; +import { init as initHeliumEntityManager, sharedMerkleKey } from "../packages/helium-entity-manager-sdk/src"; +import { DataCredits } from "../target/types/data_credits"; +import { HeliumSubDaos } from "../target/types/helium_sub_daos"; +import { IotRoutingManager } from "../target/types/iot_routing_manager"; +import { initTestDao, initTestSubdao } from "./utils/daos"; +import { + ensureIrmIdl, + ensureDCIdl, + ensureHSDIdl, + initTestDataCredits, + initSharedMerkle, + ensureHEMIdl, +} from "./utils/fixtures"; +const { expect } = chai; +import chaiAsPromised from "chai-as-promised"; +import { getAccount } from "@solana/spl-token"; +import { random } from "./utils/string"; +import { + SPL_ACCOUNT_COMPRESSION_PROGRAM_ID, + getConcurrentMerkleTreeAccountSize, +} from "@solana/spl-account-compression"; +import { HeliumEntityManager } from "../target/types/helium_entity_manager"; + +chai.use(chaiAsPromised); + +describe("iot-routing-manager", () => { + anchor.setProvider(anchor.AnchorProvider.local("http://127.0.0.1:8899")); + + let dcProgram: Program; + let hsdProgram: Program; + let hemProgram: Program; + let irmProgram: Program; + + const provider = anchor.getProvider() as anchor.AnchorProvider; + const me = provider.wallet.publicKey; + let dao: PublicKey; + let subDao: PublicKey; + let dcMint: PublicKey; + let programApproval: PublicKey; + + beforeEach(async () => { + dcProgram = await initDataCredits( + provider, + anchor.workspace.DataCredits.programId, + anchor.workspace.DataCredits.idl + ); + + ensureDCIdl(dcProgram); + + hsdProgram = await initHeliumSubDaos( + provider, + anchor.workspace.HeliumSubDaos.programId, + anchor.workspace.HeliumSubDaos.idl + ); + + ensureHSDIdl(hsdProgram); + + hemProgram = await initHeliumEntityManager( + provider, + anchor.workspace.HeliumEntityManager.programId, + anchor.workspace.HeliumEntityManager.idl + ); + ensureHEMIdl(hemProgram); + + irmProgram = await initIotRoutingManager( + provider, + anchor.workspace.IotRoutingManager.programId, + anchor.workspace.IotRoutingManager.idl + ); + ensureIrmIdl(irmProgram); + + + const dataCredits = await initTestDataCredits(dcProgram, provider); + dcMint = dataCredits.dcMint; + ({ dao } = await initTestDao( + hsdProgram, + provider, + 100, + me, + dataCredits.dcMint + )); + ({ subDao } = await initTestSubdao({ + hsdProgram, + provider, + authority: me, + dao, + numTokens: new anchor.BN("500000000000000"), + })); + + const approve = await hemProgram.methods + .approveProgramV0({ + programId: irmProgram.programId, + }) + .accounts({ dao }); + + programApproval = (await approve.pubkeys()).programApproval!; + await approve.rpc({ skipPreflight: true }); + + await initSharedMerkle(hemProgram); + }); + + it("should initialize a routing manager", async () => { + const { + pubkeys: { routingManager }, + } = await irmProgram.methods + .initializeRoutingManagerV0({ + metadataUrl: "https://some/url", + }) + .preInstructions([ + ComputeBudgetProgram.setComputeUnitLimit({ units: 500000 }), + ]) + .accounts({ + updateAuthority: me, + netIdAuthority: me, + subDao, + }) + .rpcAndKeys({ skipPreflight: true }); + + const routingManagerAcc = await irmProgram.account.iotRoutingManagerV0.fetch(routingManager!); + + expect(routingManagerAcc.updateAuthority.toBase58()).to.eq(me.toBase58()); + expect(routingManagerAcc.netIdAuthority.toBase58()).to.eq(me.toBase58()); + }); + + describe("with a routing manager", async () => { + let routingManager: PublicKey; + let merkle: Keypair; + beforeEach(async () => { + const { + pubkeys: { routingManager: routingManagerK }, + } = await irmProgram.methods + .initializeRoutingManagerV0({ + metadataUrl: "https://some/url", + }) + .preInstructions([ + ComputeBudgetProgram.setComputeUnitLimit({ units: 500000 }), + ]) + .accounts({ + updateAuthority: me, + netIdAuthority: me, + subDao, + }) + .rpcAndKeys({ skipPreflight: true }); + routingManager = routingManagerK! + }); + + it("should initialize a net id", async () => { + const { + pubkeys: { netId }, + } = await irmProgram.methods + .initializeNetIdV0({ + netId: new anchor.BN(1), + }) + .accounts({ + authority: me, + routingManager, + }) + .rpcAndKeys({ skipPreflight: true }); + + const netIdAcc = await irmProgram.account.netIdV0.fetch(netId!); + expect(netIdAcc.authority.toBase58()).to.eq(me.toBase58()); + expect(netIdAcc.id.toNumber()).to.eq(1); + }) + + describe("with net id", async () => { + let netId: PublicKey; + beforeEach(async () => { + const { + pubkeys: { netId: netIdK }, + } = await irmProgram.methods + .initializeNetIdV0({ + netId: new anchor.BN(1), + }) + .accounts({ + authority: me, + routingManager, + }) + .rpcAndKeys({ skipPreflight: true }); + netId = netIdK!; + }); + + it ("should initialize an organization", async () => { + const { + pubkeys: { organization }, + } = await irmProgram.methods + .initializeOrganizationV0({ + oui: new anchor.BN(2), + escrowKeyOverride: null, + }) + .preInstructions( + [ComputeBudgetProgram.setComputeUnitLimit({ units: 500000 })] + ) + .accounts({ + authority: me, + netId, + }) + .rpcAndKeys({ skipPreflight: true }); + + const organizationAcc = await irmProgram.account.organizationV0.fetch(organization!); + expect(organizationAcc.authority.toBase58()).to.eq(me.toBase58()); + expect(organizationAcc.oui.toNumber()).to.eq(2); + expect(organizationAcc.escrowKey.toString()).to.eq("OUI_2"); + expect(organizationAcc.netId.toBase58()).to.eq(netId.toBase58()); + expect(organizationAcc.routingManager.toBase58()).to.eq(routingManager.toBase58()); + }) + }) + }); +}); diff --git a/tests/mobile-entity-manager.ts b/tests/mobile-entity-manager.ts index e637517c7..229a82d67 100644 --- a/tests/mobile-entity-manager.ts +++ b/tests/mobile-entity-manager.ts @@ -20,6 +20,7 @@ import { ensureDCIdl, ensureHSDIdl, initTestDataCredits, + initSharedMerkle, } from './utils/fixtures'; const { expect } = chai; import chaiAsPromised from 'chai-as-promised'; diff --git a/tests/utils/fixtures.ts b/tests/utils/fixtures.ts index c07892246..9f95cd5dd 100644 --- a/tests/utils/fixtures.ts +++ b/tests/utils/fixtures.ts @@ -16,13 +16,14 @@ import { import { Keypair, PublicKey, SystemProgram } from "@solana/web3.js"; import { execSync } from "child_process"; import { ThresholdType } from "../../packages/circuit-breaker-sdk/src"; -import { makerKey } from "../../packages/helium-entity-manager-sdk/src"; +import { makerKey, sharedMerkleKey } from "../../packages/helium-entity-manager-sdk/src"; import { DataCredits } from "../../target/types/data_credits"; import { HeliumEntityManager } from "../../target/types/helium_entity_manager"; import { HeliumSubDaos } from "../../target/types/helium_sub_daos"; import { LazyDistributor } from "../../target/types/lazy_distributor"; import { initTestDao, initTestSubdao } from "./daos"; import { random } from "./string"; +import { IotRoutingManager } from "../../target/types/iot_routing_manager"; // TODO: replace this with helium default uri once uploaded const DEFAULT_METADATA_URL = @@ -115,6 +116,37 @@ export const initTestRewardableEntityConfig = async ( }; }; +export const initSharedMerkle = async (program: Program) => { + const sharedMerkle = sharedMerkleKey(3)[0]; + const exists = !!(await program.provider.connection.getAccountInfo(sharedMerkle)); + if (exists) { + return sharedMerkle; + } + const merkle = Keypair.generate(); + const space = getConcurrentMerkleTreeAccountSize(20, 64, 17); + const createMerkle = SystemProgram.createAccount({ + fromPubkey: (program.provider as anchor.AnchorProvider).wallet.publicKey, + newAccountPubkey: merkle.publicKey, + lamports: await (program.provider as anchor.AnchorProvider).connection.getMinimumBalanceForRentExemption( + space + ), + space: space, + programId: SPL_ACCOUNT_COMPRESSION_PROGRAM_ID, + }); + await program.methods + .initializeSharedMerkleV0({ + proofSize: 3, + }) + .preInstructions([createMerkle]) + .signers([merkle]) + .accounts({ + merkleTree: merkle.publicKey, + }) + .rpc({ skipPreflight: true }); + + return sharedMerkle +}; + export const initTestMaker = async ( program: Program, provider: anchor.AnchorProvider, @@ -243,6 +275,20 @@ export async function ensureMemIdl(memProgram: Program) { } } +export async function ensureIrmIdl(irmProgram: Program) { + try { + execSync( + `${ANCHOR_PATH} idl init --filepath ${__dirname}/../../target/idl/iot_routing_manager.json ${irmProgram.programId}`, + { stdio: "inherit", shell: "/bin/bash" } + ); + } catch { + execSync( + `${ANCHOR_PATH} idl upgrade --filepath ${__dirname}/../../target/idl/iot_routing_manager.json ${irmProgram.programId}`, + { stdio: "inherit", shell: "/bin/bash" } + ); + } +} + export async function ensureLDIdl(ldProgram: Program) { try { execSync( diff --git a/tsconfig.json b/tsconfig.json index 4c1f31c15..ef6dcde7f 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -19,6 +19,9 @@ { "path": "./packages/lazy-transactions-sdk" }, + { + "path": "./packages/iot-routing-manager-sdk" + }, { "path": "./packages/helium-react-hooks" }, diff --git a/yarn.lock b/yarn.lock index 25e4dede6..52f12dd39 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1073,6 +1073,21 @@ __metadata: languageName: node linkType: hard +"@helium/iot-routing-manager-sdk@workspace:packages/iot-routing-manager-sdk": + version: 0.0.0-use.local + resolution: "@helium/iot-routing-manager-sdk@workspace:packages/iot-routing-manager-sdk" + dependencies: + "@coral-xyz/anchor": ^0.28.0 + "@helium/anchor-resolvers": ^0.8.7 + bn.js: ^5.2.0 + bs58: ^4.0.1 + git-format-staged: ^2.1.3 + ts-loader: ^9.2.3 + ts-node: ^10.9.1 + typescript: ^5.2.2 + languageName: unknown + linkType: soft + "@helium/lazy-distributor-sdk@^0.8.7, @helium/lazy-distributor-sdk@workspace:packages/lazy-distributor-sdk": version: 0.0.0-use.local resolution: "@helium/lazy-distributor-sdk@workspace:packages/lazy-distributor-sdk" From ea07460ac95d66739a407a37745744bda7530fbc Mon Sep 17 00:00:00 2001 From: Noah Prince Date: Mon, 22 Jul 2024 08:08:05 -0700 Subject: [PATCH 02/63] Finish tests --- packages/iot-routing-manager-sdk/src/pdas.ts | 16 ++++++++ .../iot-routing-manager-sdk/src/resolvers.ts | 18 +++++++-- tests/iot-routing-manager.ts | 39 +++++++++++++++++++ 3 files changed, 70 insertions(+), 3 deletions(-) diff --git a/packages/iot-routing-manager-sdk/src/pdas.ts b/packages/iot-routing-manager-sdk/src/pdas.ts index 32aa9b688..f736097e1 100644 --- a/packages/iot-routing-manager-sdk/src/pdas.ts +++ b/packages/iot-routing-manager-sdk/src/pdas.ts @@ -26,6 +26,22 @@ export function organizationKey( ); } +export function devaddrConstraintKey( + organization: PublicKey, + startAddr: BN, + programId: PublicKey = PROGRAM_ID +): [PublicKey, number] { + const startAddrBuffer = Buffer.alloc(8); + startAddrBuffer.writeBigUint64LE(BigInt(startAddr.toString())); + return PublicKey.findProgramAddressSync( + [ + Buffer.from("devaddr_constraint", "utf-8"), + organization.toBuffer(), + startAddrBuffer, + ], + programId + ); +} export function netIdKey( routingManager: PublicKey, diff --git a/packages/iot-routing-manager-sdk/src/resolvers.ts b/packages/iot-routing-manager-sdk/src/resolvers.ts index 6027255b6..c090585e1 100644 --- a/packages/iot-routing-manager-sdk/src/resolvers.ts +++ b/packages/iot-routing-manager-sdk/src/resolvers.ts @@ -1,4 +1,4 @@ -import { Accounts } from "@coral-xyz/anchor"; +import { Accounts, BorshAccountsCoder, Program, Provider } from "@coral-xyz/anchor"; import { heliumCommonResolver } from "@helium/anchor-resolvers"; import { ataResolver, @@ -6,9 +6,10 @@ import { resolveIndividual, } from "@helium/anchor-resolvers"; import { PublicKey } from "@solana/web3.js"; -import { netIdKey, organizationKey } from "./pdas"; +import { devaddrConstraintKey, netIdKey, organizationKey } from "./pdas"; import { PROGRAM_ID } from "./constants"; import { heliumEntityManagerResolvers, keyToAssetKey, programApprovalKey, sharedMerkleKey } from "@helium/helium-entity-manager-sdk"; +import { IDL } from "@helium/idls/lib/types/iot_routing_manager"; export const lazyDistributorResolvers = combineResolvers( heliumCommonResolver, @@ -19,7 +20,7 @@ export const lazyDistributorResolvers = combineResolvers( mint: "collection", owner: "routingManager", }), - resolveIndividual(async ({ args, path, accounts }) => { + resolveIndividual(async ({ args, path, accounts, provider }) => { if ( args[0] && args[0].netId && @@ -37,6 +38,8 @@ export const lazyDistributorResolvers = combineResolvers( accounts.routingManager as PublicKey, args[0].oui )[0]; + } else if (path[path.length - 1] === "devaddrConstraint" && accounts.organization && accounts.netId) { + return devaddrConstraintKey(accounts.organization as PublicKey, (args[0] && args[0].startAddr) ?? (await getNetId(provider, accounts.netId as PublicKey)).currentAddrOffset)[0]; } else if (path[path.length - 1] == "programApproval" && accounts.dao) { return programApprovalKey(accounts.dao as PublicKey, PROGRAM_ID)[0]; } else if ( @@ -58,3 +61,12 @@ export const lazyDistributorResolvers = combineResolvers( }) ); +async function getNetId(provider: Provider, netId: PublicKey) { + const idl = await Program.fetchIdl(PROGRAM_ID, provider); + const netIdAccount = await provider.connection.getAccountInfo(netId); + if (!netIdAccount) { + throw new Error("NetId account not found"); + } + const coder = new BorshAccountsCoder(idl!) + return coder.decode("NetIdV0", netIdAccount.data) +} diff --git a/tests/iot-routing-manager.ts b/tests/iot-routing-manager.ts index 3acf202d8..503f4bac6 100644 --- a/tests/iot-routing-manager.ts +++ b/tests/iot-routing-manager.ts @@ -215,6 +215,45 @@ describe("iot-routing-manager", () => { expect(organizationAcc.netId.toBase58()).to.eq(netId.toBase58()); expect(organizationAcc.routingManager.toBase58()).to.eq(routingManager.toBase58()); }) + + describe("with an organization", () => { + let organization: PublicKey; + beforeEach(async () => { + const { + pubkeys: { organization: organizationK }, + } = await irmProgram.methods + .initializeOrganizationV0({ + oui: new anchor.BN(2), + escrowKeyOverride: null, + }) + .preInstructions([ + ComputeBudgetProgram.setComputeUnitLimit({ units: 500000 }), + ]) + .accounts({ + authority: me, + netId, + }) + .rpcAndKeys({ skipPreflight: true }); + organization = organizationK!; + }) + + it("should initialize a devaddr constraint", async () => { + const { + pubkeys: { devaddrConstraint }, + } = await irmProgram.methods + .initializeDevaddrConstraintV0({ + startAddr: null, + numBlocks: 2, + }) + .accounts({ + organization, + }) + .rpcAndKeys({ skipPreflight: true }); + const devaddr = await irmProgram.account.devAddrConstraintV0.fetch(devaddrConstraint!); + expect(devaddr.startAddr.toNumber()).to.eq(0); + expect(devaddr.endAddr.toNumber()).to.eq(16); + }); + }) }) }); }); From b94155cecd1b2a4e5e891745df1821e02ba592c9 Mon Sep 17 00:00:00 2001 From: Noah Prince Date: Thu, 25 Jul 2024 14:24:46 -0700 Subject: [PATCH 03/63] Add IOT burn and delegate accounts --- Anchor.toml | 3 + Cargo.lock | 1 + .../iot-routing-manager-sdk/src/resolvers.ts | 20 +- .../iot-routing-manager-sdk/tsconfig.json | 3 + .../iot-routing-manager-sdk/yarn.deploy.lock | 395 +++++++++++++++++- packages/spl-utils/src/constants.ts | 8 + programs/iot-routing-manager/Cargo.toml | 2 +- programs/iot-routing-manager/src/error.rs | 8 + .../instructions/approve_organization_v0.rs | 23 + .../initialize_devaddr_constraint_v0.rs | 85 +++- .../initialize_organization_delegate_v0.rs | 37 ++ .../initialize_organization_v0.rs | 73 +++- .../initialize_routing_manager_v0.rs | 12 +- .../src/instructions/mod.rs | 6 + .../remove_organization_delegate_v0.rs | 24 ++ programs/iot-routing-manager/src/lib.rs | 14 + programs/iot-routing-manager/src/state.rs | 10 +- tests/iot-routing-manager.ts | 23 +- yarn.lock | 1 + 19 files changed, 728 insertions(+), 20 deletions(-) create mode 100644 programs/iot-routing-manager/src/instructions/approve_organization_v0.rs create mode 100644 programs/iot-routing-manager/src/instructions/initialize_organization_delegate_v0.rs create mode 100644 programs/iot-routing-manager/src/instructions/remove_organization_delegate_v0.rs diff --git a/Anchor.toml b/Anchor.toml index cc02df868..fb3f09759 100644 --- a/Anchor.toml +++ b/Anchor.toml @@ -81,6 +81,9 @@ address = "66t3XARU6Ja3zj91gDZ2KoNLJHEMTYPSKqJWYb6PJJBA" # Proposal IDL [[test.validator.clone]] address = "DQ4C1tzvu28cwo1roN1Wm6TW35sfJEjLh517k3ZeWevx" # Mobile price oracle +[[test.validator.clone]] +address = "8UYEn5Weq7toHwgcmctvcAxaNJo3SJxXEayM57rpoXr9" # IOT price oracle + # Pyth price oracle [[test.validator.clone]] address = "4DdmDswskDxXGpwHrXUfn2CNUm9rt21ac79GHNTN3J33" diff --git a/Cargo.lock b/Cargo.lock index 59125bb4f..132e6b9fe 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2253,6 +2253,7 @@ dependencies = [ "helium-entity-manager", "helium-sub-daos", "mpl-token-metadata", + "pyth-solana-receiver-sdk", "shared-utils", "solana-security-txt", ] diff --git a/packages/iot-routing-manager-sdk/src/resolvers.ts b/packages/iot-routing-manager-sdk/src/resolvers.ts index c090585e1..30c623662 100644 --- a/packages/iot-routing-manager-sdk/src/resolvers.ts +++ b/packages/iot-routing-manager-sdk/src/resolvers.ts @@ -20,6 +20,11 @@ export const lazyDistributorResolvers = combineResolvers( mint: "collection", owner: "routingManager", }), + ataResolver({ + account: "payerIotAccount", + mint: "iotMint", + owner: "payer", + }), resolveIndividual(async ({ args, path, accounts, provider }) => { if ( args[0] && @@ -38,8 +43,17 @@ export const lazyDistributorResolvers = combineResolvers( accounts.routingManager as PublicKey, args[0].oui )[0]; - } else if (path[path.length - 1] === "devaddrConstraint" && accounts.organization && accounts.netId) { - return devaddrConstraintKey(accounts.organization as PublicKey, (args[0] && args[0].startAddr) ?? (await getNetId(provider, accounts.netId as PublicKey)).currentAddrOffset)[0]; + } else if ( + path[path.length - 1] === "devaddrConstraint" && + accounts.organization && + accounts.netId + ) { + return devaddrConstraintKey( + accounts.organization as PublicKey, + (args[0] && args[0].startAddr) ?? + (await getNetId(provider, accounts.netId as PublicKey)) + .currentAddrOffset + )[0]; } else if (path[path.length - 1] == "programApproval" && accounts.dao) { return programApprovalKey(accounts.dao as PublicKey, PROGRAM_ID)[0]; } else if ( @@ -56,7 +70,7 @@ export const lazyDistributorResolvers = combineResolvers( ) )[0]; } else if (path[path.length - 1] === "sharedMerkle") { - return sharedMerkleKey(3)[0] + return sharedMerkleKey(3)[0]; } }) ); diff --git a/packages/iot-routing-manager-sdk/tsconfig.json b/packages/iot-routing-manager-sdk/tsconfig.json index 20acdaa8e..cd351dee2 100644 --- a/packages/iot-routing-manager-sdk/tsconfig.json +++ b/packages/iot-routing-manager-sdk/tsconfig.json @@ -7,6 +7,9 @@ { "path": "../anchor-resolvers" }, + { + "path": "../helium-entity-manager-sdk" + }, { "path": "../circuit-breaker-sdk" }, diff --git a/packages/iot-routing-manager-sdk/yarn.deploy.lock b/packages/iot-routing-manager-sdk/yarn.deploy.lock index f430dacb0..aaeaef403 100644 --- a/packages/iot-routing-manager-sdk/yarn.deploy.lock +++ b/packages/iot-routing-manager-sdk/yarn.deploy.lock @@ -67,6 +67,28 @@ __metadata: languageName: node linkType: hard +"@helium/account-fetch-cache@^0.8.7": + version: 0.0.0-use.local + resolution: "@helium/account-fetch-cache@workspace:packages/account-fetch-cache" + dependencies: + "@solana/web3.js": ^1.78.8 + git-format-staged: ^2.1.3 + ts-loader: ^9.2.3 + typescript: ^5.2.2 + languageName: unknown + linkType: soft + +"@helium/address@npm:^4.10.2": + version: 4.10.2 + resolution: "@helium/address@npm:4.10.2" + dependencies: + bs58: "npm:^5.0.0" + js-sha256: "npm:^0.9.0" + multiformats: "npm:^9.6.4" + checksum: 4d83df57c638ed1496a92241a2f45da671e11b6397f02ab65c5281cbd1a435548e7ffd5be969d8d214b5af045e9be4bdd2d89f41744289c17e6410d458b03bcc + languageName: node + linkType: hard + "@helium/anchor-resolvers@^0.8.7": version: 0.0.0-use.local resolution: "@helium/anchor-resolvers@workspace:packages/anchor-resolvers" @@ -81,12 +103,182 @@ __metadata: languageName: unknown linkType: soft +"@helium/anchor-resolvers@npm:^0.5.0": + version: 0.5.0 + resolution: "@helium/anchor-resolvers@npm:0.5.0" + dependencies: + "@solana/spl-token": ^0.3.8 + "@solana/web3.js": ^1.78.4 + peerDependencies: + "@coral-xyz/anchor": ^0.28.0 + checksum: b20f52072bb8e1cb097e951c98a66149989035a58d3f4de1998c3043a1e04e36b6dee2e0760b99d0fbd5fa4e47f499972ad17f6560e1f3c7424e96a1e35343a9 + languageName: node + linkType: hard + +"@helium/circuit-breaker-sdk@^0.8.7": + version: 0.0.0-use.local + resolution: "@helium/circuit-breaker-sdk@workspace:packages/circuit-breaker-sdk" + dependencies: + "@coral-xyz/anchor": ^0.28.0 + "@helium/anchor-resolvers": ^0.8.7 + "@helium/idls": ^0.8.7 + bn.js: ^5.2.0 + bs58: ^4.0.1 + git-format-staged: ^2.1.3 + ts-loader: ^9.2.3 + ts-node: ^10.9.1 + typescript: ^5.2.2 + languageName: unknown + linkType: soft + +"@helium/helium-entity-manager-sdk@^0.8.7": + version: 0.0.0-use.local + resolution: "@helium/helium-entity-manager-sdk@workspace:packages/helium-entity-manager-sdk" + dependencies: + "@coral-xyz/anchor": ^0.28.0 + "@helium/address": ^4.10.2 + "@helium/anchor-resolvers": ^0.8.7 + "@helium/helium-sub-daos-sdk": ^0.8.7 + "@helium/idls": ^0.8.7 + "@helium/no-emit-sdk": ^0.8.7 + "@helium/spl-utils": ^0.8.7 + "@types/crypto-js": ^4.1.1 + bn.js: ^5.2.0 + bs58: ^4.0.1 + crypto-js: ^4.1.1 + git-format-staged: ^2.1.3 + js-sha256: ^0.9.0 + ts-loader: ^9.2.3 + ts-node: ^10.9.1 + typescript: ^5.2.2 + languageName: unknown + linkType: soft + +"@helium/helium-sub-daos-sdk@^0.8.7": + version: 0.0.0-use.local + resolution: "@helium/helium-sub-daos-sdk@workspace:packages/helium-sub-daos-sdk" + dependencies: + "@coral-xyz/anchor": ^0.28.0 + "@helium/anchor-resolvers": ^0.8.7 + "@helium/circuit-breaker-sdk": ^0.8.7 + "@helium/treasury-management-sdk": ^0.8.7 + "@helium/voter-stake-registry-sdk": ^0.8.7 + bn.js: ^5.2.0 + bs58: ^4.0.1 + git-format-staged: ^2.1.3 + ts-loader: ^9.2.3 + ts-node: ^10.9.1 + typescript: ^5.2.2 + languageName: unknown + linkType: soft + +"@helium/idls@^0.8.7": + version: 0.0.0-use.local + resolution: "@helium/idls@workspace:packages/idls" + dependencies: + "@coral-xyz/anchor": ^0.28.0 + "@solana/web3.js": ^1.78.8 + bn.js: ^5.2.0 + borsh: ^0.7.0 + bs58: ^4.0.1 + ts-loader: ^9.2.3 + typescript: ^5.2.2 + languageName: unknown + linkType: soft + +"@helium/idls@npm:^0.5.0": + version: 0.5.0 + resolution: "@helium/idls@npm:0.5.0" + dependencies: + "@coral-xyz/anchor": ^0.28.0 + "@solana/web3.js": ^1.78.4 + bn.js: ^5.2.0 + borsh: ^0.7.0 + bs58: ^4.0.1 + checksum: 66a021a9953cf0a96f0eaf8932a2006286c266cc323f171eedf2bc18a94d55ad035cc7da9e21c99dc70fc77b1681630382a55999a2f40228f33611d7621a0c7c + languageName: node + linkType: hard + "@helium/iot-routing-manager-sdk@workspace:.": version: 0.0.0-use.local resolution: "@helium/iot-routing-manager-sdk@workspace:." dependencies: "@coral-xyz/anchor": ^0.28.0 "@helium/anchor-resolvers": ^0.8.7 + "@helium/helium-entity-manager-sdk": ^0.8.7 + bn.js: ^5.2.0 + bs58: ^4.0.1 + git-format-staged: ^2.1.3 + ts-loader: ^9.2.3 + ts-node: ^10.9.1 + typescript: ^5.2.2 + languageName: unknown + linkType: soft + +"@helium/no-emit-sdk@^0.8.7": + version: 0.0.0-use.local + resolution: "@helium/no-emit-sdk@workspace:packages/no-emit-sdk" + dependencies: + "@coral-xyz/anchor": ^0.28.0 + "@helium/anchor-resolvers": ^0.5.0 + "@helium/idls": ^0.5.0 + bn.js: ^5.2.0 + bs58: ^4.0.1 + git-format-staged: ^2.1.3 + ts-loader: ^9.2.3 + ts-node: ^10.9.1 + typescript: ^5.2.2 + languageName: unknown + linkType: soft + +"@helium/spl-utils@^0.8.7": + version: 0.0.0-use.local + resolution: "@helium/spl-utils@workspace:packages/spl-utils" + dependencies: + "@coral-xyz/anchor": ^0.28.0 + "@helium/account-fetch-cache": ^0.8.7 + "@helium/address": ^4.10.2 + "@helium/anchor-resolvers": ^0.8.7 + "@metaplex-foundation/mpl-token-metadata": ^2.10.0 + "@solana/spl-account-compression": ^0.1.7 + "@solana/spl-token": ^0.3.8 + "@solana/web3.js": ^1.78.8 + axios: ^1.5.0 + bn.js: ^5.2.0 + borsh: ^0.7.0 + bs58: ^4.0.1 + git-format-staged: ^2.1.3 + ts-loader: ^9.2.3 + typescript: ^5.2.2 + languageName: unknown + linkType: soft + +"@helium/treasury-management-sdk@^0.8.7": + version: 0.0.0-use.local + resolution: "@helium/treasury-management-sdk@workspace:packages/treasury-management-sdk" + dependencies: + "@coral-xyz/anchor": ^0.28.0 + "@helium/anchor-resolvers": ^0.8.7 + "@helium/circuit-breaker-sdk": ^0.8.7 + "@helium/idls": ^0.8.7 + bn.js: ^5.2.0 + bs58: ^4.0.1 + git-format-staged: ^2.1.3 + ts-loader: ^9.2.3 + ts-node: ^10.9.1 + typescript: ^5.2.2 + languageName: unknown + linkType: soft + +"@helium/voter-stake-registry-sdk@^0.8.7": + version: 0.0.0-use.local + resolution: "@helium/voter-stake-registry-sdk@workspace:packages/voter-stake-registry-sdk" + dependencies: + "@coral-xyz/anchor": ^0.28.0 + "@helium/anchor-resolvers": ^0.8.7 + "@helium/idls": ^0.8.7 + "@metaplex-foundation/mpl-token-metadata": ^2.10.0 + "@solana/spl-token": ^0.3.8 bn.js: ^5.2.0 bs58: ^4.0.1 git-format-staged: ^2.1.3 @@ -134,6 +326,51 @@ __metadata: languageName: node linkType: hard +"@metaplex-foundation/beet-solana@npm:^0.4.0": + version: 0.4.0 + resolution: "@metaplex-foundation/beet-solana@npm:0.4.0" + dependencies: + "@metaplex-foundation/beet": "npm:>=0.1.0" + "@solana/web3.js": "npm:^1.56.2" + bs58: "npm:^5.0.0" + debug: "npm:^4.3.4" + checksum: ee746c2d15f985c31d133d4ee29efbda445877473cc32aafa4b684ce3fa9a916ddff30d0e3cfef7654ff5725adff59a62a635c76bc781a6e1362c5b5d3137ed0 + languageName: node + linkType: hard + +"@metaplex-foundation/beet@npm:>=0.1.0, @metaplex-foundation/beet@npm:^0.7.1": + version: 0.7.1 + resolution: "@metaplex-foundation/beet@npm:0.7.1" + dependencies: + ansicolors: "npm:^0.3.2" + bn.js: "npm:^5.2.0" + debug: "npm:^4.3.3" + checksum: f8a330073ab1a0976478e9847c0e63e32f7bee67ea6306e1f89784e8275e30daaecba7cbc5f3424e5d96c411aa3bfbc2b638c105a90067a985acdfbd33a1a287 + languageName: node + linkType: hard + +"@metaplex-foundation/cusper@npm:^0.0.2": + version: 0.0.2 + resolution: "@metaplex-foundation/cusper@npm:0.0.2" + checksum: d157953baf42a2a012cdeb809c1785f29a44d80a3b5a3841c930baeb12ac6ddcf37f1a15eded4dce20d66f7bc8f23bedb87e905758df721e274bfcd816e70ba1 + languageName: node + linkType: hard + +"@metaplex-foundation/mpl-token-metadata@npm:^2.10.0": + version: 2.13.0 + resolution: "@metaplex-foundation/mpl-token-metadata@npm:2.13.0" + dependencies: + "@metaplex-foundation/beet": "npm:^0.7.1" + "@metaplex-foundation/beet-solana": "npm:^0.4.0" + "@metaplex-foundation/cusper": "npm:^0.0.2" + "@solana/spl-token": "npm:^0.3.6" + "@solana/web3.js": "npm:^1.66.2" + bn.js: "npm:^5.2.0" + debug: "npm:^4.3.4" + checksum: 89f82980f435ac45d961e6ab03859c7e4ab9809ad2d9f84aca91bcf50fdc60e210d0596d8856adf63e474ca69d971c51a4c27d0fe4dab115fcef64d57f3be611 + languageName: node + linkType: hard + "@noble/curves@npm:^1.0.0": version: 1.2.0 resolution: "@noble/curves@npm:1.2.0" @@ -203,7 +440,23 @@ __metadata: languageName: node linkType: hard -"@solana/spl-token@npm:^0.3.8": +"@solana/spl-account-compression@npm:^0.1.7": + version: 0.1.10 + resolution: "@solana/spl-account-compression@npm:0.1.10" + dependencies: + "@metaplex-foundation/beet": "npm:^0.7.1" + "@metaplex-foundation/beet-solana": "npm:^0.4.0" + bn.js: "npm:^5.2.1" + borsh: "npm:^0.7.0" + js-sha3: "npm:^0.8.0" + typescript-collections: "npm:^1.3.3" + peerDependencies: + "@solana/web3.js": ^1.50.1 + checksum: 99bd851933c46a068dbd13484770edd7ae12488b1474ee2e9d7dfd114087f3f9f813745795f91278142fbeb09aec1024f74ef2d2c8be2b47f1df319d37f0af11 + languageName: node + linkType: hard + +"@solana/spl-token@npm:^0.3.6, @solana/spl-token@npm:^0.3.8": version: 0.3.8 resolution: "@solana/spl-token@npm:0.3.8" dependencies: @@ -216,7 +469,7 @@ __metadata: languageName: node linkType: hard -"@solana/web3.js@npm:^1.32.0, @solana/web3.js@npm:^1.68.0": +"@solana/web3.js@npm:^1.32.0, @solana/web3.js@npm:^1.56.2, @solana/web3.js@npm:^1.66.2, @solana/web3.js@npm:^1.68.0, @solana/web3.js@npm:^1.78.4": version: 1.78.4 resolution: "@solana/web3.js@npm:1.78.4" dependencies: @@ -306,6 +559,13 @@ __metadata: languageName: node linkType: hard +"@types/crypto-js@npm:^4.1.1": + version: 4.1.1 + resolution: "@types/crypto-js@npm:4.1.1" + checksum: ea3d6a67b69f88baeb6af96004395903d2367a41bd5cd86306da23a44dd96589749495da50974a9b01bb5163c500764c8a33706831eade036bddae016417e3ea + languageName: node + linkType: hard + "@types/node@npm:*": version: 20.5.7 resolution: "@types/node@npm:20.5.7" @@ -422,6 +682,13 @@ __metadata: languageName: node linkType: hard +"ansicolors@npm:^0.3.2": + version: 0.3.2 + resolution: "ansicolors@npm:0.3.2" + checksum: e84fae7ebc27ac96d9dbb57f35f078cd6dde1b7046b0f03f73dcefc9fbb1f2e82e3685d083466aded8faf038f9fa9ebb408d215282bcd7aaa301d5ac3c486815 + languageName: node + linkType: hard + "aproba@npm:^1.0.3 || ^2.0.0": version: 2.0.0 resolution: "aproba@npm:2.0.0" @@ -446,6 +713,24 @@ __metadata: languageName: node linkType: hard +"asynckit@npm:^0.4.0": + version: 0.4.0 + resolution: "asynckit@npm:0.4.0" + checksum: 7b78c451df768adba04e2d02e63e2d0bf3b07adcd6e42b4cf665cb7ce899bedd344c69a1dcbce355b5f972d597b25aaa1c1742b52cffd9caccb22f348114f6be + languageName: node + linkType: hard + +"axios@npm:^1.5.0": + version: 1.5.0 + resolution: "axios@npm:1.5.0" + dependencies: + follow-redirects: "npm:^1.15.0" + form-data: "npm:^4.0.0" + proxy-from-env: "npm:^1.1.0" + checksum: e7405a5dbbea97760d0e6cd58fecba311b0401ddb4a8efbc4108f5537da9b3f278bde566deb777935a960beec4fa18e7b8353881f2f465e4f2c0e949fead35be + languageName: node + linkType: hard + "balanced-match@npm:^1.0.0": version: 1.0.2 resolution: "balanced-match@npm:1.0.2" @@ -462,6 +747,13 @@ __metadata: languageName: node linkType: hard +"base-x@npm:^4.0.0": + version: 4.0.0 + resolution: "base-x@npm:4.0.0" + checksum: b25db9e07eb1998472a20557c7f00c797dc0595f79df95155ab74274e7fa98b9f2659b3ee547ac8773666b7f69540656793aeb97ad2b1ceccdb6fa5faaf69ac0 + languageName: node + linkType: hard + "base64-js@npm:^1.3.1, base64-js@npm:^1.5.1": version: 1.5.1 resolution: "base64-js@npm:1.5.1" @@ -550,6 +842,15 @@ __metadata: languageName: node linkType: hard +"bs58@npm:^5.0.0": + version: 5.0.0 + resolution: "bs58@npm:5.0.0" + dependencies: + base-x: "npm:^4.0.0" + checksum: 2475cb0684e07077521aac718e604a13e0f891d58cff923d437a2f7e9e28703ab39fce9f84c7c703ab369815a675f11e3bd394d38643bfe8969fbe42e6833d45 + languageName: node + linkType: hard + "buffer-layout@npm:^1.2.0, buffer-layout@npm:^1.2.2": version: 1.2.2 resolution: "buffer-layout@npm:1.2.2" @@ -653,6 +954,15 @@ __metadata: languageName: node linkType: hard +"combined-stream@npm:^1.0.8": + version: 1.0.8 + resolution: "combined-stream@npm:1.0.8" + dependencies: + delayed-stream: "npm:~1.0.0" + checksum: 49fa4aeb4916567e33ea81d088f6584749fc90c7abec76fd516bf1c5aa5c79f3584b5ba3de6b86d26ddd64bae5329c4c7479343250cfe71c75bb366eae53bb7c + languageName: node + linkType: hard + "commander@npm:^2.20.3": version: 2.20.3 resolution: "commander@npm:2.20.3" @@ -708,7 +1018,14 @@ __metadata: languageName: node linkType: hard -"debug@npm:4, debug@npm:^4.3.3": +"crypto-js@npm:^4.1.1": + version: 4.1.1 + resolution: "crypto-js@npm:4.1.1" + checksum: b3747c12ee3a7632fab3b3e171ea50f78b182545f0714f6d3e7e2858385f0f4101a15f2517e033802ce9d12ba50a391575ff4638c9de3dd9b2c4bc47768d5425 + languageName: node + linkType: hard + +"debug@npm:4, debug@npm:^4.3.3, debug@npm:^4.3.4": version: 4.3.4 resolution: "debug@npm:4.3.4" dependencies: @@ -727,6 +1044,13 @@ __metadata: languageName: node linkType: hard +"delayed-stream@npm:~1.0.0": + version: 1.0.0 + resolution: "delayed-stream@npm:1.0.0" + checksum: 46fe6e83e2cb1d85ba50bd52803c68be9bd953282fa7096f51fc29edd5d67ff84ff753c51966061e5ba7cb5e47ef6d36a91924eddb7f3f3483b1c560f77a0020 + languageName: node + linkType: hard + "delegates@npm:^1.0.0": version: 1.0.0 resolution: "delegates@npm:1.0.0" @@ -865,6 +1189,16 @@ __metadata: languageName: node linkType: hard +"follow-redirects@npm:^1.15.0": + version: 1.15.2 + resolution: "follow-redirects@npm:1.15.2" + peerDependenciesMeta: + debug: + optional: true + checksum: faa66059b66358ba65c234c2f2a37fcec029dc22775f35d9ad6abac56003268baf41e55f9ee645957b32c7d9f62baf1f0b906e68267276f54ec4b4c597c2b190 + languageName: node + linkType: hard + "foreground-child@npm:^3.1.0": version: 3.1.1 resolution: "foreground-child@npm:3.1.1" @@ -875,6 +1209,17 @@ __metadata: languageName: node linkType: hard +"form-data@npm:^4.0.0": + version: 4.0.0 + resolution: "form-data@npm:4.0.0" + dependencies: + asynckit: "npm:^0.4.0" + combined-stream: "npm:^1.0.8" + mime-types: "npm:^2.1.12" + checksum: 01135bf8675f9d5c61ff18e2e2932f719ca4de964e3be90ef4c36aacfc7b9cb2fceb5eca0b7e0190e3383fe51c5b37f4cb80b62ca06a99aaabfcfd6ac7c9328c + languageName: node + linkType: hard + "fs-minipass@npm:^2.0.0": version: 2.1.0 resolution: "fs-minipass@npm:2.1.0" @@ -1145,6 +1490,13 @@ __metadata: languageName: node linkType: hard +"js-sha3@npm:^0.8.0": + version: 0.8.0 + resolution: "js-sha3@npm:0.8.0" + checksum: 75df77c1fc266973f06cce8309ce010e9e9f07ec35ab12022ed29b7f0d9c8757f5a73e1b35aa24840dced0dea7059085aa143d817aea9e188e2a80d569d9adce + languageName: node + linkType: hard + "json-stringify-safe@npm:^5.0.1": version: 5.0.1 resolution: "json-stringify-safe@npm:5.0.1" @@ -1231,6 +1583,22 @@ __metadata: languageName: node linkType: hard +"mime-db@npm:1.52.0": + version: 1.52.0 + resolution: "mime-db@npm:1.52.0" + checksum: 0d99a03585f8b39d68182803b12ac601d9c01abfa28ec56204fa330bc9f3d1c5e14beb049bafadb3dbdf646dfb94b87e24d4ec7b31b7279ef906a8ea9b6a513f + languageName: node + linkType: hard + +"mime-types@npm:^2.1.12": + version: 2.1.35 + resolution: "mime-types@npm:2.1.35" + dependencies: + mime-db: "npm:1.52.0" + checksum: 89a5b7f1def9f3af5dad6496c5ed50191ae4331cc5389d7c521c8ad28d5fdad2d06fd81baf38fed813dc4e46bb55c8145bb0ff406330818c9cf712fb2e9b3836 + languageName: node + linkType: hard + "minimatch@npm:^3.1.1": version: 3.1.2 resolution: "minimatch@npm:3.1.2" @@ -1356,6 +1724,13 @@ __metadata: languageName: node linkType: hard +"multiformats@npm:^9.6.4": + version: 9.9.0 + resolution: "multiformats@npm:9.9.0" + checksum: d3e8c1be400c09a014f557ea02251a2710dbc9fca5aa32cc702ff29f636c5471e17979f30bdcb0a9cbb556f162a8591dc2e1219c24fc21394a56115b820bb84e + languageName: node + linkType: hard + "negotiator@npm:^0.6.3": version: 0.6.3 resolution: "negotiator@npm:0.6.3" @@ -1508,6 +1883,13 @@ __metadata: languageName: node linkType: hard +"proxy-from-env@npm:^1.1.0": + version: 1.1.0 + resolution: "proxy-from-env@npm:1.1.0" + checksum: ed7fcc2ba0a33404958e34d95d18638249a68c430e30fcb6c478497d72739ba64ce9810a24f53a7d921d0c065e5b78e3822759800698167256b04659366ca4d4 + languageName: node + linkType: hard + "readable-stream@npm:^3.6.0": version: 3.6.2 resolution: "readable-stream@npm:3.6.2" @@ -1862,6 +2244,13 @@ __metadata: languageName: node linkType: hard +"typescript-collections@npm:^1.3.3": + version: 1.3.3 + resolution: "typescript-collections@npm:1.3.3" + checksum: a27f07dffdfe8407c4302eedb3e578b1360de783626cbd53519bd9c7943293a2940ed1ec3004cafae9dce049768b143185a36ca812d0d5c3c0f621a289239633 + languageName: node + linkType: hard + "typescript@npm:^5.2.2": version: 5.2.2 resolution: "typescript@npm:5.2.2" diff --git a/packages/spl-utils/src/constants.ts b/packages/spl-utils/src/constants.ts index 31c6cb932..8f29054f5 100644 --- a/packages/spl-utils/src/constants.ts +++ b/packages/spl-utils/src/constants.ts @@ -22,3 +22,11 @@ export const HELIUM_COMMON_LUT_DEVNET = new PublicKey( export const HELIUM_COMMON_LUT = new PublicKey( "43eY9L2spbM2b1MPDFFBStUiFGt29ziZ1nc1xbpzsfVt" ); + +export const MOBILE_PRICE_FEED = new PublicKey( + "DQ4C1tzvu28cwo1roN1Wm6TW35sfJEjLh517k3ZeWevx" +); + +export const IOT_PRICE_FEED = new PublicKey( + "8UYEn5Weq7toHwgcmctvcAxaNJo3SJxXEayM57rpoXr9" +); \ No newline at end of file diff --git a/programs/iot-routing-manager/Cargo.toml b/programs/iot-routing-manager/Cargo.toml index 9fdaed859..38f34f797 100644 --- a/programs/iot-routing-manager/Cargo.toml +++ b/programs/iot-routing-manager/Cargo.toml @@ -34,4 +34,4 @@ helium-entity-manager = { workspace = true } helium-sub-daos = { workspace = true } solana-security-txt = { workspace = true } default-env = { workspace = true } - +pyth-solana-receiver-sdk = "0.3.0" diff --git a/programs/iot-routing-manager/src/error.rs b/programs/iot-routing-manager/src/error.rs index f852d9f06..7af8d31e3 100644 --- a/programs/iot-routing-manager/src/error.rs +++ b/programs/iot-routing-manager/src/error.rs @@ -8,4 +8,12 @@ pub enum ErrorCode { InvalidStringLength, #[msg("Cannot swap tree until it is close to full")] TreeNotFull, + #[msg("Arithmetic error")] + ArithmeticError, + #[msg("Pyth price is not available")] + PythPriceNotFound, + #[msg("Pyth price is stale")] + PythPriceFeedStale, + #[msg("Organization is not approved")] + OrganizationNotApproved, } diff --git a/programs/iot-routing-manager/src/instructions/approve_organization_v0.rs b/programs/iot-routing-manager/src/instructions/approve_organization_v0.rs new file mode 100644 index 000000000..07aa865f2 --- /dev/null +++ b/programs/iot-routing-manager/src/instructions/approve_organization_v0.rs @@ -0,0 +1,23 @@ +use anchor_lang::prelude::*; + +use crate::{NetIdV0, OrganizationV0}; + +#[derive(Accounts)] +pub struct ApproveOrganizationV0<'info> { + pub authority: Signer<'info>, + #[account( + has_one = authority + )] + pub net_id: Account<'info, NetIdV0>, + #[account( + mut, + has_one = net_id, + )] + pub organization: Account<'info, OrganizationV0>, + pub system_program: Program<'info, System>, +} + +pub fn handler(ctx: Context) -> Result<()> { + ctx.accounts.organization.approved = true; + Ok(()) +} diff --git a/programs/iot-routing-manager/src/instructions/initialize_devaddr_constraint_v0.rs b/programs/iot-routing-manager/src/instructions/initialize_devaddr_constraint_v0.rs index 57ed04380..b280430d5 100644 --- a/programs/iot-routing-manager/src/instructions/initialize_devaddr_constraint_v0.rs +++ b/programs/iot-routing-manager/src/instructions/initialize_devaddr_constraint_v0.rs @@ -1,6 +1,11 @@ +use crate::error::ErrorCode; use anchor_lang::prelude::*; +use anchor_spl::token::{burn, Burn, Mint, Token, TokenAccount}; +use pyth_solana_receiver_sdk::price_update::{PriceUpdateV2, VerificationLevel}; -use crate::{DevAddrConstraintV0, NetIdV0, OrganizationV0}; +use crate::{DevAddrConstraintV0, IotRoutingManagerV0, NetIdV0, OrganizationV0}; + +pub const TESTING: bool = std::option_env!("TESTING").is_some(); #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)] pub struct InitializeDevaddrConstraintArgsV0 { @@ -22,9 +27,28 @@ pub struct InitializeDevaddrConstraintV0<'info> { )] pub net_id: Box>, #[account( - has_one = net_id + has_one = iot_mint, + has_one = iot_price_oracle, + )] + pub routing_manager: Box>, + #[account( + has_one = net_id, + has_one = routing_manager, + constraint = organization.approved @ ErrorCode::OrganizationNotApproved, )] pub organization: Box>, + #[account(mut)] + pub iot_mint: Box>, + #[account( + mut, + associated_token::mint = iot_mint, + associated_token::authority = payer, + )] + pub payer_iot_account: Box>, + #[account( + constraint = iot_price_oracle.verification_level == VerificationLevel::Full @ ErrorCode::PythPriceFeedStale, + )] + pub iot_price_oracle: Box>, #[account( init, payer = payer, @@ -33,6 +57,7 @@ pub struct InitializeDevaddrConstraintV0<'info> { space = 8 + DevAddrConstraintV0::INIT_SPACE + 60 )] pub devaddr_constraint: Box>, + pub token_program: Program<'info, Token>, pub system_program: Program<'info, System>, } @@ -47,6 +72,62 @@ pub fn handler( if end_addr > ctx.accounts.net_id.current_addr_offset { ctx.accounts.net_id.current_addr_offset = end_addr; } + + let message = ctx.accounts.iot_price_oracle.price_message; + let current_time = Clock::get()?.unix_timestamp; + require_gte!( + message + .publish_time + .saturating_add(if TESTING { 6000000 } else { 10 * 60 }.into()), + current_time, + ErrorCode::PythPriceNotFound + ); + let iot_price = message.ema_price; + require_gt!(iot_price, 0); + + // Remove the confidence from the price to use the most conservative price + // https://docs.pyth.network/price-feeds/solana-price-feeds/best-practices#confidence-intervals + let iot_price_with_conf = iot_price + .checked_sub(i64::try_from(message.ema_conf.checked_mul(2).unwrap()).unwrap()) + .unwrap(); + // Exponent is a negative number, likely -8 + // Since the price is multiplied by an extra 10^8, and we're dividing by that price, need to also multiply + // by the exponent + let exponent_dec = 10_u64 + .checked_pow(u32::try_from(-message.exponent).unwrap()) + .ok_or_else(|| error!(ErrorCode::ArithmeticError))?; + + require_gt!(iot_price_with_conf, 0); + let iot_fee = ctx + .accounts + .routing_manager + .devaddr_price_usd + .checked_mul(exponent_dec) + .unwrap() + .checked_div(iot_price_with_conf.try_into().unwrap()) + .unwrap() + .checked_mul( + end_addr + .checked_sub(start_addr) + .unwrap() + .checked_div(8) + .unwrap(), + ) + .unwrap(); + if iot_fee > 0 { + burn( + CpiContext::new( + ctx.accounts.token_program.to_account_info(), + Burn { + mint: ctx.accounts.iot_mint.to_account_info(), + from: ctx.accounts.payer_iot_account.to_account_info(), + authority: ctx.accounts.payer.to_account_info(), + }, + ), + iot_fee, + )?; + } + ctx .accounts .devaddr_constraint diff --git a/programs/iot-routing-manager/src/instructions/initialize_organization_delegate_v0.rs b/programs/iot-routing-manager/src/instructions/initialize_organization_delegate_v0.rs new file mode 100644 index 000000000..98c60a9da --- /dev/null +++ b/programs/iot-routing-manager/src/instructions/initialize_organization_delegate_v0.rs @@ -0,0 +1,37 @@ +use anchor_lang::prelude::*; + +use crate::{OrganizationDelegateV0, OrganizationV0}; + +#[derive(Accounts)] +pub struct InitializeOrganizationDelegateV0<'info> { + #[account(mut)] + pub payer: Signer<'info>, + pub authority: Signer<'info>, + #[account( + has_one = authority + )] + pub organization: Account<'info, OrganizationV0>, + #[account( + init, + payer = payer, + space = 8 + OrganizationDelegateV0::INIT_SPACE + 32, + seeds = [b"organization_delegate", organization.key().as_ref(), delegate.key().as_ref()], + bump, + )] + pub organization_delegate: Account<'info, OrganizationDelegateV0>, + /// CHECK: The actual account that will act as a delegate + pub delegate: AccountInfo<'info>, + pub system_program: Program<'info, System>, +} + +pub fn handler(ctx: Context) -> Result<()> { + ctx + .accounts + .organization_delegate + .set_inner(OrganizationDelegateV0 { + organization: ctx.accounts.organization.key(), + delegate: ctx.accounts.delegate.key(), + bump_seed: ctx.bumps["organization_delegate"], + }); + Ok(()) +} diff --git a/programs/iot-routing-manager/src/instructions/initialize_organization_v0.rs b/programs/iot-routing-manager/src/instructions/initialize_organization_v0.rs index 341dca122..56f0a8b40 100644 --- a/programs/iot-routing-manager/src/instructions/initialize_organization_v0.rs +++ b/programs/iot-routing-manager/src/instructions/initialize_organization_v0.rs @@ -1,8 +1,9 @@ -use crate::{net_id_seeds, routing_manager_seeds, state::*}; +use crate::error::ErrorCode; +use crate::{net_id_seeds, routing_manager_seeds, state::*, TESTING}; use account_compression_cpi::{program::SplAccountCompression, Noop}; use anchor_lang::prelude::*; use anchor_lang::solana_program::hash::hash; -use anchor_spl::token::Mint; +use anchor_spl::token::{burn, Burn, Mint, Token, TokenAccount}; use bubblegum_cpi::program::Bubblegum; use bubblegum_cpi::TreeConfig; use helium_entity_manager::program::HeliumEntityManager; @@ -11,6 +12,7 @@ use helium_entity_manager::{ }; use helium_entity_manager::{IssueProgramEntityArgsV0, KeySerialization, SharedMerkleV0}; use helium_sub_daos::{DaoV0, SubDaoV0}; +use pyth_solana_receiver_sdk::price_update::{PriceUpdateV2, VerificationLevel}; #[cfg(feature = "devnet")] pub const ENTITY_METADATA_URL: &str = "https://entities.nft.test-helium.com"; @@ -38,15 +40,27 @@ pub struct InitializeOrganizationV0<'info> { pub program_approval: Box>, #[account( has_one = collection, - has_one = sub_dao + has_one = sub_dao, + has_one = iot_mint, + has_one = iot_price_oracle, )] pub routing_manager: Box>, #[account( - has_one = authority, has_one = routing_manager, )] pub net_id: Box>, - pub oui_authority: Signer<'info>, + #[account(mut)] + pub iot_mint: Box>, + #[account( + mut, + associated_token::mint = iot_mint, + associated_token::authority = payer, + )] + pub payer_iot_account: Box>, + #[account( + constraint = iot_price_oracle.verification_level == VerificationLevel::Full @ ErrorCode::PythPriceFeedStale, + )] + pub iot_price_oracle: Box>, /// CHECK: The new authority for this OUI pub authority: AccountInfo<'info>, #[account( @@ -133,6 +147,7 @@ pub struct InitializeOrganizationV0<'info> { pub compression_program: Program<'info, SplAccountCompression>, pub system_program: Program<'info, System>, pub helium_entity_manager_program: Program<'info, HeliumEntityManager>, + pub token_program: Program<'info, Token>, } pub fn handler( @@ -153,6 +168,7 @@ pub fn handler( escrow_key, bump_seed: ctx.bumps["organization"], net_id: ctx.accounts.net_id.key(), + approved: false, }); let uri = format!( @@ -198,5 +214,52 @@ pub fn handler( }, )?; + let message = ctx.accounts.iot_price_oracle.price_message; + let current_time = Clock::get()?.unix_timestamp; + require_gte!( + message + .publish_time + .saturating_add(if TESTING { 6000000 } else { 10 * 60 }.into()), + current_time, + ErrorCode::PythPriceNotFound + ); + let iot_price = message.ema_price; + require_gt!(iot_price, 0); + + // Remove the confidence from the price to use the most conservative price + // https://docs.pyth.network/price-feeds/solana-price-feeds/best-practices#confidence-intervals + let iot_price_with_conf = iot_price + .checked_sub(i64::try_from(message.ema_conf.checked_mul(2).unwrap()).unwrap()) + .unwrap(); + // Exponent is a negative number, likely -8 + // Since the price is multiplied by an extra 10^8, and we're dividing by that price, need to also multiply + // by the exponent + let exponent_dec = 10_u64 + .checked_pow(u32::try_from(-message.exponent).unwrap()) + .ok_or_else(|| error!(ErrorCode::ArithmeticError))?; + + require_gt!(iot_price_with_conf, 0); + let iot_fee = ctx + .accounts + .routing_manager + .oui_price_usd + .checked_mul(exponent_dec) + .unwrap() + .checked_div(iot_price_with_conf.try_into().unwrap()) + .unwrap(); + if iot_fee > 0 { + burn( + CpiContext::new( + ctx.accounts.token_program.to_account_info(), + Burn { + mint: ctx.accounts.iot_mint.to_account_info(), + from: ctx.accounts.payer_iot_account.to_account_info(), + authority: ctx.accounts.payer.to_account_info(), + }, + ), + iot_fee, + )?; + } + Ok(()) } diff --git a/programs/iot-routing-manager/src/instructions/initialize_routing_manager_v0.rs b/programs/iot-routing-manager/src/instructions/initialize_routing_manager_v0.rs index 4f7ee4f0f..964820768 100644 --- a/programs/iot-routing-manager/src/instructions/initialize_routing_manager_v0.rs +++ b/programs/iot-routing-manager/src/instructions/initialize_routing_manager_v0.rs @@ -7,6 +7,7 @@ use anchor_spl::{ }; use helium_sub_daos::SubDaoV0; use mpl_token_metadata::types::{CollectionDetails, DataV2}; +use pyth_solana_receiver_sdk::price_update::PriceUpdateV2; use shared_utils::create_metadata_accounts_v3; use shared_utils::token_metadata::{ create_master_edition_v3, CreateMasterEditionV3, CreateMetadataAccountsV3, @@ -19,6 +20,8 @@ pub const CARRIER_STAKE_AMOUNT: u64 = 500_000_000_000_000; #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)] pub struct InitializeRoutingManagerArgsV0 { pub metadata_url: String, + pub devaddr_price_usd: u64, + pub oui_price_usd: u64, } #[derive(Accounts)] @@ -40,9 +43,12 @@ pub struct InitializeRoutingManagerV0<'info> { )] pub routing_manager: Box>, #[account( - has_one = authority + has_one = authority, + has_one = dnt_mint, )] pub sub_dao: Box>, + pub dnt_mint: Box>, + pub iot_price_oracle: Box>, #[account( init, payer = payer, @@ -111,7 +117,11 @@ pub fn handler( collection: ctx.accounts.collection.key(), // Initialized via set_carrier_tree bump_seed: ctx.bumps["routing_manager"], + iot_mint: ctx.accounts.dnt_mint.key(), + iot_price_oracle: ctx.accounts.iot_price_oracle.key(), sub_dao: ctx.accounts.sub_dao.key(), + devaddr_price_usd: args.devaddr_price_usd, + oui_price_usd: args.oui_price_usd, }); let signer_seeds: &[&[&[u8]]] = &[routing_manager_seeds!(ctx.accounts.routing_manager)]; diff --git a/programs/iot-routing-manager/src/instructions/mod.rs b/programs/iot-routing-manager/src/instructions/mod.rs index cfbd89b12..9f076ba3e 100644 --- a/programs/iot-routing-manager/src/instructions/mod.rs +++ b/programs/iot-routing-manager/src/instructions/mod.rs @@ -1,9 +1,15 @@ +pub mod approve_organization_v0; pub mod initialize_devaddr_constraint_v0; pub mod initialize_net_id_v0; +pub mod initialize_organization_delegate_v0; pub mod initialize_organization_v0; pub mod initialize_routing_manager_v0; +pub mod remove_organization_delegate_v0; +pub use approve_organization_v0::*; pub use initialize_devaddr_constraint_v0::*; pub use initialize_net_id_v0::*; +pub use initialize_organization_delegate_v0::*; pub use initialize_organization_v0::*; pub use initialize_routing_manager_v0::*; +pub use remove_organization_delegate_v0::*; diff --git a/programs/iot-routing-manager/src/instructions/remove_organization_delegate_v0.rs b/programs/iot-routing-manager/src/instructions/remove_organization_delegate_v0.rs new file mode 100644 index 000000000..dcc3b0cb1 --- /dev/null +++ b/programs/iot-routing-manager/src/instructions/remove_organization_delegate_v0.rs @@ -0,0 +1,24 @@ +use anchor_lang::prelude::*; + +use crate::{OrganizationDelegateV0, OrganizationV0}; + +#[derive(Accounts)] +pub struct RemoveOrganizationDelegateV0<'info> { + /// CHECK: Can be any sol wallet + #[account(mut)] + pub rent_refund: AccountInfo<'info>, + pub authority: Signer<'info>, + #[account( + has_one = authority + )] + pub organization: Account<'info, OrganizationV0>, + #[account( + mut, + close = rent_refund, + )] + pub organization_delegate: Account<'info, OrganizationDelegateV0>, +} + +pub fn handler(_: Context) -> Result<()> { + Ok(()) +} diff --git a/programs/iot-routing-manager/src/lib.rs b/programs/iot-routing-manager/src/lib.rs index f25532b6c..d8b821db3 100644 --- a/programs/iot-routing-manager/src/lib.rs +++ b/programs/iot-routing-manager/src/lib.rs @@ -58,4 +58,18 @@ pub mod iot_routing_manager { ) -> Result<()> { initialize_routing_manager_v0::handler(ctx, args) } + + pub fn initialize_organization_delegate_v0( + ctx: Context, + ) -> Result<()> { + initialize_organization_delegate_v0::handler(ctx) + } + + pub fn remove_organization_delegate_v0(ctx: Context) -> Result<()> { + remove_organization_delegate_v0::handler(ctx) + } + + pub fn approve_organization_v0(ctx: Context) -> Result<()> { + approve_organization_v0::handler(ctx) + } } diff --git a/programs/iot-routing-manager/src/state.rs b/programs/iot-routing-manager/src/state.rs index bb6f26277..7433b6ece 100644 --- a/programs/iot-routing-manager/src/state.rs +++ b/programs/iot-routing-manager/src/state.rs @@ -4,9 +4,14 @@ use anchor_lang::prelude::*; #[derive(Default, InitSpace)] pub struct IotRoutingManagerV0 { pub sub_dao: Pubkey, + pub iot_mint: Pubkey, + pub iot_price_oracle: Pubkey, pub update_authority: Pubkey, pub net_id_authority: Pubkey, pub collection: Pubkey, // The metaplex collection to be issued for Rewardable Entities + // with 6 decimals of precision + pub devaddr_price_usd: u64, + pub oui_price_usd: u64, pub bump_seed: u8, } @@ -29,6 +34,7 @@ pub struct OrganizationV0 { pub authority: Pubkey, pub oui: u64, pub escrow_key: String, + pub approved: bool, pub bump_seed: u8, } @@ -78,8 +84,8 @@ pub struct DevAddrConstraintV0 { } #[account] -#[derive(Default)] -pub struct OranizationDelegateV0 { +#[derive(Default, InitSpace)] +pub struct OrganizationDelegateV0 { pub organization: Pubkey, pub delegate: Pubkey, pub bump_seed: u8, diff --git a/tests/iot-routing-manager.ts b/tests/iot-routing-manager.ts index 503f4bac6..2798eb756 100644 --- a/tests/iot-routing-manager.ts +++ b/tests/iot-routing-manager.ts @@ -32,6 +32,7 @@ import { getConcurrentMerkleTreeAccountSize, } from "@solana/spl-account-compression"; import { HeliumEntityManager } from "../target/types/helium_entity_manager"; +import { IOT_PRICE_FEED } from "@helium/spl-utils"; chai.use(chaiAsPromised); @@ -47,6 +48,7 @@ describe("iot-routing-manager", () => { const me = provider.wallet.publicKey; let dao: PublicKey; let subDao: PublicKey; + let iotMint: PublicKey | undefined; let dcMint: PublicKey; let programApproval: PublicKey; @@ -91,7 +93,7 @@ describe("iot-routing-manager", () => { me, dataCredits.dcMint )); - ({ subDao } = await initTestSubdao({ + ({ subDao, mint: iotMint } = await initTestSubdao({ hsdProgram, provider, authority: me, @@ -117,6 +119,8 @@ describe("iot-routing-manager", () => { } = await irmProgram.methods .initializeRoutingManagerV0({ metadataUrl: "https://some/url", + devaddrPriceUsd: new anchor.BN(100_000000), + ouiPriceUsd: new anchor.BN(100_000000), }) .preInstructions([ ComputeBudgetProgram.setComputeUnitLimit({ units: 500000 }), @@ -124,7 +128,9 @@ describe("iot-routing-manager", () => { .accounts({ updateAuthority: me, netIdAuthority: me, + dntMint: iotMint, subDao, + iotPriceOracle: IOT_PRICE_FEED, }) .rpcAndKeys({ skipPreflight: true }); @@ -136,13 +142,15 @@ describe("iot-routing-manager", () => { describe("with a routing manager", async () => { let routingManager: PublicKey; - let merkle: Keypair; + beforeEach(async () => { const { pubkeys: { routingManager: routingManagerK }, } = await irmProgram.methods .initializeRoutingManagerV0({ metadataUrl: "https://some/url", + devaddrPriceUsd: new anchor.BN(100_000000), + ouiPriceUsd: new anchor.BN(100_000000), }) .preInstructions([ ComputeBudgetProgram.setComputeUnitLimit({ units: 500000 }), @@ -151,6 +159,7 @@ describe("iot-routing-manager", () => { updateAuthority: me, netIdAuthority: me, subDao, + iotPriceOracle: IOT_PRICE_FEED, }) .rpcAndKeys({ skipPreflight: true }); routingManager = routingManagerK! @@ -234,8 +243,16 @@ describe("iot-routing-manager", () => { netId, }) .rpcAndKeys({ skipPreflight: true }); + organization = organizationK!; - }) + + await irmProgram.methods + .approveOrganizationV0() + .accounts({ + organization, + }) + .rpc({ skipPreflight: true }); + }); it("should initialize a devaddr constraint", async () => { const { diff --git a/yarn.lock b/yarn.lock index 52f12dd39..528b92110 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1079,6 +1079,7 @@ __metadata: dependencies: "@coral-xyz/anchor": ^0.28.0 "@helium/anchor-resolvers": ^0.8.7 + "@helium/helium-entity-manager-sdk": ^0.8.7 bn.js: ^5.2.0 bs58: ^4.0.1 git-format-staged: ^2.1.3 From 55baf9cbfb6a0f976fefc7628dc640bcbf1b4259 Mon Sep 17 00:00:00 2001 From: Noah Prince Date: Thu, 25 Jul 2024 14:36:11 -0700 Subject: [PATCH 04/63] Add admin key support for backfill --- Cargo.lock | 1 + packages/helium-vote-service/.env | 4 --- programs/iot-routing-manager/Cargo.toml | 1 + .../initialize_devaddr_constraint_v0.rs | 6 +++-- .../initialize_organization_v0.rs | 4 +-- .../src/instructions/mod.rs | 2 ++ .../instructions/update_organization_v0.rs | 25 +++++++++++++++++++ programs/iot-routing-manager/src/lib.rs | 7 ++++++ 8 files changed, 42 insertions(+), 8 deletions(-) delete mode 100644 packages/helium-vote-service/.env create mode 100644 programs/iot-routing-manager/src/instructions/update_organization_v0.rs diff --git a/Cargo.lock b/Cargo.lock index 132e6b9fe..f91c0e0ba 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2255,6 +2255,7 @@ dependencies = [ "mpl-token-metadata", "pyth-solana-receiver-sdk", "shared-utils", + "solana-program", "solana-security-txt", ] diff --git a/packages/helium-vote-service/.env b/packages/helium-vote-service/.env deleted file mode 100644 index 4d4fecb52..000000000 --- a/packages/helium-vote-service/.env +++ /dev/null @@ -1,4 +0,0 @@ -PGDATABASE=postgres -PGUSER=postgres -PGPASSWORD=postgres -SOLANA_URL=https://solana-rpc.web.test-helium.com?session-key=Pluto diff --git a/programs/iot-routing-manager/Cargo.toml b/programs/iot-routing-manager/Cargo.toml index 38f34f797..cee0506d6 100644 --- a/programs/iot-routing-manager/Cargo.toml +++ b/programs/iot-routing-manager/Cargo.toml @@ -35,3 +35,4 @@ helium-sub-daos = { workspace = true } solana-security-txt = { workspace = true } default-env = { workspace = true } pyth-solana-receiver-sdk = "0.3.0" +solana-program = "1.16.13" diff --git a/programs/iot-routing-manager/src/instructions/initialize_devaddr_constraint_v0.rs b/programs/iot-routing-manager/src/instructions/initialize_devaddr_constraint_v0.rs index b280430d5..b28351776 100644 --- a/programs/iot-routing-manager/src/instructions/initialize_devaddr_constraint_v0.rs +++ b/programs/iot-routing-manager/src/instructions/initialize_devaddr_constraint_v0.rs @@ -1,5 +1,5 @@ use crate::error::ErrorCode; -use anchor_lang::prelude::*; +use anchor_lang::{prelude::*, solana_program::pubkey}; use anchor_spl::token::{burn, Burn, Mint, Token, TokenAccount}; use pyth_solana_receiver_sdk::price_update::{PriceUpdateV2, VerificationLevel}; @@ -16,6 +16,7 @@ pub struct InitializeDevaddrConstraintArgsV0 { pub start_addr: Option, } +pub const ADMIN_KEY: Pubkey = pubkey!("hprdnjkbziK8NqhThmAn5Gu4XqrBbctX8du4PfJdgvW"); #[derive(Accounts)] #[instruction(args: InitializeDevaddrConstraintArgsV0)] pub struct InitializeDevaddrConstraintV0<'info> { @@ -114,7 +115,8 @@ pub fn handler( .unwrap(), ) .unwrap(); - if iot_fee > 0 { + // TEMP: Admin doesn't have to burn, that way we can backfill + if iot_fee > 0 && ctx.accounts.payer.key() != ADMIN_KEY { burn( CpiContext::new( ctx.accounts.token_program.to_account_info(), diff --git a/programs/iot-routing-manager/src/instructions/initialize_organization_v0.rs b/programs/iot-routing-manager/src/instructions/initialize_organization_v0.rs index 56f0a8b40..3cba93b3f 100644 --- a/programs/iot-routing-manager/src/instructions/initialize_organization_v0.rs +++ b/programs/iot-routing-manager/src/instructions/initialize_organization_v0.rs @@ -1,5 +1,5 @@ use crate::error::ErrorCode; -use crate::{net_id_seeds, routing_manager_seeds, state::*, TESTING}; +use crate::{net_id_seeds, routing_manager_seeds, state::*, ADMIN_KEY, TESTING}; use account_compression_cpi::{program::SplAccountCompression, Noop}; use anchor_lang::prelude::*; use anchor_lang::solana_program::hash::hash; @@ -247,7 +247,7 @@ pub fn handler( .unwrap() .checked_div(iot_price_with_conf.try_into().unwrap()) .unwrap(); - if iot_fee > 0 { + if iot_fee > 0 && ctx.accounts.payer.key() != ADMIN_KEY { burn( CpiContext::new( ctx.accounts.token_program.to_account_info(), diff --git a/programs/iot-routing-manager/src/instructions/mod.rs b/programs/iot-routing-manager/src/instructions/mod.rs index 9f076ba3e..3a48929b9 100644 --- a/programs/iot-routing-manager/src/instructions/mod.rs +++ b/programs/iot-routing-manager/src/instructions/mod.rs @@ -5,6 +5,7 @@ pub mod initialize_organization_delegate_v0; pub mod initialize_organization_v0; pub mod initialize_routing_manager_v0; pub mod remove_organization_delegate_v0; +pub mod update_organization_v0; pub use approve_organization_v0::*; pub use initialize_devaddr_constraint_v0::*; @@ -13,3 +14,4 @@ pub use initialize_organization_delegate_v0::*; pub use initialize_organization_v0::*; pub use initialize_routing_manager_v0::*; pub use remove_organization_delegate_v0::*; +pub use update_organization_v0::*; diff --git a/programs/iot-routing-manager/src/instructions/update_organization_v0.rs b/programs/iot-routing-manager/src/instructions/update_organization_v0.rs new file mode 100644 index 000000000..65d0f1015 --- /dev/null +++ b/programs/iot-routing-manager/src/instructions/update_organization_v0.rs @@ -0,0 +1,25 @@ +use anchor_lang::prelude::*; + +use crate::OrganizationV0; + +#[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)] +pub struct UpdateOrganizationArgsV0 { + new_authority: Option, +} + +#[derive(Accounts)] +pub struct UpdateOrganizationV0<'info> { + pub authority: Signer<'info>, + #[account( + mut, + has_one = authority + )] + pub organization: Account<'info, OrganizationV0>, +} + +pub fn handler(ctx: Context, args: UpdateOrganizationArgsV0) -> Result<()> { + if let Some(authority) = args.new_authority { + ctx.accounts.organization.authority = authority; + } + Ok(()) +} diff --git a/programs/iot-routing-manager/src/lib.rs b/programs/iot-routing-manager/src/lib.rs index d8b821db3..bfc8f39ae 100644 --- a/programs/iot-routing-manager/src/lib.rs +++ b/programs/iot-routing-manager/src/lib.rs @@ -72,4 +72,11 @@ pub mod iot_routing_manager { pub fn approve_organization_v0(ctx: Context) -> Result<()> { approve_organization_v0::handler(ctx) } + + pub fn update_organization_v0( + ctx: Context, + args: UpdateOrganizationArgsV0, + ) -> Result<()> { + update_organization_v0::handler(ctx, args) + } } From 3045e25465278453a9a6493e878cf5404e7e4761 Mon Sep 17 00:00:00 2001 From: Bryan Date: Fri, 23 Aug 2024 14:49:26 -0500 Subject: [PATCH 05/63] Feature/675 backfill ouis devaddrs (#682) * Add admin key support for backfill * Add script and temp endpoint for backfilling * Actually make the devaddrs * log delegates without solAddr * build * dep versions --------- Co-authored-by: Noah Prince --- package.json | 6 +- packages/crons/package.json | 2 +- packages/crons/yarn.deploy.lock | 46 +- packages/data-credits-sdk/yarn.deploy.lock | 20 +- packages/distributor-oracle/yarn.deploy.lock | 20 +- packages/entity-invalidator/yarn.deploy.lock | 20 +- packages/helium-admin-cli/package.json | 3 +- .../helium-admin-cli/src/backfill-ouis.ts | 383 +++++++++ packages/helium-admin-cli/tsconfig.json | 3 + packages/helium-admin-cli/yarn.deploy.lock | 39 +- .../yarn.deploy.lock | 20 +- packages/helium-sub-daos-sdk/yarn.deploy.lock | 20 +- packages/helium-vote-service/yarn.deploy.lock | 52 +- packages/hexboosting-sdk/yarn.deploy.lock | 20 +- packages/hotspot-utils/yarn.deploy.lock | 20 +- packages/iot-routing-manager-sdk/package.json | 6 +- .../iot-routing-manager-sdk/yarn.deploy.lock | 98 ++- packages/metadata-service/yarn.deploy.lock | 20 +- packages/migration-service/yarn.deploy.lock | 20 +- .../yarn.deploy.lock | 20 +- packages/monitor-service/yarn.deploy.lock | 20 +- .../voter-stake-registry-hooks/package.json | 2 +- .../yarn.deploy.lock | 52 +- .../voter-stake-registry-sdk/package.json | 2 +- .../voter-stake-registry-sdk/yarn.deploy.lock | 20 +- .../vsr-metadata-service/yarn.deploy.lock | 20 +- .../src/instructions/mod.rs | 2 + .../temp_backfill_organization_delegate.rs | 37 + programs/iot-routing-manager/src/lib.rs | 6 + yarn.lock | 730 +++++++++++++----- 30 files changed, 1280 insertions(+), 449 deletions(-) create mode 100644 packages/helium-admin-cli/src/backfill-ouis.ts create mode 100644 programs/iot-routing-manager/src/instructions/temp_backfill_organization_delegate.rs diff --git a/package.json b/package.json index c7a70f2cc..5e5bd9673 100644 --- a/package.json +++ b/package.json @@ -35,9 +35,9 @@ "@coral-xyz/anchor-cli": "^0.28.0", "@coral-xyz/borsh": "^0.2.6", "@helium/crypto": "^4.10.2", - "@helium/modular-governance-idls": "0.0.8-next.22+7098baa", - "@helium/nft-proxy-sdk": "0.0.8-next.22+7098baa", - "@helium/proposal-sdk": "0.0.8-next.22+7098baa", + "@helium/modular-governance-idls": "^0.0.12", + "@helium/nft-proxy-sdk": "^0.0.12", + "@helium/proposal-sdk": "^0.0.12", "@helium/transactions": "^3.38.0", "@metaplex-foundation/mpl-bubblegum": "^0.7.0", "@pythnetwork/client": "^2.8.0", diff --git a/packages/crons/package.json b/packages/crons/package.json index 027934ed6..c21999306 100644 --- a/packages/crons/package.json +++ b/packages/crons/package.json @@ -46,7 +46,7 @@ "@helium/proposal-sdk": "^0.0.8", "@helium/rewards-oracle-sdk": "^0.9.2", "@helium/spl-utils": "^0.9.2", - "@helium/state-controller-sdk": "0.0.8-next.22+7098baa", + "@helium/state-controller-sdk": "^0.0.12", "@helium/treasury-management-sdk": "^0.9.2", "@helium/voter-stake-registry-sdk": "^0.9.2", "@solana/spl-token": "^0.3.8", diff --git a/packages/crons/yarn.deploy.lock b/packages/crons/yarn.deploy.lock index d5d87b71e..138ee0ae0 100644 --- a/packages/crons/yarn.deploy.lock +++ b/packages/crons/yarn.deploy.lock @@ -206,7 +206,7 @@ __metadata: "@helium/proposal-sdk": ^0.0.8 "@helium/rewards-oracle-sdk": ^0.9.2 "@helium/spl-utils": ^0.9.2 - "@helium/state-controller-sdk": 0.0.8-next.22+7098baa + "@helium/state-controller-sdk": ^0.0.12 "@helium/treasury-management-sdk": ^0.9.2 "@helium/voter-stake-registry-sdk": ^0.9.2 "@solana/spl-token": ^0.3.8 @@ -385,7 +385,27 @@ __metadata: languageName: unknown linkType: soft -"@helium/modular-governance-idls@npm:^0.0.8, @helium/modular-governance-idls@npm:^0.0.8-next.22+7098baa": +"@helium/modular-governance-idls@npm:^0.0.10": + version: 0.0.10 + resolution: "@helium/modular-governance-idls@npm:0.0.10" + dependencies: + "@coral-xyz/anchor": ^0.28.0 + "@solana/web3.js": ^1.78.4 + checksum: 300a5a3085747f7de769ae4ca73620d3aa3902ef4d35ffc1157cff3162ab712410161917ec3e1641bcd128b2657ce22f21b81ae73eecc754f363459791ddd6a7 + languageName: node + linkType: hard + +"@helium/modular-governance-idls@npm:^0.0.12": + version: 0.0.12 + resolution: "@helium/modular-governance-idls@npm:0.0.12" + dependencies: + "@coral-xyz/anchor": ^0.28.0 + "@solana/web3.js": ^1.78.4 + checksum: 606c888d1f1af24aeae2b3f011ee2db19f17ce78b3bf37fe6bebaccc3e8e040b4e365d3fa32d4a4e42d181efdc35dc53dc0bf701b5b85065cab167e307c7f035 + languageName: node + linkType: hard + +"@helium/modular-governance-idls@npm:^0.0.8": version: 0.0.8 resolution: "@helium/modular-governance-idls@npm:0.0.8" dependencies: @@ -395,15 +415,15 @@ __metadata: languageName: node linkType: hard -"@helium/nft-proxy-sdk@npm:0.0.8-next.22+7098baa": - version: 0.0.8-next.19 - resolution: "@helium/nft-proxy-sdk@npm:0.0.8-next.19" +"@helium/nft-proxy-sdk@npm:^0.0.12": + version: 0.0.12 + resolution: "@helium/nft-proxy-sdk@npm:0.0.12" dependencies: "@coral-xyz/anchor": ^0.28.0 "@helium/anchor-resolvers": ^0.2.17 - "@helium/modular-governance-idls": ^0.0.8-next.22+7098baa + "@helium/modular-governance-idls": ^0.0.10 "@solana/spl-token": ^0.3.8 - checksum: f5c6d9348cfebb8dd2d8fd997c365b5656afa7a6683592e1ed6b0bf04f73f231265a770c96022c930d32c686f57dbf56a0b7790c9d025413c80de30f07f1e587 + checksum: e70478c9ed007a1044ff7c76d0e0fdaf1163b489772893b8f4b52dd9d69d194aee71bc63a181a81c766dc459474cdbf3403035cc1f43e2741e89c139e3881b8b languageName: node linkType: hard @@ -499,14 +519,14 @@ __metadata: languageName: unknown linkType: soft -"@helium/state-controller-sdk@npm:0.0.8-next.22+7098baa": - version: 0.0.8-next.19 - resolution: "@helium/state-controller-sdk@npm:0.0.8-next.19" +"@helium/state-controller-sdk@npm:^0.0.12": + version: 0.0.12 + resolution: "@helium/state-controller-sdk@npm:0.0.12" dependencies: "@coral-xyz/anchor": ^0.28.0 "@helium/anchor-resolvers": ^0.5.0 - "@helium/modular-governance-idls": ^0.0.8-next.22+7098baa - checksum: 51ac8d1151e7b02843e4ad437d7a20af03678198e67971698870ad1399f83ee976245df915998e9411310dc31d55f26ea7bc25f7235f20a20d573e0ff560a964 + "@helium/modular-governance-idls": ^0.0.12 + checksum: 729e0888523d9fb432100e869e56f7626b53d83b7543c1786049686d0d62ad582015ab7f29fbfd108f8b6ae8175e5fef831323c0714d5a55b339756fff9e3419 languageName: node linkType: hard @@ -534,7 +554,7 @@ __metadata: "@coral-xyz/anchor": ^0.28.0 "@helium/anchor-resolvers": ^0.9.2 "@helium/idls": ^0.9.2 - "@helium/nft-proxy-sdk": 0.0.8-next.22+7098baa + "@helium/nft-proxy-sdk": ^0.0.12 "@helium/spl-utils": ^0.9.2 "@metaplex-foundation/mpl-token-metadata": ^2.10.0 "@solana/spl-token": ^0.3.8 diff --git a/packages/data-credits-sdk/yarn.deploy.lock b/packages/data-credits-sdk/yarn.deploy.lock index 9d83ecda6..33a78b2c2 100644 --- a/packages/data-credits-sdk/yarn.deploy.lock +++ b/packages/data-credits-sdk/yarn.deploy.lock @@ -183,25 +183,25 @@ __metadata: languageName: unknown linkType: soft -"@helium/modular-governance-idls@npm:^0.0.8-next.22+7098baa": - version: 0.0.8 - resolution: "@helium/modular-governance-idls@npm:0.0.8" +"@helium/modular-governance-idls@npm:^0.0.10": + version: 0.0.10 + resolution: "@helium/modular-governance-idls@npm:0.0.10" dependencies: "@coral-xyz/anchor": ^0.28.0 "@solana/web3.js": ^1.78.4 - checksum: 3bd1bbbdc88cc154f27717e8830b117004608a7ab91a0d43c90ad6cd9cec607071b48c25626e2e15195f4c7f45585d7d0df426ad50eb63acb2bd018897cc8919 + checksum: 300a5a3085747f7de769ae4ca73620d3aa3902ef4d35ffc1157cff3162ab712410161917ec3e1641bcd128b2657ce22f21b81ae73eecc754f363459791ddd6a7 languageName: node linkType: hard -"@helium/nft-proxy-sdk@npm:0.0.8-next.22+7098baa": - version: 0.0.8-next.19 - resolution: "@helium/nft-proxy-sdk@npm:0.0.8-next.19" +"@helium/nft-proxy-sdk@npm:^0.0.12": + version: 0.0.12 + resolution: "@helium/nft-proxy-sdk@npm:0.0.12" dependencies: "@coral-xyz/anchor": ^0.28.0 "@helium/anchor-resolvers": ^0.2.17 - "@helium/modular-governance-idls": ^0.0.8-next.22+7098baa + "@helium/modular-governance-idls": ^0.0.10 "@solana/spl-token": ^0.3.8 - checksum: f5c6d9348cfebb8dd2d8fd997c365b5656afa7a6683592e1ed6b0bf04f73f231265a770c96022c930d32c686f57dbf56a0b7790c9d025413c80de30f07f1e587 + checksum: e70478c9ed007a1044ff7c76d0e0fdaf1163b489772893b8f4b52dd9d69d194aee71bc63a181a81c766dc459474cdbf3403035cc1f43e2741e89c139e3881b8b languageName: node linkType: hard @@ -251,7 +251,7 @@ __metadata: "@coral-xyz/anchor": ^0.28.0 "@helium/anchor-resolvers": ^0.9.2 "@helium/idls": ^0.9.2 - "@helium/nft-proxy-sdk": 0.0.8-next.22+7098baa + "@helium/nft-proxy-sdk": ^0.0.12 "@helium/spl-utils": ^0.9.2 "@metaplex-foundation/mpl-token-metadata": ^2.10.0 "@solana/spl-token": ^0.3.8 diff --git a/packages/distributor-oracle/yarn.deploy.lock b/packages/distributor-oracle/yarn.deploy.lock index bc3a9ce7d..9e3a17c49 100644 --- a/packages/distributor-oracle/yarn.deploy.lock +++ b/packages/distributor-oracle/yarn.deploy.lock @@ -312,25 +312,25 @@ __metadata: languageName: unknown linkType: soft -"@helium/modular-governance-idls@npm:^0.0.8-next.22+7098baa": - version: 0.0.8 - resolution: "@helium/modular-governance-idls@npm:0.0.8" +"@helium/modular-governance-idls@npm:^0.0.10": + version: 0.0.10 + resolution: "@helium/modular-governance-idls@npm:0.0.10" dependencies: "@coral-xyz/anchor": ^0.28.0 "@solana/web3.js": ^1.78.4 - checksum: 3bd1bbbdc88cc154f27717e8830b117004608a7ab91a0d43c90ad6cd9cec607071b48c25626e2e15195f4c7f45585d7d0df426ad50eb63acb2bd018897cc8919 + checksum: 300a5a3085747f7de769ae4ca73620d3aa3902ef4d35ffc1157cff3162ab712410161917ec3e1641bcd128b2657ce22f21b81ae73eecc754f363459791ddd6a7 languageName: node linkType: hard -"@helium/nft-proxy-sdk@npm:0.0.8-next.22+7098baa": - version: 0.0.8-next.19 - resolution: "@helium/nft-proxy-sdk@npm:0.0.8-next.19" +"@helium/nft-proxy-sdk@npm:^0.0.12": + version: 0.0.12 + resolution: "@helium/nft-proxy-sdk@npm:0.0.12" dependencies: "@coral-xyz/anchor": ^0.28.0 "@helium/anchor-resolvers": ^0.2.17 - "@helium/modular-governance-idls": ^0.0.8-next.22+7098baa + "@helium/modular-governance-idls": ^0.0.10 "@solana/spl-token": ^0.3.8 - checksum: f5c6d9348cfebb8dd2d8fd997c365b5656afa7a6683592e1ed6b0bf04f73f231265a770c96022c930d32c686f57dbf56a0b7790c9d025413c80de30f07f1e587 + checksum: e70478c9ed007a1044ff7c76d0e0fdaf1163b489772893b8f4b52dd9d69d194aee71bc63a181a81c766dc459474cdbf3403035cc1f43e2741e89c139e3881b8b languageName: node linkType: hard @@ -412,7 +412,7 @@ __metadata: "@coral-xyz/anchor": ^0.28.0 "@helium/anchor-resolvers": ^0.9.2 "@helium/idls": ^0.9.2 - "@helium/nft-proxy-sdk": 0.0.8-next.22+7098baa + "@helium/nft-proxy-sdk": ^0.0.12 "@helium/spl-utils": ^0.9.2 "@metaplex-foundation/mpl-token-metadata": ^2.10.0 "@solana/spl-token": ^0.3.8 diff --git a/packages/entity-invalidator/yarn.deploy.lock b/packages/entity-invalidator/yarn.deploy.lock index 8b4cf8bad..dbdb3d418 100644 --- a/packages/entity-invalidator/yarn.deploy.lock +++ b/packages/entity-invalidator/yarn.deploy.lock @@ -242,25 +242,25 @@ __metadata: languageName: node linkType: hard -"@helium/modular-governance-idls@npm:^0.0.8-next.22+7098baa": - version: 0.0.8 - resolution: "@helium/modular-governance-idls@npm:0.0.8" +"@helium/modular-governance-idls@npm:^0.0.10": + version: 0.0.10 + resolution: "@helium/modular-governance-idls@npm:0.0.10" dependencies: "@coral-xyz/anchor": ^0.28.0 "@solana/web3.js": ^1.78.4 - checksum: 3bd1bbbdc88cc154f27717e8830b117004608a7ab91a0d43c90ad6cd9cec607071b48c25626e2e15195f4c7f45585d7d0df426ad50eb63acb2bd018897cc8919 + checksum: 300a5a3085747f7de769ae4ca73620d3aa3902ef4d35ffc1157cff3162ab712410161917ec3e1641bcd128b2657ce22f21b81ae73eecc754f363459791ddd6a7 languageName: node linkType: hard -"@helium/nft-proxy-sdk@npm:0.0.8-next.22+7098baa": - version: 0.0.8-next.19 - resolution: "@helium/nft-proxy-sdk@npm:0.0.8-next.19" +"@helium/nft-proxy-sdk@npm:^0.0.12": + version: 0.0.12 + resolution: "@helium/nft-proxy-sdk@npm:0.0.12" dependencies: "@coral-xyz/anchor": ^0.28.0 "@helium/anchor-resolvers": ^0.2.17 - "@helium/modular-governance-idls": ^0.0.8-next.22+7098baa + "@helium/modular-governance-idls": ^0.0.10 "@solana/spl-token": ^0.3.8 - checksum: f5c6d9348cfebb8dd2d8fd997c365b5656afa7a6683592e1ed6b0bf04f73f231265a770c96022c930d32c686f57dbf56a0b7790c9d025413c80de30f07f1e587 + checksum: e70478c9ed007a1044ff7c76d0e0fdaf1163b489772893b8f4b52dd9d69d194aee71bc63a181a81c766dc459474cdbf3403035cc1f43e2741e89c139e3881b8b languageName: node linkType: hard @@ -326,7 +326,7 @@ __metadata: "@coral-xyz/anchor": ^0.28.0 "@helium/anchor-resolvers": ^0.9.2 "@helium/idls": ^0.9.2 - "@helium/nft-proxy-sdk": 0.0.8-next.22+7098baa + "@helium/nft-proxy-sdk": ^0.0.12 "@helium/spl-utils": ^0.9.2 "@metaplex-foundation/mpl-token-metadata": ^2.10.0 "@solana/spl-token": ^0.3.8 diff --git a/packages/helium-admin-cli/package.json b/packages/helium-admin-cli/package.json index f2d952f34..555ba7fa0 100644 --- a/packages/helium-admin-cli/package.json +++ b/packages/helium-admin-cli/package.json @@ -47,9 +47,10 @@ "@helium/fanout-sdk": "^0.9.2", "@helium/helium-entity-manager-sdk": "^0.9.2", "@helium/helium-sub-daos-sdk": "^0.9.2", + "@helium/iot-routing-manager-sdk": "^0.9.2", "@helium/lazy-distributor-sdk": "^0.9.2", "@helium/mobile-entity-manager-sdk": "^0.9.2", - "@helium/nft-proxy-sdk": "0.0.8-next.22+7098baa", + "@helium/nft-proxy-sdk": "^0.0.12", "@helium/price-oracle-sdk": "^0.9.2", "@helium/spl-utils": "^0.9.2", "@helium/treasury-management-sdk": "^0.9.2", diff --git a/packages/helium-admin-cli/src/backfill-ouis.ts b/packages/helium-admin-cli/src/backfill-ouis.ts new file mode 100644 index 000000000..5ce5e79d4 --- /dev/null +++ b/packages/helium-admin-cli/src/backfill-ouis.ts @@ -0,0 +1,383 @@ +import * as anchor from "@coral-xyz/anchor"; +import Address from "@helium/address"; +import { ED25519_KEY_TYPE } from "@helium/address/build/KeyTypes"; +import { + init as initHEM, + programApprovalKey, + sharedMerkleKey, +} from "@helium/helium-entity-manager-sdk"; +import { daoKey, subDaoKey } from "@helium/helium-sub-daos-sdk"; +import { + devaddrConstraintKey, + init as initIRM, + netIdKey, + organizationDelegateKey, + organizationKey, + routingManagerKey, +} from "@helium/iot-routing-manager-sdk"; +import { + batchParallelInstructionsWithPriorityFee, + HNT_MINT, + IOT_MINT, + IOT_PRICE_FEED, + sendInstructionsWithPriorityFee, + truthy, +} from "@helium/spl-utils"; +import { + getConcurrentMerkleTreeAccountSize, + SPL_ACCOUNT_COMPRESSION_PROGRAM_ID, +} from "@solana/spl-account-compression"; +import { Keypair, PublicKey, SystemProgram } from "@solana/web3.js"; +import AWS from "aws-sdk"; +import os from "os"; +import { Client } from "pg"; +import yargs from "yargs/yargs"; +import { exists, loadKeypair } from "./utils"; + +type Org = { + oui: number; + owner_pubkey: string; + payer_pubkey: string; + locked: boolean; +}; + +type OrgDelegate = { + oui: number; + delegate_pubkey: string; +}; + +type DevaddrConstraint = { + oui: number; + net_id: number; + start_addr: number; + end_addr: number; +}; + +const toSolana = (address: string): PublicKey | undefined => { + try { + const addr = Address.fromB58(address); + if (addr.keyType === ED25519_KEY_TYPE) return new PublicKey(addr.publicKey); + } catch (e: any) { + return undefined; + } +}; + +const overflowedI64ToU64 = (overflowedI64: number) => { + const MAX_U64 = new anchor.BN("18446744073709551616"); // 2^64 + const i64Value = new anchor.BN(overflowedI64); + if (i64Value.lt(new anchor.BN(0))) { + return MAX_U64.add(i64Value); + } + return i64Value; +}; + +export async function run(args: any = process.argv) { + const yarg = yargs(args).options({ + wallet: { + alias: "k", + describe: "Anchor wallet keypair", + default: `${os.homedir()}/.config/solana/id.json`, + }, + executeTransaction: { + type: "boolean", + }, + url: { + alias: "u", + default: "http://127.0.0.1:8899", + describe: "The solana url", + }, + pgUser: { + default: "postgres", + }, + pgPassword: { + type: "string", + }, + pgDatabase: { + type: "string", + }, + pgHost: { + default: "localhost", + }, + pgPort: { + default: "5432", + }, + awsRegion: { + default: "us-east-1", + }, + noSsl: { + type: "boolean", + default: false, + }, + metadataUrl: { + required: true, + type: "string", + describe: "Json metadata for the collection", + }, + }); + + const argv = await yarg.argv; + process.env.ANCHOR_WALLET = argv.wallet; + process.env.ANCHOR_PROVIDER_URL = argv.url; + anchor.setProvider(anchor.AnchorProvider.local(argv.url)); + const provider = anchor.getProvider() as anchor.AnchorProvider; + const conn = provider.connection; + const wallet = new anchor.Wallet(loadKeypair(argv.wallet)); + const irm = await initIRM(provider); + const hem = await initHEM(provider); + const isRds = argv.pgHost.includes("rds.amazon.com"); + let password = argv.pgPassword; + + if (isRds && !password) { + const signer = new AWS.RDS.Signer({ + region: argv.awsRegion, + hostname: argv.pgHost, + port: Number(argv.pgPort), + username: argv.pgUser, + }); + + password = await new Promise((resolve, reject) => + signer.getAuthToken({}, (err, token) => { + if (err) { + return reject(err); + } + resolve(token); + }) + ); + } + + const client = new Client({ + user: argv.pgUser, + password, + host: argv.pgHost, + database: argv.pgDatabase, + port: Number(argv.pgPort), + ssl: argv.noSsl + ? { + rejectUnauthorized: false, + } + : false, + }); + + await client.connect(); + const orgs: Org[] = (await client.query(`SELECT * FROM organizations`)).rows; + + const orgDelegates: OrgDelegate[] = ( + await client.query(`SELECT * FROM organization_delegate_keys`) + ).rows; + + const devaddrConstraints: DevaddrConstraint[] = ( + await client.query(`SELECT * FROM organization_devaddr_constraints`) + ).rows; + + const [dao] = daoKey(HNT_MINT); + const [subDao] = subDaoKey(IOT_MINT); + const [sharedMerkle] = sharedMerkleKey(3); + const [programApproval] = programApprovalKey(dao, irm.programId); + const [routingManager] = routingManagerKey(subDao); + const netIds = [ + ...devaddrConstraints.reduce( + (acc, d) => acc.add(d.net_id), + new Set() + ), + ]; + + if (!(await exists(conn, programApproval))) { + console.log(`Approving program`); + await sendInstructionsWithPriorityFee(provider, [ + await hem.methods + .approveProgramV0({ + programId: irm.programId, + }) + .accounts({ dao }) + .instruction(), + ]); + } + + if (!(await exists(conn, sharedMerkle))) { + const merkle = Keypair.generate(); + const space = getConcurrentMerkleTreeAccountSize(20, 64, 17); + console.log(`Initializing sharedMerkle`); + await sendInstructionsWithPriorityFee( + provider, + [ + SystemProgram.createAccount({ + fromPubkey: wallet.publicKey, + newAccountPubkey: merkle.publicKey, + lamports: await conn.getMinimumBalanceForRentExemption(space), + space: space, + programId: SPL_ACCOUNT_COMPRESSION_PROGRAM_ID, + }), + await hem.methods + .initializeSharedMerkleV0({ proofSize: 3 }) + .accounts({ merkleTree: merkle.publicKey }) + .instruction(), + ], + { + computeUnitLimit: 500000, + signers: [merkle], + } + ); + } + + if (!(await exists(conn, routingManager))) { + console.log(`Initializing routingManager`); + await sendInstructionsWithPriorityFee( + provider, + [ + await irm.methods + .initializeRoutingManagerV0({ + metadataUrl: argv.metadataUrl, + devaddrPriceUsd: new anchor.BN(100_000000), + ouiPriceUsd: new anchor.BN(100_000000), + }) + .accounts({ + updateAuthority: wallet.publicKey, + netIdAuthority: wallet.publicKey, + dntMint: IOT_MINT, + subDao, + iotPriceOracle: IOT_PRICE_FEED, + }) + .instruction(), + ], + { + computeUnitLimit: 500000, + } + ); + } + + const netIdIxs = ( + await Promise.all( + netIds.map(async (netId) => { + const [netIdK] = netIdKey(routingManager, new anchor.BN(netId)); + + if (!(await exists(conn, netIdK))) { + return await irm.methods + .initializeNetIdV0({ + netId: new anchor.BN(netId), + }) + .accounts({ + authority: wallet.publicKey, + routingManager, + }) + .instruction(); + } + }) + ) + ).filter(truthy); + + console.log(`Initializing (${netIdIxs.length}) netIds`); + await batchParallelInstructionsWithPriorityFee(provider, netIdIxs); + + const orgIxs = ( + await Promise.all( + orgs.map(async (org) => { + const netId = devaddrConstraints.find((d) => d.oui === org.oui) + ?.net_id!; + const [netIdK] = netIdKey(routingManager, new anchor.BN(netId)); + const [orgK] = organizationKey(routingManager, new anchor.BN(org.oui)); + const ownerSolAddr = toSolana(org.owner_pubkey); + + if (!ownerSolAddr) { + throw new Error( + `Owner doesn't have a sol address ${org.owner_pubkey}` + ); + } + + if (!(await exists(conn, orgK))) { + return await irm.methods + .initializeOrganizationV0({ + oui: new anchor.BN(org.oui), + escrowKeyOverride: org.payer_pubkey, + }) + .accounts({ + authority: ownerSolAddr, + netId: netIdK, + }) + .instruction(); + } + }) + ) + ).filter(truthy); + + console.log(`Initializing (${orgIxs.length}) organizations`); + await batchParallelInstructionsWithPriorityFee(provider, orgIxs, { + computeUnitLimit: 500000, + }); + + const orgDelegateIxs = ( + await Promise.all( + orgDelegates.map(async (orgDelegate) => { + const [orgK] = organizationKey( + routingManager, + new anchor.BN(orgDelegate.oui) + ); + + if (!(await exists(conn, orgK))) { + throw new Error(`Organization not found ${orgK.toBase58()}`); + } + + const delegateSolAddr = toSolana(orgDelegate.delegate_pubkey); + if (!delegateSolAddr) { + console.log( + `Delegate doesn't have a sol address, skipping delegate: ${orgDelegate.delegate_pubkey} oui: ${orgDelegate.oui}` + ); + } + + if (delegateSolAddr) { + const [orgDelegateK] = organizationDelegateKey(orgK, delegateSolAddr); + if (!(await exists(conn, orgDelegateK))) { + return await irm.methods + .tempBackfillOrganizationDelegate() + .accounts({ + authority: wallet.publicKey, + organization: orgK, + delegate: delegateSolAddr, + }) + .instruction(); + } + } + }) + ) + ).filter(truthy); + + console.log(`Initializing (${orgDelegateIxs.length}) orgDelegates`); + await batchParallelInstructionsWithPriorityFee(provider, orgDelegateIxs); + + const devaddrIxs = ( + await Promise.all( + devaddrConstraints.map(async (devaddr) => { + const startAddrBn = overflowedI64ToU64(devaddr.start_addr); + const endAddrBn = overflowedI64ToU64(devaddr.end_addr); + const numBlocksBn = endAddrBn + .add(new anchor.BN(1)) + .sub(startAddrBn) + .div(new anchor.BN(8)); + + const [orgK] = organizationKey( + routingManager, + new anchor.BN(devaddr.oui) + ); + + if (!(await exists(conn, orgK))) { + throw new Error(`Organization not found ${orgK.toBase58()}`); + } + + const [devaddrConstraintK] = devaddrConstraintKey(orgK, startAddrBn); + if (!(await exists(conn, devaddrConstraintK))) { + return await irm.methods + .initializeDevaddrConstraintV0({ + startAddr: startAddrBn, + numBlocks: numBlocksBn.toNumber(), + }) + .accounts({ + organization: orgK, + }) + .instruction(); + } + }) + ) + ).filter(truthy); + + console.log(`Initializing (${devaddrIxs.length}) devaddrConstraints`); + await batchParallelInstructionsWithPriorityFee(provider, devaddrIxs); +} diff --git a/packages/helium-admin-cli/tsconfig.json b/packages/helium-admin-cli/tsconfig.json index 3c77a27bd..072cf39ae 100644 --- a/packages/helium-admin-cli/tsconfig.json +++ b/packages/helium-admin-cli/tsconfig.json @@ -40,6 +40,9 @@ { "path": "../rewards-oracle-sdk" }, + { + "path": "../iot-routing-manager-sdk" + }, { "path": "./tsconfig.cjs.json" }, diff --git a/packages/helium-admin-cli/yarn.deploy.lock b/packages/helium-admin-cli/yarn.deploy.lock index aedae20b7..59fcf6f86 100644 --- a/packages/helium-admin-cli/yarn.deploy.lock +++ b/packages/helium-admin-cli/yarn.deploy.lock @@ -323,9 +323,10 @@ __metadata: "@helium/fanout-sdk": ^0.9.2 "@helium/helium-entity-manager-sdk": ^0.9.2 "@helium/helium-sub-daos-sdk": ^0.9.2 + "@helium/iot-routing-manager-sdk": ^0.9.2 "@helium/lazy-distributor-sdk": ^0.9.2 "@helium/mobile-entity-manager-sdk": ^0.9.2 - "@helium/nft-proxy-sdk": 0.0.8-next.22+7098baa + "@helium/nft-proxy-sdk": ^0.0.12 "@helium/price-oracle-sdk": ^0.9.2 "@helium/spl-utils": ^0.9.2 "@helium/treasury-management-sdk": ^0.9.2 @@ -416,6 +417,22 @@ __metadata: languageName: node linkType: hard +"@helium/iot-routing-manager-sdk@^0.9.2": + version: 0.0.0-use.local + resolution: "@helium/iot-routing-manager-sdk@workspace:packages/iot-routing-manager-sdk" + dependencies: + "@coral-xyz/anchor": ^0.28.0 + "@helium/anchor-resolvers": ^0.9.2 + "@helium/helium-entity-manager-sdk": ^0.9.2 + bn.js: ^5.2.0 + bs58: ^4.0.1 + git-format-staged: ^2.1.3 + ts-loader: ^9.2.3 + ts-node: ^10.9.1 + typescript: ^5.2.2 + languageName: unknown + linkType: soft + "@helium/lazy-distributor-sdk@^0.9.2": version: 0.0.0-use.local resolution: "@helium/lazy-distributor-sdk@workspace:packages/lazy-distributor-sdk" @@ -450,25 +467,25 @@ __metadata: languageName: unknown linkType: soft -"@helium/modular-governance-idls@npm:^0.0.8-next.22+7098baa": - version: 0.0.8 - resolution: "@helium/modular-governance-idls@npm:0.0.8" +"@helium/modular-governance-idls@npm:^0.0.10": + version: 0.0.10 + resolution: "@helium/modular-governance-idls@npm:0.0.10" dependencies: "@coral-xyz/anchor": ^0.28.0 "@solana/web3.js": ^1.78.4 - checksum: 3bd1bbbdc88cc154f27717e8830b117004608a7ab91a0d43c90ad6cd9cec607071b48c25626e2e15195f4c7f45585d7d0df426ad50eb63acb2bd018897cc8919 + checksum: 300a5a3085747f7de769ae4ca73620d3aa3902ef4d35ffc1157cff3162ab712410161917ec3e1641bcd128b2657ce22f21b81ae73eecc754f363459791ddd6a7 languageName: node linkType: hard -"@helium/nft-proxy-sdk@npm:0.0.8-next.22+7098baa": - version: 0.0.8-next.19 - resolution: "@helium/nft-proxy-sdk@npm:0.0.8-next.19" +"@helium/nft-proxy-sdk@npm:^0.0.12": + version: 0.0.12 + resolution: "@helium/nft-proxy-sdk@npm:0.0.12" dependencies: "@coral-xyz/anchor": ^0.28.0 "@helium/anchor-resolvers": ^0.2.17 - "@helium/modular-governance-idls": ^0.0.8-next.22+7098baa + "@helium/modular-governance-idls": ^0.0.10 "@solana/spl-token": ^0.3.8 - checksum: f5c6d9348cfebb8dd2d8fd997c365b5656afa7a6683592e1ed6b0bf04f73f231265a770c96022c930d32c686f57dbf56a0b7790c9d025413c80de30f07f1e587 + checksum: e70478c9ed007a1044ff7c76d0e0fdaf1163b489772893b8f4b52dd9d69d194aee71bc63a181a81c766dc459474cdbf3403035cc1f43e2741e89c139e3881b8b languageName: node linkType: hard @@ -565,7 +582,7 @@ __metadata: "@coral-xyz/anchor": ^0.28.0 "@helium/anchor-resolvers": ^0.9.2 "@helium/idls": ^0.9.2 - "@helium/nft-proxy-sdk": 0.0.8-next.22+7098baa + "@helium/nft-proxy-sdk": ^0.0.12 "@helium/spl-utils": ^0.9.2 "@metaplex-foundation/mpl-token-metadata": ^2.10.0 "@solana/spl-token": ^0.3.8 diff --git a/packages/helium-entity-manager-sdk/yarn.deploy.lock b/packages/helium-entity-manager-sdk/yarn.deploy.lock index 9d7b729b6..876612645 100644 --- a/packages/helium-entity-manager-sdk/yarn.deploy.lock +++ b/packages/helium-entity-manager-sdk/yarn.deploy.lock @@ -211,25 +211,25 @@ __metadata: languageName: node linkType: hard -"@helium/modular-governance-idls@npm:^0.0.8-next.22+7098baa": - version: 0.0.8 - resolution: "@helium/modular-governance-idls@npm:0.0.8" +"@helium/modular-governance-idls@npm:^0.0.10": + version: 0.0.10 + resolution: "@helium/modular-governance-idls@npm:0.0.10" dependencies: "@coral-xyz/anchor": ^0.28.0 "@solana/web3.js": ^1.78.4 - checksum: 3bd1bbbdc88cc154f27717e8830b117004608a7ab91a0d43c90ad6cd9cec607071b48c25626e2e15195f4c7f45585d7d0df426ad50eb63acb2bd018897cc8919 + checksum: 300a5a3085747f7de769ae4ca73620d3aa3902ef4d35ffc1157cff3162ab712410161917ec3e1641bcd128b2657ce22f21b81ae73eecc754f363459791ddd6a7 languageName: node linkType: hard -"@helium/nft-proxy-sdk@npm:0.0.8-next.22+7098baa": - version: 0.0.8-next.19 - resolution: "@helium/nft-proxy-sdk@npm:0.0.8-next.19" +"@helium/nft-proxy-sdk@npm:^0.0.12": + version: 0.0.12 + resolution: "@helium/nft-proxy-sdk@npm:0.0.12" dependencies: "@coral-xyz/anchor": ^0.28.0 "@helium/anchor-resolvers": ^0.2.17 - "@helium/modular-governance-idls": ^0.0.8-next.22+7098baa + "@helium/modular-governance-idls": ^0.0.10 "@solana/spl-token": ^0.3.8 - checksum: f5c6d9348cfebb8dd2d8fd997c365b5656afa7a6683592e1ed6b0bf04f73f231265a770c96022c930d32c686f57dbf56a0b7790c9d025413c80de30f07f1e587 + checksum: e70478c9ed007a1044ff7c76d0e0fdaf1163b489772893b8f4b52dd9d69d194aee71bc63a181a81c766dc459474cdbf3403035cc1f43e2741e89c139e3881b8b languageName: node linkType: hard @@ -295,7 +295,7 @@ __metadata: "@coral-xyz/anchor": ^0.28.0 "@helium/anchor-resolvers": ^0.9.2 "@helium/idls": ^0.9.2 - "@helium/nft-proxy-sdk": 0.0.8-next.22+7098baa + "@helium/nft-proxy-sdk": ^0.0.12 "@helium/spl-utils": ^0.9.2 "@metaplex-foundation/mpl-token-metadata": ^2.10.0 "@solana/spl-token": ^0.3.8 diff --git a/packages/helium-sub-daos-sdk/yarn.deploy.lock b/packages/helium-sub-daos-sdk/yarn.deploy.lock index 261803d52..191aeac5f 100644 --- a/packages/helium-sub-daos-sdk/yarn.deploy.lock +++ b/packages/helium-sub-daos-sdk/yarn.deploy.lock @@ -163,25 +163,25 @@ __metadata: languageName: unknown linkType: soft -"@helium/modular-governance-idls@npm:^0.0.8-next.22+7098baa": - version: 0.0.8 - resolution: "@helium/modular-governance-idls@npm:0.0.8" +"@helium/modular-governance-idls@npm:^0.0.10": + version: 0.0.10 + resolution: "@helium/modular-governance-idls@npm:0.0.10" dependencies: "@coral-xyz/anchor": ^0.28.0 "@solana/web3.js": ^1.78.4 - checksum: 3bd1bbbdc88cc154f27717e8830b117004608a7ab91a0d43c90ad6cd9cec607071b48c25626e2e15195f4c7f45585d7d0df426ad50eb63acb2bd018897cc8919 + checksum: 300a5a3085747f7de769ae4ca73620d3aa3902ef4d35ffc1157cff3162ab712410161917ec3e1641bcd128b2657ce22f21b81ae73eecc754f363459791ddd6a7 languageName: node linkType: hard -"@helium/nft-proxy-sdk@npm:0.0.8-next.22+7098baa": - version: 0.0.8-next.19 - resolution: "@helium/nft-proxy-sdk@npm:0.0.8-next.19" +"@helium/nft-proxy-sdk@npm:^0.0.12": + version: 0.0.12 + resolution: "@helium/nft-proxy-sdk@npm:0.0.12" dependencies: "@coral-xyz/anchor": ^0.28.0 "@helium/anchor-resolvers": ^0.2.17 - "@helium/modular-governance-idls": ^0.0.8-next.22+7098baa + "@helium/modular-governance-idls": ^0.0.10 "@solana/spl-token": ^0.3.8 - checksum: f5c6d9348cfebb8dd2d8fd997c365b5656afa7a6683592e1ed6b0bf04f73f231265a770c96022c930d32c686f57dbf56a0b7790c9d025413c80de30f07f1e587 + checksum: e70478c9ed007a1044ff7c76d0e0fdaf1163b489772893b8f4b52dd9d69d194aee71bc63a181a81c766dc459474cdbf3403035cc1f43e2741e89c139e3881b8b languageName: node linkType: hard @@ -231,7 +231,7 @@ __metadata: "@coral-xyz/anchor": ^0.28.0 "@helium/anchor-resolvers": ^0.9.2 "@helium/idls": ^0.9.2 - "@helium/nft-proxy-sdk": 0.0.8-next.22+7098baa + "@helium/nft-proxy-sdk": ^0.0.12 "@helium/spl-utils": ^0.9.2 "@metaplex-foundation/mpl-token-metadata": ^2.10.0 "@solana/spl-token": ^0.3.8 diff --git a/packages/helium-vote-service/yarn.deploy.lock b/packages/helium-vote-service/yarn.deploy.lock index 538190bf1..03c0d61bb 100644 --- a/packages/helium-vote-service/yarn.deploy.lock +++ b/packages/helium-vote-service/yarn.deploy.lock @@ -234,35 +234,35 @@ __metadata: languageName: unknown linkType: soft -"@helium/modular-governance-idls@npm:^0.0.5": - version: 0.0.5 - resolution: "@helium/modular-governance-idls@npm:0.0.5" +"@helium/modular-governance-idls@npm:^0.0.10": + version: 0.0.10 + resolution: "@helium/modular-governance-idls@npm:0.0.10" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@solana/web3.js": ^1.43.4 - checksum: fd13b16178d67bda5720a3658e6782d7787f73299af60807822fc4e737e2f2424b68e097f642d9e944f247bfb5df9c785c6f060c156dfe89f2ce7aae8a48d411 + "@solana/web3.js": ^1.78.4 + checksum: 300a5a3085747f7de769ae4ca73620d3aa3902ef4d35ffc1157cff3162ab712410161917ec3e1641bcd128b2657ce22f21b81ae73eecc754f363459791ddd6a7 languageName: node linkType: hard -"@helium/modular-governance-idls@npm:^0.0.8-next.22+7098baa": - version: 0.0.8 - resolution: "@helium/modular-governance-idls@npm:0.0.8" +"@helium/modular-governance-idls@npm:^0.0.5": + version: 0.0.5 + resolution: "@helium/modular-governance-idls@npm:0.0.5" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@solana/web3.js": ^1.78.4 - checksum: 3bd1bbbdc88cc154f27717e8830b117004608a7ab91a0d43c90ad6cd9cec607071b48c25626e2e15195f4c7f45585d7d0df426ad50eb63acb2bd018897cc8919 + "@solana/web3.js": ^1.43.4 + checksum: fd13b16178d67bda5720a3658e6782d7787f73299af60807822fc4e737e2f2424b68e097f642d9e944f247bfb5df9c785c6f060c156dfe89f2ce7aae8a48d411 languageName: node linkType: hard -"@helium/nft-proxy-sdk@npm:0.0.8-next.22+7098baa": - version: 0.0.8-next.19 - resolution: "@helium/nft-proxy-sdk@npm:0.0.8-next.19" +"@helium/nft-proxy-sdk@npm:^0.0.12": + version: 0.0.12 + resolution: "@helium/nft-proxy-sdk@npm:0.0.12" dependencies: "@coral-xyz/anchor": ^0.28.0 "@helium/anchor-resolvers": ^0.2.17 - "@helium/modular-governance-idls": ^0.0.8-next.22+7098baa + "@helium/modular-governance-idls": ^0.0.10 "@solana/spl-token": ^0.3.8 - checksum: f5c6d9348cfebb8dd2d8fd997c365b5656afa7a6683592e1ed6b0bf04f73f231265a770c96022c930d32c686f57dbf56a0b7790c9d025413c80de30f07f1e587 + checksum: e70478c9ed007a1044ff7c76d0e0fdaf1163b489772893b8f4b52dd9d69d194aee71bc63a181a81c766dc459474cdbf3403035cc1f43e2741e89c139e3881b8b languageName: node linkType: hard @@ -318,7 +318,7 @@ __metadata: "@coral-xyz/anchor": ^0.28.0 "@helium/anchor-resolvers": ^0.9.2 "@helium/idls": ^0.9.2 - "@helium/nft-proxy-sdk": 0.0.8-next.22+7098baa + "@helium/nft-proxy-sdk": ^0.0.12 "@helium/spl-utils": ^0.9.2 "@metaplex-foundation/mpl-token-metadata": ^2.10.0 "@solana/spl-token": ^0.3.8 @@ -644,9 +644,9 @@ __metadata: linkType: hard "@types/lodash@npm:^4.17.6": - version: 4.17.6 - resolution: "@types/lodash@npm:4.17.6" - checksum: f748c672f49c54ee631a0fab6f26d56ab99bd68a4fb91604b5d7525a72102dd1917209c12d7078c988a375edb5dc70ca600db05ac01785306fd64470048cd16c + version: 4.17.7 + resolution: "@types/lodash@npm:4.17.7" + checksum: 09e58a119cd8a70acfb33f8623dc2fc54f74cdce3b3429b879fc2daac4807fe376190a04b9e024dd300f9a3ee1876d6623979cefe619f70654ca0fe0c47679a7 languageName: node linkType: hard @@ -928,8 +928,8 @@ __metadata: linkType: hard "aws-sdk@npm:^2.1650.0": - version: 2.1650.0 - resolution: "aws-sdk@npm:2.1650.0" + version: 2.1682.0 + resolution: "aws-sdk@npm:2.1682.0" dependencies: buffer: 4.9.2 events: 1.1.1 @@ -941,7 +941,7 @@ __metadata: util: ^0.12.4 uuid: 8.0.0 xml2js: 0.6.2 - checksum: 60188893d4bdd81f56a3d4b5dd642e8f2ed80816519166ef68decb009fbfcb57a6b389436429f27ec9fa99450f43f21182c718e9660b8a44174485f9ab1102a6 + checksum: ab3b60fdb635d89951787cbe81cc530247858c0ff095f983b3fd2e4357a85161931d4495ea363ce19bb71069e613b463c4f8047a8d60c69ba4f8eaea265d6bf9 languageName: node linkType: hard @@ -1267,7 +1267,7 @@ __metadata: version: 0.5.4 resolution: "content-disposition@npm:0.5.4" dependencies: - safe-buffer: "npm:5.2.1" + safe-buffer: 5.2.1 checksum: afb9d545e296a5171d7574fcad634b2fdf698875f4006a9dd04a3e1333880c5c0c98d47b560d01216fb6505a54a2ba6a843ee3a02ec86d7e911e8315255f56c3 languageName: node linkType: hard @@ -1326,14 +1326,14 @@ __metadata: linkType: hard "debug@npm:^4.1.1, debug@npm:^4.3.5": - version: 4.3.5 - resolution: "debug@npm:4.3.5" + version: 4.3.6 + resolution: "debug@npm:4.3.6" dependencies: ms: 2.1.2 peerDependenciesMeta: supports-color: optional: true - checksum: 7c002b51e256257f936dda09eb37167df952758c57badf6bf44bdc40b89a4bcb8e5a0a2e4c7b53f97c69e2970dd5272d33a757378a12c8f8e64ea7bf99e8e86e + checksum: 1630b748dea3c581295e02137a9f5cbe2c1d85fea35c1e6597a65ca2b16a6fce68cec61b299d480787ef310ba927dc8c92d3061faba0ad06c6a724672f66be7f languageName: node linkType: hard diff --git a/packages/hexboosting-sdk/yarn.deploy.lock b/packages/hexboosting-sdk/yarn.deploy.lock index afa2fe903..890af959e 100644 --- a/packages/hexboosting-sdk/yarn.deploy.lock +++ b/packages/hexboosting-sdk/yarn.deploy.lock @@ -180,25 +180,25 @@ __metadata: languageName: unknown linkType: soft -"@helium/modular-governance-idls@npm:^0.0.8-next.22+7098baa": - version: 0.0.8 - resolution: "@helium/modular-governance-idls@npm:0.0.8" +"@helium/modular-governance-idls@npm:^0.0.10": + version: 0.0.10 + resolution: "@helium/modular-governance-idls@npm:0.0.10" dependencies: "@coral-xyz/anchor": ^0.28.0 "@solana/web3.js": ^1.78.4 - checksum: 3bd1bbbdc88cc154f27717e8830b117004608a7ab91a0d43c90ad6cd9cec607071b48c25626e2e15195f4c7f45585d7d0df426ad50eb63acb2bd018897cc8919 + checksum: 300a5a3085747f7de769ae4ca73620d3aa3902ef4d35ffc1157cff3162ab712410161917ec3e1641bcd128b2657ce22f21b81ae73eecc754f363459791ddd6a7 languageName: node linkType: hard -"@helium/nft-proxy-sdk@npm:0.0.8-next.22+7098baa": - version: 0.0.8-next.19 - resolution: "@helium/nft-proxy-sdk@npm:0.0.8-next.19" +"@helium/nft-proxy-sdk@npm:^0.0.12": + version: 0.0.12 + resolution: "@helium/nft-proxy-sdk@npm:0.0.12" dependencies: "@coral-xyz/anchor": ^0.28.0 "@helium/anchor-resolvers": ^0.2.17 - "@helium/modular-governance-idls": ^0.0.8-next.22+7098baa + "@helium/modular-governance-idls": ^0.0.10 "@solana/spl-token": ^0.3.8 - checksum: f5c6d9348cfebb8dd2d8fd997c365b5656afa7a6683592e1ed6b0bf04f73f231265a770c96022c930d32c686f57dbf56a0b7790c9d025413c80de30f07f1e587 + checksum: e70478c9ed007a1044ff7c76d0e0fdaf1163b489772893b8f4b52dd9d69d194aee71bc63a181a81c766dc459474cdbf3403035cc1f43e2741e89c139e3881b8b languageName: node linkType: hard @@ -248,7 +248,7 @@ __metadata: "@coral-xyz/anchor": ^0.28.0 "@helium/anchor-resolvers": ^0.9.2 "@helium/idls": ^0.9.2 - "@helium/nft-proxy-sdk": 0.0.8-next.22+7098baa + "@helium/nft-proxy-sdk": ^0.0.12 "@helium/spl-utils": ^0.9.2 "@metaplex-foundation/mpl-token-metadata": ^2.10.0 "@solana/spl-token": ^0.3.8 diff --git a/packages/hotspot-utils/yarn.deploy.lock b/packages/hotspot-utils/yarn.deploy.lock index f654d1c56..e9796fa9f 100644 --- a/packages/hotspot-utils/yarn.deploy.lock +++ b/packages/hotspot-utils/yarn.deploy.lock @@ -225,25 +225,25 @@ __metadata: languageName: node linkType: hard -"@helium/modular-governance-idls@npm:^0.0.8-next.22+7098baa": - version: 0.0.8 - resolution: "@helium/modular-governance-idls@npm:0.0.8" +"@helium/modular-governance-idls@npm:^0.0.10": + version: 0.0.10 + resolution: "@helium/modular-governance-idls@npm:0.0.10" dependencies: "@coral-xyz/anchor": ^0.28.0 "@solana/web3.js": ^1.78.4 - checksum: 3bd1bbbdc88cc154f27717e8830b117004608a7ab91a0d43c90ad6cd9cec607071b48c25626e2e15195f4c7f45585d7d0df426ad50eb63acb2bd018897cc8919 + checksum: 300a5a3085747f7de769ae4ca73620d3aa3902ef4d35ffc1157cff3162ab712410161917ec3e1641bcd128b2657ce22f21b81ae73eecc754f363459791ddd6a7 languageName: node linkType: hard -"@helium/nft-proxy-sdk@npm:0.0.8-next.22+7098baa": - version: 0.0.8-next.19 - resolution: "@helium/nft-proxy-sdk@npm:0.0.8-next.19" +"@helium/nft-proxy-sdk@npm:^0.0.12": + version: 0.0.12 + resolution: "@helium/nft-proxy-sdk@npm:0.0.12" dependencies: "@coral-xyz/anchor": ^0.28.0 "@helium/anchor-resolvers": ^0.2.17 - "@helium/modular-governance-idls": ^0.0.8-next.22+7098baa + "@helium/modular-governance-idls": ^0.0.10 "@solana/spl-token": ^0.3.8 - checksum: f5c6d9348cfebb8dd2d8fd997c365b5656afa7a6683592e1ed6b0bf04f73f231265a770c96022c930d32c686f57dbf56a0b7790c9d025413c80de30f07f1e587 + checksum: e70478c9ed007a1044ff7c76d0e0fdaf1163b489772893b8f4b52dd9d69d194aee71bc63a181a81c766dc459474cdbf3403035cc1f43e2741e89c139e3881b8b languageName: node linkType: hard @@ -309,7 +309,7 @@ __metadata: "@coral-xyz/anchor": ^0.28.0 "@helium/anchor-resolvers": ^0.9.2 "@helium/idls": ^0.9.2 - "@helium/nft-proxy-sdk": 0.0.8-next.22+7098baa + "@helium/nft-proxy-sdk": ^0.0.12 "@helium/spl-utils": ^0.9.2 "@metaplex-foundation/mpl-token-metadata": ^2.10.0 "@solana/spl-token": ^0.3.8 diff --git a/packages/iot-routing-manager-sdk/package.json b/packages/iot-routing-manager-sdk/package.json index e9a0988b0..8e52ff049 100644 --- a/packages/iot-routing-manager-sdk/package.json +++ b/packages/iot-routing-manager-sdk/package.json @@ -5,7 +5,7 @@ "registry": "https://registry.npmjs.org/" }, "license": "Apache-2.0", - "version": "0.8.7", + "version": "0.9.2", "description": "Interface to the iot-routing-manager smart contract", "repository": { "type": "git", @@ -32,8 +32,8 @@ }, "dependencies": { "@coral-xyz/anchor": "^0.28.0", - "@helium/anchor-resolvers": "^0.8.7", - "@helium/helium-entity-manager-sdk": "^0.8.7", + "@helium/anchor-resolvers": "^0.9.2", + "@helium/helium-entity-manager-sdk": "^0.9.2", "bn.js": "^5.2.0", "bs58": "^4.0.1" }, diff --git a/packages/iot-routing-manager-sdk/yarn.deploy.lock b/packages/iot-routing-manager-sdk/yarn.deploy.lock index aaeaef403..5c411aff6 100644 --- a/packages/iot-routing-manager-sdk/yarn.deploy.lock +++ b/packages/iot-routing-manager-sdk/yarn.deploy.lock @@ -67,7 +67,7 @@ __metadata: languageName: node linkType: hard -"@helium/account-fetch-cache@^0.8.7": +"@helium/account-fetch-cache@^0.9.2": version: 0.0.0-use.local resolution: "@helium/account-fetch-cache@workspace:packages/account-fetch-cache" dependencies: @@ -89,7 +89,7 @@ __metadata: languageName: node linkType: hard -"@helium/anchor-resolvers@^0.8.7": +"@helium/anchor-resolvers@^0.9.2": version: 0.0.0-use.local resolution: "@helium/anchor-resolvers@workspace:packages/anchor-resolvers" dependencies: @@ -103,6 +103,18 @@ __metadata: languageName: unknown linkType: soft +"@helium/anchor-resolvers@npm:^0.2.17": + version: 0.2.21 + resolution: "@helium/anchor-resolvers@npm:0.2.21" + dependencies: + "@solana/spl-token": "npm:^0.3.6" + "@solana/web3.js": "npm:^1.43.4" + peerDependencies: + "@coral-xyz/anchor": ^0.26.0 + checksum: b8639d000c7a95f47810e62b31e3fd5795ba2152310a0047dc80e09191cd8b56a949eea223f00902c2fcabe47f17090fa2b49b8386d90cd98dded6612992443f + languageName: node + linkType: hard + "@helium/anchor-resolvers@npm:^0.5.0": version: 0.5.0 resolution: "@helium/anchor-resolvers@npm:0.5.0" @@ -115,13 +127,13 @@ __metadata: languageName: node linkType: hard -"@helium/circuit-breaker-sdk@^0.8.7": +"@helium/circuit-breaker-sdk@^0.9.2": version: 0.0.0-use.local resolution: "@helium/circuit-breaker-sdk@workspace:packages/circuit-breaker-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/anchor-resolvers": ^0.8.7 - "@helium/idls": ^0.8.7 + "@helium/anchor-resolvers": ^0.9.2 + "@helium/idls": ^0.9.2 bn.js: ^5.2.0 bs58: ^4.0.1 git-format-staged: ^2.1.3 @@ -131,17 +143,17 @@ __metadata: languageName: unknown linkType: soft -"@helium/helium-entity-manager-sdk@^0.8.7": +"@helium/helium-entity-manager-sdk@^0.9.2": version: 0.0.0-use.local resolution: "@helium/helium-entity-manager-sdk@workspace:packages/helium-entity-manager-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 "@helium/address": ^4.10.2 - "@helium/anchor-resolvers": ^0.8.7 - "@helium/helium-sub-daos-sdk": ^0.8.7 - "@helium/idls": ^0.8.7 - "@helium/no-emit-sdk": ^0.8.7 - "@helium/spl-utils": ^0.8.7 + "@helium/anchor-resolvers": ^0.9.2 + "@helium/helium-sub-daos-sdk": ^0.9.2 + "@helium/idls": ^0.9.2 + "@helium/no-emit-sdk": ^0.9.2 + "@helium/spl-utils": ^0.9.2 "@types/crypto-js": ^4.1.1 bn.js: ^5.2.0 bs58: ^4.0.1 @@ -154,15 +166,15 @@ __metadata: languageName: unknown linkType: soft -"@helium/helium-sub-daos-sdk@^0.8.7": +"@helium/helium-sub-daos-sdk@^0.9.2": version: 0.0.0-use.local resolution: "@helium/helium-sub-daos-sdk@workspace:packages/helium-sub-daos-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/anchor-resolvers": ^0.8.7 - "@helium/circuit-breaker-sdk": ^0.8.7 - "@helium/treasury-management-sdk": ^0.8.7 - "@helium/voter-stake-registry-sdk": ^0.8.7 + "@helium/anchor-resolvers": ^0.9.2 + "@helium/circuit-breaker-sdk": ^0.9.2 + "@helium/treasury-management-sdk": ^0.9.2 + "@helium/voter-stake-registry-sdk": ^0.9.2 bn.js: ^5.2.0 bs58: ^4.0.1 git-format-staged: ^2.1.3 @@ -172,7 +184,7 @@ __metadata: languageName: unknown linkType: soft -"@helium/idls@^0.8.7": +"@helium/idls@^0.9.2": version: 0.0.0-use.local resolution: "@helium/idls@workspace:packages/idls" dependencies: @@ -204,8 +216,8 @@ __metadata: resolution: "@helium/iot-routing-manager-sdk@workspace:." dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/anchor-resolvers": ^0.8.7 - "@helium/helium-entity-manager-sdk": ^0.8.7 + "@helium/anchor-resolvers": ^0.9.2 + "@helium/helium-entity-manager-sdk": ^0.9.2 bn.js: ^5.2.0 bs58: ^4.0.1 git-format-staged: ^2.1.3 @@ -215,7 +227,29 @@ __metadata: languageName: unknown linkType: soft -"@helium/no-emit-sdk@^0.8.7": +"@helium/modular-governance-idls@npm:^0.0.10": + version: 0.0.10 + resolution: "@helium/modular-governance-idls@npm:0.0.10" + dependencies: + "@coral-xyz/anchor": ^0.28.0 + "@solana/web3.js": ^1.78.4 + checksum: 300a5a3085747f7de769ae4ca73620d3aa3902ef4d35ffc1157cff3162ab712410161917ec3e1641bcd128b2657ce22f21b81ae73eecc754f363459791ddd6a7 + languageName: node + linkType: hard + +"@helium/nft-proxy-sdk@npm:^0.0.12": + version: 0.0.12 + resolution: "@helium/nft-proxy-sdk@npm:0.0.12" + dependencies: + "@coral-xyz/anchor": ^0.28.0 + "@helium/anchor-resolvers": ^0.2.17 + "@helium/modular-governance-idls": ^0.0.10 + "@solana/spl-token": ^0.3.8 + checksum: e70478c9ed007a1044ff7c76d0e0fdaf1163b489772893b8f4b52dd9d69d194aee71bc63a181a81c766dc459474cdbf3403035cc1f43e2741e89c139e3881b8b + languageName: node + linkType: hard + +"@helium/no-emit-sdk@^0.9.2": version: 0.0.0-use.local resolution: "@helium/no-emit-sdk@workspace:packages/no-emit-sdk" dependencies: @@ -231,14 +265,14 @@ __metadata: languageName: unknown linkType: soft -"@helium/spl-utils@^0.8.7": +"@helium/spl-utils@^0.9.2": version: 0.0.0-use.local resolution: "@helium/spl-utils@workspace:packages/spl-utils" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/account-fetch-cache": ^0.8.7 + "@helium/account-fetch-cache": ^0.9.2 "@helium/address": ^4.10.2 - "@helium/anchor-resolvers": ^0.8.7 + "@helium/anchor-resolvers": ^0.9.2 "@metaplex-foundation/mpl-token-metadata": ^2.10.0 "@solana/spl-account-compression": ^0.1.7 "@solana/spl-token": ^0.3.8 @@ -253,14 +287,14 @@ __metadata: languageName: unknown linkType: soft -"@helium/treasury-management-sdk@^0.8.7": +"@helium/treasury-management-sdk@^0.9.2": version: 0.0.0-use.local resolution: "@helium/treasury-management-sdk@workspace:packages/treasury-management-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/anchor-resolvers": ^0.8.7 - "@helium/circuit-breaker-sdk": ^0.8.7 - "@helium/idls": ^0.8.7 + "@helium/anchor-resolvers": ^0.9.2 + "@helium/circuit-breaker-sdk": ^0.9.2 + "@helium/idls": ^0.9.2 bn.js: ^5.2.0 bs58: ^4.0.1 git-format-staged: ^2.1.3 @@ -270,13 +304,15 @@ __metadata: languageName: unknown linkType: soft -"@helium/voter-stake-registry-sdk@^0.8.7": +"@helium/voter-stake-registry-sdk@^0.9.2": version: 0.0.0-use.local resolution: "@helium/voter-stake-registry-sdk@workspace:packages/voter-stake-registry-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/anchor-resolvers": ^0.8.7 - "@helium/idls": ^0.8.7 + "@helium/anchor-resolvers": ^0.9.2 + "@helium/idls": ^0.9.2 + "@helium/nft-proxy-sdk": ^0.0.12 + "@helium/spl-utils": ^0.9.2 "@metaplex-foundation/mpl-token-metadata": ^2.10.0 "@solana/spl-token": ^0.3.8 bn.js: ^5.2.0 @@ -469,7 +505,7 @@ __metadata: languageName: node linkType: hard -"@solana/web3.js@npm:^1.32.0, @solana/web3.js@npm:^1.56.2, @solana/web3.js@npm:^1.66.2, @solana/web3.js@npm:^1.68.0, @solana/web3.js@npm:^1.78.4": +"@solana/web3.js@npm:^1.32.0, @solana/web3.js@npm:^1.43.4, @solana/web3.js@npm:^1.56.2, @solana/web3.js@npm:^1.66.2, @solana/web3.js@npm:^1.68.0, @solana/web3.js@npm:^1.78.4": version: 1.78.4 resolution: "@solana/web3.js@npm:1.78.4" dependencies: diff --git a/packages/metadata-service/yarn.deploy.lock b/packages/metadata-service/yarn.deploy.lock index 9d2c0e4cf..54c5a5c2a 100644 --- a/packages/metadata-service/yarn.deploy.lock +++ b/packages/metadata-service/yarn.deploy.lock @@ -339,25 +339,25 @@ __metadata: languageName: unknown linkType: soft -"@helium/modular-governance-idls@npm:^0.0.8-next.22+7098baa": - version: 0.0.8 - resolution: "@helium/modular-governance-idls@npm:0.0.8" +"@helium/modular-governance-idls@npm:^0.0.10": + version: 0.0.10 + resolution: "@helium/modular-governance-idls@npm:0.0.10" dependencies: "@coral-xyz/anchor": ^0.28.0 "@solana/web3.js": ^1.78.4 - checksum: 3bd1bbbdc88cc154f27717e8830b117004608a7ab91a0d43c90ad6cd9cec607071b48c25626e2e15195f4c7f45585d7d0df426ad50eb63acb2bd018897cc8919 + checksum: 300a5a3085747f7de769ae4ca73620d3aa3902ef4d35ffc1157cff3162ab712410161917ec3e1641bcd128b2657ce22f21b81ae73eecc754f363459791ddd6a7 languageName: node linkType: hard -"@helium/nft-proxy-sdk@npm:0.0.8-next.22+7098baa": - version: 0.0.8-next.19 - resolution: "@helium/nft-proxy-sdk@npm:0.0.8-next.19" +"@helium/nft-proxy-sdk@npm:^0.0.12": + version: 0.0.12 + resolution: "@helium/nft-proxy-sdk@npm:0.0.12" dependencies: "@coral-xyz/anchor": ^0.28.0 "@helium/anchor-resolvers": ^0.2.17 - "@helium/modular-governance-idls": ^0.0.8-next.22+7098baa + "@helium/modular-governance-idls": ^0.0.10 "@solana/spl-token": ^0.3.8 - checksum: f5c6d9348cfebb8dd2d8fd997c365b5656afa7a6683592e1ed6b0bf04f73f231265a770c96022c930d32c686f57dbf56a0b7790c9d025413c80de30f07f1e587 + checksum: e70478c9ed007a1044ff7c76d0e0fdaf1163b489772893b8f4b52dd9d69d194aee71bc63a181a81c766dc459474cdbf3403035cc1f43e2741e89c139e3881b8b languageName: node linkType: hard @@ -423,7 +423,7 @@ __metadata: "@coral-xyz/anchor": ^0.28.0 "@helium/anchor-resolvers": ^0.9.2 "@helium/idls": ^0.9.2 - "@helium/nft-proxy-sdk": 0.0.8-next.22+7098baa + "@helium/nft-proxy-sdk": ^0.0.12 "@helium/spl-utils": ^0.9.2 "@metaplex-foundation/mpl-token-metadata": ^2.10.0 "@solana/spl-token": ^0.3.8 diff --git a/packages/migration-service/yarn.deploy.lock b/packages/migration-service/yarn.deploy.lock index 313bbd3ae..933bb9269 100644 --- a/packages/migration-service/yarn.deploy.lock +++ b/packages/migration-service/yarn.deploy.lock @@ -454,25 +454,25 @@ __metadata: languageName: unknown linkType: soft -"@helium/modular-governance-idls@npm:^0.0.8-next.22+7098baa": - version: 0.0.8 - resolution: "@helium/modular-governance-idls@npm:0.0.8" +"@helium/modular-governance-idls@npm:^0.0.10": + version: 0.0.10 + resolution: "@helium/modular-governance-idls@npm:0.0.10" dependencies: "@coral-xyz/anchor": ^0.28.0 "@solana/web3.js": ^1.78.4 - checksum: 3bd1bbbdc88cc154f27717e8830b117004608a7ab91a0d43c90ad6cd9cec607071b48c25626e2e15195f4c7f45585d7d0df426ad50eb63acb2bd018897cc8919 + checksum: 300a5a3085747f7de769ae4ca73620d3aa3902ef4d35ffc1157cff3162ab712410161917ec3e1641bcd128b2657ce22f21b81ae73eecc754f363459791ddd6a7 languageName: node linkType: hard -"@helium/nft-proxy-sdk@npm:0.0.8-next.22+7098baa": - version: 0.0.8-next.19 - resolution: "@helium/nft-proxy-sdk@npm:0.0.8-next.19" +"@helium/nft-proxy-sdk@npm:^0.0.12": + version: 0.0.12 + resolution: "@helium/nft-proxy-sdk@npm:0.0.12" dependencies: "@coral-xyz/anchor": ^0.28.0 "@helium/anchor-resolvers": ^0.2.17 - "@helium/modular-governance-idls": ^0.0.8-next.22+7098baa + "@helium/modular-governance-idls": ^0.0.10 "@solana/spl-token": ^0.3.8 - checksum: f5c6d9348cfebb8dd2d8fd997c365b5656afa7a6683592e1ed6b0bf04f73f231265a770c96022c930d32c686f57dbf56a0b7790c9d025413c80de30f07f1e587 + checksum: e70478c9ed007a1044ff7c76d0e0fdaf1163b489772893b8f4b52dd9d69d194aee71bc63a181a81c766dc459474cdbf3403035cc1f43e2741e89c139e3881b8b languageName: node linkType: hard @@ -554,7 +554,7 @@ __metadata: "@coral-xyz/anchor": ^0.28.0 "@helium/anchor-resolvers": ^0.9.2 "@helium/idls": ^0.9.2 - "@helium/nft-proxy-sdk": 0.0.8-next.22+7098baa + "@helium/nft-proxy-sdk": ^0.0.12 "@helium/spl-utils": ^0.9.2 "@metaplex-foundation/mpl-token-metadata": ^2.10.0 "@solana/spl-token": ^0.3.8 diff --git a/packages/mobile-entity-manager-sdk/yarn.deploy.lock b/packages/mobile-entity-manager-sdk/yarn.deploy.lock index aa748b8cc..7445779be 100644 --- a/packages/mobile-entity-manager-sdk/yarn.deploy.lock +++ b/packages/mobile-entity-manager-sdk/yarn.deploy.lock @@ -229,25 +229,25 @@ __metadata: languageName: unknown linkType: soft -"@helium/modular-governance-idls@npm:^0.0.8-next.22+7098baa": - version: 0.0.8 - resolution: "@helium/modular-governance-idls@npm:0.0.8" +"@helium/modular-governance-idls@npm:^0.0.10": + version: 0.0.10 + resolution: "@helium/modular-governance-idls@npm:0.0.10" dependencies: "@coral-xyz/anchor": ^0.28.0 "@solana/web3.js": ^1.78.4 - checksum: 3bd1bbbdc88cc154f27717e8830b117004608a7ab91a0d43c90ad6cd9cec607071b48c25626e2e15195f4c7f45585d7d0df426ad50eb63acb2bd018897cc8919 + checksum: 300a5a3085747f7de769ae4ca73620d3aa3902ef4d35ffc1157cff3162ab712410161917ec3e1641bcd128b2657ce22f21b81ae73eecc754f363459791ddd6a7 languageName: node linkType: hard -"@helium/nft-proxy-sdk@npm:0.0.8-next.22+7098baa": - version: 0.0.8-next.19 - resolution: "@helium/nft-proxy-sdk@npm:0.0.8-next.19" +"@helium/nft-proxy-sdk@npm:^0.0.12": + version: 0.0.12 + resolution: "@helium/nft-proxy-sdk@npm:0.0.12" dependencies: "@coral-xyz/anchor": ^0.28.0 "@helium/anchor-resolvers": ^0.2.17 - "@helium/modular-governance-idls": ^0.0.8-next.22+7098baa + "@helium/modular-governance-idls": ^0.0.10 "@solana/spl-token": ^0.3.8 - checksum: f5c6d9348cfebb8dd2d8fd997c365b5656afa7a6683592e1ed6b0bf04f73f231265a770c96022c930d32c686f57dbf56a0b7790c9d025413c80de30f07f1e587 + checksum: e70478c9ed007a1044ff7c76d0e0fdaf1163b489772893b8f4b52dd9d69d194aee71bc63a181a81c766dc459474cdbf3403035cc1f43e2741e89c139e3881b8b languageName: node linkType: hard @@ -313,7 +313,7 @@ __metadata: "@coral-xyz/anchor": ^0.28.0 "@helium/anchor-resolvers": ^0.9.2 "@helium/idls": ^0.9.2 - "@helium/nft-proxy-sdk": 0.0.8-next.22+7098baa + "@helium/nft-proxy-sdk": ^0.0.12 "@helium/spl-utils": ^0.9.2 "@metaplex-foundation/mpl-token-metadata": ^2.10.0 "@solana/spl-token": ^0.3.8 diff --git a/packages/monitor-service/yarn.deploy.lock b/packages/monitor-service/yarn.deploy.lock index 92be85366..61596846b 100644 --- a/packages/monitor-service/yarn.deploy.lock +++ b/packages/monitor-service/yarn.deploy.lock @@ -299,13 +299,13 @@ __metadata: languageName: unknown linkType: soft -"@helium/modular-governance-idls@npm:^0.0.8-next.22+7098baa": - version: 0.0.8 - resolution: "@helium/modular-governance-idls@npm:0.0.8" +"@helium/modular-governance-idls@npm:^0.0.10": + version: 0.0.10 + resolution: "@helium/modular-governance-idls@npm:0.0.10" dependencies: "@coral-xyz/anchor": ^0.28.0 "@solana/web3.js": ^1.78.4 - checksum: 3bd1bbbdc88cc154f27717e8830b117004608a7ab91a0d43c90ad6cd9cec607071b48c25626e2e15195f4c7f45585d7d0df426ad50eb63acb2bd018897cc8919 + checksum: 300a5a3085747f7de769ae4ca73620d3aa3902ef4d35ffc1157cff3162ab712410161917ec3e1641bcd128b2657ce22f21b81ae73eecc754f363459791ddd6a7 languageName: node linkType: hard @@ -350,15 +350,15 @@ __metadata: languageName: unknown linkType: soft -"@helium/nft-proxy-sdk@npm:0.0.8-next.22+7098baa": - version: 0.0.8-next.19 - resolution: "@helium/nft-proxy-sdk@npm:0.0.8-next.19" +"@helium/nft-proxy-sdk@npm:^0.0.12": + version: 0.0.12 + resolution: "@helium/nft-proxy-sdk@npm:0.0.12" dependencies: "@coral-xyz/anchor": ^0.28.0 "@helium/anchor-resolvers": ^0.2.17 - "@helium/modular-governance-idls": ^0.0.8-next.22+7098baa + "@helium/modular-governance-idls": ^0.0.10 "@solana/spl-token": ^0.3.8 - checksum: f5c6d9348cfebb8dd2d8fd997c365b5656afa7a6683592e1ed6b0bf04f73f231265a770c96022c930d32c686f57dbf56a0b7790c9d025413c80de30f07f1e587 + checksum: e70478c9ed007a1044ff7c76d0e0fdaf1163b489772893b8f4b52dd9d69d194aee71bc63a181a81c766dc459474cdbf3403035cc1f43e2741e89c139e3881b8b languageName: node linkType: hard @@ -439,7 +439,7 @@ __metadata: "@coral-xyz/anchor": ^0.28.0 "@helium/anchor-resolvers": ^0.9.2 "@helium/idls": ^0.9.2 - "@helium/nft-proxy-sdk": 0.0.8-next.22+7098baa + "@helium/nft-proxy-sdk": ^0.0.12 "@helium/spl-utils": ^0.9.2 "@metaplex-foundation/mpl-token-metadata": ^2.10.0 "@solana/spl-token": ^0.3.8 diff --git a/packages/voter-stake-registry-hooks/package.json b/packages/voter-stake-registry-hooks/package.json index 75124fa4f..fc2825dc6 100644 --- a/packages/voter-stake-registry-hooks/package.json +++ b/packages/voter-stake-registry-hooks/package.json @@ -38,7 +38,7 @@ "@helium/helium-react-hooks": "^0.9.2", "@helium/helium-sub-daos-sdk": "^0.9.2", "@helium/modular-governance-hooks": "^0.0.8", - "@helium/modular-governance-idls": "0.0.8-next.22+7098baa", + "@helium/modular-governance-idls": "^0.0.12", "@helium/spl-utils": "^0.9.2", "@helium/voter-stake-registry-sdk": "^0.9.2", "@solana/wallet-adapter-base": "^0.9.22", diff --git a/packages/voter-stake-registry-hooks/yarn.deploy.lock b/packages/voter-stake-registry-hooks/yarn.deploy.lock index 5a7d0c240..cd15c4651 100644 --- a/packages/voter-stake-registry-hooks/yarn.deploy.lock +++ b/packages/voter-stake-registry-hooks/yarn.deploy.lock @@ -275,17 +275,27 @@ __metadata: languageName: node linkType: hard -"@helium/modular-governance-idls@npm:0.0.8-next.22+7098baa": - version: 0.0.8-next.19 - resolution: "@helium/modular-governance-idls@npm:0.0.8-next.19" +"@helium/modular-governance-idls@npm:^0.0.10": + version: 0.0.10 + resolution: "@helium/modular-governance-idls@npm:0.0.10" dependencies: "@coral-xyz/anchor": ^0.28.0 "@solana/web3.js": ^1.78.4 - checksum: 109d5ceca42944851485274cb231d4a01c075eea6ce67ab0128a751ec112018ec5d681f7c4a79633d49b1b3da3b1312a7b6a79ddd9d8dbe7f2fba1f333a56002 + checksum: 300a5a3085747f7de769ae4ca73620d3aa3902ef4d35ffc1157cff3162ab712410161917ec3e1641bcd128b2657ce22f21b81ae73eecc754f363459791ddd6a7 languageName: node linkType: hard -"@helium/modular-governance-idls@npm:^0.0.8, @helium/modular-governance-idls@npm:^0.0.8-next.22+7098baa": +"@helium/modular-governance-idls@npm:^0.0.12": + version: 0.0.12 + resolution: "@helium/modular-governance-idls@npm:0.0.12" + dependencies: + "@coral-xyz/anchor": ^0.28.0 + "@solana/web3.js": ^1.78.4 + checksum: 606c888d1f1af24aeae2b3f011ee2db19f17ce78b3bf37fe6bebaccc3e8e040b4e365d3fa32d4a4e42d181efdc35dc53dc0bf701b5b85065cab167e307c7f035 + languageName: node + linkType: hard + +"@helium/modular-governance-idls@npm:^0.0.8": version: 0.0.8 resolution: "@helium/modular-governance-idls@npm:0.0.8" dependencies: @@ -295,15 +305,15 @@ __metadata: languageName: node linkType: hard -"@helium/nft-proxy-sdk@npm:0.0.8-next.22+7098baa": - version: 0.0.8-next.19 - resolution: "@helium/nft-proxy-sdk@npm:0.0.8-next.19" +"@helium/nft-proxy-sdk@npm:^0.0.12": + version: 0.0.12 + resolution: "@helium/nft-proxy-sdk@npm:0.0.12" dependencies: "@coral-xyz/anchor": ^0.28.0 "@helium/anchor-resolvers": ^0.2.17 - "@helium/modular-governance-idls": ^0.0.8-next.22+7098baa + "@helium/modular-governance-idls": ^0.0.10 "@solana/spl-token": ^0.3.8 - checksum: f5c6d9348cfebb8dd2d8fd997c365b5656afa7a6683592e1ed6b0bf04f73f231265a770c96022c930d32c686f57dbf56a0b7790c9d025413c80de30f07f1e587 + checksum: e70478c9ed007a1044ff7c76d0e0fdaf1163b489772893b8f4b52dd9d69d194aee71bc63a181a81c766dc459474cdbf3403035cc1f43e2741e89c139e3881b8b languageName: node linkType: hard @@ -380,7 +390,7 @@ __metadata: "@helium/helium-react-hooks": ^0.9.2 "@helium/helium-sub-daos-sdk": ^0.9.2 "@helium/modular-governance-hooks": ^0.0.8 - "@helium/modular-governance-idls": 0.0.8-next.22+7098baa + "@helium/modular-governance-idls": ^0.0.12 "@helium/spl-utils": ^0.9.2 "@helium/voter-stake-registry-sdk": ^0.9.2 "@solana/wallet-adapter-base": ^0.9.22 @@ -406,7 +416,7 @@ __metadata: "@coral-xyz/anchor": ^0.28.0 "@helium/anchor-resolvers": ^0.9.2 "@helium/idls": ^0.9.2 - "@helium/nft-proxy-sdk": 0.0.8-next.22+7098baa + "@helium/nft-proxy-sdk": ^0.0.12 "@helium/spl-utils": ^0.9.2 "@metaplex-foundation/mpl-token-metadata": ^2.10.0 "@solana/spl-token": ^0.3.8 @@ -784,21 +794,21 @@ __metadata: languageName: node linkType: hard -"@tanstack/query-core@npm:5.45.0": - version: 5.45.0 - resolution: "@tanstack/query-core@npm:5.45.0" - checksum: a3c13d90cfa12955d22fa754ebfddbea70081fc0128111083269bdd78ed0d25678f050007b753164a929a00fdef9ee5ebba945deb8e360120ae3cbae06e655a5 +"@tanstack/query-core@npm:5.52.0": + version: 5.52.0 + resolution: "@tanstack/query-core@npm:5.52.0" + checksum: 1e142995fa9b0eec88009dd1083cd226eaec9125dc668b6485699639f45edb1386e4acd634e0eddc33d3a29e0c9636302824c42ac8c4106935d776fdc41d2638 languageName: node linkType: hard "@tanstack/react-query@npm:^5.45.0": - version: 5.45.0 - resolution: "@tanstack/react-query@npm:5.45.0" + version: 5.52.1 + resolution: "@tanstack/react-query@npm:5.52.1" dependencies: - "@tanstack/query-core": 5.45.0 + "@tanstack/query-core": 5.52.0 peerDependencies: - react: ^18.0.0 - checksum: 3f2896e132e2fc4f5a2b77e015719cd8f74a3b5ce958d3d2ffc83cc9bd8a1a265ed54835a8751daf00b85af7bf15f8ad1a9fe123dafdfdfe3e81f17e585d0e95 + react: ^18 || ^19 + checksum: f46bf1f85cc03b8329aee5d8a5a96b4e30dc88aff04d5256ebd0efefe1f507720b42a4be4a9bee340d3ade6cf0ae7b59187de90d87ea973c0f67e3764f76260c languageName: node linkType: hard diff --git a/packages/voter-stake-registry-sdk/package.json b/packages/voter-stake-registry-sdk/package.json index 3a049fc1a..ebba3892d 100644 --- a/packages/voter-stake-registry-sdk/package.json +++ b/packages/voter-stake-registry-sdk/package.json @@ -34,7 +34,7 @@ "@coral-xyz/anchor": "^0.28.0", "@helium/anchor-resolvers": "^0.9.2", "@helium/idls": "^0.9.2", - "@helium/nft-proxy-sdk": "0.0.8-next.22+7098baa", + "@helium/nft-proxy-sdk": "^0.0.12", "@helium/spl-utils": "^0.9.2", "@metaplex-foundation/mpl-token-metadata": "^2.10.0", "@solana/spl-token": "^0.3.8", diff --git a/packages/voter-stake-registry-sdk/yarn.deploy.lock b/packages/voter-stake-registry-sdk/yarn.deploy.lock index b2b468da0..bf85dd978 100644 --- a/packages/voter-stake-registry-sdk/yarn.deploy.lock +++ b/packages/voter-stake-registry-sdk/yarn.deploy.lock @@ -129,25 +129,25 @@ __metadata: languageName: unknown linkType: soft -"@helium/modular-governance-idls@npm:^0.0.8-next.22+7098baa": - version: 0.0.8 - resolution: "@helium/modular-governance-idls@npm:0.0.8" +"@helium/modular-governance-idls@npm:^0.0.10": + version: 0.0.10 + resolution: "@helium/modular-governance-idls@npm:0.0.10" dependencies: "@coral-xyz/anchor": ^0.28.0 "@solana/web3.js": ^1.78.4 - checksum: 3bd1bbbdc88cc154f27717e8830b117004608a7ab91a0d43c90ad6cd9cec607071b48c25626e2e15195f4c7f45585d7d0df426ad50eb63acb2bd018897cc8919 + checksum: 300a5a3085747f7de769ae4ca73620d3aa3902ef4d35ffc1157cff3162ab712410161917ec3e1641bcd128b2657ce22f21b81ae73eecc754f363459791ddd6a7 languageName: node linkType: hard -"@helium/nft-proxy-sdk@npm:0.0.8-next.22+7098baa": - version: 0.0.8-next.19 - resolution: "@helium/nft-proxy-sdk@npm:0.0.8-next.19" +"@helium/nft-proxy-sdk@npm:^0.0.12": + version: 0.0.12 + resolution: "@helium/nft-proxy-sdk@npm:0.0.12" dependencies: "@coral-xyz/anchor": ^0.28.0 "@helium/anchor-resolvers": ^0.2.17 - "@helium/modular-governance-idls": ^0.0.8-next.22+7098baa + "@helium/modular-governance-idls": ^0.0.10 "@solana/spl-token": ^0.3.8 - checksum: f5c6d9348cfebb8dd2d8fd997c365b5656afa7a6683592e1ed6b0bf04f73f231265a770c96022c930d32c686f57dbf56a0b7790c9d025413c80de30f07f1e587 + checksum: e70478c9ed007a1044ff7c76d0e0fdaf1163b489772893b8f4b52dd9d69d194aee71bc63a181a81c766dc459474cdbf3403035cc1f43e2741e89c139e3881b8b languageName: node linkType: hard @@ -180,7 +180,7 @@ __metadata: "@coral-xyz/anchor": ^0.28.0 "@helium/anchor-resolvers": ^0.9.2 "@helium/idls": ^0.9.2 - "@helium/nft-proxy-sdk": 0.0.8-next.22+7098baa + "@helium/nft-proxy-sdk": ^0.0.12 "@helium/spl-utils": ^0.9.2 "@metaplex-foundation/mpl-token-metadata": ^2.10.0 "@solana/spl-token": ^0.3.8 diff --git a/packages/vsr-metadata-service/yarn.deploy.lock b/packages/vsr-metadata-service/yarn.deploy.lock index a84a405e9..baa64ebbc 100644 --- a/packages/vsr-metadata-service/yarn.deploy.lock +++ b/packages/vsr-metadata-service/yarn.deploy.lock @@ -173,25 +173,25 @@ __metadata: languageName: unknown linkType: soft -"@helium/modular-governance-idls@npm:^0.0.8-next.22+7098baa": - version: 0.0.8 - resolution: "@helium/modular-governance-idls@npm:0.0.8" +"@helium/modular-governance-idls@npm:^0.0.10": + version: 0.0.10 + resolution: "@helium/modular-governance-idls@npm:0.0.10" dependencies: "@coral-xyz/anchor": ^0.28.0 "@solana/web3.js": ^1.78.4 - checksum: 3bd1bbbdc88cc154f27717e8830b117004608a7ab91a0d43c90ad6cd9cec607071b48c25626e2e15195f4c7f45585d7d0df426ad50eb63acb2bd018897cc8919 + checksum: 300a5a3085747f7de769ae4ca73620d3aa3902ef4d35ffc1157cff3162ab712410161917ec3e1641bcd128b2657ce22f21b81ae73eecc754f363459791ddd6a7 languageName: node linkType: hard -"@helium/nft-proxy-sdk@npm:0.0.8-next.22+7098baa": - version: 0.0.8-next.19 - resolution: "@helium/nft-proxy-sdk@npm:0.0.8-next.19" +"@helium/nft-proxy-sdk@npm:^0.0.12": + version: 0.0.12 + resolution: "@helium/nft-proxy-sdk@npm:0.0.12" dependencies: "@coral-xyz/anchor": ^0.28.0 "@helium/anchor-resolvers": ^0.2.17 - "@helium/modular-governance-idls": ^0.0.8-next.22+7098baa + "@helium/modular-governance-idls": ^0.0.10 "@solana/spl-token": ^0.3.8 - checksum: f5c6d9348cfebb8dd2d8fd997c365b5656afa7a6683592e1ed6b0bf04f73f231265a770c96022c930d32c686f57dbf56a0b7790c9d025413c80de30f07f1e587 + checksum: e70478c9ed007a1044ff7c76d0e0fdaf1163b489772893b8f4b52dd9d69d194aee71bc63a181a81c766dc459474cdbf3403035cc1f43e2741e89c139e3881b8b languageName: node linkType: hard @@ -224,7 +224,7 @@ __metadata: "@coral-xyz/anchor": ^0.28.0 "@helium/anchor-resolvers": ^0.9.2 "@helium/idls": ^0.9.2 - "@helium/nft-proxy-sdk": 0.0.8-next.22+7098baa + "@helium/nft-proxy-sdk": ^0.0.12 "@helium/spl-utils": ^0.9.2 "@metaplex-foundation/mpl-token-metadata": ^2.10.0 "@solana/spl-token": ^0.3.8 diff --git a/programs/iot-routing-manager/src/instructions/mod.rs b/programs/iot-routing-manager/src/instructions/mod.rs index 3a48929b9..84b559954 100644 --- a/programs/iot-routing-manager/src/instructions/mod.rs +++ b/programs/iot-routing-manager/src/instructions/mod.rs @@ -5,6 +5,7 @@ pub mod initialize_organization_delegate_v0; pub mod initialize_organization_v0; pub mod initialize_routing_manager_v0; pub mod remove_organization_delegate_v0; +pub mod temp_backfill_organization_delegate; pub mod update_organization_v0; pub use approve_organization_v0::*; @@ -14,4 +15,5 @@ pub use initialize_organization_delegate_v0::*; pub use initialize_organization_v0::*; pub use initialize_routing_manager_v0::*; pub use remove_organization_delegate_v0::*; +pub use temp_backfill_organization_delegate::*; pub use update_organization_v0::*; diff --git a/programs/iot-routing-manager/src/instructions/temp_backfill_organization_delegate.rs b/programs/iot-routing-manager/src/instructions/temp_backfill_organization_delegate.rs new file mode 100644 index 000000000..e1ae64909 --- /dev/null +++ b/programs/iot-routing-manager/src/instructions/temp_backfill_organization_delegate.rs @@ -0,0 +1,37 @@ +use anchor_lang::prelude::*; +use std::str::FromStr; + +use crate::{OrganizationDelegateV0, OrganizationV0}; + +#[derive(Accounts)] +pub struct TempBackfillOrganizationDelegate<'info> { + #[account( + mut, + address = Pubkey::from_str("hprdnjkbziK8NqhThmAn5Gu4XqrBbctX8du4PfJdgvW").unwrap() + )] + pub authority: Signer<'info>, + pub organization: Account<'info, OrganizationV0>, + #[account( + init, + payer = authority, + space = 8 + OrganizationDelegateV0::INIT_SPACE + 32, + seeds = [b"organization_delegate", organization.key().as_ref(), delegate.key().as_ref()], + bump, + )] + pub organization_delegate: Account<'info, OrganizationDelegateV0>, + /// CHECK: The actual account that will act as a delegate + pub delegate: AccountInfo<'info>, + pub system_program: Program<'info, System>, +} + +pub fn handler(ctx: Context) -> Result<()> { + ctx + .accounts + .organization_delegate + .set_inner(OrganizationDelegateV0 { + organization: ctx.accounts.organization.key(), + delegate: ctx.accounts.delegate.key(), + bump_seed: ctx.bumps["organization_delegate"], + }); + Ok(()) +} diff --git a/programs/iot-routing-manager/src/lib.rs b/programs/iot-routing-manager/src/lib.rs index bfc8f39ae..6cd54dd3a 100644 --- a/programs/iot-routing-manager/src/lib.rs +++ b/programs/iot-routing-manager/src/lib.rs @@ -79,4 +79,10 @@ pub mod iot_routing_manager { ) -> Result<()> { update_organization_v0::handler(ctx, args) } + + pub fn temp_backfill_organization_delegate( + ctx: Context, + ) -> Result<()> { + temp_backfill_organization_delegate::handler(ctx) + } } diff --git a/yarn.lock b/yarn.lock index 528b92110..5055446ef 100644 --- a/yarn.lock +++ b/yarn.lock @@ -184,29 +184,6 @@ __metadata: languageName: node linkType: hard -"@coral-xyz/anchor@npm:^0.27.0": - version: 0.27.0 - resolution: "@coral-xyz/anchor@npm:0.27.0" - dependencies: - "@coral-xyz/borsh": "npm:^0.27.0" - "@solana/web3.js": "npm:^1.68.0" - base64-js: "npm:^1.5.1" - bn.js: "npm:^5.1.2" - bs58: "npm:^4.0.1" - buffer-layout: "npm:^1.2.2" - camelcase: "npm:^6.3.0" - cross-fetch: "npm:^3.1.5" - crypto-hash: "npm:^1.3.0" - eventemitter3: "npm:^4.0.7" - js-sha256: "npm:^0.9.0" - pako: "npm:^2.0.3" - snake-case: "npm:^3.0.4" - superstruct: "npm:^0.15.4" - toml: "npm:^3.0.0" - checksum: 369581b2ee0bb3a95e04934ad91459d921b62d7f883fafa292818eb2550b717d2ced5c98c2a817b73d6dc8dab904a41d681d11c110c41c7f78f6135d9942eb4c - languageName: node - linkType: hard - "@coral-xyz/anchor@npm:^0.28.0": version: 0.28.0 resolution: "@coral-xyz/anchor@npm:0.28.0" @@ -299,18 +276,6 @@ __metadata: languageName: node linkType: hard -"@coral-xyz/borsh@npm:^0.27.0": - version: 0.27.0 - resolution: "@coral-xyz/borsh@npm:0.27.0" - dependencies: - bn.js: "npm:^5.1.2" - buffer-layout: "npm:^1.2.0" - peerDependencies: - "@solana/web3.js": ^1.68.0 - checksum: b5e06650ad3f8cfbdb9c96c0b7329f07345f258fce8cfb1737c6ee1bf991d8fd4e90a3ac397a1f3d98c39173cc10bad3255247d77385b3542d20a0bf7e3878d9 - languageName: node - linkType: hard - "@coral-xyz/borsh@npm:^0.28.0": version: 0.28.0 resolution: "@coral-xyz/borsh@npm:0.28.0" @@ -361,6 +326,13 @@ __metadata: languageName: node linkType: hard +"@fastify/accept-negotiator@npm:^1.0.0": + version: 1.1.0 + resolution: "@fastify/accept-negotiator@npm:1.1.0" + checksum: 5c8f263680af0aece8c1fdea4d4c094a7f82cc5ed90b709357eb52a01e3388d1ac74a17e5a1d5d53f2d3ca93ae50d283ee451a6435b2cbe1b9847fff4d7d0732 + languageName: node + linkType: hard + "@fastify/ajv-compiler@npm:^3.5.0": version: 3.5.0 resolution: "@fastify/ajv-compiler@npm:3.5.0" @@ -412,6 +384,33 @@ __metadata: languageName: node linkType: hard +"@fastify/send@npm:^2.0.0": + version: 2.1.0 + resolution: "@fastify/send@npm:2.1.0" + dependencies: + "@lukeed/ms": ^2.0.1 + escape-html: ~1.0.3 + fast-decode-uri-component: ^1.0.1 + http-errors: 2.0.0 + mime: ^3.0.0 + checksum: c0eeddd35c53167e41ee7c25ccbb964e5a1e4a17c827da6486db656581f83f162237d6f8104b698a4a136d8ea054f2d028bfa4c7d1c4126db51584680f43e1f1 + languageName: node + linkType: hard + +"@fastify/static@npm:^6": + version: 6.12.0 + resolution: "@fastify/static@npm:6.12.0" + dependencies: + "@fastify/accept-negotiator": ^1.0.0 + "@fastify/send": ^2.0.0 + content-disposition: ^0.5.3 + fastify-plugin: ^4.0.0 + glob: ^8.0.1 + p-limit: ^3.1.0 + checksum: 1ba2f88665baddc9e67c7ea8aee401b5ec8c207e7fd615b2e68246a7ee2cafcc75e66b66d901abb154566fa7132af2319cd00e15350ed57936b74ee10c8eb9c7 + languageName: node + linkType: hard + "@gar/promisify@npm:^1.1.3": version: 1.1.3 resolution: "@gar/promisify@npm:1.1.3" @@ -480,11 +479,11 @@ __metadata: languageName: node linkType: hard -"@helium/account-fetch-cache-hooks@^0.8.7, @helium/account-fetch-cache-hooks@workspace:packages/account-fetch-cache-hooks": +"@helium/account-fetch-cache-hooks@^0.9.2, @helium/account-fetch-cache-hooks@workspace:packages/account-fetch-cache-hooks": version: 0.0.0-use.local resolution: "@helium/account-fetch-cache-hooks@workspace:packages/account-fetch-cache-hooks" dependencies: - "@helium/account-fetch-cache": ^0.8.7 + "@helium/account-fetch-cache": ^0.9.2 "@solana/web3.js": ^1.78.8 git-format-staged: ^2.1.3 react-async-hook: ^4.0.0 @@ -510,7 +509,7 @@ __metadata: languageName: node linkType: hard -"@helium/account-fetch-cache@^0.8.7, @helium/account-fetch-cache@workspace:packages/account-fetch-cache": +"@helium/account-fetch-cache@^0.9.2, @helium/account-fetch-cache@workspace:packages/account-fetch-cache": version: 0.0.0-use.local resolution: "@helium/account-fetch-cache@workspace:packages/account-fetch-cache" dependencies: @@ -539,7 +538,7 @@ __metadata: "@connectrpc/connect-node": ^1.3.0 "@coral-xyz/anchor": ^0.28.0 "@fastify/cors": ^8.1.1 - "@helium/account-fetch-cache": ^0.8.7 + "@helium/account-fetch-cache": ^0.9.2 "@metaplex-foundation/mpl-token-metadata": ^2.10.0 "@solana/web3.js": ^1.78.8 "@substreams/core": ^0.15.1 @@ -567,7 +566,7 @@ __metadata: git-format-staged: ^2.1.3 h3-js: ^4.1.0 http-status-codes: ^2.2.0 - inflection: ^2.0.1 + inflection: ^3.0.0 kafkajs: ^2.2.4 lodash: ^4.17.21 p-limit: 3.1.0 @@ -608,7 +607,7 @@ __metadata: languageName: node linkType: hard -"@helium/anchor-resolvers@^0.8.7, @helium/anchor-resolvers@workspace:packages/anchor-resolvers": +"@helium/anchor-resolvers@^0.9.2, @helium/anchor-resolvers@workspace:packages/anchor-resolvers": version: 0.0.0-use.local resolution: "@helium/anchor-resolvers@workspace:packages/anchor-resolvers" dependencies: @@ -622,7 +621,7 @@ __metadata: languageName: unknown linkType: soft -"@helium/anchor-resolvers@npm:^0.2.5": +"@helium/anchor-resolvers@npm:^0.2.17": version: 0.2.21 resolution: "@helium/anchor-resolvers@npm:0.2.21" dependencies: @@ -646,13 +645,13 @@ __metadata: languageName: node linkType: hard -"@helium/circuit-breaker-sdk@^0.8.7, @helium/circuit-breaker-sdk@workspace:packages/circuit-breaker-sdk": +"@helium/circuit-breaker-sdk@^0.9.2, @helium/circuit-breaker-sdk@workspace:packages/circuit-breaker-sdk": version: 0.0.0-use.local resolution: "@helium/circuit-breaker-sdk@workspace:packages/circuit-breaker-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/anchor-resolvers": ^0.8.7 - "@helium/idls": ^0.8.7 + "@helium/anchor-resolvers": ^0.9.2 + "@helium/idls": ^0.9.2 bn.js: ^5.2.0 bs58: ^4.0.1 git-format-staged: ^2.1.3 @@ -667,23 +666,23 @@ __metadata: resolution: "@helium/crons@workspace:packages/crons" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/account-fetch-cache": ^0.8.7 - "@helium/distributor-oracle": ^0.8.7 - "@helium/fanout-sdk": ^0.8.7 - "@helium/helium-entity-manager-sdk": ^0.8.7 - "@helium/helium-sub-daos-sdk": ^0.8.7 - "@helium/idls": ^0.8.7 - "@helium/lazy-distributor-sdk": ^0.8.7 - "@helium/mobile-entity-manager-sdk": ^0.8.7 - "@helium/no-emit-sdk": ^0.8.7 + "@helium/account-fetch-cache": ^0.9.2 + "@helium/distributor-oracle": ^0.9.2 + "@helium/fanout-sdk": ^0.9.2 + "@helium/helium-entity-manager-sdk": ^0.9.2 + "@helium/helium-sub-daos-sdk": ^0.9.2 + "@helium/idls": ^0.9.2 + "@helium/lazy-distributor-sdk": ^0.9.2 + "@helium/mobile-entity-manager-sdk": ^0.9.2 + "@helium/no-emit-sdk": ^0.9.2 "@helium/organization-sdk": ^0.0.8 - "@helium/price-oracle-sdk": ^0.8.7 + "@helium/price-oracle-sdk": ^0.9.2 "@helium/proposal-sdk": ^0.0.8 - "@helium/rewards-oracle-sdk": ^0.8.7 - "@helium/spl-utils": ^0.8.7 - "@helium/state-controller-sdk": ^0.0.8 - "@helium/treasury-management-sdk": ^0.8.7 - "@helium/voter-stake-registry-sdk": ^0.8.7 + "@helium/rewards-oracle-sdk": ^0.9.2 + "@helium/spl-utils": ^0.9.2 + "@helium/state-controller-sdk": ^0.0.12 + "@helium/treasury-management-sdk": ^0.9.2 + "@helium/voter-stake-registry-sdk": ^0.9.2 "@solana/spl-token": ^0.3.8 "@solana/web3.js": ^1.78.8 "@types/bn.js": ^5.1.0 @@ -732,15 +731,15 @@ __metadata: languageName: unknown linkType: soft -"@helium/data-credits-sdk@^0.8.7, @helium/data-credits-sdk@workspace:packages/data-credits-sdk": +"@helium/data-credits-sdk@^0.9.2, @helium/data-credits-sdk@workspace:packages/data-credits-sdk": version: 0.0.0-use.local resolution: "@helium/data-credits-sdk@workspace:packages/data-credits-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/anchor-resolvers": ^0.8.7 - "@helium/circuit-breaker-sdk": ^0.8.7 - "@helium/helium-sub-daos-sdk": ^0.8.7 - "@helium/idls": ^0.8.7 + "@helium/anchor-resolvers": ^0.9.2 + "@helium/circuit-breaker-sdk": ^0.9.2 + "@helium/helium-sub-daos-sdk": ^0.9.2 + "@helium/idls": ^0.9.2 "@types/crypto-js": ^4.1.1 bn.js: ^5.2.0 bs58: ^4.0.1 @@ -752,20 +751,20 @@ __metadata: languageName: unknown linkType: soft -"@helium/distributor-oracle@^0.8.7, @helium/distributor-oracle@workspace:packages/distributor-oracle": +"@helium/distributor-oracle@^0.9.2, @helium/distributor-oracle@workspace:packages/distributor-oracle": version: 0.0.0-use.local resolution: "@helium/distributor-oracle@workspace:packages/distributor-oracle" dependencies: "@coral-xyz/anchor": ^0.28.0 "@fastify/cors": ^8.1.1 - "@helium/account-fetch-cache": ^0.8.7 + "@helium/account-fetch-cache": ^0.9.2 "@helium/address": ^4.10.2 - "@helium/helium-entity-manager-sdk": ^0.8.7 - "@helium/helium-sub-daos-sdk": ^0.8.7 - "@helium/idls": ^0.8.7 - "@helium/lazy-distributor-sdk": ^0.8.7 - "@helium/rewards-oracle-sdk": ^0.8.7 - "@helium/spl-utils": ^0.8.7 + "@helium/helium-entity-manager-sdk": ^0.9.2 + "@helium/helium-sub-daos-sdk": ^0.9.2 + "@helium/idls": ^0.9.2 + "@helium/lazy-distributor-sdk": ^0.9.2 + "@helium/rewards-oracle-sdk": ^0.9.2 + "@helium/spl-utils": ^0.9.2 "@metaplex-foundation/mpl-bubblegum": ^0.7.0 "@solana/spl-token": ^0.3.8 "@types/bs58": ^4.0.1 @@ -798,9 +797,9 @@ __metadata: resolution: "@helium/entity-invalidator@workspace:packages/entity-invalidator" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/account-fetch-cache": ^0.8.7 - "@helium/helium-entity-manager-sdk": ^0.8.7 - "@helium/spl-utils": ^0.8.7 + "@helium/account-fetch-cache": ^0.9.2 + "@helium/helium-entity-manager-sdk": ^0.9.2 + "@helium/spl-utils": ^0.9.2 "@solana/web3.js": ^1.78.8 "@types/bn.js": ^5.1.1 "@types/deep-equal": ^1.0.1 @@ -830,10 +829,10 @@ __metadata: dependencies: "@coral-xyz/anchor": ^0.28.0 "@fastify/cors": ^8.1.1 - "@helium/account-fetch-cache": ^0.8.7 + "@helium/account-fetch-cache": ^0.9.2 "@helium/address": ^4.10.2 - "@helium/fanout-sdk": ^0.8.7 - "@helium/spl-utils": ^0.8.7 + "@helium/fanout-sdk": ^0.9.2 + "@helium/spl-utils": ^0.9.2 "@metaplex-foundation/mpl-token-metadata": ^2.10.0 "@solana/spl-account-compression": ^0.1.7 "@solana/spl-token": ^0.3.8 @@ -851,13 +850,13 @@ __metadata: languageName: unknown linkType: soft -"@helium/fanout-sdk@^0.8.7, @helium/fanout-sdk@workspace:packages/fanout-sdk": +"@helium/fanout-sdk@^0.9.2, @helium/fanout-sdk@workspace:packages/fanout-sdk": version: 0.0.0-use.local resolution: "@helium/fanout-sdk@workspace:packages/fanout-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/anchor-resolvers": ^0.8.7 - "@helium/idls": ^0.8.7 + "@helium/anchor-resolvers": ^0.9.2 + "@helium/idls": ^0.9.2 bn.js: ^5.2.0 bs58: ^4.0.1 git-format-staged: ^2.1.3 @@ -873,8 +872,8 @@ __metadata: dependencies: "@coral-xyz/anchor": ^0.28.0 "@fastify/cors": ^8.1.1 - "@helium/idls": ^0.8.7 - "@helium/spl-utils": ^0.8.7 + "@helium/idls": ^0.9.2 + "@helium/spl-utils": ^0.9.2 "@metaplex-foundation/mpl-token-metadata": ^2.10.0 "@solana/spl-token": ^0.3.8 "@solana/web3.js": ^1.78.8 @@ -900,18 +899,20 @@ __metadata: dependencies: "@coral-xyz/anchor": ^0.28.0 "@helium/address": ^4.10.2 - "@helium/circuit-breaker-sdk": ^0.8.7 + "@helium/circuit-breaker-sdk": ^0.9.2 "@helium/crypto": ^4.10.2 - "@helium/data-credits-sdk": ^0.8.7 - "@helium/distributor-oracle": ^0.8.7 - "@helium/fanout-sdk": ^0.8.7 - "@helium/helium-entity-manager-sdk": ^0.8.7 - "@helium/helium-sub-daos-sdk": ^0.8.7 - "@helium/lazy-distributor-sdk": ^0.8.7 - "@helium/mobile-entity-manager-sdk": ^0.8.7 - "@helium/price-oracle-sdk": ^0.8.7 - "@helium/spl-utils": ^0.8.7 - "@helium/treasury-management-sdk": ^0.8.7 + "@helium/data-credits-sdk": ^0.9.2 + "@helium/distributor-oracle": ^0.9.2 + "@helium/fanout-sdk": ^0.9.2 + "@helium/helium-entity-manager-sdk": ^0.9.2 + "@helium/helium-sub-daos-sdk": ^0.9.2 + "@helium/iot-routing-manager-sdk": ^0.9.2 + "@helium/lazy-distributor-sdk": ^0.9.2 + "@helium/mobile-entity-manager-sdk": ^0.9.2 + "@helium/nft-proxy-sdk": ^0.0.12 + "@helium/price-oracle-sdk": ^0.9.2 + "@helium/spl-utils": ^0.9.2 + "@helium/treasury-management-sdk": ^0.9.2 "@solana/spl-account-compression": ^0.1.7 "@solana/spl-governance": ^0.3.18 "@solana/spl-token": ^0.3.8 @@ -931,17 +932,17 @@ __metadata: languageName: unknown linkType: soft -"@helium/helium-entity-manager-sdk@^0.8.7, @helium/helium-entity-manager-sdk@workspace:packages/helium-entity-manager-sdk": +"@helium/helium-entity-manager-sdk@^0.9.2, @helium/helium-entity-manager-sdk@workspace:packages/helium-entity-manager-sdk": version: 0.0.0-use.local resolution: "@helium/helium-entity-manager-sdk@workspace:packages/helium-entity-manager-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 "@helium/address": ^4.10.2 - "@helium/anchor-resolvers": ^0.8.7 - "@helium/helium-sub-daos-sdk": ^0.8.7 - "@helium/idls": ^0.8.7 - "@helium/no-emit-sdk": ^0.8.7 - "@helium/spl-utils": ^0.8.7 + "@helium/anchor-resolvers": ^0.9.2 + "@helium/helium-sub-daos-sdk": ^0.9.2 + "@helium/idls": ^0.9.2 + "@helium/no-emit-sdk": ^0.9.2 + "@helium/spl-utils": ^0.9.2 "@types/crypto-js": ^4.1.1 bn.js: ^5.2.0 bs58: ^4.0.1 @@ -954,13 +955,13 @@ __metadata: languageName: unknown linkType: soft -"@helium/helium-react-hooks@^0.8.7, @helium/helium-react-hooks@workspace:packages/helium-react-hooks": +"@helium/helium-react-hooks@^0.9.2, @helium/helium-react-hooks@workspace:packages/helium-react-hooks": version: 0.0.0-use.local resolution: "@helium/helium-react-hooks@workspace:packages/helium-react-hooks" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/account-fetch-cache": ^0.8.7 - "@helium/account-fetch-cache-hooks": ^0.8.7 + "@helium/account-fetch-cache": ^0.9.2 + "@helium/account-fetch-cache-hooks": ^0.9.2 "@solana/spl-token": ^0.3.8 "@solana/wallet-adapter-react": ^0.15.32 "@solana/web3.js": ^1.78.8 @@ -997,15 +998,15 @@ __metadata: languageName: node linkType: hard -"@helium/helium-sub-daos-sdk@^0.8.7, @helium/helium-sub-daos-sdk@workspace:packages/helium-sub-daos-sdk": +"@helium/helium-sub-daos-sdk@^0.9.2, @helium/helium-sub-daos-sdk@workspace:packages/helium-sub-daos-sdk": version: 0.0.0-use.local resolution: "@helium/helium-sub-daos-sdk@workspace:packages/helium-sub-daos-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/anchor-resolvers": ^0.8.7 - "@helium/circuit-breaker-sdk": ^0.8.7 - "@helium/treasury-management-sdk": ^0.8.7 - "@helium/voter-stake-registry-sdk": ^0.8.7 + "@helium/anchor-resolvers": ^0.9.2 + "@helium/circuit-breaker-sdk": ^0.9.2 + "@helium/treasury-management-sdk": ^0.9.2 + "@helium/voter-stake-registry-sdk": ^0.9.2 bn.js: ^5.2.0 bs58: ^4.0.1 git-format-staged: ^2.1.3 @@ -1015,14 +1016,41 @@ __metadata: languageName: unknown linkType: soft +"@helium/helium-vote-service@workspace:packages/helium-vote-service": + version: 0.0.0-use.local + resolution: "@helium/helium-vote-service@workspace:packages/helium-vote-service" + dependencies: + "@fastify/cors": ^8.1.1 + "@fastify/static": ^6 + "@helium/organization-sdk": ^0.0.5 + "@helium/spl-utils": ^0.9.2 + "@helium/voter-stake-registry-sdk": ^0.9.2 + "@solana/web3.js": ^1.78.8 + "@types/bn.js": ^5.1.1 + "@types/lodash": ^4.17.6 + "@types/pg": ^8.11.6 + aws-sdk: ^2.1650.0 + dotenv: ^16.0.3 + fastify: ^4.13.0 + git-format-staged: ^2.1.3 + pg: ^8.12.0 + sequelize: ^6.28.0 + simple-git: ^3.21.0 + ts-loader: ^9.2.3 + ts-node: ^10.9.1 + ts-node-dev: ^2.0.0 + typescript: ^5.2.2 + languageName: unknown + linkType: soft + "@helium/hexboosting-sdk@workspace:packages/hexboosting-sdk": version: 0.0.0-use.local resolution: "@helium/hexboosting-sdk@workspace:packages/hexboosting-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/anchor-resolvers": ^0.8.7 - "@helium/helium-sub-daos-sdk": ^0.8.7 - "@helium/idls": ^0.8.7 + "@helium/anchor-resolvers": ^0.9.2 + "@helium/helium-sub-daos-sdk": ^0.9.2 + "@helium/idls": ^0.9.2 bn.js: ^5.2.0 bs58: ^4.0.1 git-format-staged: ^2.1.3 @@ -1037,16 +1065,16 @@ __metadata: resolution: "@helium/hotspot-utils@workspace:packages/hotspot-utils" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/helium-entity-manager-sdk": ^0.8.7 - "@helium/helium-sub-daos-sdk": ^0.8.7 - "@helium/idls": ^0.8.7 - "@helium/spl-utils": ^0.8.7 + "@helium/helium-entity-manager-sdk": ^0.9.2 + "@helium/helium-sub-daos-sdk": ^0.9.2 + "@helium/idls": ^0.9.2 + "@helium/spl-utils": ^0.9.2 "@solana/web3.js": ^1.78.8 bs58: ^4.0.1 languageName: unknown linkType: soft -"@helium/idls@^0.8.7, @helium/idls@workspace:packages/idls": +"@helium/idls@^0.9.2, @helium/idls@workspace:packages/idls": version: 0.0.0-use.local resolution: "@helium/idls@workspace:packages/idls" dependencies: @@ -1073,13 +1101,13 @@ __metadata: languageName: node linkType: hard -"@helium/iot-routing-manager-sdk@workspace:packages/iot-routing-manager-sdk": +"@helium/iot-routing-manager-sdk@^0.9.2, @helium/iot-routing-manager-sdk@workspace:packages/iot-routing-manager-sdk": version: 0.0.0-use.local resolution: "@helium/iot-routing-manager-sdk@workspace:packages/iot-routing-manager-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/anchor-resolvers": ^0.8.7 - "@helium/helium-entity-manager-sdk": ^0.8.7 + "@helium/anchor-resolvers": ^0.9.2 + "@helium/helium-entity-manager-sdk": ^0.9.2 bn.js: ^5.2.0 bs58: ^4.0.1 git-format-staged: ^2.1.3 @@ -1089,13 +1117,13 @@ __metadata: languageName: unknown linkType: soft -"@helium/lazy-distributor-sdk@^0.8.7, @helium/lazy-distributor-sdk@workspace:packages/lazy-distributor-sdk": +"@helium/lazy-distributor-sdk@^0.9.2, @helium/lazy-distributor-sdk@workspace:packages/lazy-distributor-sdk": version: 0.0.0-use.local resolution: "@helium/lazy-distributor-sdk@workspace:packages/lazy-distributor-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/anchor-resolvers": ^0.8.7 - "@helium/circuit-breaker-sdk": ^0.8.7 + "@helium/anchor-resolvers": ^0.9.2 + "@helium/circuit-breaker-sdk": ^0.9.2 bn.js: ^5.2.0 bs58: ^4.0.1 git-format-staged: ^2.1.3 @@ -1105,13 +1133,13 @@ __metadata: languageName: unknown linkType: soft -"@helium/lazy-transactions-sdk@^0.8.7, @helium/lazy-transactions-sdk@workspace:packages/lazy-transactions-sdk": +"@helium/lazy-transactions-sdk@^0.9.2, @helium/lazy-transactions-sdk@workspace:packages/lazy-transactions-sdk": version: 0.0.0-use.local resolution: "@helium/lazy-transactions-sdk@workspace:packages/lazy-transactions-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/idls": ^0.8.7 - "@helium/spl-utils": ^0.8.7 + "@helium/idls": ^0.9.2 + "@helium/spl-utils": ^0.9.2 bn.js: ^5.2.0 bs58: ^4.0.1 git-format-staged: ^2.1.3 @@ -1130,13 +1158,13 @@ __metadata: "@coral-xyz/anchor": ^0.28.0 "@fastify/cors": ^8.1.1 "@grpc/grpc-js": ^1.10.1 - "@helium/account-fetch-cache": ^0.8.7 + "@helium/account-fetch-cache": ^0.9.2 "@helium/address": ^4.10.2 - "@helium/data-credits-sdk": ^0.8.7 - "@helium/helium-entity-manager-sdk": ^0.8.7 - "@helium/helium-sub-daos-sdk": ^0.8.7 - "@helium/idls": ^0.8.7 - "@helium/spl-utils": ^0.8.7 + "@helium/data-credits-sdk": ^0.9.2 + "@helium/helium-entity-manager-sdk": ^0.9.2 + "@helium/helium-sub-daos-sdk": ^0.9.2 + "@helium/idls": ^0.9.2 + "@helium/spl-utils": ^0.9.2 "@metaplex-foundation/mpl-token-metadata": ^2.10.0 "@solana/spl-token": ^0.3.8 "@solana/web3.js": ^1.78.8 @@ -1170,18 +1198,18 @@ __metadata: "@clockwork-xyz/sdk": ^0.3.0 "@coral-xyz/anchor": ^0.28.0 "@fastify/cors": ^8.1.1 - "@helium/account-fetch-cache": ^0.8.7 + "@helium/account-fetch-cache": ^0.9.2 "@helium/address": ^4.10.2 - "@helium/circuit-breaker-sdk": ^0.8.7 + "@helium/circuit-breaker-sdk": ^0.9.2 "@helium/crypto": ^4.10.2 - "@helium/data-credits-sdk": ^0.8.7 - "@helium/distributor-oracle": ^0.8.7 - "@helium/helium-entity-manager-sdk": ^0.8.7 - "@helium/helium-sub-daos-sdk": ^0.8.7 - "@helium/lazy-distributor-sdk": ^0.8.7 - "@helium/lazy-transactions-sdk": ^0.8.7 - "@helium/treasury-management-sdk": ^0.8.7 - "@helium/voter-stake-registry-sdk": ^0.8.7 + "@helium/data-credits-sdk": ^0.9.2 + "@helium/distributor-oracle": ^0.9.2 + "@helium/helium-entity-manager-sdk": ^0.9.2 + "@helium/helium-sub-daos-sdk": ^0.9.2 + "@helium/lazy-distributor-sdk": ^0.9.2 + "@helium/lazy-transactions-sdk": ^0.9.2 + "@helium/treasury-management-sdk": ^0.9.2 + "@helium/voter-stake-registry-sdk": ^0.9.2 "@metaplex-foundation/mpl-token-metadata": ^2.10.0 "@project-serum/borsh": ^0.2.5 "@solana/buffer-layout": ^4.0.0 @@ -1211,14 +1239,14 @@ __metadata: languageName: unknown linkType: soft -"@helium/mobile-entity-manager-sdk@^0.8.7, @helium/mobile-entity-manager-sdk@workspace:packages/mobile-entity-manager-sdk": +"@helium/mobile-entity-manager-sdk@^0.9.2, @helium/mobile-entity-manager-sdk@workspace:packages/mobile-entity-manager-sdk": version: 0.0.0-use.local resolution: "@helium/mobile-entity-manager-sdk@workspace:packages/mobile-entity-manager-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/anchor-resolvers": ^0.8.7 - "@helium/helium-entity-manager-sdk": ^0.8.7 - "@helium/idls": ^0.8.7 + "@helium/anchor-resolvers": ^0.9.2 + "@helium/helium-entity-manager-sdk": ^0.9.2 + "@helium/idls": ^0.9.2 "@types/crypto-js": ^4.1.1 bn.js: ^5.2.0 bs58: ^4.0.1 @@ -1247,13 +1275,33 @@ __metadata: languageName: node linkType: hard -"@helium/modular-governance-idls@npm:^0.0.2": - version: 0.0.2 - resolution: "@helium/modular-governance-idls@npm:0.0.2" +"@helium/modular-governance-idls@npm:^0.0.10": + version: 0.0.10 + resolution: "@helium/modular-governance-idls@npm:0.0.10" dependencies: - "@coral-xyz/anchor": "npm:^0.27.0" - "@solana/web3.js": "npm:^1.43.4" - checksum: 2ad5ab42d9a3144f7f80c8b0d04606de4ec117a477d0a48677ada302b204c93f88cab84b708e5944e84734e838c0e009252a82068fdc4ab17d5af88daa12c93f + "@coral-xyz/anchor": ^0.28.0 + "@solana/web3.js": ^1.78.4 + checksum: 300a5a3085747f7de769ae4ca73620d3aa3902ef4d35ffc1157cff3162ab712410161917ec3e1641bcd128b2657ce22f21b81ae73eecc754f363459791ddd6a7 + languageName: node + linkType: hard + +"@helium/modular-governance-idls@npm:^0.0.12": + version: 0.0.12 + resolution: "@helium/modular-governance-idls@npm:0.0.12" + dependencies: + "@coral-xyz/anchor": ^0.28.0 + "@solana/web3.js": ^1.78.4 + checksum: 606c888d1f1af24aeae2b3f011ee2db19f17ce78b3bf37fe6bebaccc3e8e040b4e365d3fa32d4a4e42d181efdc35dc53dc0bf701b5b85065cab167e307c7f035 + languageName: node + linkType: hard + +"@helium/modular-governance-idls@npm:^0.0.5": + version: 0.0.5 + resolution: "@helium/modular-governance-idls@npm:0.0.5" + dependencies: + "@coral-xyz/anchor": ^0.28.0 + "@solana/web3.js": ^1.43.4 + checksum: fd13b16178d67bda5720a3658e6782d7787f73299af60807822fc4e737e2f2424b68e097f642d9e944f247bfb5df9c785c6f060c156dfe89f2ce7aae8a48d411 languageName: node linkType: hard @@ -1272,16 +1320,16 @@ __metadata: resolution: "@helium/monitor-service@workspace:packages/monitor-service" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/account-fetch-cache": ^0.8.7 - "@helium/circuit-breaker-sdk": ^0.8.7 - "@helium/data-credits-sdk": ^0.8.7 - "@helium/helium-entity-manager-sdk": ^0.8.7 - "@helium/helium-sub-daos-sdk": ^0.8.7 - "@helium/idls": ^0.8.7 - "@helium/lazy-distributor-sdk": ^0.8.7 - "@helium/lazy-transactions-sdk": ^0.8.7 - "@helium/price-oracle-sdk": ^0.8.7 - "@helium/spl-utils": ^0.8.7 + "@helium/account-fetch-cache": ^0.9.2 + "@helium/circuit-breaker-sdk": ^0.9.2 + "@helium/data-credits-sdk": ^0.9.2 + "@helium/helium-entity-manager-sdk": ^0.9.2 + "@helium/helium-sub-daos-sdk": ^0.9.2 + "@helium/idls": ^0.9.2 + "@helium/lazy-distributor-sdk": ^0.9.2 + "@helium/lazy-transactions-sdk": ^0.9.2 + "@helium/price-oracle-sdk": ^0.9.2 + "@helium/spl-utils": ^0.9.2 "@metaplex-foundation/mpl-bubblegum": ^0.7.0 "@metaplex-foundation/mpl-token-metadata": ^2.10.0 "@solana/spl-account-compression": ^0.1.7 @@ -1308,7 +1356,19 @@ __metadata: languageName: unknown linkType: soft -"@helium/no-emit-sdk@^0.8.7, @helium/no-emit-sdk@workspace:packages/no-emit-sdk": +"@helium/nft-proxy-sdk@npm:^0.0.12": + version: 0.0.12 + resolution: "@helium/nft-proxy-sdk@npm:0.0.12" + dependencies: + "@coral-xyz/anchor": ^0.28.0 + "@helium/anchor-resolvers": ^0.2.17 + "@helium/modular-governance-idls": ^0.0.10 + "@solana/spl-token": ^0.3.8 + checksum: e70478c9ed007a1044ff7c76d0e0fdaf1163b489772893b8f4b52dd9d69d194aee71bc63a181a81c766dc459474cdbf3403035cc1f43e2741e89c139e3881b8b + languageName: node + linkType: hard + +"@helium/no-emit-sdk@^0.9.2, @helium/no-emit-sdk@workspace:packages/no-emit-sdk": version: 0.0.0-use.local resolution: "@helium/no-emit-sdk@workspace:packages/no-emit-sdk" dependencies: @@ -1324,6 +1384,18 @@ __metadata: languageName: unknown linkType: soft +"@helium/organization-sdk@npm:^0.0.5": + version: 0.0.5 + resolution: "@helium/organization-sdk@npm:0.0.5" + dependencies: + "@coral-xyz/anchor": ^0.28.0 + "@helium/anchor-resolvers": ^0.2.17 + "@helium/modular-governance-idls": ^0.0.5 + "@helium/proposal-sdk": ^0.0.5 + checksum: 6ee2034f142d45828db65085ce4a88d0f1bd795492695b6af7530ac021bfc7df469ae66641b0673fde17826cc9f54e2bcd0e9b65f573ec7a0ea21e14045dc6cf + languageName: node + linkType: hard + "@helium/organization-sdk@npm:^0.0.8": version: 0.0.8 resolution: "@helium/organization-sdk@npm:0.0.8" @@ -1336,12 +1408,12 @@ __metadata: languageName: node linkType: hard -"@helium/price-oracle-sdk@^0.8.7, @helium/price-oracle-sdk@workspace:packages/price-oracle-sdk": +"@helium/price-oracle-sdk@^0.9.2, @helium/price-oracle-sdk@workspace:packages/price-oracle-sdk": version: 0.0.0-use.local resolution: "@helium/price-oracle-sdk@workspace:packages/price-oracle-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/idls": ^0.8.7 + "@helium/idls": ^0.9.2 bn.js: ^5.2.0 bs58: ^4.0.1 git-format-staged: ^2.1.3 @@ -1351,14 +1423,25 @@ __metadata: languageName: unknown linkType: soft -"@helium/proposal-sdk@npm:^0.0.2": - version: 0.0.2 - resolution: "@helium/proposal-sdk@npm:0.0.2" +"@helium/proposal-sdk@npm:^0.0.12": + version: 0.0.12 + resolution: "@helium/proposal-sdk@npm:0.0.12" + dependencies: + "@coral-xyz/anchor": ^0.28.0 + "@helium/anchor-resolvers": ^0.5.0 + "@helium/modular-governance-idls": ^0.0.12 + checksum: ed4839652d2ffdef73b39436eb26b51e0b0f85032cdfffd7cbb10a7ca158c5ef642f1c9d13b91852fdbd5f8213563d2970299eaabeff770a2ec2f4f57d3625be + languageName: node + linkType: hard + +"@helium/proposal-sdk@npm:^0.0.5": + version: 0.0.5 + resolution: "@helium/proposal-sdk@npm:0.0.5" dependencies: - "@coral-xyz/anchor": "npm:^0.27.0" - "@helium/anchor-resolvers": "npm:^0.2.5" - "@helium/modular-governance-idls": "npm:^0.0.2" - checksum: 444afea92f1e6a982de10a3ef98dd8aa63324815c432124a76bc88971b48cc7bb39f1086102602e524713a4da35fce4820a7843f807479d1f634bc592d1a67d3 + "@coral-xyz/anchor": ^0.28.0 + "@helium/anchor-resolvers": ^0.2.17 + "@helium/modular-governance-idls": ^0.0.5 + checksum: c774de53273fd51f64d683f0f9d9449d4716bebf3b29178f557c999fd290d632932ede281e85834c34c2496bef0e4b7f732f9f177840f93b464e89e5f48512bb languageName: node linkType: hard @@ -1402,13 +1485,13 @@ __metadata: languageName: unknown linkType: soft -"@helium/rewards-oracle-sdk@^0.8.7, @helium/rewards-oracle-sdk@workspace:packages/rewards-oracle-sdk": +"@helium/rewards-oracle-sdk@^0.9.2, @helium/rewards-oracle-sdk@workspace:packages/rewards-oracle-sdk": version: 0.0.0-use.local resolution: "@helium/rewards-oracle-sdk@workspace:packages/rewards-oracle-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/anchor-resolvers": ^0.8.7 - "@helium/idls": ^0.8.7 + "@helium/anchor-resolvers": ^0.9.2 + "@helium/idls": ^0.9.2 bn.js: ^5.2.0 bs58: ^4.0.1 git-format-staged: ^2.1.3 @@ -1418,14 +1501,14 @@ __metadata: languageName: unknown linkType: soft -"@helium/spl-utils@^0.8.7, @helium/spl-utils@workspace:packages/spl-utils": +"@helium/spl-utils@^0.9.2, @helium/spl-utils@workspace:packages/spl-utils": version: 0.0.0-use.local resolution: "@helium/spl-utils@workspace:packages/spl-utils" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/account-fetch-cache": ^0.8.7 + "@helium/account-fetch-cache": ^0.9.2 "@helium/address": ^4.10.2 - "@helium/anchor-resolvers": ^0.8.7 + "@helium/anchor-resolvers": ^0.9.2 "@metaplex-foundation/mpl-token-metadata": ^2.10.0 "@solana/spl-account-compression": ^0.1.7 "@solana/spl-token": ^0.3.8 @@ -1440,14 +1523,14 @@ __metadata: languageName: unknown linkType: soft -"@helium/state-controller-sdk@npm:^0.0.8": - version: 0.0.8 - resolution: "@helium/state-controller-sdk@npm:0.0.8" +"@helium/state-controller-sdk@npm:^0.0.12": + version: 0.0.12 + resolution: "@helium/state-controller-sdk@npm:0.0.12" dependencies: "@coral-xyz/anchor": ^0.28.0 "@helium/anchor-resolvers": ^0.5.0 - "@helium/modular-governance-idls": ^0.0.8 - checksum: 64ff3e83d47512431bdb15d9bda92225455b00099574d3ac4d523696e21ea1a08430d8c75d47390121920c67eacbde4ec91b02c4a36f2e8be038c36aac2b4c08 + "@helium/modular-governance-idls": ^0.0.12 + checksum: 729e0888523d9fb432100e869e56f7626b53d83b7543c1786049686d0d62ad582015ab7f29fbfd108f8b6ae8175e5fef831323c0714d5a55b339756fff9e3419 languageName: node linkType: hard @@ -1474,9 +1557,9 @@ __metadata: dependencies: "@coral-xyz/anchor": ^0.28.0 "@fastify/cors": ^8.1.1 - "@helium/account-fetch-cache": ^0.8.7 + "@helium/account-fetch-cache": ^0.9.2 "@helium/address": ^4.10.2 - "@helium/spl-utils": ^0.8.7 + "@helium/spl-utils": ^0.9.2 "@jup-ag/api": ^6.0.6 "@solana/spl-token": ^0.3.8 "@solana/web3.js": ^1.78.8 @@ -1506,14 +1589,14 @@ __metadata: languageName: node linkType: hard -"@helium/treasury-management-sdk@^0.8.7, @helium/treasury-management-sdk@workspace:packages/treasury-management-sdk": +"@helium/treasury-management-sdk@^0.9.2, @helium/treasury-management-sdk@workspace:packages/treasury-management-sdk": version: 0.0.0-use.local resolution: "@helium/treasury-management-sdk@workspace:packages/treasury-management-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/anchor-resolvers": ^0.8.7 - "@helium/circuit-breaker-sdk": ^0.8.7 - "@helium/idls": ^0.8.7 + "@helium/anchor-resolvers": ^0.9.2 + "@helium/circuit-breaker-sdk": ^0.9.2 + "@helium/idls": ^0.9.2 bn.js: ^5.2.0 bs58: ^4.0.1 git-format-staged: ^2.1.3 @@ -1528,17 +1611,19 @@ __metadata: resolution: "@helium/voter-stake-registry-hooks@workspace:packages/voter-stake-registry-hooks" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/account-fetch-cache": ^0.8.7 - "@helium/account-fetch-cache-hooks": ^0.8.7 - "@helium/circuit-breaker-sdk": ^0.8.7 - "@helium/helium-react-hooks": ^0.8.7 - "@helium/helium-sub-daos-sdk": ^0.8.7 + "@helium/account-fetch-cache": ^0.9.2 + "@helium/account-fetch-cache-hooks": ^0.9.2 + "@helium/circuit-breaker-sdk": ^0.9.2 + "@helium/helium-react-hooks": ^0.9.2 + "@helium/helium-sub-daos-sdk": ^0.9.2 "@helium/modular-governance-hooks": ^0.0.8 - "@helium/spl-utils": ^0.8.7 - "@helium/voter-stake-registry-sdk": ^0.8.7 + "@helium/modular-governance-idls": ^0.0.12 + "@helium/spl-utils": ^0.9.2 + "@helium/voter-stake-registry-sdk": ^0.9.2 "@solana/wallet-adapter-base": ^0.9.22 "@solana/wallet-adapter-react": ^0.15.32 "@solana/web3.js": ^1.78.8 + "@tanstack/react-query": ^5.45.0 axios: ^1.3.6 bs58: ^4.0.1 git-format-staged: ^2.1.3 @@ -1551,13 +1636,15 @@ __metadata: languageName: unknown linkType: soft -"@helium/voter-stake-registry-sdk@^0.8.7, @helium/voter-stake-registry-sdk@workspace:packages/voter-stake-registry-sdk": +"@helium/voter-stake-registry-sdk@^0.9.2, @helium/voter-stake-registry-sdk@workspace:packages/voter-stake-registry-sdk": version: 0.0.0-use.local resolution: "@helium/voter-stake-registry-sdk@workspace:packages/voter-stake-registry-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/anchor-resolvers": ^0.8.7 - "@helium/idls": ^0.8.7 + "@helium/anchor-resolvers": ^0.9.2 + "@helium/idls": ^0.9.2 + "@helium/nft-proxy-sdk": ^0.0.12 + "@helium/spl-utils": ^0.9.2 "@metaplex-foundation/mpl-token-metadata": ^2.10.0 "@solana/spl-token": ^0.3.8 bn.js: ^5.2.0 @@ -1575,10 +1662,10 @@ __metadata: dependencies: "@coral-xyz/anchor": ^0.28.0 "@fastify/cors": ^8.1.1 - "@helium/account-fetch-cache": ^0.8.7 + "@helium/account-fetch-cache": ^0.9.2 "@helium/address": ^4.10.2 - "@helium/spl-utils": ^0.8.7 - "@helium/voter-stake-registry-sdk": ^0.8.7 + "@helium/spl-utils": ^0.9.2 + "@helium/voter-stake-registry-sdk": ^0.9.2 "@metaplex-foundation/mpl-token-metadata": ^2.10.0 "@solana/spl-account-compression": ^0.1.7 "@solana/spl-token": ^0.3.8 @@ -1722,6 +1809,22 @@ __metadata: languageName: node linkType: hard +"@kwsites/file-exists@npm:^1.1.1": + version: 1.1.1 + resolution: "@kwsites/file-exists@npm:1.1.1" + dependencies: + debug: ^4.1.1 + checksum: 4ff945de7293285133aeae759caddc71e73c4a44a12fac710fdd4f574cce2671a3f89d8165fdb03d383cfc97f3f96f677d8de3c95133da3d0e12a123a23109fe + languageName: node + linkType: hard + +"@kwsites/promise-deferred@npm:^1.1.1": + version: 1.1.1 + resolution: "@kwsites/promise-deferred@npm:1.1.1" + checksum: 07455477a0123d9a38afb503739eeff2c5424afa8d3dbdcc7f9502f13604488a4b1d9742fc7288832a52a6422cf1e1c0a1d51f69a39052f14d27c9a0420b6629 + languageName: node + linkType: hard + "@lerna/add@npm:5.6.2": version: 5.6.2 resolution: "@lerna/add@npm:5.6.2" @@ -2526,6 +2629,13 @@ __metadata: languageName: node linkType: hard +"@lukeed/ms@npm:^2.0.1": + version: 2.0.2 + resolution: "@lukeed/ms@npm:2.0.2" + checksum: 6ae47ed3ebc857ffc0283cfe46129947209c770d0974eb86626138b6c194a760d08863ec593ec75a645aec133b3237b37af500739b030293e4d9a81130f4e2ae + languageName: node + linkType: hard + "@mapbox/node-pre-gyp@npm:^1.0.5": version: 1.0.11 resolution: "@mapbox/node-pre-gyp@npm:1.0.11" @@ -3737,6 +3847,24 @@ __metadata: languageName: node linkType: hard +"@tanstack/query-core@npm:5.52.0": + version: 5.52.0 + resolution: "@tanstack/query-core@npm:5.52.0" + checksum: 1e142995fa9b0eec88009dd1083cd226eaec9125dc668b6485699639f45edb1386e4acd634e0eddc33d3a29e0c9636302824c42ac8c4106935d776fdc41d2638 + languageName: node + linkType: hard + +"@tanstack/react-query@npm:^5.45.0": + version: 5.52.1 + resolution: "@tanstack/react-query@npm:5.52.1" + dependencies: + "@tanstack/query-core": 5.52.0 + peerDependencies: + react: ^18 || ^19 + checksum: f46bf1f85cc03b8329aee5d8a5a96b4e30dc88aff04d5256ebd0efefe1f507720b42a4be4a9bee340d3ade6cf0ae7b59187de90d87ea973c0f67e3764f76260c + languageName: node + linkType: hard + "@tanstack/react-virtual@npm:^3.0.0-beta.60": version: 3.2.0 resolution: "@tanstack/react-virtual@npm:3.2.0" @@ -3996,6 +4124,13 @@ __metadata: languageName: node linkType: hard +"@types/lodash@npm:^4.17.6": + version: 4.17.7 + resolution: "@types/lodash@npm:4.17.7" + checksum: 09e58a119cd8a70acfb33f8623dc2fc54f74cdce3b3429b879fc2daac4807fe376190a04b9e024dd300f9a3ee1876d6623979cefe619f70654ca0fe0c47679a7 + languageName: node + linkType: hard + "@types/long@npm:^4.0.1": version: 4.0.2 resolution: "@types/long@npm:4.0.2" @@ -4132,6 +4267,17 @@ __metadata: languageName: node linkType: hard +"@types/pg@npm:^8.11.6": + version: 8.11.6 + resolution: "@types/pg@npm:8.11.6" + dependencies: + "@types/node": "*" + pg-protocol: "*" + pg-types: ^4.0.1 + checksum: 231f7e5bfe8b4d14cca398d24cd55f4f14f582f815b62059e6f3ee74108cf92089fbd946568ebc35fa402f238ed9c8a8c1e10e7084e83e4ca3aff75957243014 + languageName: node + linkType: hard + "@types/pg@npm:^8.6.6": version: 8.10.2 resolution: "@types/pg@npm:8.10.2" @@ -5031,6 +5177,24 @@ __metadata: languageName: node linkType: hard +"aws-sdk@npm:^2.1650.0": + version: 2.1682.0 + resolution: "aws-sdk@npm:2.1682.0" + dependencies: + buffer: 4.9.2 + events: 1.1.1 + ieee754: 1.1.13 + jmespath: 0.16.0 + querystring: 0.2.0 + sax: 1.2.1 + url: 0.10.3 + util: ^0.12.4 + uuid: 8.0.0 + xml2js: 0.6.2 + checksum: ab3b60fdb635d89951787cbe81cc530247858c0ff095f983b3fd2e4357a85161931d4495ea363ce19bb71069e613b463c4f8047a8d60c69ba4f8eaea265d6bf9 + languageName: node + linkType: hard + "axe-core@npm:=4.7.0": version: 4.7.0 resolution: "axe-core@npm:4.7.0" @@ -6002,6 +6166,15 @@ __metadata: languageName: node linkType: hard +"content-disposition@npm:^0.5.3": + version: 0.5.4 + resolution: "content-disposition@npm:0.5.4" + dependencies: + safe-buffer: 5.2.1 + checksum: afb9d545e296a5171d7574fcad634b2fdf698875f4006a9dd04a3e1333880c5c0c98d47b560d01216fb6505a54a2ba6a843ee3a02ec86d7e911e8315255f56c3 + languageName: node + linkType: hard + "conventional-changelog-angular@npm:^5.0.12": version: 5.0.13 resolution: "conventional-changelog-angular@npm:5.0.13" @@ -6343,6 +6516,18 @@ __metadata: languageName: node linkType: hard +"debug@npm:^4.1.1, debug@npm:^4.3.5": + version: 4.3.6 + resolution: "debug@npm:4.3.6" + dependencies: + ms: 2.1.2 + peerDependenciesMeta: + supports-color: + optional: true + checksum: 1630b748dea3c581295e02137a9f5cbe2c1d85fea35c1e6597a65ca2b16a6fce68cec61b299d480787ef310ba927dc8c92d3061faba0ad06c6a724672f66be7f + languageName: node + linkType: hard + "debuglog@npm:^1.0.1": version: 1.0.1 resolution: "debuglog@npm:1.0.1" @@ -6508,6 +6693,13 @@ __metadata: languageName: node linkType: hard +"depd@npm:2.0.0": + version: 2.0.0 + resolution: "depd@npm:2.0.0" + checksum: abbe19c768c97ee2eed6282d8ce3031126662252c58d711f646921c9623f9052e3e1906443066beec1095832f534e57c523b7333f8e7e0d93051ab6baef5ab3a + languageName: node + linkType: hard + "deprecation@npm:^2.0.0": version: 2.3.1 resolution: "deprecation@npm:2.3.1" @@ -6974,6 +7166,13 @@ __metadata: languageName: node linkType: hard +"escape-html@npm:~1.0.3": + version: 1.0.3 + resolution: "escape-html@npm:1.0.3" + checksum: 6213ca9ae00d0ab8bccb6d8d4e0a98e76237b2410302cf7df70aaa6591d509a2a37ce8998008cbecae8fc8ffaadf3fb0229535e6a145f3ce0b211d060decbb24 + languageName: node + linkType: hard + "escape-string-regexp@npm:4.0.0, escape-string-regexp@npm:^4.0.0": version: 4.0.0 resolution: "escape-string-regexp@npm:4.0.0" @@ -8512,6 +8711,19 @@ __metadata: languageName: node linkType: hard +"http-errors@npm:2.0.0": + version: 2.0.0 + resolution: "http-errors@npm:2.0.0" + dependencies: + depd: 2.0.0 + inherits: 2.0.4 + setprototypeof: 1.2.0 + statuses: 2.0.1 + toidentifier: 1.0.1 + checksum: 9b0a3782665c52ce9dc658a0d1560bcb0214ba5699e4ea15aefb2a496e2ca83db03ebc42e1cce4ac1f413e4e0d2d736a3fd755772c556a9a06853ba2a0b7d920 + languageName: node + linkType: hard + "http-proxy-agent@npm:^5.0.0": version: 5.0.0 resolution: "http-proxy-agent@npm:5.0.0" @@ -8668,6 +8880,13 @@ __metadata: languageName: node linkType: hard +"inflection@npm:^3.0.0": + version: 3.0.0 + resolution: "inflection@npm:3.0.0" + checksum: 6a3b21cb011a9bca1c045ef92d199c927cfd8c4b97809152fabc9c325d36789a7499397b50d46157d080efd19843807ac73e38a2fe79d8f2cf291323998fb5b5 + languageName: node + linkType: hard + "inflight@npm:^1.0.4": version: 1.0.6 resolution: "inflight@npm:1.0.6" @@ -8678,7 +8897,7 @@ __metadata: languageName: node linkType: hard -"inherits@npm:2, inherits@npm:^2.0.1, inherits@npm:^2.0.3, inherits@npm:^2.0.4, inherits@npm:~2.0.3": +"inherits@npm:2, inherits@npm:2.0.4, inherits@npm:^2.0.1, inherits@npm:^2.0.3, inherits@npm:^2.0.4, inherits@npm:~2.0.3": version: 2.0.4 resolution: "inherits@npm:2.0.4" checksum: 4a48a733847879d6cf6691860a6b1e3f0f4754176e4d71494c41f3475553768b10f84b5ce1d40fbd0e34e6bfbb864ee35858ad4dd2cf31e02fc4a154b724d7f1 @@ -10169,6 +10388,15 @@ __metadata: languageName: node linkType: hard +"mime@npm:^3.0.0": + version: 3.0.0 + resolution: "mime@npm:3.0.0" + bin: + mime: cli.js + checksum: f43f9b7bfa64534e6b05bd6062961681aeb406a5b53673b53b683f27fcc4e739989941836a355eef831f4478923651ecc739f4a5f6e20a76487b432bfd4db928 + languageName: node + linkType: hard + "mimic-fn@npm:^2.1.0": version: 2.1.0 resolution: "mimic-fn@npm:2.1.0" @@ -11264,7 +11492,7 @@ __metadata: languageName: node linkType: hard -"p-limit@npm:3.1.0, p-limit@npm:^3.0.2": +"p-limit@npm:3.1.0, p-limit@npm:^3.0.2, p-limit@npm:^3.1.0": version: 3.1.0 resolution: "p-limit@npm:3.1.0" dependencies: @@ -11587,6 +11815,13 @@ __metadata: languageName: node linkType: hard +"pg-connection-string@npm:^2.6.4": + version: 2.6.4 + resolution: "pg-connection-string@npm:2.6.4" + checksum: 2c1d2ac1add1f93076f1594d217a0980f79add05dc48de6363e1c550827c78a6ee3e3b5420da9c54858f6b678cdb348aed49732ee68158b6cdb70f1d1c748cf9 + languageName: node + linkType: hard + "pg-format@npm:^1.0.4": version: 1.0.4 resolution: "pg-format@npm:1.0.4" @@ -11617,6 +11852,15 @@ __metadata: languageName: node linkType: hard +"pg-pool@npm:^3.6.2": + version: 3.6.2 + resolution: "pg-pool@npm:3.6.2" + peerDependencies: + pg: ">=8.0" + checksum: 5ceee4320a35fce08777d085d50a30a1253574257e1e7c5c56c915056d387d340f797115580c8d90a46691f83c39a9b4da1fd810d9ad168cc455c79c289116f4 + languageName: node + linkType: hard + "pg-protocol@npm:*, pg-protocol@npm:^1.6.0": version: 1.6.0 resolution: "pg-protocol@npm:1.6.0" @@ -11624,6 +11868,13 @@ __metadata: languageName: node linkType: hard +"pg-protocol@npm:^1.6.1": + version: 1.6.1 + resolution: "pg-protocol@npm:1.6.1" + checksum: cce3f72cc4bdc04db9ce3fa38b2c45b745f0a95a925847b349087f52c02c4d51b7c74d8867e40639699d0c7609accfaffb6b1d221b3268d2bdc4bb8d6a2995a3 + languageName: node + linkType: hard + "pg-types@npm:^2.1.0": version: 2.2.0 resolution: "pg-types@npm:2.2.0" @@ -11676,6 +11927,28 @@ __metadata: languageName: node linkType: hard +"pg@npm:^8.12.0": + version: 8.12.0 + resolution: "pg@npm:8.12.0" + dependencies: + pg-cloudflare: ^1.1.1 + pg-connection-string: ^2.6.4 + pg-pool: ^3.6.2 + pg-protocol: ^1.6.1 + pg-types: ^2.1.0 + pgpass: 1.x + peerDependencies: + pg-native: ">=3.0.1" + dependenciesMeta: + pg-cloudflare: + optional: true + peerDependenciesMeta: + pg-native: + optional: true + checksum: 8450b61c787f360e22182aa853548f834f13622714868d0789a60f63743d66ae28930cdca0ef0251bfc89b04679e9074c1398f172c2937bf59b5a360337f4149 + languageName: node + linkType: hard + "pgpass@npm:1.x": version: 1.0.5 resolution: "pgpass@npm:1.0.5" @@ -12882,8 +13155,9 @@ __metadata: "@coral-xyz/anchor-cli": ^0.28.0 "@coral-xyz/borsh": ^0.2.6 "@helium/crypto": ^4.10.2 - "@helium/modular-governance-idls": ^0.0.2 - "@helium/proposal-sdk": ^0.0.2 + "@helium/modular-governance-idls": ^0.0.12 + "@helium/nft-proxy-sdk": ^0.0.12 + "@helium/proposal-sdk": ^0.0.12 "@helium/transactions": ^3.38.0 "@metaplex-foundation/mpl-bubblegum": ^0.7.0 "@pythnetwork/client": ^2.8.0 @@ -12988,7 +13262,7 @@ __metadata: languageName: node linkType: hard -"safe-buffer@npm:^5.0.1, safe-buffer@npm:^5.1.0, safe-buffer@npm:^5.1.2, safe-buffer@npm:^5.2.0, safe-buffer@npm:~5.2.0": +"safe-buffer@npm:5.2.1, safe-buffer@npm:^5.0.1, safe-buffer@npm:^5.1.0, safe-buffer@npm:^5.1.2, safe-buffer@npm:^5.2.0, safe-buffer@npm:~5.2.0": version: 5.2.1 resolution: "safe-buffer@npm:5.2.1" checksum: b99c4b41fdd67a6aaf280fcd05e9ffb0813654894223afb78a31f14a19ad220bba8aba1cb14eddce1fcfb037155fe6de4e861784eb434f7d11ed58d1e70dd491 @@ -13307,6 +13581,13 @@ __metadata: languageName: node linkType: hard +"setprototypeof@npm:1.2.0": + version: 1.2.0 + resolution: "setprototypeof@npm:1.2.0" + checksum: be18cbbf70e7d8097c97f713a2e76edf84e87299b40d085c6bf8b65314e994cc15e2e317727342fa6996e38e1f52c59720b53fe621e2eb593a6847bf0356db89 + languageName: node + linkType: hard + "sha.js@npm:^2.4.0": version: 2.4.11 resolution: "sha.js@npm:2.4.11" @@ -13466,6 +13747,17 @@ __metadata: languageName: node linkType: hard +"simple-git@npm:^3.21.0": + version: 3.25.0 + resolution: "simple-git@npm:3.25.0" + dependencies: + "@kwsites/file-exists": ^1.1.1 + "@kwsites/promise-deferred": ^1.1.1 + debug: ^4.3.5 + checksum: 0f54f03882f3b733fc5b61826935b3a6b1d2f8976fe74a488ef72d05baf1f8eb6f465867dcf72c1b7292b20843de23e900160c5c9b5d6933b3db2188cb79e1d2 + languageName: node + linkType: hard + "simple-swizzle@npm:^0.2.2": version: 0.2.2 resolution: "simple-swizzle@npm:0.2.2" @@ -13674,6 +13966,13 @@ __metadata: languageName: node linkType: hard +"statuses@npm:2.0.1": + version: 2.0.1 + resolution: "statuses@npm:2.0.1" + checksum: 18c7623fdb8f646fb213ca4051be4df7efb3484d4ab662937ca6fbef7ced9b9e12842709872eb3020cc3504b93bde88935c9f6417489627a7786f24f8031cbcb + languageName: node + linkType: hard + "stop-iteration-iterator@npm:^1.0.0": version: 1.0.0 resolution: "stop-iteration-iterator@npm:1.0.0" @@ -14211,6 +14510,13 @@ __metadata: languageName: node linkType: hard +"toidentifier@npm:1.0.1": + version: 1.0.1 + resolution: "toidentifier@npm:1.0.1" + checksum: 952c29e2a85d7123239b5cfdd889a0dde47ab0497f0913d70588f19c53f7e0b5327c95f4651e413c74b785147f9637b17410ac8c846d5d4a20a5a33eb6dc3a45 + languageName: node + linkType: hard + "toml@npm:^3.0.0": version: 3.0.0 resolution: "toml@npm:3.0.0" @@ -15237,6 +15543,16 @@ __metadata: languageName: node linkType: hard +"xml2js@npm:0.6.2": + version: 0.6.2 + resolution: "xml2js@npm:0.6.2" + dependencies: + sax: ">=0.6.0" + xmlbuilder: ~11.0.0 + checksum: 458a83806193008edff44562c0bdb982801d61ee7867ae58fd35fab781e69e17f40dfeb8fc05391a4648c9c54012066d3955fe5d993ffbe4dc63399023f32ac2 + languageName: node + linkType: hard + "xmlbuilder@npm:~11.0.0": version: 11.0.1 resolution: "xmlbuilder@npm:11.0.1" From e2513909d6caa47d26d7d9545dfbcfcf55655465 Mon Sep 17 00:00:00 2001 From: bry Date: Mon, 26 Aug 2024 11:16:55 -0500 Subject: [PATCH 06/63] clippy --- .../src/instructions/initialize_devaddr_constraint_v0.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/programs/iot-routing-manager/src/instructions/initialize_devaddr_constraint_v0.rs b/programs/iot-routing-manager/src/instructions/initialize_devaddr_constraint_v0.rs index b28351776..8cce98665 100644 --- a/programs/iot-routing-manager/src/instructions/initialize_devaddr_constraint_v0.rs +++ b/programs/iot-routing-manager/src/instructions/initialize_devaddr_constraint_v0.rs @@ -137,7 +137,7 @@ pub fn handler( routing_manager: ctx.accounts.net_id.routing_manager, net_id: ctx.accounts.net_id.key(), organization: ctx.accounts.organization.key(), - start_addr: start_addr, + start_addr, end_addr, bump_seed: ctx.bumps["devaddr_constraint"], }); From 78d749e15f93124fc8619138e228b966c9713891 Mon Sep 17 00:00:00 2001 From: bry Date: Tue, 27 Aug 2024 14:20:42 -0500 Subject: [PATCH 07/63] Add logic to approve the orgs --- packages/helium-admin-cli/src/backfill-ouis.ts | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/packages/helium-admin-cli/src/backfill-ouis.ts b/packages/helium-admin-cli/src/backfill-ouis.ts index 5ce5e79d4..a95c0e1ed 100644 --- a/packages/helium-admin-cli/src/backfill-ouis.ts +++ b/packages/helium-admin-cli/src/backfill-ouis.ts @@ -78,9 +78,6 @@ export async function run(args: any = process.argv) { describe: "Anchor wallet keypair", default: `${os.homedir()}/.config/solana/id.json`, }, - executeTransaction: { - type: "boolean", - }, url: { alias: "u", default: "http://127.0.0.1:8899", @@ -304,6 +301,21 @@ export async function run(args: any = process.argv) { computeUnitLimit: 500000, }); + const orgApprovalIxs = ( + await Promise.all( + orgs.map(async (org) => { + const [orgK] = organizationKey(routingManager, new anchor.BN(org.oui)); + return await irm.methods + .approveOrganizationV0() + .accounts({ organization: orgK }) + .instruction(); + }) + ) + ).filter(truthy); + + console.log(`Approving (${orgApprovalIxs.length}) organizations`); + await batchParallelInstructionsWithPriorityFee(provider, orgApprovalIxs); + const orgDelegateIxs = ( await Promise.all( orgDelegates.map(async (orgDelegate) => { From bfcadb7ddd9fb5a3b7a274417173e5edc8bc78e0 Mon Sep 17 00:00:00 2001 From: bry Date: Tue, 27 Aug 2024 16:27:29 -0500 Subject: [PATCH 08/63] return null in cachedIdlFetch --- .../src/utils/cachedIdlFetch.ts | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/packages/account-postgres-sink-service/src/utils/cachedIdlFetch.ts b/packages/account-postgres-sink-service/src/utils/cachedIdlFetch.ts index 003068ae3..794a2f80f 100644 --- a/packages/account-postgres-sink-service/src/utils/cachedIdlFetch.ts +++ b/packages/account-postgres-sink-service/src/utils/cachedIdlFetch.ts @@ -1,4 +1,4 @@ -import * as anchor from '@coral-xyz/anchor'; +import * as anchor from "@coral-xyz/anchor"; const cachedIdlFetch = (() => { let cache: { programId: string; idl: anchor.Idl }[] = []; @@ -22,12 +22,17 @@ const cachedIdlFetch = (() => { // move to front of cache cache.splice(0, 0, cache.splice(foundIdx, 1)[0]); } else { - idl = await anchor.Program.fetchIdl(programId, provider); + try { + idl = await anchor.Program.fetchIdl(programId, provider); - if (idl) { - cache.unshift({ programId, idl }); - // prune cache to 10 items; - cache = cache.slice(0, 10); + if (idl) { + cache.unshift({ programId, idl }); + // prune cache to 10 items; + cache = cache.slice(0, 10); + } + } catch (e) { + console.error(e); + idl = null; } } From 3269c43d7886a2646c19b252dd77393e9abe82a9 Mon Sep 17 00:00:00 2001 From: bry Date: Wed, 4 Sep 2024 17:29:54 -0500 Subject: [PATCH 09/63] add locked to organization and allow updating --- packages/helium-admin-cli/src/backfill-ouis.ts | 1 + .../src/instructions/initialize_organization_v0.rs | 1 + .../src/instructions/update_organization_v0.rs | 8 ++++++++ programs/iot-routing-manager/src/state.rs | 1 + 4 files changed, 11 insertions(+) diff --git a/packages/helium-admin-cli/src/backfill-ouis.ts b/packages/helium-admin-cli/src/backfill-ouis.ts index a95c0e1ed..2dbda6b01 100644 --- a/packages/helium-admin-cli/src/backfill-ouis.ts +++ b/packages/helium-admin-cli/src/backfill-ouis.ts @@ -285,6 +285,7 @@ export async function run(args: any = process.argv) { .initializeOrganizationV0({ oui: new anchor.BN(org.oui), escrowKeyOverride: org.payer_pubkey, + locked: org.locked, }) .accounts({ authority: ownerSolAddr, diff --git a/programs/iot-routing-manager/src/instructions/initialize_organization_v0.rs b/programs/iot-routing-manager/src/instructions/initialize_organization_v0.rs index 3cba93b3f..c89eb3054 100644 --- a/programs/iot-routing-manager/src/instructions/initialize_organization_v0.rs +++ b/programs/iot-routing-manager/src/instructions/initialize_organization_v0.rs @@ -169,6 +169,7 @@ pub fn handler( bump_seed: ctx.bumps["organization"], net_id: ctx.accounts.net_id.key(), approved: false, + locked: false, }); let uri = format!( diff --git a/programs/iot-routing-manager/src/instructions/update_organization_v0.rs b/programs/iot-routing-manager/src/instructions/update_organization_v0.rs index 65d0f1015..5f54693bd 100644 --- a/programs/iot-routing-manager/src/instructions/update_organization_v0.rs +++ b/programs/iot-routing-manager/src/instructions/update_organization_v0.rs @@ -5,6 +5,8 @@ use crate::OrganizationV0; #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)] pub struct UpdateOrganizationArgsV0 { new_authority: Option, + escrow_key: Option, + locked: Option, } #[derive(Accounts)] @@ -21,5 +23,11 @@ pub fn handler(ctx: Context, args: UpdateOrganizationArgsV if let Some(authority) = args.new_authority { ctx.accounts.organization.authority = authority; } + if let Some(escrow_key) = args.escrow_key { + ctx.accounts.organization.escrow_key = escrow_key; + } + if let Some(locked) = args.locked { + ctx.accounts.organization.locked = locked; + } Ok(()) } diff --git a/programs/iot-routing-manager/src/state.rs b/programs/iot-routing-manager/src/state.rs index 7433b6ece..659ae25c1 100644 --- a/programs/iot-routing-manager/src/state.rs +++ b/programs/iot-routing-manager/src/state.rs @@ -35,6 +35,7 @@ pub struct OrganizationV0 { pub oui: u64, pub escrow_key: String, pub approved: bool, + pub locked: bool, pub bump_seed: u8, } From 35dc305c134c30df9ee96205b19a7796353e8bee Mon Sep 17 00:00:00 2001 From: bry Date: Thu, 5 Sep 2024 10:11:31 -0500 Subject: [PATCH 10/63] tracking locked off chain --- .../src/instructions/initialize_organization_v0.rs | 1 - .../src/instructions/update_organization_v0.rs | 4 ---- programs/iot-routing-manager/src/state.rs | 1 - 3 files changed, 6 deletions(-) diff --git a/programs/iot-routing-manager/src/instructions/initialize_organization_v0.rs b/programs/iot-routing-manager/src/instructions/initialize_organization_v0.rs index c89eb3054..3cba93b3f 100644 --- a/programs/iot-routing-manager/src/instructions/initialize_organization_v0.rs +++ b/programs/iot-routing-manager/src/instructions/initialize_organization_v0.rs @@ -169,7 +169,6 @@ pub fn handler( bump_seed: ctx.bumps["organization"], net_id: ctx.accounts.net_id.key(), approved: false, - locked: false, }); let uri = format!( diff --git a/programs/iot-routing-manager/src/instructions/update_organization_v0.rs b/programs/iot-routing-manager/src/instructions/update_organization_v0.rs index 5f54693bd..69ed2d4cb 100644 --- a/programs/iot-routing-manager/src/instructions/update_organization_v0.rs +++ b/programs/iot-routing-manager/src/instructions/update_organization_v0.rs @@ -6,7 +6,6 @@ use crate::OrganizationV0; pub struct UpdateOrganizationArgsV0 { new_authority: Option, escrow_key: Option, - locked: Option, } #[derive(Accounts)] @@ -26,8 +25,5 @@ pub fn handler(ctx: Context, args: UpdateOrganizationArgsV if let Some(escrow_key) = args.escrow_key { ctx.accounts.organization.escrow_key = escrow_key; } - if let Some(locked) = args.locked { - ctx.accounts.organization.locked = locked; - } Ok(()) } diff --git a/programs/iot-routing-manager/src/state.rs b/programs/iot-routing-manager/src/state.rs index 659ae25c1..7433b6ece 100644 --- a/programs/iot-routing-manager/src/state.rs +++ b/programs/iot-routing-manager/src/state.rs @@ -35,7 +35,6 @@ pub struct OrganizationV0 { pub oui: u64, pub escrow_key: String, pub approved: bool, - pub locked: bool, pub bump_seed: u8, } From 155a60c59cd426758f3a4975f5fe03590559f809 Mon Sep 17 00:00:00 2001 From: bry Date: Thu, 5 Sep 2024 11:37:50 -0500 Subject: [PATCH 11/63] missed refrence to locked --- packages/helium-admin-cli/src/backfill-ouis.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/helium-admin-cli/src/backfill-ouis.ts b/packages/helium-admin-cli/src/backfill-ouis.ts index 2dbda6b01..a95c0e1ed 100644 --- a/packages/helium-admin-cli/src/backfill-ouis.ts +++ b/packages/helium-admin-cli/src/backfill-ouis.ts @@ -285,7 +285,6 @@ export async function run(args: any = process.argv) { .initializeOrganizationV0({ oui: new anchor.BN(org.oui), escrowKeyOverride: org.payer_pubkey, - locked: org.locked, }) .accounts({ authority: ownerSolAddr, From a15a326a0fb23e9338b6304a1a70769740bb2a94 Mon Sep 17 00:00:00 2001 From: bry Date: Fri, 6 Sep 2024 10:33:02 -0500 Subject: [PATCH 12/63] remove updating of escrow_key --- .../src/instructions/update_organization_v0.rs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/programs/iot-routing-manager/src/instructions/update_organization_v0.rs b/programs/iot-routing-manager/src/instructions/update_organization_v0.rs index 69ed2d4cb..65d0f1015 100644 --- a/programs/iot-routing-manager/src/instructions/update_organization_v0.rs +++ b/programs/iot-routing-manager/src/instructions/update_organization_v0.rs @@ -5,7 +5,6 @@ use crate::OrganizationV0; #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)] pub struct UpdateOrganizationArgsV0 { new_authority: Option, - escrow_key: Option, } #[derive(Accounts)] @@ -22,8 +21,5 @@ pub fn handler(ctx: Context, args: UpdateOrganizationArgsV if let Some(authority) = args.new_authority { ctx.accounts.organization.authority = authority; } - if let Some(escrow_key) = args.escrow_key { - ctx.accounts.organization.escrow_key = escrow_key; - } Ok(()) } From 5f6821be7c506d63d178498b6b62fbc55eaa0da9 Mon Sep 17 00:00:00 2001 From: bry Date: Fri, 20 Sep 2024 15:37:40 -0500 Subject: [PATCH 13/63] Add mut to net_id --- .../src/instructions/initialize_devaddr_constraint_v0.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/programs/iot-routing-manager/src/instructions/initialize_devaddr_constraint_v0.rs b/programs/iot-routing-manager/src/instructions/initialize_devaddr_constraint_v0.rs index 8cce98665..caead0993 100644 --- a/programs/iot-routing-manager/src/instructions/initialize_devaddr_constraint_v0.rs +++ b/programs/iot-routing-manager/src/instructions/initialize_devaddr_constraint_v0.rs @@ -24,6 +24,7 @@ pub struct InitializeDevaddrConstraintV0<'info> { pub payer: Signer<'info>, pub authority: Signer<'info>, #[account( + mut, has_one = authority, )] pub net_id: Box>, From a377525ea28b7a26174c38b282ee0c0de982c4cd Mon Sep 17 00:00:00 2001 From: bry Date: Thu, 10 Oct 2024 09:33:29 -0500 Subject: [PATCH 14/63] Fix naming typo and add remove_devaddr_constraint_v0 --- .../initialize_devaddr_constraint_v0.rs | 8 +++---- .../src/instructions/mod.rs | 2 ++ .../remove_devaddr_constraint_v0.rs | 22 +++++++++++++++++++ programs/iot-routing-manager/src/lib.rs | 4 ++++ programs/iot-routing-manager/src/state.rs | 2 +- 5 files changed, 33 insertions(+), 5 deletions(-) create mode 100644 programs/iot-routing-manager/src/instructions/remove_devaddr_constraint_v0.rs diff --git a/programs/iot-routing-manager/src/instructions/initialize_devaddr_constraint_v0.rs b/programs/iot-routing-manager/src/instructions/initialize_devaddr_constraint_v0.rs index caead0993..b9784a5d6 100644 --- a/programs/iot-routing-manager/src/instructions/initialize_devaddr_constraint_v0.rs +++ b/programs/iot-routing-manager/src/instructions/initialize_devaddr_constraint_v0.rs @@ -3,7 +3,7 @@ use anchor_lang::{prelude::*, solana_program::pubkey}; use anchor_spl::token::{burn, Burn, Mint, Token, TokenAccount}; use pyth_solana_receiver_sdk::price_update::{PriceUpdateV2, VerificationLevel}; -use crate::{DevAddrConstraintV0, IotRoutingManagerV0, NetIdV0, OrganizationV0}; +use crate::{DevaddrConstraintV0, IotRoutingManagerV0, NetIdV0, OrganizationV0}; pub const TESTING: bool = std::option_env!("TESTING").is_some(); @@ -56,9 +56,9 @@ pub struct InitializeDevaddrConstraintV0<'info> { payer = payer, seeds = [b"devaddr_constraint", organization.key().as_ref(), &args.start_addr.unwrap_or(net_id.current_addr_offset).to_le_bytes()[..]], bump, - space = 8 + DevAddrConstraintV0::INIT_SPACE + 60 + space = 8 + DevaddrConstraintV0::INIT_SPACE + 60 )] - pub devaddr_constraint: Box>, + pub devaddr_constraint: Box>, pub token_program: Program<'info, Token>, pub system_program: Program<'info, System>, } @@ -134,7 +134,7 @@ pub fn handler( ctx .accounts .devaddr_constraint - .set_inner(DevAddrConstraintV0 { + .set_inner(DevaddrConstraintV0 { routing_manager: ctx.accounts.net_id.routing_manager, net_id: ctx.accounts.net_id.key(), organization: ctx.accounts.organization.key(), diff --git a/programs/iot-routing-manager/src/instructions/mod.rs b/programs/iot-routing-manager/src/instructions/mod.rs index 84b559954..2f7e0654a 100644 --- a/programs/iot-routing-manager/src/instructions/mod.rs +++ b/programs/iot-routing-manager/src/instructions/mod.rs @@ -4,6 +4,7 @@ pub mod initialize_net_id_v0; pub mod initialize_organization_delegate_v0; pub mod initialize_organization_v0; pub mod initialize_routing_manager_v0; +pub mod remove_devaddr_constraint_v0; pub mod remove_organization_delegate_v0; pub mod temp_backfill_organization_delegate; pub mod update_organization_v0; @@ -14,6 +15,7 @@ pub use initialize_net_id_v0::*; pub use initialize_organization_delegate_v0::*; pub use initialize_organization_v0::*; pub use initialize_routing_manager_v0::*; +pub use remove_devaddr_constraint_v0::*; pub use remove_organization_delegate_v0::*; pub use temp_backfill_organization_delegate::*; pub use update_organization_v0::*; diff --git a/programs/iot-routing-manager/src/instructions/remove_devaddr_constraint_v0.rs b/programs/iot-routing-manager/src/instructions/remove_devaddr_constraint_v0.rs new file mode 100644 index 000000000..2fe9f5ee2 --- /dev/null +++ b/programs/iot-routing-manager/src/instructions/remove_devaddr_constraint_v0.rs @@ -0,0 +1,22 @@ +use anchor_lang::prelude::*; + +use crate::{DevaddrConstraintV0, NetIdV0}; + +#[derive(Accounts)] +pub struct RemoveDevaddrConstraintV0<'info> { + /// CHECK: Can be any sol wallet + #[account(mut)] + pub rent_refund: AccountInfo<'info>, + pub authority: Signer<'info>, + #[account(has_one = authority)] + pub net_id: Box>, + #[account( + mut, + close = rent_refund, + )] + pub devaddr_constraint: Account<'info, DevaddrConstraintV0>, +} + +pub fn handler(_: Context) -> Result<()> { + Ok(()) +} diff --git a/programs/iot-routing-manager/src/lib.rs b/programs/iot-routing-manager/src/lib.rs index 6cd54dd3a..1710e76f6 100644 --- a/programs/iot-routing-manager/src/lib.rs +++ b/programs/iot-routing-manager/src/lib.rs @@ -38,6 +38,10 @@ pub mod iot_routing_manager { initialize_devaddr_constraint_v0::handler(ctx, args) } + pub fn remove_devaddr_constraint_v0(ctx: Context) -> Result<()> { + remove_devaddr_constraint_v0::handler(ctx) + } + pub fn initialize_net_id_v0( ctx: Context, args: InitializeNetIdArgsV0, diff --git a/programs/iot-routing-manager/src/state.rs b/programs/iot-routing-manager/src/state.rs index 7433b6ece..1888eba9e 100644 --- a/programs/iot-routing-manager/src/state.rs +++ b/programs/iot-routing-manager/src/state.rs @@ -74,7 +74,7 @@ macro_rules! net_id_seeds { #[account] #[derive(Default, InitSpace)] -pub struct DevAddrConstraintV0 { +pub struct DevaddrConstraintV0 { pub routing_manager: Pubkey, pub net_id: Pubkey, pub organization: Pubkey, From 591d8560410c61895415820271fd87007ee22b1e Mon Sep 17 00:00:00 2001 From: bry Date: Mon, 14 Oct 2024 12:39:17 -0500 Subject: [PATCH 15/63] tweak --- .../src/instructions/remove_devaddr_constraint_v0.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/programs/iot-routing-manager/src/instructions/remove_devaddr_constraint_v0.rs b/programs/iot-routing-manager/src/instructions/remove_devaddr_constraint_v0.rs index 2fe9f5ee2..22cdd68cd 100644 --- a/programs/iot-routing-manager/src/instructions/remove_devaddr_constraint_v0.rs +++ b/programs/iot-routing-manager/src/instructions/remove_devaddr_constraint_v0.rs @@ -8,7 +8,9 @@ pub struct RemoveDevaddrConstraintV0<'info> { #[account(mut)] pub rent_refund: AccountInfo<'info>, pub authority: Signer<'info>, - #[account(has_one = authority)] + #[account( + has_one = authority + )] pub net_id: Box>, #[account( mut, From d25bf1a9d2ec7d10ec36ac752b390c40fb3d00d0 Mon Sep 17 00:00:00 2001 From: bry Date: Thu, 17 Oct 2024 15:21:01 -0500 Subject: [PATCH 16/63] add next_oui_id and temp endpoint --- .../initialize_organization_v0.rs | 11 +- .../initialize_routing_manager_v0.rs | 1 + .../src/instructions/mod.rs | 2 + .../temp_backfill_organization.rs | 270 ++++++++++++++++++ programs/iot-routing-manager/src/state.rs | 1 + 5 files changed, 280 insertions(+), 5 deletions(-) create mode 100644 programs/iot-routing-manager/src/instructions/temp_backfill_organization.rs diff --git a/programs/iot-routing-manager/src/instructions/initialize_organization_v0.rs b/programs/iot-routing-manager/src/instructions/initialize_organization_v0.rs index 3cba93b3f..6a1459f3a 100644 --- a/programs/iot-routing-manager/src/instructions/initialize_organization_v0.rs +++ b/programs/iot-routing-manager/src/instructions/initialize_organization_v0.rs @@ -22,7 +22,6 @@ pub const ENTITY_METADATA_URL: &str = "https://entities.nft.helium.io"; #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)] pub struct InitializeOrganizationArgsV0 { - pub oui: u64, // Default escrow key is OUI_. For legacy OUIs, this can be overridden pub escrow_key_override: Option, } @@ -39,6 +38,7 @@ pub struct InitializeOrganizationV0<'info> { )] pub program_approval: Box>, #[account( + mut, has_one = collection, has_one = sub_dao, has_one = iot_mint, @@ -66,7 +66,7 @@ pub struct InitializeOrganizationV0<'info> { #[account( init, payer = payer, - seeds = ["organization".as_bytes(), routing_manager.key().as_ref(), &args.oui.to_le_bytes()[..]], + seeds = ["organization".as_bytes(), routing_manager.key().as_ref(), &routing_manager.next_oui_id.to_le_bytes()[..]], space = 8 + std::mem::size_of::() + args.escrow_key_override.map(|k| k.len()).unwrap_or(8) + 60, bump )] @@ -104,7 +104,7 @@ pub struct InitializeOrganizationV0<'info> { seeds = [ "key_to_asset".as_bytes(), dao.key().as_ref(), - &hash(format!("OUI_{}", args.oui).as_bytes()).to_bytes() + &hash(format!("OUI_{}", &routing_manager.next_oui_id).as_bytes()).to_bytes() ], seeds::program = helium_entity_manager_program.key(), bump @@ -158,11 +158,11 @@ pub fn handler( routing_manager_seeds!(ctx.accounts.routing_manager), net_id_seeds!(ctx.accounts.net_id), ]; - let key = format!("OUI_{}", args.oui); + let key = format!("OUI_{}", ctx.accounts.routing_manager.next_oui_id); let escrow_key = args.escrow_key_override.unwrap_or(key.clone()); ctx.accounts.organization.set_inner(OrganizationV0 { - oui: args.oui, + oui: ctx.accounts.routing_manager.next_oui_id, routing_manager: ctx.accounts.routing_manager.key(), authority: ctx.accounts.authority.key(), escrow_key, @@ -261,5 +261,6 @@ pub fn handler( )?; } + ctx.accounts.routing_manager.next_oui_id += 1; Ok(()) } diff --git a/programs/iot-routing-manager/src/instructions/initialize_routing_manager_v0.rs b/programs/iot-routing-manager/src/instructions/initialize_routing_manager_v0.rs index 964820768..ecd348af9 100644 --- a/programs/iot-routing-manager/src/instructions/initialize_routing_manager_v0.rs +++ b/programs/iot-routing-manager/src/instructions/initialize_routing_manager_v0.rs @@ -122,6 +122,7 @@ pub fn handler( sub_dao: ctx.accounts.sub_dao.key(), devaddr_price_usd: args.devaddr_price_usd, oui_price_usd: args.oui_price_usd, + next_oui_id: 1, }); let signer_seeds: &[&[&[u8]]] = &[routing_manager_seeds!(ctx.accounts.routing_manager)]; diff --git a/programs/iot-routing-manager/src/instructions/mod.rs b/programs/iot-routing-manager/src/instructions/mod.rs index 2f7e0654a..7af0a6d32 100644 --- a/programs/iot-routing-manager/src/instructions/mod.rs +++ b/programs/iot-routing-manager/src/instructions/mod.rs @@ -6,6 +6,7 @@ pub mod initialize_organization_v0; pub mod initialize_routing_manager_v0; pub mod remove_devaddr_constraint_v0; pub mod remove_organization_delegate_v0; +pub mod temp_backfill_organization; pub mod temp_backfill_organization_delegate; pub mod update_organization_v0; @@ -17,5 +18,6 @@ pub use initialize_organization_v0::*; pub use initialize_routing_manager_v0::*; pub use remove_devaddr_constraint_v0::*; pub use remove_organization_delegate_v0::*; +pub use temp_backfill_organization::*; pub use temp_backfill_organization_delegate::*; pub use update_organization_v0::*; diff --git a/programs/iot-routing-manager/src/instructions/temp_backfill_organization.rs b/programs/iot-routing-manager/src/instructions/temp_backfill_organization.rs new file mode 100644 index 000000000..72a578a2b --- /dev/null +++ b/programs/iot-routing-manager/src/instructions/temp_backfill_organization.rs @@ -0,0 +1,270 @@ +use crate::error::ErrorCode; +use crate::{net_id_seeds, routing_manager_seeds, state::*, ADMIN_KEY, TESTING}; +use account_compression_cpi::{program::SplAccountCompression, Noop}; +use anchor_lang::prelude::*; +use anchor_lang::solana_program::hash::hash; +use anchor_spl::token::{burn, Burn, Mint, Token, TokenAccount}; +use bubblegum_cpi::program::Bubblegum; +use bubblegum_cpi::TreeConfig; +use helium_entity_manager::program::HeliumEntityManager; +use helium_entity_manager::{ + cpi::accounts::IssueProgramEntityV0, cpi::issue_program_entity_v0, ProgramApprovalV0, +}; +use helium_entity_manager::{IssueProgramEntityArgsV0, KeySerialization, SharedMerkleV0}; +use helium_sub_daos::{DaoV0, SubDaoV0}; +use pyth_solana_receiver_sdk::price_update::{PriceUpdateV2, VerificationLevel}; +use std::cmp::max; + +#[cfg(feature = "devnet")] +pub const ENTITY_METADATA_URL: &str = "https://entities.nft.test-helium.com"; + +#[cfg(not(feature = "devnet"))] +pub const ENTITY_METADATA_URL: &str = "https://entities.nft.helium.io"; + +#[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)] +pub struct InitializeOrganizationArgsV0 { + pub oui: u64, + // Default escrow key is OUI_. For legacy OUIs, this can be overridden + pub escrow_key_override: Option, +} + +#[derive(Accounts)] +#[instruction(args: InitializeOrganizationArgsV0)] +pub struct InitializeOrganizationV0<'info> { + #[account(mut)] + pub payer: Signer<'info>, + #[account( + seeds = ["program_approval".as_bytes(), dao.key().as_ref(), crate::id().as_ref()], + seeds::program = helium_entity_manager_program.key(), + bump = program_approval.bump_seed, + )] + pub program_approval: Box>, + #[account( + mut, + has_one = collection, + has_one = sub_dao, + has_one = iot_mint, + has_one = iot_price_oracle, + )] + pub routing_manager: Box>, + #[account( + has_one = routing_manager, + )] + pub net_id: Box>, + #[account(mut)] + pub iot_mint: Box>, + #[account( + mut, + associated_token::mint = iot_mint, + associated_token::authority = payer, + )] + pub payer_iot_account: Box>, + #[account( + constraint = iot_price_oracle.verification_level == VerificationLevel::Full @ ErrorCode::PythPriceFeedStale, + )] + pub iot_price_oracle: Box>, + /// CHECK: The new authority for this OUI + pub authority: AccountInfo<'info>, + #[account( + init, + payer = payer, + seeds = ["organization".as_bytes(), routing_manager.key().as_ref(), &args.oui.to_le_bytes()], + space = 8 + std::mem::size_of::() + args.escrow_key_override.map(|k| k.len()).unwrap_or(8) + 60, + bump + )] + pub organization: Box>, + pub collection: Box>, + /// CHECK: Handled by cpi + #[account( + mut, + seeds = ["metadata".as_bytes(), token_metadata_program.key().as_ref(), collection.key().as_ref()], + seeds::program = token_metadata_program.key(), + bump, + )] + pub collection_metadata: UncheckedAccount<'info>, + /// CHECK: Handled By cpi account + #[account( + seeds = ["metadata".as_bytes(), token_metadata_program.key().as_ref(), collection.key().as_ref(), "edition".as_bytes()], + seeds::program = token_metadata_program.key(), + bump, + )] + pub collection_master_edition: UncheckedAccount<'info>, + /// CHECK: Checked in cpi + #[account( + seeds = [b"entity_creator", dao.key().as_ref()], + seeds::program = helium_entity_manager_program.key(), + bump, + )] + pub entity_creator: UncheckedAccount<'info>, + pub dao: Box>, + #[account( + has_one = dao + )] + pub sub_dao: Box>, + #[account( + mut, + seeds = [ + "key_to_asset".as_bytes(), + dao.key().as_ref(), + &hash(format!("OUI_{}", args.oui).as_bytes()).to_bytes() + ], + seeds::program = helium_entity_manager_program.key(), + bump + )] + /// CHECK: Checked in cpi + pub key_to_asset: UncheckedAccount<'info>, + #[account( + mut, + seeds = [merkle_tree.key().as_ref()], + seeds::program = bubblegum_program.key(), + bump, + )] + pub tree_authority: Box>, + /// CHECK: Used in cpi + pub recipient: AccountInfo<'info>, + /// CHECK: Used in cpi + #[account(mut)] + pub merkle_tree: AccountInfo<'info>, + #[account( + seeds = ["collection_cpi".as_bytes()], + seeds::program = bubblegum_program.key(), + bump, + )] + /// CHECK: Used in cpi + pub bubblegum_signer: UncheckedAccount<'info>, + #[account( + mut, + seeds = ["shared_merkle".as_bytes(), &[3]], + seeds::program = helium_entity_manager_program.key(), + bump = shared_merkle.bump_seed, + has_one = merkle_tree + )] + pub shared_merkle: Box>, + + /// CHECK: Verified by constraint + #[account(address = mpl_token_metadata::ID)] + pub token_metadata_program: AccountInfo<'info>, + pub log_wrapper: Program<'info, Noop>, + pub bubblegum_program: Program<'info, Bubblegum>, + pub compression_program: Program<'info, SplAccountCompression>, + pub system_program: Program<'info, System>, + pub helium_entity_manager_program: Program<'info, HeliumEntityManager>, + pub token_program: Program<'info, Token>, +} + +pub fn handler( + ctx: Context, + args: InitializeOrganizationArgsV0, +) -> Result<()> { + let seeds: &[&[&[u8]]] = &[ + routing_manager_seeds!(ctx.accounts.routing_manager), + net_id_seeds!(ctx.accounts.net_id), + ]; + let key = format!("OUI_{}", args.oui); + let escrow_key = args.escrow_key_override.unwrap_or(key.clone()); + + ctx.accounts.organization.set_inner(OrganizationV0 { + oui: args.oui, + routing_manager: ctx.accounts.routing_manager.key(), + authority: ctx.accounts.authority.key(), + escrow_key, + bump_seed: ctx.bumps["organization"], + net_id: ctx.accounts.net_id.key(), + approved: false, + }); + + let uri = format!( + "{}/v2/oui/{}", + ENTITY_METADATA_URL, + ctx.accounts.key_to_asset.key(), + ); + + issue_program_entity_v0( + CpiContext::new_with_signer( + ctx.accounts.helium_entity_manager_program.to_account_info(), + IssueProgramEntityV0 { + payer: ctx.accounts.payer.to_account_info(), + program_approver: ctx.accounts.net_id.to_account_info(), + program_approval: ctx.accounts.program_approval.to_account_info(), + collection_authority: ctx.accounts.routing_manager.to_account_info(), + collection: ctx.accounts.collection.to_account_info(), + collection_metadata: ctx.accounts.collection_metadata.to_account_info(), + collection_master_edition: ctx.accounts.collection_master_edition.to_account_info(), + entity_creator: ctx.accounts.entity_creator.to_account_info(), + dao: ctx.accounts.dao.to_account_info(), + key_to_asset: ctx.accounts.key_to_asset.to_account_info(), + tree_authority: ctx.accounts.tree_authority.to_account_info(), + recipient: ctx.accounts.recipient.to_account_info(), + merkle_tree: ctx.accounts.merkle_tree.to_account_info(), + bubblegum_signer: ctx.accounts.bubblegum_signer.to_account_info(), + token_metadata_program: ctx.accounts.token_metadata_program.to_account_info(), + log_wrapper: ctx.accounts.log_wrapper.to_account_info(), + bubblegum_program: ctx.accounts.bubblegum_program.to_account_info(), + compression_program: ctx.accounts.compression_program.to_account_info(), + system_program: ctx.accounts.system_program.to_account_info(), + shared_merkle: Some(ctx.accounts.shared_merkle.to_account_info()), + }, + seeds, + ), + IssueProgramEntityArgsV0 { + entity_key: key.as_bytes().to_vec(), + name: key, + symbol: String::from("OUI"), + approver_seeds: seeds[1].iter().map(|s| s.to_vec()).collect(), + key_serialization: KeySerialization::UTF8, + metadata_url: Some(uri), + }, + )?; + + let message = ctx.accounts.iot_price_oracle.price_message; + let current_time = Clock::get()?.unix_timestamp; + require_gte!( + message + .publish_time + .saturating_add(if TESTING { 6000000 } else { 10 * 60 }.into()), + current_time, + ErrorCode::PythPriceNotFound + ); + let iot_price = message.ema_price; + require_gt!(iot_price, 0); + + // Remove the confidence from the price to use the most conservative price + // https://docs.pyth.network/price-feeds/solana-price-feeds/best-practices#confidence-intervals + let iot_price_with_conf = iot_price + .checked_sub(i64::try_from(message.ema_conf.checked_mul(2).unwrap()).unwrap()) + .unwrap(); + // Exponent is a negative number, likely -8 + // Since the price is multiplied by an extra 10^8, and we're dividing by that price, need to also multiply + // by the exponent + let exponent_dec = 10_u64 + .checked_pow(u32::try_from(-message.exponent).unwrap()) + .ok_or_else(|| error!(ErrorCode::ArithmeticError))?; + + require_gt!(iot_price_with_conf, 0); + let iot_fee = ctx + .accounts + .routing_manager + .oui_price_usd + .checked_mul(exponent_dec) + .unwrap() + .checked_div(iot_price_with_conf.try_into().unwrap()) + .unwrap(); + if iot_fee > 0 && ctx.accounts.payer.key() != ADMIN_KEY { + burn( + CpiContext::new( + ctx.accounts.token_program.to_account_info(), + Burn { + mint: ctx.accounts.iot_mint.to_account_info(), + from: ctx.accounts.payer_iot_account.to_account_info(), + authority: ctx.accounts.payer.to_account_info(), + }, + ), + iot_fee, + )?; + } + + ctx.accounts.routing_manager.next_oui_id = + max(ctx.accounts.routing_manager.next_oui_id, args.oui); + + Ok(()) +} diff --git a/programs/iot-routing-manager/src/state.rs b/programs/iot-routing-manager/src/state.rs index 1888eba9e..c769cf1e9 100644 --- a/programs/iot-routing-manager/src/state.rs +++ b/programs/iot-routing-manager/src/state.rs @@ -12,6 +12,7 @@ pub struct IotRoutingManagerV0 { // with 6 decimals of precision pub devaddr_price_usd: u64, pub oui_price_usd: u64, + pub next_oui_id: u64, pub bump_seed: u8, } From 282cc346b1dee2811fa2775ba95cd7235a22aa8c Mon Sep 17 00:00:00 2001 From: bry Date: Thu, 17 Oct 2024 15:50:09 -0500 Subject: [PATCH 17/63] update backfill script --- packages/helium-admin-cli/src/backfill-ouis.ts | 2 +- .../instructions/initialize_organization_v0.rs | 16 +++------------- .../instructions/temp_backfill_organization.rs | 10 +++++----- programs/iot-routing-manager/src/lib.rs | 14 +++++++++----- 4 files changed, 18 insertions(+), 24 deletions(-) diff --git a/packages/helium-admin-cli/src/backfill-ouis.ts b/packages/helium-admin-cli/src/backfill-ouis.ts index a95c0e1ed..0d43fba5b 100644 --- a/packages/helium-admin-cli/src/backfill-ouis.ts +++ b/packages/helium-admin-cli/src/backfill-ouis.ts @@ -282,7 +282,7 @@ export async function run(args: any = process.argv) { if (!(await exists(conn, orgK))) { return await irm.methods - .initializeOrganizationV0({ + .tempBackfillOrganization({ oui: new anchor.BN(org.oui), escrowKeyOverride: org.payer_pubkey, }) diff --git a/programs/iot-routing-manager/src/instructions/initialize_organization_v0.rs b/programs/iot-routing-manager/src/instructions/initialize_organization_v0.rs index 6a1459f3a..4d34be463 100644 --- a/programs/iot-routing-manager/src/instructions/initialize_organization_v0.rs +++ b/programs/iot-routing-manager/src/instructions/initialize_organization_v0.rs @@ -20,14 +20,7 @@ pub const ENTITY_METADATA_URL: &str = "https://entities.nft.test-helium.com"; #[cfg(not(feature = "devnet"))] pub const ENTITY_METADATA_URL: &str = "https://entities.nft.helium.io"; -#[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)] -pub struct InitializeOrganizationArgsV0 { - // Default escrow key is OUI_. For legacy OUIs, this can be overridden - pub escrow_key_override: Option, -} - #[derive(Accounts)] -#[instruction(args: InitializeOrganizationArgsV0)] pub struct InitializeOrganizationV0<'info> { #[account(mut)] pub payer: Signer<'info>, @@ -67,7 +60,7 @@ pub struct InitializeOrganizationV0<'info> { init, payer = payer, seeds = ["organization".as_bytes(), routing_manager.key().as_ref(), &routing_manager.next_oui_id.to_le_bytes()[..]], - space = 8 + std::mem::size_of::() + args.escrow_key_override.map(|k| k.len()).unwrap_or(8) + 60, + space = 8 + std::mem::size_of::() + 8 + 60, bump )] pub organization: Box>, @@ -150,16 +143,13 @@ pub struct InitializeOrganizationV0<'info> { pub token_program: Program<'info, Token>, } -pub fn handler( - ctx: Context, - args: InitializeOrganizationArgsV0, -) -> Result<()> { +pub fn handler(ctx: Context) -> Result<()> { let seeds: &[&[&[u8]]] = &[ routing_manager_seeds!(ctx.accounts.routing_manager), net_id_seeds!(ctx.accounts.net_id), ]; let key = format!("OUI_{}", ctx.accounts.routing_manager.next_oui_id); - let escrow_key = args.escrow_key_override.unwrap_or(key.clone()); + let escrow_key = key.clone(); ctx.accounts.organization.set_inner(OrganizationV0 { oui: ctx.accounts.routing_manager.next_oui_id, diff --git a/programs/iot-routing-manager/src/instructions/temp_backfill_organization.rs b/programs/iot-routing-manager/src/instructions/temp_backfill_organization.rs index 72a578a2b..1bc035801 100644 --- a/programs/iot-routing-manager/src/instructions/temp_backfill_organization.rs +++ b/programs/iot-routing-manager/src/instructions/temp_backfill_organization.rs @@ -22,15 +22,15 @@ pub const ENTITY_METADATA_URL: &str = "https://entities.nft.test-helium.com"; pub const ENTITY_METADATA_URL: &str = "https://entities.nft.helium.io"; #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)] -pub struct InitializeOrganizationArgsV0 { +pub struct TempBackfillOrganizationArgs { pub oui: u64, // Default escrow key is OUI_. For legacy OUIs, this can be overridden pub escrow_key_override: Option, } #[derive(Accounts)] -#[instruction(args: InitializeOrganizationArgsV0)] -pub struct InitializeOrganizationV0<'info> { +#[instruction(args: TempBackfillOrganizationArgs)] +pub struct TempBackfillOrganization<'info> { #[account(mut)] pub payer: Signer<'info>, #[account( @@ -153,8 +153,8 @@ pub struct InitializeOrganizationV0<'info> { } pub fn handler( - ctx: Context, - args: InitializeOrganizationArgsV0, + ctx: Context, + args: TempBackfillOrganizationArgs, ) -> Result<()> { let seeds: &[&[&[u8]]] = &[ routing_manager_seeds!(ctx.accounts.routing_manager), diff --git a/programs/iot-routing-manager/src/lib.rs b/programs/iot-routing-manager/src/lib.rs index 1710e76f6..09b2c3001 100644 --- a/programs/iot-routing-manager/src/lib.rs +++ b/programs/iot-routing-manager/src/lib.rs @@ -49,11 +49,8 @@ pub mod iot_routing_manager { initialize_net_id_v0::handler(ctx, args) } - pub fn initialize_organization_v0( - ctx: Context, - args: InitializeOrganizationArgsV0, - ) -> Result<()> { - initialize_organization_v0::handler(ctx, args) + pub fn initialize_organization_v0(ctx: Context) -> Result<()> { + initialize_organization_v0::handler(ctx) } pub fn initialize_routing_manager_v0( @@ -84,6 +81,13 @@ pub mod iot_routing_manager { update_organization_v0::handler(ctx, args) } + pub fn temp_backfill_organization( + ctx: Context, + args: TempBackfillOrganizationArgs, + ) -> Result<()> { + temp_backfill_organization::handler(ctx, args) + } + pub fn temp_backfill_organization_delegate( ctx: Context, ) -> Result<()> { From fdbb19eb906d24fbaadb6f8bce2130dfd7727bee Mon Sep 17 00:00:00 2001 From: bry Date: Mon, 21 Oct 2024 09:41:43 -0500 Subject: [PATCH 18/63] add log --- packages/helium-admin-cli/src/backfill-ouis.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/helium-admin-cli/src/backfill-ouis.ts b/packages/helium-admin-cli/src/backfill-ouis.ts index 0d43fba5b..dbc576a10 100644 --- a/packages/helium-admin-cli/src/backfill-ouis.ts +++ b/packages/helium-admin-cli/src/backfill-ouis.ts @@ -217,7 +217,7 @@ export async function run(args: any = process.argv) { } if (!(await exists(conn, routingManager))) { - console.log(`Initializing routingManager`); + console.log(`Initializing routingManager ${routingManager.toBase58()}`); await sendInstructionsWithPriorityFee( provider, [ From 6c9563a31d7c6a12929e0c32e2e73d180ebbf40d Mon Sep 17 00:00:00 2001 From: bry Date: Thu, 24 Oct 2024 13:58:30 -0500 Subject: [PATCH 19/63] fix settign next_oui_id on backfill --- .../temp_backfill_organization.rs | 2 +- tests/iot-routing-manager.ts | 53 ++++++++++--------- 2 files changed, 29 insertions(+), 26 deletions(-) diff --git a/programs/iot-routing-manager/src/instructions/temp_backfill_organization.rs b/programs/iot-routing-manager/src/instructions/temp_backfill_organization.rs index 1bc035801..9daf67f8f 100644 --- a/programs/iot-routing-manager/src/instructions/temp_backfill_organization.rs +++ b/programs/iot-routing-manager/src/instructions/temp_backfill_organization.rs @@ -264,7 +264,7 @@ pub fn handler( } ctx.accounts.routing_manager.next_oui_id = - max(ctx.accounts.routing_manager.next_oui_id, args.oui); + max(ctx.accounts.routing_manager.next_oui_id, args.oui + 1); Ok(()) } diff --git a/tests/iot-routing-manager.ts b/tests/iot-routing-manager.ts index 2798eb756..e7507d738 100644 --- a/tests/iot-routing-manager.ts +++ b/tests/iot-routing-manager.ts @@ -10,7 +10,10 @@ import { } from "@solana/web3.js"; import chai from "chai"; import { init as initIotRoutingManager } from "../packages/iot-routing-manager-sdk/src"; -import { init as initHeliumEntityManager, sharedMerkleKey } from "../packages/helium-entity-manager-sdk/src"; +import { + init as initHeliumEntityManager, + sharedMerkleKey, +} from "../packages/helium-entity-manager-sdk/src"; import { DataCredits } from "../target/types/data_credits"; import { HeliumSubDaos } from "../target/types/helium_sub_daos"; import { IotRoutingManager } from "../target/types/iot_routing_manager"; @@ -83,7 +86,6 @@ describe("iot-routing-manager", () => { ); ensureIrmIdl(irmProgram); - const dataCredits = await initTestDataCredits(dcProgram, provider); dcMint = dataCredits.dcMint; ({ dao } = await initTestDao( @@ -134,7 +136,8 @@ describe("iot-routing-manager", () => { }) .rpcAndKeys({ skipPreflight: true }); - const routingManagerAcc = await irmProgram.account.iotRoutingManagerV0.fetch(routingManager!); + const routingManagerAcc = + await irmProgram.account.iotRoutingManagerV0.fetch(routingManager!); expect(routingManagerAcc.updateAuthority.toBase58()).to.eq(me.toBase58()); expect(routingManagerAcc.netIdAuthority.toBase58()).to.eq(me.toBase58()); @@ -162,7 +165,7 @@ describe("iot-routing-manager", () => { iotPriceOracle: IOT_PRICE_FEED, }) .rpcAndKeys({ skipPreflight: true }); - routingManager = routingManagerK! + routingManager = routingManagerK!; }); it("should initialize a net id", async () => { @@ -181,7 +184,7 @@ describe("iot-routing-manager", () => { const netIdAcc = await irmProgram.account.netIdV0.fetch(netId!); expect(netIdAcc.authority.toBase58()).to.eq(me.toBase58()); expect(netIdAcc.id.toNumber()).to.eq(1); - }) + }); describe("with net id", async () => { let netId: PublicKey; @@ -200,30 +203,31 @@ describe("iot-routing-manager", () => { netId = netIdK!; }); - it ("should initialize an organization", async () => { + it("should initialize an organization", async () => { const { pubkeys: { organization }, } = await irmProgram.methods - .initializeOrganizationV0({ - oui: new anchor.BN(2), - escrowKeyOverride: null, - }) - .preInstructions( - [ComputeBudgetProgram.setComputeUnitLimit({ units: 500000 })] - ) + .initializeOrganizationV0() + .preInstructions([ + ComputeBudgetProgram.setComputeUnitLimit({ units: 500000 }), + ]) .accounts({ authority: me, netId, }) .rpcAndKeys({ skipPreflight: true }); - const organizationAcc = await irmProgram.account.organizationV0.fetch(organization!); + const organizationAcc = await irmProgram.account.organizationV0.fetch( + organization! + ); expect(organizationAcc.authority.toBase58()).to.eq(me.toBase58()); - expect(organizationAcc.oui.toNumber()).to.eq(2); - expect(organizationAcc.escrowKey.toString()).to.eq("OUI_2"); + expect(organizationAcc.oui.toNumber()).to.eq(1); + expect(organizationAcc.escrowKey.toString()).to.eq("OUI_1"); expect(organizationAcc.netId.toBase58()).to.eq(netId.toBase58()); - expect(organizationAcc.routingManager.toBase58()).to.eq(routingManager.toBase58()); - }) + expect(organizationAcc.routingManager.toBase58()).to.eq( + routingManager.toBase58() + ); + }); describe("with an organization", () => { let organization: PublicKey; @@ -231,10 +235,7 @@ describe("iot-routing-manager", () => { const { pubkeys: { organization: organizationK }, } = await irmProgram.methods - .initializeOrganizationV0({ - oui: new anchor.BN(2), - escrowKeyOverride: null, - }) + .initializeOrganizationV0() .preInstructions([ ComputeBudgetProgram.setComputeUnitLimit({ units: 500000 }), ]) @@ -266,11 +267,13 @@ describe("iot-routing-manager", () => { organization, }) .rpcAndKeys({ skipPreflight: true }); - const devaddr = await irmProgram.account.devAddrConstraintV0.fetch(devaddrConstraint!); + const devaddr = await irmProgram.account.devaddrConstraintV0.fetch( + devaddrConstraint! + ); expect(devaddr.startAddr.toNumber()).to.eq(0); expect(devaddr.endAddr.toNumber()).to.eq(16); }); - }) - }) + }); + }); }); }); From 0472aa695069dba7bf14c1de044d1818f8325bb5 Mon Sep 17 00:00:00 2001 From: bry Date: Sat, 26 Oct 2024 17:06:30 -0500 Subject: [PATCH 20/63] net_id u32 --- .../helium-admin-cli/src/backfill-ouis.ts | 2 +- packages/iot-routing-manager-sdk/src/pdas.ts | 29 ++++++++++--------- .../src/instructions/initialize_net_id_v0.rs | 2 +- programs/iot-routing-manager/src/state.rs | 2 +- 4 files changed, 19 insertions(+), 16 deletions(-) diff --git a/packages/helium-admin-cli/src/backfill-ouis.ts b/packages/helium-admin-cli/src/backfill-ouis.ts index dbc576a10..193d48d68 100644 --- a/packages/helium-admin-cli/src/backfill-ouis.ts +++ b/packages/helium-admin-cli/src/backfill-ouis.ts @@ -250,7 +250,7 @@ export async function run(args: any = process.argv) { if (!(await exists(conn, netIdK))) { return await irm.methods .initializeNetIdV0({ - netId: new anchor.BN(netId), + netId, }) .accounts({ authority: wallet.publicKey, diff --git a/packages/iot-routing-manager-sdk/src/pdas.ts b/packages/iot-routing-manager-sdk/src/pdas.ts index f736097e1..b6fa194c0 100644 --- a/packages/iot-routing-manager-sdk/src/pdas.ts +++ b/packages/iot-routing-manager-sdk/src/pdas.ts @@ -1,7 +1,6 @@ import { PublicKey } from "@solana/web3.js"; import { PROGRAM_ID } from "./constants"; -import BN from "bn.js"; - +import { BN } from "@coral-xyz/anchor"; export function routingManagerKey( subDao: PublicKey, @@ -18,10 +17,14 @@ export function organizationKey( oui: BN, programId: PublicKey = PROGRAM_ID ): [PublicKey, number] { - const ouiBuffer = Buffer.alloc(8) - ouiBuffer.writeBigUint64LE(BigInt(oui.toString())) + const ouiBuffer = Buffer.alloc(8); + ouiBuffer.writeBigUint64LE(BigInt(oui.toString())); return PublicKey.findProgramAddressSync( - [Buffer.from("organization", "utf-8"), routingManager.toBuffer(), ouiBuffer], + [ + Buffer.from("organization", "utf-8"), + routingManager.toBuffer(), + ouiBuffer, + ], programId ); } @@ -48,14 +51,10 @@ export function netIdKey( id: BN, programId: PublicKey = PROGRAM_ID ): [PublicKey, number] { - const idBuffer = Buffer.alloc(8); - idBuffer.writeBigUint64LE(BigInt(id.toString())); + const idBuffer = Buffer.alloc(4); + idBuffer.writeUInt32LE(Number(id.toString())); return PublicKey.findProgramAddressSync( - [ - Buffer.from("net_id", "utf-8"), - routingManager.toBuffer(), - idBuffer, - ], + [Buffer.from("net_id", "utf-8"), routingManager.toBuffer(), idBuffer], programId ); } @@ -66,7 +65,11 @@ export function organizationDelegateKey( programId: PublicKey = PROGRAM_ID ): [PublicKey, number] { return PublicKey.findProgramAddressSync( - [Buffer.from("organization_delegate", "utf-8"), organization.toBuffer(), delegate.toBuffer()], + [ + Buffer.from("organization_delegate", "utf-8"), + organization.toBuffer(), + delegate.toBuffer(), + ], programId ); } diff --git a/programs/iot-routing-manager/src/instructions/initialize_net_id_v0.rs b/programs/iot-routing-manager/src/instructions/initialize_net_id_v0.rs index 8e07b6e66..d970c7b04 100644 --- a/programs/iot-routing-manager/src/instructions/initialize_net_id_v0.rs +++ b/programs/iot-routing-manager/src/instructions/initialize_net_id_v0.rs @@ -4,7 +4,7 @@ use crate::{IotRoutingManagerV0, NetIdV0}; #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)] pub struct InitializeNetIdArgsV0 { - pub net_id: u64, + pub net_id: u32, } #[derive(Accounts)] diff --git a/programs/iot-routing-manager/src/state.rs b/programs/iot-routing-manager/src/state.rs index c769cf1e9..591e5faa0 100644 --- a/programs/iot-routing-manager/src/state.rs +++ b/programs/iot-routing-manager/src/state.rs @@ -55,7 +55,7 @@ macro_rules! organization_seeds { #[derive(Default, InitSpace)] pub struct NetIdV0 { pub routing_manager: Pubkey, - pub id: u64, + pub id: u32, pub authority: Pubkey, pub current_addr_offset: u64, pub bump_seed: u8, From d74d29f6c760a3e7a8af01db46df02adc702d696 Mon Sep 17 00:00:00 2001 From: bry Date: Wed, 13 Nov 2024 08:15:27 -0600 Subject: [PATCH 21/63] increment end_addr by 1 --- .../src/instructions/initialize_devaddr_constraint_v0.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/programs/iot-routing-manager/src/instructions/initialize_devaddr_constraint_v0.rs b/programs/iot-routing-manager/src/instructions/initialize_devaddr_constraint_v0.rs index b9784a5d6..fc0e64fff 100644 --- a/programs/iot-routing-manager/src/instructions/initialize_devaddr_constraint_v0.rs +++ b/programs/iot-routing-manager/src/instructions/initialize_devaddr_constraint_v0.rs @@ -71,8 +71,11 @@ pub fn handler( .start_addr .unwrap_or(ctx.accounts.net_id.current_addr_offset); let end_addr = start_addr + (args.num_blocks * 8) as u64; + + // Increment end_addr by 1 + // Since start_addr and end_addr of multiple devaddrs cant overlap if end_addr > ctx.accounts.net_id.current_addr_offset { - ctx.accounts.net_id.current_addr_offset = end_addr; + ctx.accounts.net_id.current_addr_offset = end_addr + 1; } let message = ctx.accounts.iot_price_oracle.price_message; From 294239d5823eceed95aa959764c3e1113dbbd709 Mon Sep 17 00:00:00 2001 From: bry Date: Wed, 20 Nov 2024 11:56:03 -0600 Subject: [PATCH 22/63] add TempBackfill endpoint for devaddr constraints --- packages/spl-utils/src/constants.ts | 12 ++- .../initialize_devaddr_constraint_v0.rs | 23 ++---- .../initialize_organization_v0.rs | 5 +- .../src/instructions/mod.rs | 2 + .../temp_backfill_devaddr_constraint_v0.rs | 73 +++++++++++++++++++ .../temp_backfill_organization.rs | 70 ++---------------- .../temp_backfill_organization_delegate.rs | 4 +- 7 files changed, 102 insertions(+), 87 deletions(-) create mode 100644 programs/iot-routing-manager/src/instructions/temp_backfill_devaddr_constraint_v0.rs diff --git a/packages/spl-utils/src/constants.ts b/packages/spl-utils/src/constants.ts index c267f24ea..58d132d68 100644 --- a/packages/spl-utils/src/constants.ts +++ b/packages/spl-utils/src/constants.ts @@ -1,16 +1,20 @@ import { PublicKey } from "@solana/web3.js"; export const DC_MINT = new PublicKey( - "dcuc8Amr83Wz27ZkQ2K9NS6r8zRpf1J6cvArEBDZDmm" + "EMsZWzk2zqwtTvvimTVD1qq4usxsNptt1HWSHYurcBWA" ); -export const HNT_MINT = new PublicKey("hntyVP6YFm1Hg25TN9WGLqM12b8TQmcknKrdu1oxWux"); +export const HNT_MINT = new PublicKey( + "2ZiWvqkZ8DCZwjoJ3HudxnChPrPPk6UVWraouC3GHvRN" +); export const MOBILE_MINT = new PublicKey( - "mb1eu7TzEc71KxDpsmsKoucSSuuoGLv1drys1oP2jh6" + "BuPZsYRpvVrYUPZMqZAJun2E7mTeAUwpCekb2uJUvapr" ); -export const IOT_MINT = new PublicKey("iotEVVZLEywoTn1QdwNPddxPWszn3zFhEot3MfL9fns"); +export const IOT_MINT = new PublicKey( + "2GtqVJo9yKXuJbyZrxr3ouQbU8AXDJQq74DQpFXFrHg7" +); // TODO: Replace with actual HNT feed export const HNT_PYTH_PRICE_FEED = new PublicKey( diff --git a/programs/iot-routing-manager/src/instructions/initialize_devaddr_constraint_v0.rs b/programs/iot-routing-manager/src/instructions/initialize_devaddr_constraint_v0.rs index fc0e64fff..8848ccd71 100644 --- a/programs/iot-routing-manager/src/instructions/initialize_devaddr_constraint_v0.rs +++ b/programs/iot-routing-manager/src/instructions/initialize_devaddr_constraint_v0.rs @@ -1,5 +1,5 @@ use crate::error::ErrorCode; -use anchor_lang::{prelude::*, solana_program::pubkey}; +use anchor_lang::prelude::*; use anchor_spl::token::{burn, Burn, Mint, Token, TokenAccount}; use pyth_solana_receiver_sdk::price_update::{PriceUpdateV2, VerificationLevel}; @@ -10,23 +10,15 @@ pub const TESTING: bool = std::option_env!("TESTING").is_some(); #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)] pub struct InitializeDevaddrConstraintArgsV0 { pub num_blocks: u32, - /// Override the default start address for the devaddr constraint. - /// WARNING: This is dangerous and can create unvalidated overlap, - /// this should not happen under Helium managed net ids - pub start_addr: Option, } -pub const ADMIN_KEY: Pubkey = pubkey!("hprdnjkbziK8NqhThmAn5Gu4XqrBbctX8du4PfJdgvW"); #[derive(Accounts)] #[instruction(args: InitializeDevaddrConstraintArgsV0)] pub struct InitializeDevaddrConstraintV0<'info> { #[account(mut)] pub payer: Signer<'info>, pub authority: Signer<'info>, - #[account( - mut, - has_one = authority, - )] + #[account(mut)] pub net_id: Box>, #[account( has_one = iot_mint, @@ -36,6 +28,7 @@ pub struct InitializeDevaddrConstraintV0<'info> { #[account( has_one = net_id, has_one = routing_manager, + has_one = authority, constraint = organization.approved @ ErrorCode::OrganizationNotApproved, )] pub organization: Box>, @@ -54,7 +47,7 @@ pub struct InitializeDevaddrConstraintV0<'info> { #[account( init, payer = payer, - seeds = [b"devaddr_constraint", organization.key().as_ref(), &args.start_addr.unwrap_or(net_id.current_addr_offset).to_le_bytes()[..]], + seeds = [b"devaddr_constraint", organization.key().as_ref(), &net_id.current_addr_offset.to_le_bytes()[..]], bump, space = 8 + DevaddrConstraintV0::INIT_SPACE + 60 )] @@ -67,9 +60,7 @@ pub fn handler( ctx: Context, args: InitializeDevaddrConstraintArgsV0, ) -> Result<()> { - let start_addr = args - .start_addr - .unwrap_or(ctx.accounts.net_id.current_addr_offset); + let start_addr = ctx.accounts.net_id.current_addr_offset; let end_addr = start_addr + (args.num_blocks * 8) as u64; // Increment end_addr by 1 @@ -119,8 +110,8 @@ pub fn handler( .unwrap(), ) .unwrap(); - // TEMP: Admin doesn't have to burn, that way we can backfill - if iot_fee > 0 && ctx.accounts.payer.key() != ADMIN_KEY { + + if iot_fee > 0 { burn( CpiContext::new( ctx.accounts.token_program.to_account_info(), diff --git a/programs/iot-routing-manager/src/instructions/initialize_organization_v0.rs b/programs/iot-routing-manager/src/instructions/initialize_organization_v0.rs index 4d34be463..cfec7871e 100644 --- a/programs/iot-routing-manager/src/instructions/initialize_organization_v0.rs +++ b/programs/iot-routing-manager/src/instructions/initialize_organization_v0.rs @@ -1,5 +1,5 @@ use crate::error::ErrorCode; -use crate::{net_id_seeds, routing_manager_seeds, state::*, ADMIN_KEY, TESTING}; +use crate::{net_id_seeds, routing_manager_seeds, state::*, TESTING}; use account_compression_cpi::{program::SplAccountCompression, Noop}; use anchor_lang::prelude::*; use anchor_lang::solana_program::hash::hash; @@ -237,7 +237,8 @@ pub fn handler(ctx: Context) -> Result<()> { .unwrap() .checked_div(iot_price_with_conf.try_into().unwrap()) .unwrap(); - if iot_fee > 0 && ctx.accounts.payer.key() != ADMIN_KEY { + + if iot_fee > 0 { burn( CpiContext::new( ctx.accounts.token_program.to_account_info(), diff --git a/programs/iot-routing-manager/src/instructions/mod.rs b/programs/iot-routing-manager/src/instructions/mod.rs index 7af0a6d32..9d5f07ff9 100644 --- a/programs/iot-routing-manager/src/instructions/mod.rs +++ b/programs/iot-routing-manager/src/instructions/mod.rs @@ -6,6 +6,7 @@ pub mod initialize_organization_v0; pub mod initialize_routing_manager_v0; pub mod remove_devaddr_constraint_v0; pub mod remove_organization_delegate_v0; +pub mod temp_backfill_devaddr_constraint_v0; pub mod temp_backfill_organization; pub mod temp_backfill_organization_delegate; pub mod update_organization_v0; @@ -18,6 +19,7 @@ pub use initialize_organization_v0::*; pub use initialize_routing_manager_v0::*; pub use remove_devaddr_constraint_v0::*; pub use remove_organization_delegate_v0::*; +pub use temp_backfill_devaddr_constraint_v0::*; pub use temp_backfill_organization::*; pub use temp_backfill_organization_delegate::*; pub use update_organization_v0::*; diff --git a/programs/iot-routing-manager/src/instructions/temp_backfill_devaddr_constraint_v0.rs b/programs/iot-routing-manager/src/instructions/temp_backfill_devaddr_constraint_v0.rs new file mode 100644 index 000000000..24ac0b1e9 --- /dev/null +++ b/programs/iot-routing-manager/src/instructions/temp_backfill_devaddr_constraint_v0.rs @@ -0,0 +1,73 @@ +use crate::error::ErrorCode; +use anchor_lang::prelude::*; +use anchor_spl::token::{Mint, Token}; +use std::str::FromStr; + +use crate::{DevaddrConstraintV0, IotRoutingManagerV0, NetIdV0, OrganizationV0}; + +#[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)] +pub struct TempBackfillDevaddrConstraintArgsV0 { + pub num_blocks: u32, + pub start_addr: u64, +} + +#[derive(Accounts)] +#[instruction(args: TempBackfillDevaddrConstraintArgsV0)] +pub struct TempBackfillDevaddrConstraintV0<'info> { + #[account( + mut, + address = Pubkey::from_str("hprdnjkbziK8NqhThmAn5Gu4XqrBbctX8du4PfJdgvW").unwrap() + )] + pub payer: Signer<'info>, + #[account(mut)] + pub net_id: Box>, + #[account( + has_one = iot_mint, + )] + pub routing_manager: Box>, + #[account( + has_one = net_id, + has_one = routing_manager, + constraint = organization.approved @ ErrorCode::OrganizationNotApproved, + )] + pub organization: Box>, + #[account(mut)] + pub iot_mint: Box>, + #[account( + init, + payer = payer, + seeds = [b"devaddr_constraint", organization.key().as_ref(), &args.start_addr.to_le_bytes()[..]], + bump, + space = 8 + DevaddrConstraintV0::INIT_SPACE + 60 + )] + pub devaddr_constraint: Box>, + pub token_program: Program<'info, Token>, + pub system_program: Program<'info, System>, +} + +pub fn handler( + ctx: Context, + args: TempBackfillDevaddrConstraintArgsV0, +) -> Result<()> { + let start_addr = args.start_addr; + let end_addr = start_addr + (args.num_blocks * 8) as u64; + + // Increment end_addr by 1 + // Since start_addr and end_addr of multiple devaddrs cant overlap + if end_addr > ctx.accounts.net_id.current_addr_offset { + ctx.accounts.net_id.current_addr_offset = end_addr + 1; + } + + ctx + .accounts + .devaddr_constraint + .set_inner(DevaddrConstraintV0 { + routing_manager: ctx.accounts.net_id.routing_manager, + net_id: ctx.accounts.net_id.key(), + organization: ctx.accounts.organization.key(), + start_addr, + end_addr, + bump_seed: ctx.bumps["devaddr_constraint"], + }); + Ok(()) +} diff --git a/programs/iot-routing-manager/src/instructions/temp_backfill_organization.rs b/programs/iot-routing-manager/src/instructions/temp_backfill_organization.rs index 9daf67f8f..45b416c32 100644 --- a/programs/iot-routing-manager/src/instructions/temp_backfill_organization.rs +++ b/programs/iot-routing-manager/src/instructions/temp_backfill_organization.rs @@ -1,9 +1,8 @@ -use crate::error::ErrorCode; -use crate::{net_id_seeds, routing_manager_seeds, state::*, ADMIN_KEY, TESTING}; +use crate::{net_id_seeds, routing_manager_seeds, state::*}; use account_compression_cpi::{program::SplAccountCompression, Noop}; use anchor_lang::prelude::*; use anchor_lang::solana_program::hash::hash; -use anchor_spl::token::{burn, Burn, Mint, Token, TokenAccount}; +use anchor_spl::token::{Mint, Token}; use bubblegum_cpi::program::Bubblegum; use bubblegum_cpi::TreeConfig; use helium_entity_manager::program::HeliumEntityManager; @@ -12,8 +11,8 @@ use helium_entity_manager::{ }; use helium_entity_manager::{IssueProgramEntityArgsV0, KeySerialization, SharedMerkleV0}; use helium_sub_daos::{DaoV0, SubDaoV0}; -use pyth_solana_receiver_sdk::price_update::{PriceUpdateV2, VerificationLevel}; use std::cmp::max; +use std::str::FromStr; #[cfg(feature = "devnet")] pub const ENTITY_METADATA_URL: &str = "https://entities.nft.test-helium.com"; @@ -31,7 +30,10 @@ pub struct TempBackfillOrganizationArgs { #[derive(Accounts)] #[instruction(args: TempBackfillOrganizationArgs)] pub struct TempBackfillOrganization<'info> { - #[account(mut)] + #[account( + mut, + address = Pubkey::from_str("hprdnjkbziK8NqhThmAn5Gu4XqrBbctX8du4PfJdgvW").unwrap() + )] pub payer: Signer<'info>, #[account( seeds = ["program_approval".as_bytes(), dao.key().as_ref(), crate::id().as_ref()], @@ -44,7 +46,6 @@ pub struct TempBackfillOrganization<'info> { has_one = collection, has_one = sub_dao, has_one = iot_mint, - has_one = iot_price_oracle, )] pub routing_manager: Box>, #[account( @@ -53,16 +54,6 @@ pub struct TempBackfillOrganization<'info> { pub net_id: Box>, #[account(mut)] pub iot_mint: Box>, - #[account( - mut, - associated_token::mint = iot_mint, - associated_token::authority = payer, - )] - pub payer_iot_account: Box>, - #[account( - constraint = iot_price_oracle.verification_level == VerificationLevel::Full @ ErrorCode::PythPriceFeedStale, - )] - pub iot_price_oracle: Box>, /// CHECK: The new authority for this OUI pub authority: AccountInfo<'info>, #[account( @@ -216,53 +207,6 @@ pub fn handler( }, )?; - let message = ctx.accounts.iot_price_oracle.price_message; - let current_time = Clock::get()?.unix_timestamp; - require_gte!( - message - .publish_time - .saturating_add(if TESTING { 6000000 } else { 10 * 60 }.into()), - current_time, - ErrorCode::PythPriceNotFound - ); - let iot_price = message.ema_price; - require_gt!(iot_price, 0); - - // Remove the confidence from the price to use the most conservative price - // https://docs.pyth.network/price-feeds/solana-price-feeds/best-practices#confidence-intervals - let iot_price_with_conf = iot_price - .checked_sub(i64::try_from(message.ema_conf.checked_mul(2).unwrap()).unwrap()) - .unwrap(); - // Exponent is a negative number, likely -8 - // Since the price is multiplied by an extra 10^8, and we're dividing by that price, need to also multiply - // by the exponent - let exponent_dec = 10_u64 - .checked_pow(u32::try_from(-message.exponent).unwrap()) - .ok_or_else(|| error!(ErrorCode::ArithmeticError))?; - - require_gt!(iot_price_with_conf, 0); - let iot_fee = ctx - .accounts - .routing_manager - .oui_price_usd - .checked_mul(exponent_dec) - .unwrap() - .checked_div(iot_price_with_conf.try_into().unwrap()) - .unwrap(); - if iot_fee > 0 && ctx.accounts.payer.key() != ADMIN_KEY { - burn( - CpiContext::new( - ctx.accounts.token_program.to_account_info(), - Burn { - mint: ctx.accounts.iot_mint.to_account_info(), - from: ctx.accounts.payer_iot_account.to_account_info(), - authority: ctx.accounts.payer.to_account_info(), - }, - ), - iot_fee, - )?; - } - ctx.accounts.routing_manager.next_oui_id = max(ctx.accounts.routing_manager.next_oui_id, args.oui + 1); diff --git a/programs/iot-routing-manager/src/instructions/temp_backfill_organization_delegate.rs b/programs/iot-routing-manager/src/instructions/temp_backfill_organization_delegate.rs index e1ae64909..c79e9d3dd 100644 --- a/programs/iot-routing-manager/src/instructions/temp_backfill_organization_delegate.rs +++ b/programs/iot-routing-manager/src/instructions/temp_backfill_organization_delegate.rs @@ -9,11 +9,11 @@ pub struct TempBackfillOrganizationDelegate<'info> { mut, address = Pubkey::from_str("hprdnjkbziK8NqhThmAn5Gu4XqrBbctX8du4PfJdgvW").unwrap() )] - pub authority: Signer<'info>, + pub payer: Signer<'info>, pub organization: Account<'info, OrganizationV0>, #[account( init, - payer = authority, + payer = payer, space = 8 + OrganizationDelegateV0::INIT_SPACE + 32, seeds = [b"organization_delegate", organization.key().as_ref(), delegate.key().as_ref()], bump, From c48ebbd68e44523cdddf2481d0bf7696d016024e Mon Sep 17 00:00:00 2001 From: bry Date: Wed, 20 Nov 2024 12:23:54 -0600 Subject: [PATCH 23/63] fix backfill script --- packages/helium-admin-cli/src/backfill-ouis.ts | 4 ++-- programs/iot-routing-manager/src/instructions/mod.rs | 4 ++-- ...raint_v0.rs => temp_backfill_devaddr_constraint.rs} | 10 +++++----- programs/iot-routing-manager/src/lib.rs | 7 +++++++ 4 files changed, 16 insertions(+), 9 deletions(-) rename programs/iot-routing-manager/src/instructions/{temp_backfill_devaddr_constraint_v0.rs => temp_backfill_devaddr_constraint.rs} (88%) diff --git a/packages/helium-admin-cli/src/backfill-ouis.ts b/packages/helium-admin-cli/src/backfill-ouis.ts index 193d48d68..5a739d3c3 100644 --- a/packages/helium-admin-cli/src/backfill-ouis.ts +++ b/packages/helium-admin-cli/src/backfill-ouis.ts @@ -341,7 +341,7 @@ export async function run(args: any = process.argv) { return await irm.methods .tempBackfillOrganizationDelegate() .accounts({ - authority: wallet.publicKey, + payer: wallet.publicKey, organization: orgK, delegate: delegateSolAddr, }) @@ -377,7 +377,7 @@ export async function run(args: any = process.argv) { const [devaddrConstraintK] = devaddrConstraintKey(orgK, startAddrBn); if (!(await exists(conn, devaddrConstraintK))) { return await irm.methods - .initializeDevaddrConstraintV0({ + .tempBackfillDevaddrConstraint({ startAddr: startAddrBn, numBlocks: numBlocksBn.toNumber(), }) diff --git a/programs/iot-routing-manager/src/instructions/mod.rs b/programs/iot-routing-manager/src/instructions/mod.rs index 9d5f07ff9..1f721af94 100644 --- a/programs/iot-routing-manager/src/instructions/mod.rs +++ b/programs/iot-routing-manager/src/instructions/mod.rs @@ -6,7 +6,7 @@ pub mod initialize_organization_v0; pub mod initialize_routing_manager_v0; pub mod remove_devaddr_constraint_v0; pub mod remove_organization_delegate_v0; -pub mod temp_backfill_devaddr_constraint_v0; +pub mod temp_backfill_devaddr_constraint; pub mod temp_backfill_organization; pub mod temp_backfill_organization_delegate; pub mod update_organization_v0; @@ -19,7 +19,7 @@ pub use initialize_organization_v0::*; pub use initialize_routing_manager_v0::*; pub use remove_devaddr_constraint_v0::*; pub use remove_organization_delegate_v0::*; -pub use temp_backfill_devaddr_constraint_v0::*; +pub use temp_backfill_devaddr_constraint::*; pub use temp_backfill_organization::*; pub use temp_backfill_organization_delegate::*; pub use update_organization_v0::*; diff --git a/programs/iot-routing-manager/src/instructions/temp_backfill_devaddr_constraint_v0.rs b/programs/iot-routing-manager/src/instructions/temp_backfill_devaddr_constraint.rs similarity index 88% rename from programs/iot-routing-manager/src/instructions/temp_backfill_devaddr_constraint_v0.rs rename to programs/iot-routing-manager/src/instructions/temp_backfill_devaddr_constraint.rs index 24ac0b1e9..21f1516ad 100644 --- a/programs/iot-routing-manager/src/instructions/temp_backfill_devaddr_constraint_v0.rs +++ b/programs/iot-routing-manager/src/instructions/temp_backfill_devaddr_constraint.rs @@ -6,14 +6,14 @@ use std::str::FromStr; use crate::{DevaddrConstraintV0, IotRoutingManagerV0, NetIdV0, OrganizationV0}; #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)] -pub struct TempBackfillDevaddrConstraintArgsV0 { +pub struct TempBackfillDevaddrConstraintArgs { pub num_blocks: u32, pub start_addr: u64, } #[derive(Accounts)] -#[instruction(args: TempBackfillDevaddrConstraintArgsV0)] -pub struct TempBackfillDevaddrConstraintV0<'info> { +#[instruction(args: TempBackfillDevaddrConstraintArgs)] +pub struct TempBackfillDevaddrConstraint<'info> { #[account( mut, address = Pubkey::from_str("hprdnjkbziK8NqhThmAn5Gu4XqrBbctX8du4PfJdgvW").unwrap() @@ -46,8 +46,8 @@ pub struct TempBackfillDevaddrConstraintV0<'info> { } pub fn handler( - ctx: Context, - args: TempBackfillDevaddrConstraintArgsV0, + ctx: Context, + args: TempBackfillDevaddrConstraintArgs, ) -> Result<()> { let start_addr = args.start_addr; let end_addr = start_addr + (args.num_blocks * 8) as u64; diff --git a/programs/iot-routing-manager/src/lib.rs b/programs/iot-routing-manager/src/lib.rs index 09b2c3001..617a036b0 100644 --- a/programs/iot-routing-manager/src/lib.rs +++ b/programs/iot-routing-manager/src/lib.rs @@ -93,4 +93,11 @@ pub mod iot_routing_manager { ) -> Result<()> { temp_backfill_organization_delegate::handler(ctx) } + + pub fn temp_backfill_devaddr_constraint( + ctx: Context, + args: TempBackfillDevaddrConstraintArgs, + ) -> Result<()> { + temp_backfill_devaddr_constraint::handler(ctx, args) + } } From b84d80c036be47656502377a0863928930ec7a31 Mon Sep 17 00:00:00 2001 From: bry Date: Wed, 20 Nov 2024 12:24:33 -0600 Subject: [PATCH 24/63] revert constants --- packages/spl-utils/src/constants.ts | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/packages/spl-utils/src/constants.ts b/packages/spl-utils/src/constants.ts index 58d132d68..ac194f25d 100644 --- a/packages/spl-utils/src/constants.ts +++ b/packages/spl-utils/src/constants.ts @@ -1,20 +1,16 @@ import { PublicKey } from "@solana/web3.js"; export const DC_MINT = new PublicKey( - "EMsZWzk2zqwtTvvimTVD1qq4usxsNptt1HWSHYurcBWA" + "dcuc8Amr83Wz27ZkQ2K9NS6r8zRpf1J6cvArEBDZDmm" ); -export const HNT_MINT = new PublicKey( - "2ZiWvqkZ8DCZwjoJ3HudxnChPrPPk6UVWraouC3GHvRN" -); +export const HNT_MINT = new PublicKey("hntyVP6YFm1Hg25TN9WGLqM12b8TQmcknKrdu1oxWux"); export const MOBILE_MINT = new PublicKey( - "BuPZsYRpvVrYUPZMqZAJun2E7mTeAUwpCekb2uJUvapr" + "mb1eu7TzEc71KxDpsmsKoucSSuuoGLv1drys1oP2jh6" ); -export const IOT_MINT = new PublicKey( - "2GtqVJo9yKXuJbyZrxr3ouQbU8AXDJQq74DQpFXFrHg7" -); +export const IOT_MINT = new PublicKey("iotEVVZLEywoTn1QdwNPddxPWszn3zFhEot3MfL9fns"); // TODO: Replace with actual HNT feed export const HNT_PYTH_PRICE_FEED = new PublicKey( @@ -29,13 +25,6 @@ export const HELIUM_COMMON_LUT = new PublicKey( "43eY9L2spbM2b1MPDFFBStUiFGt29ziZ1nc1xbpzsfVt" ); -export const MOBILE_PRICE_FEED = new PublicKey( - "DQ4C1tzvu28cwo1roN1Wm6TW35sfJEjLh517k3ZeWevx" -); - -export const IOT_PRICE_FEED = new PublicKey( - "8UYEn5Weq7toHwgcmctvcAxaNJo3SJxXEayM57rpoXr9" -); export type Network = "hnt" | "mobile" | "iot"; export const networksToMint: { [Network: string]: PublicKey } = { hnt: HNT_MINT, @@ -47,4 +36,4 @@ export const realmNames: Record = { [HNT_MINT.toBase58()]: "Helium", [MOBILE_MINT.toBase58()]: "Helium MOBILE", [IOT_MINT.toBase58()]: "Helium IOT", -}; +}; \ No newline at end of file From 1f28b5dfea1295d479b202ec1246d346d57c952a Mon Sep 17 00:00:00 2001 From: bry Date: Tue, 3 Dec 2024 13:47:53 -0600 Subject: [PATCH 25/63] add temp backfill organizations --- .../src/instructions/initialize_routing_manager_v0.rs | 3 --- .../src/instructions/temp_backfill_organization.rs | 8 +++----- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/programs/iot-routing-manager/src/instructions/initialize_routing_manager_v0.rs b/programs/iot-routing-manager/src/instructions/initialize_routing_manager_v0.rs index ecd348af9..dc9f2658d 100644 --- a/programs/iot-routing-manager/src/instructions/initialize_routing_manager_v0.rs +++ b/programs/iot-routing-manager/src/instructions/initialize_routing_manager_v0.rs @@ -14,9 +14,6 @@ use shared_utils::token_metadata::{ Metadata as MetadataProgram, }; -// 500m MOBILE -pub const CARRIER_STAKE_AMOUNT: u64 = 500_000_000_000_000; - #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)] pub struct InitializeRoutingManagerArgsV0 { pub metadata_url: String, diff --git a/programs/iot-routing-manager/src/instructions/temp_backfill_organization.rs b/programs/iot-routing-manager/src/instructions/temp_backfill_organization.rs index 45b416c32..86f25bcd0 100644 --- a/programs/iot-routing-manager/src/instructions/temp_backfill_organization.rs +++ b/programs/iot-routing-manager/src/instructions/temp_backfill_organization.rs @@ -23,8 +23,7 @@ pub const ENTITY_METADATA_URL: &str = "https://entities.nft.helium.io"; #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)] pub struct TempBackfillOrganizationArgs { pub oui: u64, - // Default escrow key is OUI_. For legacy OUIs, this can be overridden - pub escrow_key_override: Option, + pub escrow_key_override: String, } #[derive(Accounts)] @@ -60,7 +59,7 @@ pub struct TempBackfillOrganization<'info> { init, payer = payer, seeds = ["organization".as_bytes(), routing_manager.key().as_ref(), &args.oui.to_le_bytes()], - space = 8 + std::mem::size_of::() + args.escrow_key_override.map(|k| k.len()).unwrap_or(8) + 60, + space = 8 + std::mem::size_of::() + args.escrow_key_override.len() + 60, bump )] pub organization: Box>, @@ -152,13 +151,12 @@ pub fn handler( net_id_seeds!(ctx.accounts.net_id), ]; let key = format!("OUI_{}", args.oui); - let escrow_key = args.escrow_key_override.unwrap_or(key.clone()); ctx.accounts.organization.set_inner(OrganizationV0 { oui: args.oui, routing_manager: ctx.accounts.routing_manager.key(), authority: ctx.accounts.authority.key(), - escrow_key, + escrow_key: args.escrow_key_override, bump_seed: ctx.bumps["organization"], net_id: ctx.accounts.net_id.key(), approved: false, From 87ef960bb91423ec9ed2538bac528fce99d4df8c Mon Sep 17 00:00:00 2001 From: bry Date: Wed, 4 Dec 2024 14:57:51 -0600 Subject: [PATCH 26/63] conflicts --- packages/iot-routing-manager-sdk/yarn.deploy.lock | 2 +- .../src/instructions/initialize_incentive_program_v0.rs | 1 + yarn.lock | 8 -------- 3 files changed, 2 insertions(+), 9 deletions(-) diff --git a/packages/iot-routing-manager-sdk/yarn.deploy.lock b/packages/iot-routing-manager-sdk/yarn.deploy.lock index 7e0364ed8..f409ab9f2 100644 --- a/packages/iot-routing-manager-sdk/yarn.deploy.lock +++ b/packages/iot-routing-manager-sdk/yarn.deploy.lock @@ -89,7 +89,7 @@ __metadata: languageName: node linkType: hard -"@helium/anchor-resolvers@^0.9.2, @helium/anchor-resolvers@^0.9.4": +"@helium/anchor-resolvers@^0.9.15, @helium/anchor-resolvers@workspace:packages/anchor-resolvers": version: 0.0.0-use.local resolution: "@helium/anchor-resolvers@workspace:packages/anchor-resolvers" dependencies: diff --git a/programs/mobile-entity-manager/src/instructions/initialize_incentive_program_v0.rs b/programs/mobile-entity-manager/src/instructions/initialize_incentive_program_v0.rs index 5df5fe1d3..8d447416d 100644 --- a/programs/mobile-entity-manager/src/instructions/initialize_incentive_program_v0.rs +++ b/programs/mobile-entity-manager/src/instructions/initialize_incentive_program_v0.rs @@ -147,6 +147,7 @@ pub fn handler( bubblegum_program: ctx.accounts.bubblegum_program.to_account_info(), compression_program: ctx.accounts.compression_program.to_account_info(), system_program: ctx.accounts.system_program.to_account_info(), + shared_merkle: None, }, seeds, ), diff --git a/yarn.lock b/yarn.lock index 71f11eb74..1d1b3bffa 100644 --- a/yarn.lock +++ b/yarn.lock @@ -609,11 +609,7 @@ __metadata: languageName: node linkType: hard -<<<<<<< HEAD -"@helium/anchor-resolvers@^0.9.2, @helium/anchor-resolvers@^0.9.4, @helium/anchor-resolvers@workspace:packages/anchor-resolvers": -======= "@helium/anchor-resolvers@^0.9.15, @helium/anchor-resolvers@workspace:packages/anchor-resolvers": ->>>>>>> develop version: 0.0.0-use.local resolution: "@helium/anchor-resolvers@workspace:packages/anchor-resolvers" dependencies: @@ -941,11 +937,7 @@ __metadata: languageName: unknown linkType: soft -<<<<<<< HEAD -"@helium/helium-entity-manager-sdk@^0.9.2, @helium/helium-entity-manager-sdk@^0.9.4, @helium/helium-entity-manager-sdk@workspace:packages/helium-entity-manager-sdk": -======= "@helium/helium-entity-manager-sdk@^0.9.15, @helium/helium-entity-manager-sdk@workspace:packages/helium-entity-manager-sdk": ->>>>>>> develop version: 0.0.0-use.local resolution: "@helium/helium-entity-manager-sdk@workspace:packages/helium-entity-manager-sdk" dependencies: From 9251bb004709b4c5287bebcdb686209f6a837afb Mon Sep 17 00:00:00 2001 From: bry Date: Wed, 4 Dec 2024 15:05:48 -0600 Subject: [PATCH 27/63] add price feeds to constants --- .../iot-routing-manager-sdk/yarn.deploy.lock | 56 +++++++++---------- packages/spl-utils/src/constants.ts | 18 +++++- yarn.lock | 4 +- 3 files changed, 45 insertions(+), 33 deletions(-) diff --git a/packages/iot-routing-manager-sdk/yarn.deploy.lock b/packages/iot-routing-manager-sdk/yarn.deploy.lock index f409ab9f2..89ddfbbf0 100644 --- a/packages/iot-routing-manager-sdk/yarn.deploy.lock +++ b/packages/iot-routing-manager-sdk/yarn.deploy.lock @@ -67,7 +67,7 @@ __metadata: languageName: node linkType: hard -"@helium/account-fetch-cache@^0.9.4": +"@helium/account-fetch-cache@^0.9.15": version: 0.0.0-use.local resolution: "@helium/account-fetch-cache@workspace:packages/account-fetch-cache" dependencies: @@ -89,7 +89,7 @@ __metadata: languageName: node linkType: hard -"@helium/anchor-resolvers@^0.9.15, @helium/anchor-resolvers@workspace:packages/anchor-resolvers": +"@helium/anchor-resolvers@^0.9.15, @helium/anchor-resolvers@^0.9.2": version: 0.0.0-use.local resolution: "@helium/anchor-resolvers@workspace:packages/anchor-resolvers" dependencies: @@ -127,13 +127,13 @@ __metadata: languageName: node linkType: hard -"@helium/circuit-breaker-sdk@^0.9.4": +"@helium/circuit-breaker-sdk@^0.9.15": version: 0.0.0-use.local resolution: "@helium/circuit-breaker-sdk@workspace:packages/circuit-breaker-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/anchor-resolvers": ^0.9.4 - "@helium/idls": ^0.9.4 + "@helium/anchor-resolvers": ^0.9.15 + "@helium/idls": ^0.9.15 bn.js: ^5.2.0 bs58: ^4.0.1 git-format-staged: ^2.1.3 @@ -149,11 +149,11 @@ __metadata: dependencies: "@coral-xyz/anchor": ^0.28.0 "@helium/address": ^4.10.2 - "@helium/anchor-resolvers": ^0.9.4 - "@helium/helium-sub-daos-sdk": ^0.9.4 - "@helium/idls": ^0.9.4 - "@helium/no-emit-sdk": ^0.9.4 - "@helium/spl-utils": ^0.9.4 + "@helium/anchor-resolvers": ^0.9.15 + "@helium/helium-sub-daos-sdk": ^0.9.15 + "@helium/idls": ^0.9.15 + "@helium/no-emit-sdk": ^0.9.15 + "@helium/spl-utils": ^0.9.15 "@types/crypto-js": ^4.1.1 bn.js: ^5.2.0 bs58: ^4.0.1 @@ -166,15 +166,15 @@ __metadata: languageName: unknown linkType: soft -"@helium/helium-sub-daos-sdk@^0.9.4": +"@helium/helium-sub-daos-sdk@^0.9.15": version: 0.0.0-use.local resolution: "@helium/helium-sub-daos-sdk@workspace:packages/helium-sub-daos-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/anchor-resolvers": ^0.9.4 - "@helium/circuit-breaker-sdk": ^0.9.4 - "@helium/treasury-management-sdk": ^0.9.4 - "@helium/voter-stake-registry-sdk": ^0.9.4 + "@helium/anchor-resolvers": ^0.9.15 + "@helium/circuit-breaker-sdk": ^0.9.15 + "@helium/treasury-management-sdk": ^0.9.15 + "@helium/voter-stake-registry-sdk": ^0.9.15 bn.js: ^5.2.0 bs58: ^4.0.1 git-format-staged: ^2.1.3 @@ -184,7 +184,7 @@ __metadata: languageName: unknown linkType: soft -"@helium/idls@^0.9.4": +"@helium/idls@^0.9.15": version: 0.0.0-use.local resolution: "@helium/idls@workspace:packages/idls" dependencies: @@ -249,7 +249,7 @@ __metadata: languageName: node linkType: hard -"@helium/no-emit-sdk@^0.9.4": +"@helium/no-emit-sdk@^0.9.15": version: 0.0.0-use.local resolution: "@helium/no-emit-sdk@workspace:packages/no-emit-sdk" dependencies: @@ -265,14 +265,14 @@ __metadata: languageName: unknown linkType: soft -"@helium/spl-utils@^0.9.4": +"@helium/spl-utils@^0.9.15": version: 0.0.0-use.local resolution: "@helium/spl-utils@workspace:packages/spl-utils" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/account-fetch-cache": ^0.9.4 + "@helium/account-fetch-cache": ^0.9.15 "@helium/address": ^4.10.2 - "@helium/anchor-resolvers": ^0.9.4 + "@helium/anchor-resolvers": ^0.9.15 "@metaplex-foundation/mpl-token-metadata": ^2.10.0 "@solana/spl-account-compression": ^0.1.7 "@solana/spl-token": ^0.3.8 @@ -287,14 +287,14 @@ __metadata: languageName: unknown linkType: soft -"@helium/treasury-management-sdk@^0.9.4": +"@helium/treasury-management-sdk@^0.9.15": version: 0.0.0-use.local resolution: "@helium/treasury-management-sdk@workspace:packages/treasury-management-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/anchor-resolvers": ^0.9.4 - "@helium/circuit-breaker-sdk": ^0.9.4 - "@helium/idls": ^0.9.4 + "@helium/anchor-resolvers": ^0.9.15 + "@helium/circuit-breaker-sdk": ^0.9.15 + "@helium/idls": ^0.9.15 bn.js: ^5.2.0 bs58: ^4.0.1 git-format-staged: ^2.1.3 @@ -304,15 +304,15 @@ __metadata: languageName: unknown linkType: soft -"@helium/voter-stake-registry-sdk@^0.9.4": +"@helium/voter-stake-registry-sdk@^0.9.15": version: 0.0.0-use.local resolution: "@helium/voter-stake-registry-sdk@workspace:packages/voter-stake-registry-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/anchor-resolvers": ^0.9.4 - "@helium/idls": ^0.9.4 + "@helium/anchor-resolvers": ^0.9.15 + "@helium/idls": ^0.9.15 "@helium/nft-proxy-sdk": ^0.0.12 - "@helium/spl-utils": ^0.9.4 + "@helium/spl-utils": ^0.9.15 "@metaplex-foundation/mpl-token-metadata": ^2.10.0 "@solana/spl-token": ^0.3.8 bn.js: ^5.2.0 diff --git a/packages/spl-utils/src/constants.ts b/packages/spl-utils/src/constants.ts index ac194f25d..f01c009d6 100644 --- a/packages/spl-utils/src/constants.ts +++ b/packages/spl-utils/src/constants.ts @@ -4,13 +4,17 @@ export const DC_MINT = new PublicKey( "dcuc8Amr83Wz27ZkQ2K9NS6r8zRpf1J6cvArEBDZDmm" ); -export const HNT_MINT = new PublicKey("hntyVP6YFm1Hg25TN9WGLqM12b8TQmcknKrdu1oxWux"); +export const HNT_MINT = new PublicKey( + "hntyVP6YFm1Hg25TN9WGLqM12b8TQmcknKrdu1oxWux" +); export const MOBILE_MINT = new PublicKey( "mb1eu7TzEc71KxDpsmsKoucSSuuoGLv1drys1oP2jh6" ); -export const IOT_MINT = new PublicKey("iotEVVZLEywoTn1QdwNPddxPWszn3zFhEot3MfL9fns"); +export const IOT_MINT = new PublicKey( + "iotEVVZLEywoTn1QdwNPddxPWszn3zFhEot3MfL9fns" +); // TODO: Replace with actual HNT feed export const HNT_PYTH_PRICE_FEED = new PublicKey( @@ -25,6 +29,14 @@ export const HELIUM_COMMON_LUT = new PublicKey( "43eY9L2spbM2b1MPDFFBStUiFGt29ziZ1nc1xbpzsfVt" ); +export const MOBILE_PRICE_FEED = new PublicKey( + "DQ4C1tzvu28cwo1roN1Wm6TW35sfJEjLh517k3ZeWevx" +); + +export const IOT_PRICE_FEED = new PublicKey( + "8UYEn5Weq7toHwgcmctvcAxaNJo3SJxXEayM57rpoXr9" +); + export type Network = "hnt" | "mobile" | "iot"; export const networksToMint: { [Network: string]: PublicKey } = { hnt: HNT_MINT, @@ -36,4 +48,4 @@ export const realmNames: Record = { [HNT_MINT.toBase58()]: "Helium", [MOBILE_MINT.toBase58()]: "Helium MOBILE", [IOT_MINT.toBase58()]: "Helium IOT", -}; \ No newline at end of file +}; diff --git a/yarn.lock b/yarn.lock index 1d1b3bffa..9c6e460b0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -609,7 +609,7 @@ __metadata: languageName: node linkType: hard -"@helium/anchor-resolvers@^0.9.15, @helium/anchor-resolvers@workspace:packages/anchor-resolvers": +"@helium/anchor-resolvers@^0.9.15, @helium/anchor-resolvers@^0.9.2, @helium/anchor-resolvers@workspace:packages/anchor-resolvers": version: 0.0.0-use.local resolution: "@helium/anchor-resolvers@workspace:packages/anchor-resolvers" dependencies: @@ -937,7 +937,7 @@ __metadata: languageName: unknown linkType: soft -"@helium/helium-entity-manager-sdk@^0.9.15, @helium/helium-entity-manager-sdk@workspace:packages/helium-entity-manager-sdk": +"@helium/helium-entity-manager-sdk@^0.9.15, @helium/helium-entity-manager-sdk@^0.9.2, @helium/helium-entity-manager-sdk@workspace:packages/helium-entity-manager-sdk": version: 0.0.0-use.local resolution: "@helium/helium-entity-manager-sdk@workspace:packages/helium-entity-manager-sdk" dependencies: From ee24b551600105d8019afa4eb55342aef9257b2a Mon Sep 17 00:00:00 2001 From: bry Date: Wed, 4 Dec 2024 15:16:13 -0600 Subject: [PATCH 28/63] clippy --- utils/shared-utils/src/precise_number.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/shared-utils/src/precise_number.rs b/utils/shared-utils/src/precise_number.rs index 1f3c51e0f..89d91fcdb 100644 --- a/utils/shared-utils/src/precise_number.rs +++ b/utils/shared-utils/src/precise_number.rs @@ -71,8 +71,8 @@ pub const fn ln2hi() -> InnerUint { U192([13974485815783726801_u64, 3_u64, 0_u64]) } pub const LN2HI: PreciseNumber = PreciseNumber { value: ln2hi() }; -#[inline] +#[inline] pub const fn ln2hi_scale() -> InnerUint { U192([7766279631452241920_u64, 5_u64, 0_u64]) } From 65d73f33101a3af6b1fbc219586e341637f71f1d Mon Sep 17 00:00:00 2001 From: bry Date: Wed, 4 Dec 2024 15:41:06 -0600 Subject: [PATCH 29/63] use std div_ceil --- .../src/instructions/initialize_shared_merkle_v0.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/programs/helium-entity-manager/src/instructions/initialize_shared_merkle_v0.rs b/programs/helium-entity-manager/src/instructions/initialize_shared_merkle_v0.rs index 134f502ba..9756dd70b 100644 --- a/programs/helium-entity-manager/src/instructions/initialize_shared_merkle_v0.rs +++ b/programs/helium-entity-manager/src/instructions/initialize_shared_merkle_v0.rs @@ -44,10 +44,6 @@ pub struct InitializeSharedMerkleV0<'info> { pub const STARTING_DEPTH: u32 = 17; pub const BUFFER_SIZE: u32 = 64; -fn div_ceil(dividend: u64, divisor: u64) -> u64 { - (dividend + divisor - 1) / divisor -} - pub fn handler( ctx: Context, args: InitializeSharedMerkleArgsV0, @@ -56,7 +52,7 @@ pub fn handler( let total_lamports = ctx.accounts.merkle_tree.lamports() + ctx.accounts.tree_authority.lamports(); ctx.accounts.shared_merkle.set_inner(SharedMerkleV0 { proof_size: args.proof_size, - price_per_mint: div_ceil(total_lamports, 2u64.pow(depth) - 3), // because we can swap with 3 left + price_per_mint: total_lamports.div_ceil(2u64.pow(depth) - 3), // because we can swap with 3 left merkle_tree: ctx.accounts.merkle_tree.key(), bump_seed: ctx.bumps["shared_merkle"], }); From df3c3eb90cbaaabf86eaf2a7d3ce8346ab34f969 Mon Sep 17 00:00:00 2001 From: bry Date: Wed, 4 Dec 2024 15:48:06 -0600 Subject: [PATCH 30/63] clippy --- .../src/instructions/initialize_shared_merkle_v0.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/programs/helium-entity-manager/src/instructions/initialize_shared_merkle_v0.rs b/programs/helium-entity-manager/src/instructions/initialize_shared_merkle_v0.rs index 9756dd70b..13c88bd19 100644 --- a/programs/helium-entity-manager/src/instructions/initialize_shared_merkle_v0.rs +++ b/programs/helium-entity-manager/src/instructions/initialize_shared_merkle_v0.rs @@ -44,6 +44,11 @@ pub struct InitializeSharedMerkleV0<'info> { pub const STARTING_DEPTH: u32 = 17; pub const BUFFER_SIZE: u32 = 64; +#[allow(clippy::manual_div_ceil)] +fn div_ceil(dividend: u64, divisor: u64) -> u64 { + (dividend + divisor - 1) / divisor +} + pub fn handler( ctx: Context, args: InitializeSharedMerkleArgsV0, @@ -52,7 +57,7 @@ pub fn handler( let total_lamports = ctx.accounts.merkle_tree.lamports() + ctx.accounts.tree_authority.lamports(); ctx.accounts.shared_merkle.set_inner(SharedMerkleV0 { proof_size: args.proof_size, - price_per_mint: total_lamports.div_ceil(2u64.pow(depth) - 3), // because we can swap with 3 left + price_per_mint: div_ceil(total_lamports, 2u64.pow(depth) - 3), // because we can swap with 3 left merkle_tree: ctx.accounts.merkle_tree.key(), bump_seed: ctx.bumps["shared_merkle"], }); From c881e2a4bc1eaffb912c795bbd0a40c270e8de8c Mon Sep 17 00:00:00 2001 From: bry Date: Wed, 4 Dec 2024 16:13:02 -0600 Subject: [PATCH 31/63] fix cacheIdlFetch --- .../account-postgres-sink-service/src/utils/cachedIdlFetch.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/account-postgres-sink-service/src/utils/cachedIdlFetch.ts b/packages/account-postgres-sink-service/src/utils/cachedIdlFetch.ts index 519580c05..427fa1945 100644 --- a/packages/account-postgres-sink-service/src/utils/cachedIdlFetch.ts +++ b/packages/account-postgres-sink-service/src/utils/cachedIdlFetch.ts @@ -20,8 +20,7 @@ const cachedIdlFetch = (() => { cache.delete(programId); cache.set(programId, idl); } else { - try { - idl = await anchor.Program.fetchIdl(programId, provider); + idl = await anchor.Program.fetchIdl(programId, provider); if (idl) { cache.set(programId, idl); From ed679b6339b683f59c3431ac3de3fbe2b1f446a3 Mon Sep 17 00:00:00 2001 From: bry Date: Thu, 5 Dec 2024 07:00:42 -0600 Subject: [PATCH 32/63] Fix tests --- tests/sus.ts | 70 +++++++++++++----------- utils/shared-utils/src/precise_number.rs | 6 +- 2 files changed, 39 insertions(+), 37 deletions(-) diff --git a/tests/sus.ts b/tests/sus.ts index 4b2dcdd99..99f59e11a 100644 --- a/tests/sus.ts +++ b/tests/sus.ts @@ -6,7 +6,7 @@ import { Asset, sus } from "@helium/sus"; import { PROGRAM_ID as BUBBLEGUM_PROGRAM_ID, createBurnInstruction as createBubblegumBurnInstruction, - createTransferInstruction as createBubblegumTransferInstruction + createTransferInstruction as createBubblegumTransferInstruction, } from "@metaplex-foundation/mpl-bubblegum"; import { ConcurrentMerkleTreeAccount, @@ -29,6 +29,7 @@ import axios from "axios"; import { BN } from "bn.js"; import bs58 from "bs58"; import { expect } from "chai"; +import { ensureDCIdl } from "./utils/fixtures"; const SUS = new PublicKey("sustWW3deA7acADNGJnkYj2EAf65EmqUNLxKekDpu6w"); const hotspot = "9Cyj2K3Fi7xH8fZ1xrp4gtr1CU6Zk8VFM4fZN9NR9ncz"; @@ -59,11 +60,13 @@ describe("sus", () => { const susR = await sus({ connection, wallet: SUS, - serializedTransactions: [transaction.serialize({ - verifySignatures: false, - requireAllSignatures: false, - })], - cluster: "devnet" + serializedTransactions: [ + transaction.serialize({ + verifySignatures: false, + requireAllSignatures: false, + }), + ], + cluster: "devnet", }); const { writableAccounts, balanceChanges } = susR[0]; @@ -80,7 +83,7 @@ describe("sus", () => { expect(writableAccounts[2].owner?.toBase58()).to.eq(SUS.toBase58()); expect(writableAccounts[2].metadata?.decimals).to.eq(8); - console.log(balanceChanges[0]) + console.log(balanceChanges[0]); expect(balanceChanges[0].owner.toBase58()).to.eq(SUS.toBase58()); expect(balanceChanges[0].amount).to.eq(BigInt(-2044280)); @@ -107,6 +110,7 @@ describe("sus", () => { {} ) ); + await ensureDCIdl(dataCredits); transaction.add( await dataCredits.methods @@ -131,22 +135,23 @@ describe("sus", () => { const [susR] = await sus({ connection, wallet: SUS, - serializedTransactions: [transaction.serialize({ - verifySignatures: false, - requireAllSignatures: false, - })], - cluster: "devnet" + serializedTransactions: [ + transaction.serialize({ + verifySignatures: false, + requireAllSignatures: false, + }), + ], + cluster: "devnet", }); - console.log(susR.instructions[0].parsed); expect(susR.writableAccounts.map((r) => r.name)).to.deep.eq([ "Native SOL Account", - "DelegatedDataCreditsV0", + "Unknown", "DC Mint", - "DC Token Account", + "Unknown", "HNT Token Account", "HNT Mint", - "DC Token Account", + "Unknown", "MintWindowedCircuitBreakerV0", ]); expect(susR.instructions[0].parsed?.name).to.eq("mintDataCreditsV0"); @@ -179,10 +184,12 @@ describe("sus", () => { const [susR] = await sus({ connection, wallet: SUS, - serializedTransactions: [transaction.serialize({ - verifySignatures: false, - requireAllSignatures: false, - })], + serializedTransactions: [ + transaction.serialize({ + verifySignatures: false, + requireAllSignatures: false, + }), + ], checkCNfts: true, cNfts: [asset], }); @@ -205,23 +212,21 @@ describe("sus", () => { }, }); const asset = assetResponse.data.result; - const transaction = await burnCompressedCollectable( - connection, - SUS, - asset, - ); + const transaction = await burnCompressedCollectable(connection, SUS, asset); const [susR] = await sus({ connection, wallet: SUS, - serializedTransactions: [transaction.serialize({ - verifySignatures: false, - requireAllSignatures: false, - })], + serializedTransactions: [ + transaction.serialize({ + verifySignatures: false, + requireAllSignatures: false, + }), + ], checkCNfts: true, cNfts: [asset], - cluster: "devnet" + cluster: "devnet", }); - console.log(susR.explorerLink) + console.log(susR.explorerLink); expect(susR.possibleCNftChanges[0]).to.eq(asset); expect(susR.warnings[0].message).to.eq( @@ -241,7 +246,7 @@ async function getBubblegumAuthorityPDA(merkleRollPubKey: PublicKey) { const burnCompressedCollectable = async ( connection: Connection, wallet: PublicKey, - collectable: Asset, + collectable: Asset ): Promise => { const payer = wallet; @@ -322,7 +327,6 @@ const burnCompressedCollectable = async ( return transaction; }; - const transferCompressedCollectable = async ( connection: Connection, wallet: PublicKey, diff --git a/utils/shared-utils/src/precise_number.rs b/utils/shared-utils/src/precise_number.rs index 89d91fcdb..472a21c27 100644 --- a/utils/shared-utils/src/precise_number.rs +++ b/utils/shared-utils/src/precise_number.rs @@ -1,13 +1,11 @@ //! Defines PreciseNumber, a U192 wrapper with float-like operations // Stolen from SPL math, but changing inner unit -use std::cmp::Ordering; -use std::convert::*; +use std::{cmp::Ordering, convert::*}; use anchor_lang::prelude::msg; -use crate::signed_precise_number::SignedPreciseNumber; -use crate::uint::U192; +use crate::{signed_precise_number::SignedPreciseNumber, uint::U192}; // Allows for easy swapping between different internal representations pub type InnerUint = U192; From da1b1a7ac77c6571227f58919d7b3c9b683190e6 Mon Sep 17 00:00:00 2001 From: bry Date: Thu, 5 Dec 2024 07:32:06 -0600 Subject: [PATCH 33/63] fix tests --- tests/sus.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/sus.ts b/tests/sus.ts index 99f59e11a..30f60979b 100644 --- a/tests/sus.ts +++ b/tests/sus.ts @@ -146,12 +146,12 @@ describe("sus", () => { expect(susR.writableAccounts.map((r) => r.name)).to.deep.eq([ "Native SOL Account", - "Unknown", + "DelegatedDataCreditsV0", "DC Mint", - "Unknown", + "DC Token Account", "HNT Token Account", "HNT Mint", - "Unknown", + "DC Token Account", "MintWindowedCircuitBreakerV0", ]); expect(susR.instructions[0].parsed?.name).to.eq("mintDataCreditsV0"); From 7130c4a6caf6aebce2353377f96406f75f18267b Mon Sep 17 00:00:00 2001 From: bry Date: Thu, 5 Dec 2024 08:02:27 -0600 Subject: [PATCH 34/63] rever precise_number changes --- utils/shared-utils/src/precise_number.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/utils/shared-utils/src/precise_number.rs b/utils/shared-utils/src/precise_number.rs index 472a21c27..89d91fcdb 100644 --- a/utils/shared-utils/src/precise_number.rs +++ b/utils/shared-utils/src/precise_number.rs @@ -1,11 +1,13 @@ //! Defines PreciseNumber, a U192 wrapper with float-like operations // Stolen from SPL math, but changing inner unit -use std::{cmp::Ordering, convert::*}; +use std::cmp::Ordering; +use std::convert::*; use anchor_lang::prelude::msg; -use crate::{signed_precise_number::SignedPreciseNumber, uint::U192}; +use crate::signed_precise_number::SignedPreciseNumber; +use crate::uint::U192; // Allows for easy swapping between different internal representations pub type InnerUint = U192; From 30bda0c5d55f09909faab10ce499fe295d8c856c Mon Sep 17 00:00:00 2001 From: Bryan Date: Thu, 5 Dec 2024 08:59:07 -0600 Subject: [PATCH 35/63] Delete packages/rewards-oracle-faucet-service/.env --- packages/rewards-oracle-faucet-service/.env | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 packages/rewards-oracle-faucet-service/.env diff --git a/packages/rewards-oracle-faucet-service/.env b/packages/rewards-oracle-faucet-service/.env deleted file mode 100644 index fca0da9bc..000000000 --- a/packages/rewards-oracle-faucet-service/.env +++ /dev/null @@ -1,3 +0,0 @@ -PGUSER=postgres -PGDATABASE=postgres -PGPASSWORD=postgres From 0560375a42f814bf19a80f22ef4d92986dfbd177 Mon Sep 17 00:00:00 2001 From: bry Date: Thu, 5 Dec 2024 14:33:25 -0600 Subject: [PATCH 36/63] fix tests --- tests/helium-entity-manager.ts | 2 - tests/helium-sub-daos.ts | 110 ++++++++++++++++++++++----------- tests/iot-routing-manager.ts | 38 ++++++------ 3 files changed, 91 insertions(+), 59 deletions(-) diff --git a/tests/helium-entity-manager.ts b/tests/helium-entity-manager.ts index cbf1381f1..ee47cea47 100644 --- a/tests/helium-entity-manager.ts +++ b/tests/helium-entity-manager.ts @@ -55,8 +55,6 @@ const { expect } = chai; import { helium } from "@helium/proto"; // @ts-ignore import axios from "axios"; - -import { keyToAssetKey } from "@helium/helium-entity-manager-sdk"; import { MerkleTree, SPL_ACCOUNT_COMPRESSION_PROGRAM_ID, diff --git a/tests/helium-sub-daos.ts b/tests/helium-sub-daos.ts index 3ef836125..c06a7e04d 100644 --- a/tests/helium-sub-daos.ts +++ b/tests/helium-sub-daos.ts @@ -17,7 +17,7 @@ import { roundToDecimals, sendInstructions, toBN, - toNumber + toNumber, } from "@helium/spl-utils"; import { AccountLayout, getMint } from "@solana/spl-token"; import { @@ -31,7 +31,10 @@ import { BN } from "bn.js"; import chai, { assert, expect } from "chai"; import chaiAsPromised from "chai-as-promised"; import { init as dcInit } from "../packages/data-credits-sdk/src"; -import { init as issuerInit, onboardIotHotspot } from "../packages/helium-entity-manager-sdk/src"; +import { + init as issuerInit, + onboardIotHotspot, +} from "../packages/helium-entity-manager-sdk/src"; import { currentEpoch, delegatorRewardsPercent, @@ -161,7 +164,13 @@ describe("helium-sub-daos", () => { provider.wallet.publicKey ); const { subDao, treasury, mint, treasuryCircuitBreaker } = - await initTestSubdao({hsdProgram: program, vsrProgram, provider, authority: provider.wallet.publicKey, dao}); + await initTestSubdao({ + hsdProgram: program, + vsrProgram, + provider, + authority: provider.wallet.publicKey, + dao, + }); const account = await program.account.subDaoV0.fetch(subDao!); const breaker = @@ -247,7 +256,13 @@ describe("helium-sub-daos", () => { ({ dataCredits: { dcMint }, - subDao: { subDao, treasury, rewardsEscrow, mint: dntMint, subDaoRegistrar }, + subDao: { + subDao, + treasury, + rewardsEscrow, + mint: dntMint, + subDaoRegistrar, + }, dao: { dao }, } = await initWorld( provider, @@ -258,14 +273,27 @@ describe("helium-sub-daos", () => { EPOCH_REWARDS, SUB_DAO_EPOCH_REWARDS, registrar, - hntMint, + hntMint )); // Add on the voting rewards let { pubkeys: { vetokenTracker: tracker }, } = await rewardsProgram.methods .initializeVetokenTrackerV0({ - votingRewardsTiers: [], + votingRewardsTiers: [ + { + numVetokens: new anchor.BN(0), + percent: delegatorRewardsPercent(0), + }, + { + numVetokens: new anchor.BN(10), + percent: delegatorRewardsPercent(50), + }, + { + numVetokens: new anchor.BN(1000000000000000), + percent: delegatorRewardsPercent(100), + }, + ], }) .accounts({ registrar: subDaoRegistrar, @@ -508,16 +536,19 @@ describe("helium-sub-daos", () => { // Onboard one hotspot to add to the utility score const { rewardableEntityConfig } = await initTestRewardableEntityConfig(hemProgram, subDao); - const { maker, collection, makerKeypair, merkle } = await initTestMaker( - hemProgram, - provider, - rewardableEntityConfig, - dao + const { maker, collection, makerKeypair, merkle } = + await initTestMaker( + hemProgram, + provider, + rewardableEntityConfig, + dao + ); + const eccVerifier = loadKeypair( + __dirname + "/keypairs/verifier-test.json" ); - const eccVerifier = loadKeypair(__dirname + "/keypairs/verifier-test.json"); const ecc = (await HeliumKeypair.makeRandom()).address.b58; const hotspotOwner = Keypair.generate(); - + const { getAssetFn, getAssetProofFn, hotspot } = await createMockCompression({ collection, @@ -526,7 +557,7 @@ describe("helium-sub-daos", () => { ecc, hotspotOwner, }); - console.log("I AM ISSUING") + console.log("I AM ISSUING"); const issueMethod = hemProgram.methods .issueEntityV0({ entityKey: Buffer.from(bs58.decode(ecc)), @@ -548,7 +579,7 @@ describe("helium-sub-daos", () => { .mintDataCreditsV0({ // $50 onboard, $10 location assert dcAmount: toBN(60, 5), - hntAmount: null + hntAmount: null, }) .accounts({ dcMint }) .rpc({ skipPreflight: true }); @@ -563,23 +594,25 @@ describe("helium-sub-daos", () => { location: new BN(1000), getAssetFn, getAssetProofFn, - dcFeePayer: me + dcFeePayer: me, }) ).signers([makerKeypair, hotspotOwner]); - const { pubkeys: { iotInfo: infoKey }} = await method.rpcAndKeys({ skipPreflight: true }); + const { + pubkeys: { iotInfo: infoKey }, + } = await method.rpcAndKeys({ skipPreflight: true }); await hemProgram.methods - .setEntityActiveV0({ - isActive: true, - entityKey: Buffer.from(bs58.decode(ecc)), - }) - .accounts({ - activeDeviceAuthority: me, - rewardableEntityConfig, - info: infoKey! as PublicKey, - }) - .rpc({ skipPreflight: true }); + .setEntityActiveV0({ + isActive: true, + entityKey: Buffer.from(bs58.decode(ecc)), + }) + .accounts({ + activeDeviceAuthority: me, + rewardableEntityConfig, + info: infoKey! as PublicKey, + }) + .rpc({ skipPreflight: true }); const { subDaoEpochInfo } = await burnDc(1600000); const epoch = ( @@ -627,10 +660,7 @@ describe("helium-sub-daos", () => { const supply = (await getMint(provider.connection, hntMint)).supply; const veHnt = toNumber(subDaoInfo.vehntAtEpochStart, 8); const totalUtility = - Math.max(veHnt, 1) * - Math.pow(50, 1 / 4) * - Math.sqrt(16) * - 1; + Math.max(veHnt, 1) * Math.pow(50, 1 / 4) * Math.sqrt(16) * 1; expect(daoInfo.totalRewards.toString()).to.eq( EPOCH_REWARDS.toString() ); @@ -919,17 +949,25 @@ describe("helium-sub-daos", () => { }) .rpc({ skipPreflight: true }); - const { pubkeys: { vsrEpochInfo } } =await program.methods + const { + pubkeys: { vsrEpochInfo }, + } = await program.methods .issueVotingRewardsV0({ epoch, }) .accounts({ subDao, - vsrEpochInfo: vsrEpochInfoKey(vetokenTracker, epoch.mul(new BN(EPOCH_LENGTH)))[0], + vsrEpochInfo: vsrEpochInfoKey( + vetokenTracker, + epoch.mul(new BN(EPOCH_LENGTH)) + )[0], }) .rpcAndKeys({ skipPreflight: true }); - const vsrEpochInfoAcc = await rewardsProgram.account.vsrEpochInfoV0.fetch(vsrEpochInfo!); + const vsrEpochInfoAcc = + await rewardsProgram.account.vsrEpochInfoV0.fetch( + vsrEpochInfo! + ); await program.methods .issueHstPoolV0({ @@ -958,9 +996,7 @@ describe("helium-sub-daos", () => { expect((postMobileBalance - preMobileBalance).toString()).to.eq( ((SUB_DAO_EPOCH_REWARDS / 100) * 92).toString() ); - expect( - vsrEpochInfoAcc.rewardsAmount.toString() - ).to.eq((0.02 * SUB_DAO_EPOCH_REWARDS).toString()); + expect(vsrEpochInfoAcc.rewardsAmount.toString()).to.eq("0"); const acc = await program.account.subDaoEpochInfoV0.fetch( subDaoEpochInfo diff --git a/tests/iot-routing-manager.ts b/tests/iot-routing-manager.ts index e7507d738..76534d45a 100644 --- a/tests/iot-routing-manager.ts +++ b/tests/iot-routing-manager.ts @@ -2,38 +2,27 @@ import * as anchor from "@coral-xyz/anchor"; import { Program } from "@coral-xyz/anchor"; import { init as initDataCredits } from "@helium/data-credits-sdk"; import { init as initHeliumSubDaos } from "@helium/helium-sub-daos-sdk"; -import { - SystemProgram, - Keypair, - PublicKey, - ComputeBudgetProgram, -} from "@solana/web3.js"; +import { PublicKey, ComputeBudgetProgram } from "@solana/web3.js"; import chai from "chai"; import { init as initIotRoutingManager } from "../packages/iot-routing-manager-sdk/src"; -import { - init as initHeliumEntityManager, - sharedMerkleKey, -} from "../packages/helium-entity-manager-sdk/src"; +import { init as initHeliumEntityManager } from "../packages/helium-entity-manager-sdk/src"; +import { init as initVsr } from "../packages/voter-stake-registry-sdk/src"; import { DataCredits } from "../target/types/data_credits"; import { HeliumSubDaos } from "../target/types/helium_sub_daos"; import { IotRoutingManager } from "../target/types/iot_routing_manager"; +import { VoterStakeRegistry } from "../target/types/voter_stake_registry"; import { initTestDao, initTestSubdao } from "./utils/daos"; import { ensureIrmIdl, ensureDCIdl, ensureHSDIdl, + ensureVSRIdl, initTestDataCredits, initSharedMerkle, ensureHEMIdl, } from "./utils/fixtures"; const { expect } = chai; import chaiAsPromised from "chai-as-promised"; -import { getAccount } from "@solana/spl-token"; -import { random } from "./utils/string"; -import { - SPL_ACCOUNT_COMPRESSION_PROGRAM_ID, - getConcurrentMerkleTreeAccountSize, -} from "@solana/spl-account-compression"; import { HeliumEntityManager } from "../target/types/helium_entity_manager"; import { IOT_PRICE_FEED } from "@helium/spl-utils"; @@ -46,6 +35,7 @@ describe("iot-routing-manager", () => { let hsdProgram: Program; let hemProgram: Program; let irmProgram: Program; + let vsrProgram: Program; const provider = anchor.getProvider() as anchor.AnchorProvider; const me = provider.wallet.publicKey; @@ -86,6 +76,13 @@ describe("iot-routing-manager", () => { ); ensureIrmIdl(irmProgram); + vsrProgram = await initVsr( + provider, + anchor.workspace.VoterStakeRegistry.programId, + anchor.workspace.VoterStakeRegistry.idl + ); + ensureVSRIdl(vsrProgram); + const dataCredits = await initTestDataCredits(dcProgram, provider); dcMint = dataCredits.dcMint; ({ dao } = await initTestDao( @@ -95,8 +92,10 @@ describe("iot-routing-manager", () => { me, dataCredits.dcMint )); + ({ subDao, mint: iotMint } = await initTestSubdao({ hsdProgram, + vsrProgram, provider, authority: me, dao, @@ -173,7 +172,7 @@ describe("iot-routing-manager", () => { pubkeys: { netId }, } = await irmProgram.methods .initializeNetIdV0({ - netId: new anchor.BN(1), + netId: 1, }) .accounts({ authority: me, @@ -183,7 +182,7 @@ describe("iot-routing-manager", () => { const netIdAcc = await irmProgram.account.netIdV0.fetch(netId!); expect(netIdAcc.authority.toBase58()).to.eq(me.toBase58()); - expect(netIdAcc.id.toNumber()).to.eq(1); + expect(netIdAcc.id).to.eq(1); }); describe("with net id", async () => { @@ -193,7 +192,7 @@ describe("iot-routing-manager", () => { pubkeys: { netId: netIdK }, } = await irmProgram.methods .initializeNetIdV0({ - netId: new anchor.BN(1), + netId: 1, }) .accounts({ authority: me, @@ -260,7 +259,6 @@ describe("iot-routing-manager", () => { pubkeys: { devaddrConstraint }, } = await irmProgram.methods .initializeDevaddrConstraintV0({ - startAddr: null, numBlocks: 2, }) .accounts({ From 2ded775545a34401cbb87bc5bc30acf16e364925 Mon Sep 17 00:00:00 2001 From: bry Date: Fri, 6 Dec 2024 13:42:42 -0600 Subject: [PATCH 37/63] fix --- .../iot-routing-manager-sdk/yarn.deploy.lock | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/packages/iot-routing-manager-sdk/yarn.deploy.lock b/packages/iot-routing-manager-sdk/yarn.deploy.lock index 89ddfbbf0..87a3e0181 100644 --- a/packages/iot-routing-manager-sdk/yarn.deploy.lock +++ b/packages/iot-routing-manager-sdk/yarn.deploy.lock @@ -134,6 +134,7 @@ __metadata: "@coral-xyz/anchor": ^0.28.0 "@helium/anchor-resolvers": ^0.9.15 "@helium/idls": ^0.9.15 + "@helium/spl-utils": ^0.9.15 bn.js: ^5.2.0 bs58: ^4.0.1 git-format-staged: ^2.1.3 @@ -173,6 +174,7 @@ __metadata: "@coral-xyz/anchor": ^0.28.0 "@helium/anchor-resolvers": ^0.9.15 "@helium/circuit-breaker-sdk": ^0.9.15 + "@helium/spl-utils": ^0.9.15 "@helium/treasury-management-sdk": ^0.9.15 "@helium/voter-stake-registry-sdk": ^0.9.15 bn.js: ^5.2.0 @@ -198,19 +200,6 @@ __metadata: languageName: unknown linkType: soft -"@helium/idls@npm:^0.5.0": - version: 0.5.0 - resolution: "@helium/idls@npm:0.5.0" - dependencies: - "@coral-xyz/anchor": ^0.28.0 - "@solana/web3.js": ^1.78.4 - bn.js: ^5.2.0 - borsh: ^0.7.0 - bs58: ^4.0.1 - checksum: 66a021a9953cf0a96f0eaf8932a2006286c266cc323f171eedf2bc18a94d55ad035cc7da9e21c99dc70fc77b1681630382a55999a2f40228f33611d7621a0c7c - languageName: node - linkType: hard - "@helium/iot-routing-manager-sdk@workspace:.": version: 0.0.0-use.local resolution: "@helium/iot-routing-manager-sdk@workspace:." @@ -255,7 +244,8 @@ __metadata: dependencies: "@coral-xyz/anchor": ^0.28.0 "@helium/anchor-resolvers": ^0.5.0 - "@helium/idls": ^0.5.0 + "@helium/idls": ^0.9.15 + "@helium/spl-utils": ^0.9.15 bn.js: ^5.2.0 bs58: ^4.0.1 git-format-staged: ^2.1.3 @@ -295,6 +285,7 @@ __metadata: "@helium/anchor-resolvers": ^0.9.15 "@helium/circuit-breaker-sdk": ^0.9.15 "@helium/idls": ^0.9.15 + "@helium/spl-utils": ^0.9.15 bn.js: ^5.2.0 bs58: ^4.0.1 git-format-staged: ^2.1.3 From 8b09e3fab068428caef9d2d16c0b74da344b0bfb Mon Sep 17 00:00:00 2001 From: bry Date: Fri, 6 Dec 2024 14:38:09 -0600 Subject: [PATCH 38/63] fix test --- .../package.json | 1 + .../yarn.deploy.lock | 89 ++++++++++++++++++- yarn.lock | 1 + 3 files changed, 89 insertions(+), 2 deletions(-) diff --git a/packages/account-postgres-sink-service/package.json b/packages/account-postgres-sink-service/package.json index 31f71b2f1..89c8389e3 100644 --- a/packages/account-postgres-sink-service/package.json +++ b/packages/account-postgres-sink-service/package.json @@ -38,6 +38,7 @@ "@coral-xyz/anchor": "^0.28.0", "@fastify/cors": "^8.1.1", "@helium/account-fetch-cache": "^0.9.15", + "@helium/spl-utils": "^0.9.15", "@metaplex-foundation/mpl-token-metadata": "^2.10.0", "@solana/web3.js": "^1.78.8", "@substreams/core": "^0.15.1", diff --git a/packages/account-postgres-sink-service/yarn.deploy.lock b/packages/account-postgres-sink-service/yarn.deploy.lock index 5733cb30d..51d9f21aa 100644 --- a/packages/account-postgres-sink-service/yarn.deploy.lock +++ b/packages/account-postgres-sink-service/yarn.deploy.lock @@ -200,6 +200,7 @@ __metadata: "@coral-xyz/anchor": ^0.28.0 "@fastify/cors": ^8.1.1 "@helium/account-fetch-cache": ^0.9.15 + "@helium/spl-utils": ^0.9.15 "@metaplex-foundation/mpl-token-metadata": ^2.10.0 "@solana/web3.js": ^1.78.8 "@substreams/core": ^0.15.1 @@ -244,6 +245,53 @@ __metadata: languageName: unknown linkType: soft +"@helium/address@npm:^4.10.2": + version: 4.10.2 + resolution: "@helium/address@npm:4.10.2" + dependencies: + bs58: "npm:^5.0.0" + js-sha256: "npm:^0.9.0" + multiformats: "npm:^9.6.4" + checksum: 4d83df57c638ed1496a92241a2f45da671e11b6397f02ab65c5281cbd1a435548e7ffd5be969d8d214b5af045e9be4bdd2d89f41744289c17e6410d458b03bcc + languageName: node + linkType: hard + +"@helium/anchor-resolvers@^0.9.15": + version: 0.0.0-use.local + resolution: "@helium/anchor-resolvers@workspace:packages/anchor-resolvers" + dependencies: + "@solana/spl-token": ^0.3.8 + "@solana/web3.js": ^1.78.8 + git-format-staged: ^2.1.3 + ts-loader: ^9.2.3 + typescript: ^5.2.2 + peerDependencies: + "@coral-xyz/anchor": ^0.28.0 + languageName: unknown + linkType: soft + +"@helium/spl-utils@^0.9.15": + version: 0.0.0-use.local + resolution: "@helium/spl-utils@workspace:packages/spl-utils" + dependencies: + "@coral-xyz/anchor": ^0.28.0 + "@helium/account-fetch-cache": ^0.9.15 + "@helium/address": ^4.10.2 + "@helium/anchor-resolvers": ^0.9.15 + "@metaplex-foundation/mpl-token-metadata": ^2.10.0 + "@solana/spl-account-compression": ^0.1.7 + "@solana/spl-token": ^0.3.8 + "@solana/web3.js": ^1.78.8 + axios: ^1.5.0 + bn.js: ^5.2.0 + borsh: ^0.7.0 + bs58: ^4.0.1 + git-format-staged: ^2.1.3 + ts-loader: ^9.2.3 + typescript: ^5.2.2 + languageName: unknown + linkType: soft + "@isaacs/cliui@npm:^8.0.2": version: 8.0.2 resolution: "@isaacs/cliui@npm:8.0.2" @@ -476,7 +524,23 @@ __metadata: languageName: node linkType: hard -"@solana/spl-token@npm:^0.3.6": +"@solana/spl-account-compression@npm:^0.1.7": + version: 0.1.10 + resolution: "@solana/spl-account-compression@npm:0.1.10" + dependencies: + "@metaplex-foundation/beet": "npm:^0.7.1" + "@metaplex-foundation/beet-solana": "npm:^0.4.0" + bn.js: "npm:^5.2.1" + borsh: "npm:^0.7.0" + js-sha3: "npm:^0.8.0" + typescript-collections: "npm:^1.3.3" + peerDependencies: + "@solana/web3.js": ^1.50.1 + checksum: 99bd851933c46a068dbd13484770edd7ae12488b1474ee2e9d7dfd114087f3f9f813745795f91278142fbeb09aec1024f74ef2d2c8be2b47f1df319d37f0af11 + languageName: node + linkType: hard + +"@solana/spl-token@npm:^0.3.6, @solana/spl-token@npm:^0.3.8": version: 0.3.8 resolution: "@solana/spl-token@npm:0.3.8" dependencies: @@ -1009,7 +1073,7 @@ __metadata: languageName: node linkType: hard -"axios@npm:^1.3.6": +"axios@npm:^1.3.6, axios@npm:^1.5.0": version: 1.5.0 resolution: "axios@npm:1.5.0" dependencies: @@ -2561,6 +2625,13 @@ __metadata: languageName: node linkType: hard +"js-sha3@npm:^0.8.0": + version: 0.8.0 + resolution: "js-sha3@npm:0.8.0" + checksum: 75df77c1fc266973f06cce8309ce010e9e9f07ec35ab12022ed29b7f0d9c8757f5a73e1b35aa24840dced0dea7059085aa143d817aea9e188e2a80d569d9adce + languageName: node + linkType: hard + "json-schema-traverse@npm:^1.0.0": version: 1.0.0 resolution: "json-schema-traverse@npm:1.0.0" @@ -2894,6 +2965,13 @@ __metadata: languageName: node linkType: hard +"multiformats@npm:^9.6.4": + version: 9.9.0 + resolution: "multiformats@npm:9.9.0" + checksum: d3e8c1be400c09a014f557ea02251a2710dbc9fca5aa32cc702ff29f636c5471e17979f30bdcb0a9cbb556f162a8591dc2e1219c24fc21394a56115b820bb84e + languageName: node + linkType: hard + "negotiator@npm:^0.6.3": version: 0.6.3 resolution: "negotiator@npm:0.6.3" @@ -4173,6 +4251,13 @@ __metadata: languageName: node linkType: hard +"typescript-collections@npm:^1.3.3": + version: 1.3.3 + resolution: "typescript-collections@npm:1.3.3" + checksum: a27f07dffdfe8407c4302eedb3e578b1360de783626cbd53519bd9c7943293a2940ed1ec3004cafae9dce049768b143185a36ca812d0d5c3c0f621a289239633 + languageName: node + linkType: hard + "typescript@npm:^5.2.2": version: 5.2.2 resolution: "typescript@npm:5.2.2" diff --git a/yarn.lock b/yarn.lock index ff8426461..10709079f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -539,6 +539,7 @@ __metadata: "@coral-xyz/anchor": ^0.28.0 "@fastify/cors": ^8.1.1 "@helium/account-fetch-cache": ^0.9.15 + "@helium/spl-utils": ^0.9.15 "@metaplex-foundation/mpl-token-metadata": ^2.10.0 "@solana/web3.js": ^1.78.8 "@substreams/core": ^0.15.1 From 9e06fed0fdb259376a2237813108f898a5c9eab4 Mon Sep 17 00:00:00 2001 From: bry Date: Thu, 12 Dec 2024 15:31:53 -0600 Subject: [PATCH 39/63] Fix test --- .../yarn.deploy.lock | 10 +-- .../iot-routing-manager-sdk/yarn.deploy.lock | 76 +++++++++---------- yarn.lock | 7 +- 3 files changed, 46 insertions(+), 47 deletions(-) diff --git a/packages/account-postgres-sink-service/yarn.deploy.lock b/packages/account-postgres-sink-service/yarn.deploy.lock index 95a177195..22c474b11 100644 --- a/packages/account-postgres-sink-service/yarn.deploy.lock +++ b/packages/account-postgres-sink-service/yarn.deploy.lock @@ -199,8 +199,8 @@ __metadata: "@connectrpc/connect-node": ^1.3.0 "@coral-xyz/anchor": ^0.28.0 "@fastify/cors": ^8.1.1 - "@helium/spl-utils": ^0.9.18 "@helium/account-fetch-cache": ^0.9.18 + "@helium/spl-utils": ^0.9.18 "@metaplex-foundation/mpl-token-metadata": ^2.10.0 "@solana/web3.js": ^1.78.8 "@substreams/core": ^0.15.1 @@ -256,7 +256,7 @@ __metadata: languageName: node linkType: hard -"@helium/anchor-resolvers@^0.9.15": +"@helium/anchor-resolvers@^0.9.18": version: 0.0.0-use.local resolution: "@helium/anchor-resolvers@workspace:packages/anchor-resolvers" dependencies: @@ -270,14 +270,14 @@ __metadata: languageName: unknown linkType: soft -"@helium/spl-utils@^0.9.15": +"@helium/spl-utils@^0.9.18": version: 0.0.0-use.local resolution: "@helium/spl-utils@workspace:packages/spl-utils" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/account-fetch-cache": ^0.9.15 + "@helium/account-fetch-cache": ^0.9.18 "@helium/address": ^4.10.2 - "@helium/anchor-resolvers": ^0.9.15 + "@helium/anchor-resolvers": ^0.9.18 "@metaplex-foundation/mpl-token-metadata": ^2.10.0 "@solana/spl-account-compression": ^0.1.7 "@solana/spl-token": ^0.3.8 diff --git a/packages/iot-routing-manager-sdk/yarn.deploy.lock b/packages/iot-routing-manager-sdk/yarn.deploy.lock index 87a3e0181..7ada05684 100644 --- a/packages/iot-routing-manager-sdk/yarn.deploy.lock +++ b/packages/iot-routing-manager-sdk/yarn.deploy.lock @@ -67,7 +67,7 @@ __metadata: languageName: node linkType: hard -"@helium/account-fetch-cache@^0.9.15": +"@helium/account-fetch-cache@^0.9.18": version: 0.0.0-use.local resolution: "@helium/account-fetch-cache@workspace:packages/account-fetch-cache" dependencies: @@ -89,7 +89,7 @@ __metadata: languageName: node linkType: hard -"@helium/anchor-resolvers@^0.9.15, @helium/anchor-resolvers@^0.9.2": +"@helium/anchor-resolvers@^0.9.18, @helium/anchor-resolvers@^0.9.2": version: 0.0.0-use.local resolution: "@helium/anchor-resolvers@workspace:packages/anchor-resolvers" dependencies: @@ -127,14 +127,14 @@ __metadata: languageName: node linkType: hard -"@helium/circuit-breaker-sdk@^0.9.15": +"@helium/circuit-breaker-sdk@^0.9.18": version: 0.0.0-use.local resolution: "@helium/circuit-breaker-sdk@workspace:packages/circuit-breaker-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/anchor-resolvers": ^0.9.15 - "@helium/idls": ^0.9.15 - "@helium/spl-utils": ^0.9.15 + "@helium/anchor-resolvers": ^0.9.18 + "@helium/idls": ^0.9.18 + "@helium/spl-utils": ^0.9.18 bn.js: ^5.2.0 bs58: ^4.0.1 git-format-staged: ^2.1.3 @@ -150,11 +150,11 @@ __metadata: dependencies: "@coral-xyz/anchor": ^0.28.0 "@helium/address": ^4.10.2 - "@helium/anchor-resolvers": ^0.9.15 - "@helium/helium-sub-daos-sdk": ^0.9.15 - "@helium/idls": ^0.9.15 - "@helium/no-emit-sdk": ^0.9.15 - "@helium/spl-utils": ^0.9.15 + "@helium/anchor-resolvers": ^0.9.18 + "@helium/helium-sub-daos-sdk": ^0.9.18 + "@helium/idls": ^0.9.18 + "@helium/no-emit-sdk": ^0.9.18 + "@helium/spl-utils": ^0.9.18 "@types/crypto-js": ^4.1.1 bn.js: ^5.2.0 bs58: ^4.0.1 @@ -167,16 +167,16 @@ __metadata: languageName: unknown linkType: soft -"@helium/helium-sub-daos-sdk@^0.9.15": +"@helium/helium-sub-daos-sdk@^0.9.18": version: 0.0.0-use.local resolution: "@helium/helium-sub-daos-sdk@workspace:packages/helium-sub-daos-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/anchor-resolvers": ^0.9.15 - "@helium/circuit-breaker-sdk": ^0.9.15 - "@helium/spl-utils": ^0.9.15 - "@helium/treasury-management-sdk": ^0.9.15 - "@helium/voter-stake-registry-sdk": ^0.9.15 + "@helium/anchor-resolvers": ^0.9.18 + "@helium/circuit-breaker-sdk": ^0.9.18 + "@helium/spl-utils": ^0.9.18 + "@helium/treasury-management-sdk": ^0.9.18 + "@helium/voter-stake-registry-sdk": ^0.9.18 bn.js: ^5.2.0 bs58: ^4.0.1 git-format-staged: ^2.1.3 @@ -186,7 +186,7 @@ __metadata: languageName: unknown linkType: soft -"@helium/idls@^0.9.15": +"@helium/idls@^0.9.18": version: 0.0.0-use.local resolution: "@helium/idls@workspace:packages/idls" dependencies: @@ -226,26 +226,26 @@ __metadata: languageName: node linkType: hard -"@helium/nft-proxy-sdk@npm:^0.0.12": - version: 0.0.12 - resolution: "@helium/nft-proxy-sdk@npm:0.0.12" +"@helium/nft-proxy-sdk@npm:^0.0.15": + version: 0.0.15 + resolution: "@helium/nft-proxy-sdk@npm:0.0.15" dependencies: "@coral-xyz/anchor": ^0.28.0 "@helium/anchor-resolvers": ^0.2.17 "@helium/modular-governance-idls": ^0.0.10 "@solana/spl-token": ^0.3.8 - checksum: e70478c9ed007a1044ff7c76d0e0fdaf1163b489772893b8f4b52dd9d69d194aee71bc63a181a81c766dc459474cdbf3403035cc1f43e2741e89c139e3881b8b + checksum: ce22c3b786b00bb1a64baa33b040b0530d87420b49ab5b0b8a5704fbc184c71d93c01120d4fc8cf9fdc347b2a4a38c422011d86cc3e5e090243ee630f29e9456 languageName: node linkType: hard -"@helium/no-emit-sdk@^0.9.15": +"@helium/no-emit-sdk@^0.9.18": version: 0.0.0-use.local resolution: "@helium/no-emit-sdk@workspace:packages/no-emit-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 "@helium/anchor-resolvers": ^0.5.0 - "@helium/idls": ^0.9.15 - "@helium/spl-utils": ^0.9.15 + "@helium/idls": ^0.9.18 + "@helium/spl-utils": ^0.9.18 bn.js: ^5.2.0 bs58: ^4.0.1 git-format-staged: ^2.1.3 @@ -255,14 +255,14 @@ __metadata: languageName: unknown linkType: soft -"@helium/spl-utils@^0.9.15": +"@helium/spl-utils@^0.9.18": version: 0.0.0-use.local resolution: "@helium/spl-utils@workspace:packages/spl-utils" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/account-fetch-cache": ^0.9.15 + "@helium/account-fetch-cache": ^0.9.18 "@helium/address": ^4.10.2 - "@helium/anchor-resolvers": ^0.9.15 + "@helium/anchor-resolvers": ^0.9.18 "@metaplex-foundation/mpl-token-metadata": ^2.10.0 "@solana/spl-account-compression": ^0.1.7 "@solana/spl-token": ^0.3.8 @@ -277,15 +277,15 @@ __metadata: languageName: unknown linkType: soft -"@helium/treasury-management-sdk@^0.9.15": +"@helium/treasury-management-sdk@^0.9.18": version: 0.0.0-use.local resolution: "@helium/treasury-management-sdk@workspace:packages/treasury-management-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/anchor-resolvers": ^0.9.15 - "@helium/circuit-breaker-sdk": ^0.9.15 - "@helium/idls": ^0.9.15 - "@helium/spl-utils": ^0.9.15 + "@helium/anchor-resolvers": ^0.9.18 + "@helium/circuit-breaker-sdk": ^0.9.18 + "@helium/idls": ^0.9.18 + "@helium/spl-utils": ^0.9.18 bn.js: ^5.2.0 bs58: ^4.0.1 git-format-staged: ^2.1.3 @@ -295,15 +295,15 @@ __metadata: languageName: unknown linkType: soft -"@helium/voter-stake-registry-sdk@^0.9.15": +"@helium/voter-stake-registry-sdk@^0.9.18": version: 0.0.0-use.local resolution: "@helium/voter-stake-registry-sdk@workspace:packages/voter-stake-registry-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/anchor-resolvers": ^0.9.15 - "@helium/idls": ^0.9.15 - "@helium/nft-proxy-sdk": ^0.0.12 - "@helium/spl-utils": ^0.9.15 + "@helium/anchor-resolvers": ^0.9.18 + "@helium/idls": ^0.9.18 + "@helium/nft-proxy-sdk": ^0.0.15 + "@helium/spl-utils": ^0.9.18 "@metaplex-foundation/mpl-token-metadata": ^2.10.0 "@solana/spl-token": ^0.3.8 bn.js: ^5.2.0 diff --git a/yarn.lock b/yarn.lock index 4ff79962c..101c757cd 100644 --- a/yarn.lock +++ b/yarn.lock @@ -538,8 +538,8 @@ __metadata: "@connectrpc/connect-node": ^1.3.0 "@coral-xyz/anchor": ^0.28.0 "@fastify/cors": ^8.1.1 - "@helium/spl-utils": ^0.9.18 "@helium/account-fetch-cache": ^0.9.18 + "@helium/spl-utils": ^0.9.18 "@metaplex-foundation/mpl-token-metadata": ^2.10.0 "@solana/web3.js": ^1.78.8 "@substreams/core": ^0.15.1 @@ -610,7 +610,7 @@ __metadata: languageName: node linkType: hard -"@helium/anchor-resolvers@^0.9.18, @helium/anchor-resolvers@workspace:packages/anchor-resolvers": +"@helium/anchor-resolvers@^0.9.18, @helium/anchor-resolvers@^0.9.2, @helium/anchor-resolvers@workspace:packages/anchor-resolvers": version: 0.0.0-use.local resolution: "@helium/anchor-resolvers@workspace:packages/anchor-resolvers" dependencies: @@ -939,8 +939,7 @@ __metadata: languageName: unknown linkType: soft - -"@helium/helium-entity-manager-sdk@^0.9.18, @helium/helium-entity-manager-sdk@workspace:packages/helium-entity-manager-sdk": +"@helium/helium-entity-manager-sdk@^0.9.18, @helium/helium-entity-manager-sdk@^0.9.2, @helium/helium-entity-manager-sdk@workspace:packages/helium-entity-manager-sdk": version: 0.0.0-use.local resolution: "@helium/helium-entity-manager-sdk@workspace:packages/helium-entity-manager-sdk" dependencies: From 757756a152ab5fe7edf2c61eae37cfc9776a92a7 Mon Sep 17 00:00:00 2001 From: bry Date: Wed, 18 Dec 2024 11:04:42 -0600 Subject: [PATCH 40/63] update deploy lock --- packages/iot-routing-manager-sdk/yarn.deploy.lock | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/iot-routing-manager-sdk/yarn.deploy.lock b/packages/iot-routing-manager-sdk/yarn.deploy.lock index 7ada05684..ce21dde22 100644 --- a/packages/iot-routing-manager-sdk/yarn.deploy.lock +++ b/packages/iot-routing-manager-sdk/yarn.deploy.lock @@ -174,6 +174,7 @@ __metadata: "@coral-xyz/anchor": ^0.28.0 "@helium/anchor-resolvers": ^0.9.18 "@helium/circuit-breaker-sdk": ^0.9.18 + "@helium/nft-proxy-sdk": ^0.0.15 "@helium/spl-utils": ^0.9.18 "@helium/treasury-management-sdk": ^0.9.18 "@helium/voter-stake-registry-sdk": ^0.9.18 From 51db92f53c8f1fba906021de019badcd1de0ed12 Mon Sep 17 00:00:00 2001 From: bry Date: Wed, 18 Dec 2024 12:06:56 -0600 Subject: [PATCH 41/63] add update instructions --- .../src/instructions/mod.rs | 4 ++ .../src/instructions/update_net_id_v0.rs | 28 +++++++++ .../instructions/update_organization_v0.rs | 9 ++- .../instructions/update_routing_manager_v0.rs | 46 +++++++++++++++ programs/iot-routing-manager/src/lib.rs | 11 ++++ tests/iot-routing-manager.ts | 57 +++++++++++++++++++ 6 files changed, 152 insertions(+), 3 deletions(-) create mode 100644 programs/iot-routing-manager/src/instructions/update_net_id_v0.rs create mode 100644 programs/iot-routing-manager/src/instructions/update_routing_manager_v0.rs diff --git a/programs/iot-routing-manager/src/instructions/mod.rs b/programs/iot-routing-manager/src/instructions/mod.rs index 1f721af94..be9c3f806 100644 --- a/programs/iot-routing-manager/src/instructions/mod.rs +++ b/programs/iot-routing-manager/src/instructions/mod.rs @@ -9,7 +9,9 @@ pub mod remove_organization_delegate_v0; pub mod temp_backfill_devaddr_constraint; pub mod temp_backfill_organization; pub mod temp_backfill_organization_delegate; +pub mod update_net_id_v0; pub mod update_organization_v0; +pub mod update_routing_manager_v0; pub use approve_organization_v0::*; pub use initialize_devaddr_constraint_v0::*; @@ -22,4 +24,6 @@ pub use remove_organization_delegate_v0::*; pub use temp_backfill_devaddr_constraint::*; pub use temp_backfill_organization::*; pub use temp_backfill_organization_delegate::*; +pub use update_net_id_v0::*; pub use update_organization_v0::*; +pub use update_routing_manager_v0::*; diff --git a/programs/iot-routing-manager/src/instructions/update_net_id_v0.rs b/programs/iot-routing-manager/src/instructions/update_net_id_v0.rs new file mode 100644 index 000000000..8a0b04a6f --- /dev/null +++ b/programs/iot-routing-manager/src/instructions/update_net_id_v0.rs @@ -0,0 +1,28 @@ +use anchor_lang::prelude::*; + +use crate::NetIdV0; + +#[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)] +pub struct UpdateNetIdArgsV0 { + authority: Option, +} + +#[derive(Accounts)] +pub struct UpdateNetIdV0<'info> { + pub authority: Signer<'info>, + #[account( + mut, + has_one = authority + )] + pub net_id: Account<'info, NetIdV0>, +} + +pub fn handler(ctx: Context, args: UpdateNetIdArgsV0) -> Result<()> { + let net_id = &mut ctx.accounts.net_id; + + if args.authority.is_some() { + net_id.authority = args.authority.unwrap() + } + + Ok(()) +} diff --git a/programs/iot-routing-manager/src/instructions/update_organization_v0.rs b/programs/iot-routing-manager/src/instructions/update_organization_v0.rs index 65d0f1015..989519c30 100644 --- a/programs/iot-routing-manager/src/instructions/update_organization_v0.rs +++ b/programs/iot-routing-manager/src/instructions/update_organization_v0.rs @@ -4,7 +4,7 @@ use crate::OrganizationV0; #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)] pub struct UpdateOrganizationArgsV0 { - new_authority: Option, + authority: Option, } #[derive(Accounts)] @@ -18,8 +18,11 @@ pub struct UpdateOrganizationV0<'info> { } pub fn handler(ctx: Context, args: UpdateOrganizationArgsV0) -> Result<()> { - if let Some(authority) = args.new_authority { - ctx.accounts.organization.authority = authority; + let organization = &mut ctx.accounts.organization; + + if args.authority.is_some() { + organization.authority = args.authority.unwrap() } + Ok(()) } diff --git a/programs/iot-routing-manager/src/instructions/update_routing_manager_v0.rs b/programs/iot-routing-manager/src/instructions/update_routing_manager_v0.rs new file mode 100644 index 000000000..2823443ae --- /dev/null +++ b/programs/iot-routing-manager/src/instructions/update_routing_manager_v0.rs @@ -0,0 +1,46 @@ +use anchor_lang::prelude::*; + +use crate::IotRoutingManagerV0; + +#[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)] +pub struct UpdateRoutingManagerArgsV0 { + update_authority: Option, + net_id_authority: Option, + devaddr_price_usd: Option, + oui_price_usd: Option, +} + +#[derive(Accounts)] +pub struct UpdateRoutingManagerV0<'info> { + pub update_authority: Signer<'info>, + #[account( + mut, + has_one = update_authority + )] + pub routing_manager: Account<'info, IotRoutingManagerV0>, +} + +pub fn handler( + ctx: Context, + args: UpdateRoutingManagerArgsV0, +) -> Result<()> { + let routing_manager = &mut ctx.accounts.routing_manager; + + if args.update_authority.is_some() { + routing_manager.update_authority = args.update_authority.unwrap(); + } + + if args.net_id_authority.is_some() { + routing_manager.net_id_authority = args.net_id_authority.unwrap(); + } + + if args.devaddr_price_usd.is_some() { + routing_manager.devaddr_price_usd = args.devaddr_price_usd.unwrap(); + } + + if args.oui_price_usd.is_some() { + routing_manager.oui_price_usd = args.oui_price_usd.unwrap(); + } + + Ok(()) +} diff --git a/programs/iot-routing-manager/src/lib.rs b/programs/iot-routing-manager/src/lib.rs index 617a036b0..f3f057f8c 100644 --- a/programs/iot-routing-manager/src/lib.rs +++ b/programs/iot-routing-manager/src/lib.rs @@ -74,6 +74,17 @@ pub mod iot_routing_manager { approve_organization_v0::handler(ctx) } + pub fn update_routing_manager_v0( + ctx: Context, + args: UpdateRoutingManagerArgsV0, + ) -> Result<()> { + update_routing_manager_v0::handler(ctx, args) + } + + pub fn update_net_id_v0(ctx: Context, args: UpdateNetIdArgsV0) -> Result<()> { + update_net_id_v0::handler(ctx, args) + } + pub fn update_organization_v0( ctx: Context, args: UpdateOrganizationArgsV0, diff --git a/tests/iot-routing-manager.ts b/tests/iot-routing-manager.ts index 76534d45a..82fffb4b5 100644 --- a/tests/iot-routing-manager.ts +++ b/tests/iot-routing-manager.ts @@ -228,6 +228,20 @@ describe("iot-routing-manager", () => { ); }); + it("should update the net id", async () => { + await irmProgram.methods + .updateNetIdV0({ + authority: PublicKey.default, + }) + .accounts({ netId }) + .rpc(); + + const netIdAcc = await irmProgram.account.netIdV0.fetch(netId); + expect(netIdAcc.authority.toBase58()).to.eq( + PublicKey.default.toBase58() + ); + }); + describe("with an organization", () => { let organization: PublicKey; beforeEach(async () => { @@ -271,7 +285,50 @@ describe("iot-routing-manager", () => { expect(devaddr.startAddr.toNumber()).to.eq(0); expect(devaddr.endAddr.toNumber()).to.eq(16); }); + + it("should update the organization", async () => { + await irmProgram.methods + .updateOrganizationV0({ + authority: PublicKey.default, + }) + .accounts({ organization }) + .rpc(); + + const orgAcc = await irmProgram.account.netIdV0.fetch(netId); + expect(orgAcc.authority.toBase58()).to.eq( + PublicKey.default.toBase58() + ); + }); }); }); + + it("should update the routing manager", async () => { + await irmProgram.methods + .updateRoutingManagerV0({ + updateAuthority: PublicKey.default, + netIdAuthority: PublicKey.default, + devaddrPriceUsd: new anchor.BN(10_000000), + ouiPriceUsd: new anchor.BN(10_000000), + }) + .accounts({ + routingManager, + }) + .rpc(); + + const routingManagerAcc = + await irmProgram.account.iotRoutingManagerV0.fetch(routingManager); + expect(routingManagerAcc.updateAuthority.toBase58).to.eq( + PublicKey.default.toBase58() + ); + expect(routingManagerAcc.netIdAuthority.toBase58).to.eq( + PublicKey.default.toBase58() + ); + expect(routingManagerAcc.devaddrPriceUsd.toNumber()).to.eq( + new anchor.BN(10_000000).toNumber() + ); + expect(routingManagerAcc.ouiPriceUsd.toNumber()).to.eq( + new anchor.BN(10_000000).toNumber() + ); + }); }); }); From ef32013664c39f280c4fb1e5761f45652118d958 Mon Sep 17 00:00:00 2001 From: bry Date: Wed, 18 Dec 2024 13:25:39 -0600 Subject: [PATCH 42/63] add oui_wallet to backfill script --- .../helium-admin-cli/src/backfill-ouis.ts | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/packages/helium-admin-cli/src/backfill-ouis.ts b/packages/helium-admin-cli/src/backfill-ouis.ts index 5a739d3c3..87ba512e6 100644 --- a/packages/helium-admin-cli/src/backfill-ouis.ts +++ b/packages/helium-admin-cli/src/backfill-ouis.ts @@ -78,6 +78,11 @@ export async function run(args: any = process.argv) { describe: "Anchor wallet keypair", default: `${os.homedir()}/.config/solana/id.json`, }, + oui_wallet: { + required: true, + type: "string", + describe: "Address of wallet to control oui operations", + }, url: { alias: "u", default: "http://127.0.0.1:8899", @@ -119,6 +124,7 @@ export async function run(args: any = process.argv) { const provider = anchor.getProvider() as anchor.AnchorProvider; const conn = provider.connection; const wallet = new anchor.Wallet(loadKeypair(argv.wallet)); + const oui_wallet = new PublicKey(argv.oui_wallet); const irm = await initIRM(provider); const hem = await initHEM(provider); const isRds = argv.pgHost.includes("rds.amazon.com"); @@ -392,4 +398,21 @@ export async function run(args: any = process.argv) { console.log(`Initializing (${devaddrIxs.length}) devaddrConstraints`); await batchParallelInstructionsWithPriorityFee(provider, devaddrIxs); + + console.log(`Updating authorites to ${argv.helium_oui_wallet}`); + await batchParallelInstructionsWithPriorityFee(provider, [ + await irm.methods + .updateRoutingManagerV0({ + updateAuthority: null, + netIdAuthority: oui_wallet, + devaddrPriceUsd: null, + ouiPriceUsd: null, + }) + .instruction(), + await irm.methods + .updateNetIdV0({ + authority: oui_wallet, + }) + .instruction(), + ]); } From 67997c5bd734bd67b147aae37be33f2754b58ab0 Mon Sep 17 00:00:00 2001 From: bry Date: Wed, 15 Jan 2025 16:05:20 -0600 Subject: [PATCH 43/63] fixes --- .../helium-admin-cli/src/backfill-ouis.ts | 82 ++++++++++++++----- packages/spl-utils/src/constants.ts | 8 +- 2 files changed, 65 insertions(+), 25 deletions(-) diff --git a/packages/helium-admin-cli/src/backfill-ouis.ts b/packages/helium-admin-cli/src/backfill-ouis.ts index 87ba512e6..fea2206e8 100644 --- a/packages/helium-admin-cli/src/backfill-ouis.ts +++ b/packages/helium-admin-cli/src/backfill-ouis.ts @@ -78,7 +78,7 @@ export async function run(args: any = process.argv) { describe: "Anchor wallet keypair", default: `${os.homedir()}/.config/solana/id.json`, }, - oui_wallet: { + ouiWallet: { required: true, type: "string", describe: "Address of wallet to control oui operations", @@ -124,7 +124,7 @@ export async function run(args: any = process.argv) { const provider = anchor.getProvider() as anchor.AnchorProvider; const conn = provider.connection; const wallet = new anchor.Wallet(loadKeypair(argv.wallet)); - const oui_wallet = new PublicKey(argv.oui_wallet); + const ouiWallet = new PublicKey(argv.ouiWallet); const irm = await initIRM(provider); const hem = await initHEM(provider); const isRds = argv.pgHost.includes("rds.amazon.com"); @@ -311,10 +311,15 @@ export async function run(args: any = process.argv) { await Promise.all( orgs.map(async (org) => { const [orgK] = organizationKey(routingManager, new anchor.BN(org.oui)); - return await irm.methods - .approveOrganizationV0() - .accounts({ organization: orgK }) - .instruction(); + if ( + !(await exists(conn, orgK)) || + !(await irm.account.organizationV0.fetch(orgK)).approved + ) { + return await irm.methods + .approveOrganizationV0() + .accounts({ organization: orgK }) + .instruction(); + } }) ) ).filter(truthy); @@ -399,20 +404,55 @@ export async function run(args: any = process.argv) { console.log(`Initializing (${devaddrIxs.length}) devaddrConstraints`); await batchParallelInstructionsWithPriorityFee(provider, devaddrIxs); - console.log(`Updating authorites to ${argv.helium_oui_wallet}`); - await batchParallelInstructionsWithPriorityFee(provider, [ - await irm.methods - .updateRoutingManagerV0({ - updateAuthority: null, - netIdAuthority: oui_wallet, - devaddrPriceUsd: null, - ouiPriceUsd: null, - }) - .instruction(), - await irm.methods - .updateNetIdV0({ - authority: oui_wallet, + if ( + (await exists(conn, routingManager)) && + !( + await irm.account.iotRoutingManagerV0.fetch(routingManager) + ).netIdAuthority.equals(ouiWallet) + ) { + console.log(`Updating routingManager netIdAuthority to ${argv.ouiWallet}`); + await batchParallelInstructionsWithPriorityFee(provider, [ + await irm.methods + .updateRoutingManagerV0({ + updateAuthority: null, + netIdAuthority: ouiWallet, + devaddrPriceUsd: null, + ouiPriceUsd: null, + }) + .accounts({ + updateAuthority: wallet.publicKey, + routingManager, + }) + .instruction(), + ]); + } + + const netIdUpdateIxs = ( + await Promise.all( + netIds.map(async (netId) => { + const [netIdK] = netIdKey(routingManager, new anchor.BN(netId)); + if ( + (await exists(conn, netIdK)) && + !(await irm.account.netIdV0.fetch(netIdK)).authority.equals(ouiWallet) + ) { + return await irm.methods + .updateNetIdV0({ + authority: ouiWallet, + }) + .accounts({ + authority: wallet.publicKey, + netId: netIdK, + }) + .instruction(); + } }) - .instruction(), - ]); + ) + ).filter(truthy); + + if (netIdUpdateIxs.length > 0) { + console.log( + `Updating (${netIdUpdateIxs.length}) netIdAuthorites to ${argv.ouiWallet}` + ); + await batchParallelInstructionsWithPriorityFee(provider, netIdUpdateIxs); + } } diff --git a/packages/spl-utils/src/constants.ts b/packages/spl-utils/src/constants.ts index f01c009d6..81afc144f 100644 --- a/packages/spl-utils/src/constants.ts +++ b/packages/spl-utils/src/constants.ts @@ -1,19 +1,19 @@ import { PublicKey } from "@solana/web3.js"; export const DC_MINT = new PublicKey( - "dcuc8Amr83Wz27ZkQ2K9NS6r8zRpf1J6cvArEBDZDmm" + "EMsZWzk2zqwtTvvimTVD1qq4usxsNptt1HWSHYurcBWA" ); export const HNT_MINT = new PublicKey( - "hntyVP6YFm1Hg25TN9WGLqM12b8TQmcknKrdu1oxWux" + "2ZiWvqkZ8DCZwjoJ3HudxnChPrPPk6UVWraouC3GHvRN" ); export const MOBILE_MINT = new PublicKey( - "mb1eu7TzEc71KxDpsmsKoucSSuuoGLv1drys1oP2jh6" + "BuPZsYRpvVrYUPZMqZAJun2E7mTeAUwpCekb2uJUvapr" ); export const IOT_MINT = new PublicKey( - "iotEVVZLEywoTn1QdwNPddxPWszn3zFhEot3MfL9fns" + "2GtqVJo9yKXuJbyZrxr3ouQbU8AXDJQq74DQpFXFrHg7" ); // TODO: Replace with actual HNT feed From f9f4eb3ccf36edcf89e1d02af93bba9c51efe5e8 Mon Sep 17 00:00:00 2001 From: bry Date: Wed, 15 Jan 2025 16:05:55 -0600 Subject: [PATCH 44/63] undo constants --- packages/spl-utils/src/constants.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/spl-utils/src/constants.ts b/packages/spl-utils/src/constants.ts index 81afc144f..f01c009d6 100644 --- a/packages/spl-utils/src/constants.ts +++ b/packages/spl-utils/src/constants.ts @@ -1,19 +1,19 @@ import { PublicKey } from "@solana/web3.js"; export const DC_MINT = new PublicKey( - "EMsZWzk2zqwtTvvimTVD1qq4usxsNptt1HWSHYurcBWA" + "dcuc8Amr83Wz27ZkQ2K9NS6r8zRpf1J6cvArEBDZDmm" ); export const HNT_MINT = new PublicKey( - "2ZiWvqkZ8DCZwjoJ3HudxnChPrPPk6UVWraouC3GHvRN" + "hntyVP6YFm1Hg25TN9WGLqM12b8TQmcknKrdu1oxWux" ); export const MOBILE_MINT = new PublicKey( - "BuPZsYRpvVrYUPZMqZAJun2E7mTeAUwpCekb2uJUvapr" + "mb1eu7TzEc71KxDpsmsKoucSSuuoGLv1drys1oP2jh6" ); export const IOT_MINT = new PublicKey( - "2GtqVJo9yKXuJbyZrxr3ouQbU8AXDJQq74DQpFXFrHg7" + "iotEVVZLEywoTn1QdwNPddxPWszn3zFhEot3MfL9fns" ); // TODO: Replace with actual HNT feed From 6a24819b95990ebdff713bfca31f3010b5b34732 Mon Sep 17 00:00:00 2001 From: Bryan Date: Tue, 4 Feb 2025 16:42:09 -0600 Subject: [PATCH 45/63] Update packages/iot-routing-manager-sdk/package.json --- packages/iot-routing-manager-sdk/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/iot-routing-manager-sdk/package.json b/packages/iot-routing-manager-sdk/package.json index 8e52ff049..5ec9aaed0 100644 --- a/packages/iot-routing-manager-sdk/package.json +++ b/packages/iot-routing-manager-sdk/package.json @@ -32,8 +32,8 @@ }, "dependencies": { "@coral-xyz/anchor": "^0.28.0", - "@helium/anchor-resolvers": "^0.9.2", - "@helium/helium-entity-manager-sdk": "^0.9.2", + "@helium/anchor-resolvers": "^0.9.23", + "@helium/helium-entity-manager-sdk": "^0.9.23", "bn.js": "^5.2.0", "bs58": "^4.0.1" }, From f6eb25156e8008a86979cdb27ce4f136294677f5 Mon Sep 17 00:00:00 2001 From: bry Date: Thu, 13 Feb 2025 16:37:18 -0600 Subject: [PATCH 46/63] pr comments --- .../yarn.deploy.lock | 4 +- .../yarn.deploy.lock | 14 +- packages/circuit-breaker-sdk/yarn.deploy.lock | 18 +- packages/crons/yarn.deploy.lock | 164 +- packages/data-credits-sdk/yarn.deploy.lock | 60 +- .../src/pages/docs/api/hexboosting-sdk.md | 10 +- .../pages/docs/api/lazy-distributor-sdk.md | 15 + packages/entity-invalidator/yarn.deploy.lock | 74 +- .../fanout-metadata-service/yarn.deploy.lock | 26 +- packages/fanout-sdk/yarn.deploy.lock | 18 +- packages/faucet-service/yarn.deploy.lock | 16 +- packages/helium-admin-cli/package.json | 1 + packages/helium-admin-cli/yarn.deploy.lock | 170 +- .../helium-entity-manager-sdk/src/pdas.ts | 39 +- .../src/resolvers.ts | 17 +- .../yarn.deploy.lock | 66 +- packages/helium-react-hooks/yarn.deploy.lock | 10 +- packages/helium-sub-daos-sdk/yarn.deploy.lock | 48 +- packages/helium-vote-service/yarn.deploy.lock | 44 +- packages/hexboosting-sdk/yarn.deploy.lock | 58 +- packages/hotspot-utils/yarn.deploy.lock | 76 +- packages/iot-routing-manager-sdk/package.json | 6 +- packages/iot-routing-manager-sdk/src/index.ts | 7 +- .../iot-routing-manager-sdk/src/resolvers.ts | 17 +- .../iot-routing-manager-sdk/yarn.deploy.lock | 370 ++-- .../lazy-distributor-sdk/yarn.deploy.lock | 26 +- .../lazy-transactions-sdk/yarn.deploy.lock | 16 +- packages/metadata-service/yarn.deploy.lock | 92 +- packages/migration-service/yarn.deploy.lock | 150 +- .../yarn.deploy.lock | 76 +- packages/monitor-service/yarn.deploy.lock | 120 +- packages/no-emit-sdk/yarn.deploy.lock | 16 +- packages/price-oracle-sdk/yarn.deploy.lock | 16 +- packages/rewards-oracle-sdk/yarn.deploy.lock | 18 +- .../src/idl/iot_routing_manager.json | 1541 +++++++++++++++++ packages/spl-utils/yarn.deploy.lock | 8 +- .../tokens-to-rent-service/yarn.deploy.lock | 14 +- .../treasury-management-sdk/yarn.deploy.lock | 28 +- .../yarn.deploy.lock | 92 +- .../voter-stake-registry-sdk/yarn.deploy.lock | 18 +- .../vsr-metadata-service/yarn.deploy.lock | 26 +- yarn.lock | 179 +- 42 files changed, 2804 insertions(+), 980 deletions(-) create mode 100644 packages/spl-utils/src/idl/iot_routing_manager.json diff --git a/packages/account-fetch-cache-hooks/yarn.deploy.lock b/packages/account-fetch-cache-hooks/yarn.deploy.lock index 51c538d29..fb47f53f9 100644 --- a/packages/account-fetch-cache-hooks/yarn.deploy.lock +++ b/packages/account-fetch-cache-hooks/yarn.deploy.lock @@ -18,7 +18,7 @@ __metadata: version: 0.0.0-use.local resolution: "@helium/account-fetch-cache-hooks@workspace:." dependencies: - "@helium/account-fetch-cache": ^0.9.23 + "@helium/account-fetch-cache": ^0.9.24-alpha.0 "@solana/web3.js": ^1.91.1 git-format-staged: ^2.1.3 react-async-hook: ^4.0.0 @@ -30,7 +30,7 @@ __metadata: languageName: unknown linkType: soft -"@helium/account-fetch-cache@^0.9.23": +"@helium/account-fetch-cache@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/account-fetch-cache@workspace:packages/account-fetch-cache" dependencies: diff --git a/packages/account-postgres-sink-service/yarn.deploy.lock b/packages/account-postgres-sink-service/yarn.deploy.lock index 51b297aab..07b7f5c86 100644 --- a/packages/account-postgres-sink-service/yarn.deploy.lock +++ b/packages/account-postgres-sink-service/yarn.deploy.lock @@ -179,7 +179,7 @@ __metadata: languageName: node linkType: hard -"@helium/account-fetch-cache@^0.9.23": +"@helium/account-fetch-cache@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/account-fetch-cache@workspace:packages/account-fetch-cache" dependencies: @@ -199,8 +199,8 @@ __metadata: "@connectrpc/connect-node": ^1.4.0 "@coral-xyz/anchor": ^0.28.0 "@fastify/cors": ^8.1.1 - "@helium/account-fetch-cache": ^0.9.23 - "@helium/spl-utils": ^0.9.23 + "@helium/account-fetch-cache": ^0.9.24-alpha.0 + "@helium/spl-utils": ^0.9.24-alpha.0 "@metaplex-foundation/mpl-token-metadata": ^2.10.0 "@solana/web3.js": ^1.91.1 "@substreams/core": ^0.16.0 @@ -256,7 +256,7 @@ __metadata: languageName: node linkType: hard -"@helium/anchor-resolvers@^0.9.23": +"@helium/anchor-resolvers@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/anchor-resolvers@workspace:packages/anchor-resolvers" dependencies: @@ -270,14 +270,14 @@ __metadata: languageName: unknown linkType: soft -"@helium/spl-utils@^0.9.23": +"@helium/spl-utils@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/spl-utils@workspace:packages/spl-utils" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/account-fetch-cache": ^0.9.23 + "@helium/account-fetch-cache": ^0.9.24-alpha.0 "@helium/address": ^4.10.2 - "@helium/anchor-resolvers": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 "@metaplex-foundation/mpl-token-metadata": ^2.10.0 "@solana/spl-account-compression": ^0.1.7 "@solana/spl-token": ^0.3.8 diff --git a/packages/circuit-breaker-sdk/yarn.deploy.lock b/packages/circuit-breaker-sdk/yarn.deploy.lock index 002e73575..bb6e5b6e8 100644 --- a/packages/circuit-breaker-sdk/yarn.deploy.lock +++ b/packages/circuit-breaker-sdk/yarn.deploy.lock @@ -67,7 +67,7 @@ __metadata: languageName: node linkType: hard -"@helium/account-fetch-cache@^0.9.23": +"@helium/account-fetch-cache@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/account-fetch-cache@workspace:packages/account-fetch-cache" dependencies: @@ -89,7 +89,7 @@ __metadata: languageName: node linkType: hard -"@helium/anchor-resolvers@^0.9.23": +"@helium/anchor-resolvers@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/anchor-resolvers@workspace:packages/anchor-resolvers" dependencies: @@ -108,9 +108,9 @@ __metadata: resolution: "@helium/circuit-breaker-sdk@workspace:." dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/anchor-resolvers": ^0.9.23 - "@helium/idls": ^0.9.23 - "@helium/spl-utils": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 + "@helium/idls": ^0.9.24-alpha.0 + "@helium/spl-utils": ^0.9.24-alpha.0 bn.js: ^5.2.0 bs58: ^4.0.1 git-format-staged: ^2.1.3 @@ -120,7 +120,7 @@ __metadata: languageName: unknown linkType: soft -"@helium/idls@^0.9.23": +"@helium/idls@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/idls@workspace:packages/idls" dependencies: @@ -134,14 +134,14 @@ __metadata: languageName: unknown linkType: soft -"@helium/spl-utils@^0.9.23": +"@helium/spl-utils@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/spl-utils@workspace:packages/spl-utils" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/account-fetch-cache": ^0.9.23 + "@helium/account-fetch-cache": ^0.9.24-alpha.0 "@helium/address": ^4.10.2 - "@helium/anchor-resolvers": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 "@metaplex-foundation/mpl-token-metadata": ^2.10.0 "@solana/spl-account-compression": ^0.1.7 "@solana/spl-token": ^0.3.8 diff --git a/packages/crons/yarn.deploy.lock b/packages/crons/yarn.deploy.lock index e08d7b9f1..376c04f54 100644 --- a/packages/crons/yarn.deploy.lock +++ b/packages/crons/yarn.deploy.lock @@ -153,7 +153,7 @@ __metadata: languageName: node linkType: hard -"@helium/account-fetch-cache@^0.9.23": +"@helium/account-fetch-cache@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/account-fetch-cache@workspace:packages/account-fetch-cache" dependencies: @@ -175,7 +175,7 @@ __metadata: languageName: node linkType: hard -"@helium/anchor-resolvers@^0.9.2, @helium/anchor-resolvers@^0.9.23": +"@helium/anchor-resolvers@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/anchor-resolvers@workspace:packages/anchor-resolvers" dependencies: @@ -213,14 +213,26 @@ __metadata: languageName: node linkType: hard -"@helium/circuit-breaker-sdk@^0.9.23": +"@helium/anchor-resolvers@npm:^0.9.2": + version: 0.9.23 + resolution: "@helium/anchor-resolvers@npm:0.9.23" + dependencies: + "@solana/spl-token": ^0.3.8 + "@solana/web3.js": ^1.91.1 + peerDependencies: + "@coral-xyz/anchor": ^0.28.0 + checksum: d6050a29235b862000c6bc9519bc0567b7c10355576392b2e200c06a5795a7827e7ee92bf4e27cfb845accec3b9d888ef4e90e91851f08728bbe05fa313d0206 + languageName: node + linkType: hard + +"@helium/circuit-breaker-sdk@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/circuit-breaker-sdk@workspace:packages/circuit-breaker-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/anchor-resolvers": ^0.9.23 - "@helium/idls": ^0.9.23 - "@helium/spl-utils": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 + "@helium/idls": ^0.9.24-alpha.0 + "@helium/spl-utils": ^0.9.24-alpha.0 bn.js: ^5.2.0 bs58: ^4.0.1 git-format-staged: ^2.1.3 @@ -235,24 +247,24 @@ __metadata: resolution: "@helium/crons@workspace:." dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/account-fetch-cache": ^0.9.23 - "@helium/distributor-oracle": ^0.9.23 - "@helium/fanout-sdk": ^0.9.23 - "@helium/helium-entity-manager-sdk": ^0.9.23 - "@helium/helium-sub-daos-sdk": ^0.9.23 - "@helium/idls": ^0.9.23 - "@helium/lazy-distributor-sdk": ^0.9.23 - "@helium/mobile-entity-manager-sdk": ^0.9.23 + "@helium/account-fetch-cache": ^0.9.24-alpha.0 + "@helium/distributor-oracle": ^0.9.24-alpha.0 + "@helium/fanout-sdk": ^0.9.24-alpha.0 + "@helium/helium-entity-manager-sdk": ^0.9.24-alpha.0 + "@helium/helium-sub-daos-sdk": ^0.9.24-alpha.0 + "@helium/idls": ^0.9.24-alpha.0 + "@helium/lazy-distributor-sdk": ^0.9.24-alpha.0 + "@helium/mobile-entity-manager-sdk": ^0.9.24-alpha.0 "@helium/nft-proxy-sdk": ^0.0.15 - "@helium/no-emit-sdk": ^0.9.23 + "@helium/no-emit-sdk": ^0.9.24-alpha.0 "@helium/organization-sdk": ^0.0.15 - "@helium/price-oracle-sdk": ^0.9.23 + "@helium/price-oracle-sdk": ^0.9.24-alpha.0 "@helium/proposal-sdk": ^0.0.15 - "@helium/rewards-oracle-sdk": ^0.9.23 - "@helium/spl-utils": ^0.9.23 + "@helium/rewards-oracle-sdk": ^0.9.24-alpha.0 + "@helium/spl-utils": ^0.9.24-alpha.0 "@helium/state-controller-sdk": ^0.0.15 - "@helium/treasury-management-sdk": ^0.9.23 - "@helium/voter-stake-registry-sdk": ^0.9.23 + "@helium/treasury-management-sdk": ^0.9.24-alpha.0 + "@helium/voter-stake-registry-sdk": ^0.9.24-alpha.0 "@solana/spl-token": ^0.3.8 "@solana/web3.js": ^1.91.1 "@types/bn.js": ^5.1.0 @@ -270,20 +282,20 @@ __metadata: languageName: unknown linkType: soft -"@helium/distributor-oracle@^0.9.23": +"@helium/distributor-oracle@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/distributor-oracle@workspace:packages/distributor-oracle" dependencies: "@coral-xyz/anchor": ^0.28.0 "@fastify/cors": ^8.1.1 - "@helium/account-fetch-cache": ^0.9.23 + "@helium/account-fetch-cache": ^0.9.24-alpha.0 "@helium/address": ^4.10.2 - "@helium/helium-entity-manager-sdk": ^0.9.23 - "@helium/helium-sub-daos-sdk": ^0.9.23 - "@helium/idls": ^0.9.23 - "@helium/lazy-distributor-sdk": ^0.9.23 - "@helium/rewards-oracle-sdk": ^0.9.23 - "@helium/spl-utils": ^0.9.23 + "@helium/helium-entity-manager-sdk": ^0.9.24-alpha.0 + "@helium/helium-sub-daos-sdk": ^0.9.24-alpha.0 + "@helium/idls": ^0.9.24-alpha.0 + "@helium/lazy-distributor-sdk": ^0.9.24-alpha.0 + "@helium/rewards-oracle-sdk": ^0.9.24-alpha.0 + "@helium/spl-utils": ^0.9.24-alpha.0 "@helium/tuktuk-sdk": ^0.0.1 "@metaplex-foundation/mpl-bubblegum": ^0.7.0 "@solana/spl-token": ^0.3.8 @@ -313,14 +325,14 @@ __metadata: languageName: unknown linkType: soft -"@helium/fanout-sdk@^0.9.23": +"@helium/fanout-sdk@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/fanout-sdk@workspace:packages/fanout-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/anchor-resolvers": ^0.9.23 - "@helium/idls": ^0.9.23 - "@helium/spl-utils": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 + "@helium/idls": ^0.9.24-alpha.0 + "@helium/spl-utils": ^0.9.24-alpha.0 bn.js: ^5.2.0 bs58: ^4.0.1 git-format-staged: ^2.1.3 @@ -330,17 +342,17 @@ __metadata: languageName: unknown linkType: soft -"@helium/helium-entity-manager-sdk@^0.9.23": +"@helium/helium-entity-manager-sdk@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/helium-entity-manager-sdk@workspace:packages/helium-entity-manager-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 "@helium/address": ^4.10.2 - "@helium/anchor-resolvers": ^0.9.23 - "@helium/helium-sub-daos-sdk": ^0.9.23 - "@helium/idls": ^0.9.23 - "@helium/no-emit-sdk": ^0.9.23 - "@helium/spl-utils": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 + "@helium/helium-sub-daos-sdk": ^0.9.24-alpha.0 + "@helium/idls": ^0.9.24-alpha.0 + "@helium/no-emit-sdk": ^0.9.24-alpha.0 + "@helium/spl-utils": ^0.9.24-alpha.0 "@types/crypto-js": ^4.1.1 bn.js: ^5.2.0 bs58: ^4.0.1 @@ -353,17 +365,17 @@ __metadata: languageName: unknown linkType: soft -"@helium/helium-sub-daos-sdk@^0.9.23": +"@helium/helium-sub-daos-sdk@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/helium-sub-daos-sdk@workspace:packages/helium-sub-daos-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/anchor-resolvers": ^0.9.23 - "@helium/circuit-breaker-sdk": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 + "@helium/circuit-breaker-sdk": ^0.9.24-alpha.0 "@helium/nft-proxy-sdk": ^0.0.15 - "@helium/spl-utils": ^0.9.23 - "@helium/treasury-management-sdk": ^0.9.23 - "@helium/voter-stake-registry-sdk": ^0.9.23 + "@helium/spl-utils": ^0.9.24-alpha.0 + "@helium/treasury-management-sdk": ^0.9.24-alpha.0 + "@helium/voter-stake-registry-sdk": ^0.9.24-alpha.0 bn.js: ^5.2.0 bs58: ^4.0.1 git-format-staged: ^2.1.3 @@ -373,7 +385,7 @@ __metadata: languageName: unknown linkType: soft -"@helium/idls@^0.9.23": +"@helium/idls@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/idls@workspace:packages/idls" dependencies: @@ -387,14 +399,14 @@ __metadata: languageName: unknown linkType: soft -"@helium/lazy-distributor-sdk@^0.9.23": +"@helium/lazy-distributor-sdk@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/lazy-distributor-sdk@workspace:packages/lazy-distributor-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/anchor-resolvers": ^0.9.23 - "@helium/circuit-breaker-sdk": ^0.9.23 - "@helium/spl-utils": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 + "@helium/circuit-breaker-sdk": ^0.9.24-alpha.0 + "@helium/spl-utils": ^0.9.24-alpha.0 bn.js: ^5.2.0 bs58: ^4.0.1 git-format-staged: ^2.1.3 @@ -404,15 +416,15 @@ __metadata: languageName: unknown linkType: soft -"@helium/mobile-entity-manager-sdk@^0.9.23": +"@helium/mobile-entity-manager-sdk@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/mobile-entity-manager-sdk@workspace:packages/mobile-entity-manager-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/anchor-resolvers": ^0.9.23 - "@helium/helium-entity-manager-sdk": ^0.9.23 - "@helium/idls": ^0.9.23 - "@helium/spl-utils": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 + "@helium/helium-entity-manager-sdk": ^0.9.24-alpha.0 + "@helium/idls": ^0.9.24-alpha.0 + "@helium/spl-utils": ^0.9.24-alpha.0 "@types/crypto-js": ^4.1.1 bn.js: ^5.2.0 bs58: ^4.0.1 @@ -455,14 +467,14 @@ __metadata: languageName: node linkType: hard -"@helium/no-emit-sdk@^0.9.23": +"@helium/no-emit-sdk@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/no-emit-sdk@workspace:packages/no-emit-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 "@helium/anchor-resolvers": ^0.5.0 - "@helium/idls": ^0.9.23 - "@helium/spl-utils": ^0.9.23 + "@helium/idls": ^0.9.24-alpha.0 + "@helium/spl-utils": ^0.9.24-alpha.0 bn.js: ^5.2.0 bs58: ^4.0.1 git-format-staged: ^2.1.3 @@ -484,13 +496,13 @@ __metadata: languageName: node linkType: hard -"@helium/price-oracle-sdk@^0.9.23": +"@helium/price-oracle-sdk@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/price-oracle-sdk@workspace:packages/price-oracle-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/idls": ^0.9.23 - "@helium/spl-utils": ^0.9.23 + "@helium/idls": ^0.9.24-alpha.0 + "@helium/spl-utils": ^0.9.24-alpha.0 bn.js: ^5.2.0 bs58: ^4.0.1 git-format-staged: ^2.1.3 @@ -511,14 +523,14 @@ __metadata: languageName: node linkType: hard -"@helium/rewards-oracle-sdk@^0.9.23": +"@helium/rewards-oracle-sdk@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/rewards-oracle-sdk@workspace:packages/rewards-oracle-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/anchor-resolvers": ^0.9.23 - "@helium/idls": ^0.9.23 - "@helium/spl-utils": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 + "@helium/idls": ^0.9.24-alpha.0 + "@helium/spl-utils": ^0.9.24-alpha.0 bn.js: ^5.2.0 bs58: ^4.0.1 git-format-staged: ^2.1.3 @@ -528,14 +540,14 @@ __metadata: languageName: unknown linkType: soft -"@helium/spl-utils@^0.9.23": +"@helium/spl-utils@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/spl-utils@workspace:packages/spl-utils" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/account-fetch-cache": ^0.9.23 + "@helium/account-fetch-cache": ^0.9.24-alpha.0 "@helium/address": ^4.10.2 - "@helium/anchor-resolvers": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 "@metaplex-foundation/mpl-token-metadata": ^2.10.0 "@solana/spl-account-compression": ^0.1.7 "@solana/spl-token": ^0.3.8 @@ -561,15 +573,15 @@ __metadata: languageName: node linkType: hard -"@helium/treasury-management-sdk@^0.9.23": +"@helium/treasury-management-sdk@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/treasury-management-sdk@workspace:packages/treasury-management-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/anchor-resolvers": ^0.9.23 - "@helium/circuit-breaker-sdk": ^0.9.23 - "@helium/idls": ^0.9.23 - "@helium/spl-utils": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 + "@helium/circuit-breaker-sdk": ^0.9.24-alpha.0 + "@helium/idls": ^0.9.24-alpha.0 + "@helium/spl-utils": ^0.9.24-alpha.0 bn.js: ^5.2.0 bs58: ^4.0.1 git-format-staged: ^2.1.3 @@ -601,15 +613,15 @@ __metadata: languageName: node linkType: hard -"@helium/voter-stake-registry-sdk@^0.9.23": +"@helium/voter-stake-registry-sdk@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/voter-stake-registry-sdk@workspace:packages/voter-stake-registry-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/anchor-resolvers": ^0.9.23 - "@helium/idls": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 + "@helium/idls": ^0.9.24-alpha.0 "@helium/nft-proxy-sdk": ^0.0.15 - "@helium/spl-utils": ^0.9.23 + "@helium/spl-utils": ^0.9.24-alpha.0 "@metaplex-foundation/mpl-token-metadata": ^2.10.0 "@solana/spl-token": ^0.3.8 bn.js: ^5.2.0 diff --git a/packages/data-credits-sdk/yarn.deploy.lock b/packages/data-credits-sdk/yarn.deploy.lock index 12897c164..cc8cb8679 100644 --- a/packages/data-credits-sdk/yarn.deploy.lock +++ b/packages/data-credits-sdk/yarn.deploy.lock @@ -67,7 +67,7 @@ __metadata: languageName: node linkType: hard -"@helium/account-fetch-cache@^0.9.23": +"@helium/account-fetch-cache@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/account-fetch-cache@workspace:packages/account-fetch-cache" dependencies: @@ -89,7 +89,7 @@ __metadata: languageName: node linkType: hard -"@helium/anchor-resolvers@^0.9.23": +"@helium/anchor-resolvers@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/anchor-resolvers@workspace:packages/anchor-resolvers" dependencies: @@ -115,14 +115,14 @@ __metadata: languageName: node linkType: hard -"@helium/circuit-breaker-sdk@^0.9.23": +"@helium/circuit-breaker-sdk@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/circuit-breaker-sdk@workspace:packages/circuit-breaker-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/anchor-resolvers": ^0.9.23 - "@helium/idls": ^0.9.23 - "@helium/spl-utils": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 + "@helium/idls": ^0.9.24-alpha.0 + "@helium/spl-utils": ^0.9.24-alpha.0 bn.js: ^5.2.0 bs58: ^4.0.1 git-format-staged: ^2.1.3 @@ -137,11 +137,11 @@ __metadata: resolution: "@helium/data-credits-sdk@workspace:." dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/anchor-resolvers": ^0.9.23 - "@helium/circuit-breaker-sdk": ^0.9.23 - "@helium/helium-sub-daos-sdk": ^0.9.23 - "@helium/idls": ^0.9.23 - "@helium/spl-utils": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 + "@helium/circuit-breaker-sdk": ^0.9.24-alpha.0 + "@helium/helium-sub-daos-sdk": ^0.9.24-alpha.0 + "@helium/idls": ^0.9.24-alpha.0 + "@helium/spl-utils": ^0.9.24-alpha.0 "@types/crypto-js": ^4.1.1 bn.js: ^5.2.0 bs58: ^4.0.1 @@ -153,17 +153,17 @@ __metadata: languageName: unknown linkType: soft -"@helium/helium-sub-daos-sdk@^0.9.23": +"@helium/helium-sub-daos-sdk@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/helium-sub-daos-sdk@workspace:packages/helium-sub-daos-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/anchor-resolvers": ^0.9.23 - "@helium/circuit-breaker-sdk": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 + "@helium/circuit-breaker-sdk": ^0.9.24-alpha.0 "@helium/nft-proxy-sdk": ^0.0.15 - "@helium/spl-utils": ^0.9.23 - "@helium/treasury-management-sdk": ^0.9.23 - "@helium/voter-stake-registry-sdk": ^0.9.23 + "@helium/spl-utils": ^0.9.24-alpha.0 + "@helium/treasury-management-sdk": ^0.9.24-alpha.0 + "@helium/voter-stake-registry-sdk": ^0.9.24-alpha.0 bn.js: ^5.2.0 bs58: ^4.0.1 git-format-staged: ^2.1.3 @@ -173,7 +173,7 @@ __metadata: languageName: unknown linkType: soft -"@helium/idls@^0.9.23": +"@helium/idls@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/idls@workspace:packages/idls" dependencies: @@ -209,14 +209,14 @@ __metadata: languageName: node linkType: hard -"@helium/spl-utils@^0.9.23": +"@helium/spl-utils@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/spl-utils@workspace:packages/spl-utils" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/account-fetch-cache": ^0.9.23 + "@helium/account-fetch-cache": ^0.9.24-alpha.0 "@helium/address": ^4.10.2 - "@helium/anchor-resolvers": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 "@metaplex-foundation/mpl-token-metadata": ^2.10.0 "@solana/spl-account-compression": ^0.1.7 "@solana/spl-token": ^0.3.8 @@ -231,15 +231,15 @@ __metadata: languageName: unknown linkType: soft -"@helium/treasury-management-sdk@^0.9.23": +"@helium/treasury-management-sdk@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/treasury-management-sdk@workspace:packages/treasury-management-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/anchor-resolvers": ^0.9.23 - "@helium/circuit-breaker-sdk": ^0.9.23 - "@helium/idls": ^0.9.23 - "@helium/spl-utils": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 + "@helium/circuit-breaker-sdk": ^0.9.24-alpha.0 + "@helium/idls": ^0.9.24-alpha.0 + "@helium/spl-utils": ^0.9.24-alpha.0 bn.js: ^5.2.0 bs58: ^4.0.1 git-format-staged: ^2.1.3 @@ -249,15 +249,15 @@ __metadata: languageName: unknown linkType: soft -"@helium/voter-stake-registry-sdk@^0.9.23": +"@helium/voter-stake-registry-sdk@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/voter-stake-registry-sdk@workspace:packages/voter-stake-registry-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/anchor-resolvers": ^0.9.23 - "@helium/idls": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 + "@helium/idls": ^0.9.24-alpha.0 "@helium/nft-proxy-sdk": ^0.0.15 - "@helium/spl-utils": ^0.9.23 + "@helium/spl-utils": ^0.9.24-alpha.0 "@metaplex-foundation/mpl-token-metadata": ^2.10.0 "@solana/spl-token": ^0.3.8 bn.js: ^5.2.0 diff --git a/packages/docsite/src/pages/docs/api/hexboosting-sdk.md b/packages/docsite/src/pages/docs/api/hexboosting-sdk.md index b750154b3..fe8ab2692 100644 --- a/packages/docsite/src/pages/docs/api/hexboosting-sdk.md +++ b/packages/docsite/src/pages/docs/api/hexboosting-sdk.md @@ -16,13 +16,14 @@ If you are looking for a quick start guide, check out the [Getting Started](/doc | boostConfig | immut | no | | | carrier | immut | no | | | hexboostAuthority | immut | yes | | -| priceOracle | immut | no | | -| paymentMint | mut | no | | +| dataCredits | immut | no | | +| dcMint | mut | no | | | paymentAccount | mut | no | | | boostedHex | mut | no | | | systemProgram | immut | no | | | tokenProgram | immut | no | | | associatedTokenProgram | immut | no | | +| dataCreditsProgram | immut | no | | #### Args @@ -42,9 +43,10 @@ If you are looking for a quick start guide, check out the [Getting Started](/doc | rentReclaimAuthority | immut | no | | | startAuthority | immut | no | | | priceOracle | immut | no | | -| dntMint | immut | no | | +| dcMint | immut | no | | | boostConfig | mut | no | | | systemProgram | immut | no | | +| dao | immut | no | | #### Args @@ -130,6 +132,7 @@ If you are looking for a quick start guide, check out the [Getting Started](/doc | minimumPeriods | u16 | | bumpSeed | u8 | | startAuthority | publicKey | +| dcMint | publicKey | ### BoostedHexV0 @@ -196,6 +199,7 @@ If you are looking for a quick start guide, check out the [Getting Started](/doc | boostPrice | u64 | | minimumPeriods | u16 | | priceOracle | publicKey | +| dcMint | publicKey | ### DeviceTypeV0 diff --git a/packages/docsite/src/pages/docs/api/lazy-distributor-sdk.md b/packages/docsite/src/pages/docs/api/lazy-distributor-sdk.md index e90558007..d2dbec941 100644 --- a/packages/docsite/src/pages/docs/api/lazy-distributor-sdk.md +++ b/packages/docsite/src/pages/docs/api/lazy-distributor-sdk.md @@ -210,6 +210,21 @@ If you are looking for a quick start guide, check out the [Getting Started](/doc | Name | Type | Docs | | ---- | ---- | ---- | +### tempUpdateMatchingDestination + +#### Accounts + +| Name | Mutability | Signer | Docs | +| ----------------- | ---------- | ------ | ---- | +| authority | immut | yes | | +| originalRecipient | immut | no | | +| recipient | mut | no | | + +#### Args + +| Name | Type | Docs | +| ---- | ---- | ---- | + ## Accounts ### RemoteTaskTransactionV0 diff --git a/packages/entity-invalidator/yarn.deploy.lock b/packages/entity-invalidator/yarn.deploy.lock index b74d0d9d9..6700353aa 100644 --- a/packages/entity-invalidator/yarn.deploy.lock +++ b/packages/entity-invalidator/yarn.deploy.lock @@ -67,7 +67,7 @@ __metadata: languageName: node linkType: hard -"@helium/account-fetch-cache@^0.9.23": +"@helium/account-fetch-cache@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/account-fetch-cache@workspace:packages/account-fetch-cache" dependencies: @@ -89,7 +89,7 @@ __metadata: languageName: node linkType: hard -"@helium/anchor-resolvers@^0.9.23": +"@helium/anchor-resolvers@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/anchor-resolvers@workspace:packages/anchor-resolvers" dependencies: @@ -127,14 +127,14 @@ __metadata: languageName: node linkType: hard -"@helium/circuit-breaker-sdk@^0.9.23": +"@helium/circuit-breaker-sdk@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/circuit-breaker-sdk@workspace:packages/circuit-breaker-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/anchor-resolvers": ^0.9.23 - "@helium/idls": ^0.9.23 - "@helium/spl-utils": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 + "@helium/idls": ^0.9.24-alpha.0 + "@helium/spl-utils": ^0.9.24-alpha.0 bn.js: ^5.2.0 bs58: ^4.0.1 git-format-staged: ^2.1.3 @@ -149,9 +149,9 @@ __metadata: resolution: "@helium/entity-invalidator@workspace:." dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/account-fetch-cache": ^0.9.23 - "@helium/helium-entity-manager-sdk": ^0.9.23 - "@helium/spl-utils": ^0.9.23 + "@helium/account-fetch-cache": ^0.9.24-alpha.0 + "@helium/helium-entity-manager-sdk": ^0.9.24-alpha.0 + "@helium/spl-utils": ^0.9.24-alpha.0 "@solana/web3.js": ^1.91.1 "@types/bn.js": ^5.1.1 "@types/deep-equal": ^1.0.1 @@ -175,17 +175,17 @@ __metadata: languageName: unknown linkType: soft -"@helium/helium-entity-manager-sdk@^0.9.23": +"@helium/helium-entity-manager-sdk@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/helium-entity-manager-sdk@workspace:packages/helium-entity-manager-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 "@helium/address": ^4.10.2 - "@helium/anchor-resolvers": ^0.9.23 - "@helium/helium-sub-daos-sdk": ^0.9.23 - "@helium/idls": ^0.9.23 - "@helium/no-emit-sdk": ^0.9.23 - "@helium/spl-utils": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 + "@helium/helium-sub-daos-sdk": ^0.9.24-alpha.0 + "@helium/idls": ^0.9.24-alpha.0 + "@helium/no-emit-sdk": ^0.9.24-alpha.0 + "@helium/spl-utils": ^0.9.24-alpha.0 "@types/crypto-js": ^4.1.1 bn.js: ^5.2.0 bs58: ^4.0.1 @@ -198,17 +198,17 @@ __metadata: languageName: unknown linkType: soft -"@helium/helium-sub-daos-sdk@^0.9.23": +"@helium/helium-sub-daos-sdk@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/helium-sub-daos-sdk@workspace:packages/helium-sub-daos-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/anchor-resolvers": ^0.9.23 - "@helium/circuit-breaker-sdk": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 + "@helium/circuit-breaker-sdk": ^0.9.24-alpha.0 "@helium/nft-proxy-sdk": ^0.0.15 - "@helium/spl-utils": ^0.9.23 - "@helium/treasury-management-sdk": ^0.9.23 - "@helium/voter-stake-registry-sdk": ^0.9.23 + "@helium/spl-utils": ^0.9.24-alpha.0 + "@helium/treasury-management-sdk": ^0.9.24-alpha.0 + "@helium/voter-stake-registry-sdk": ^0.9.24-alpha.0 bn.js: ^5.2.0 bs58: ^4.0.1 git-format-staged: ^2.1.3 @@ -218,7 +218,7 @@ __metadata: languageName: unknown linkType: soft -"@helium/idls@^0.9.23": +"@helium/idls@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/idls@workspace:packages/idls" dependencies: @@ -254,14 +254,14 @@ __metadata: languageName: node linkType: hard -"@helium/no-emit-sdk@^0.9.23": +"@helium/no-emit-sdk@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/no-emit-sdk@workspace:packages/no-emit-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 "@helium/anchor-resolvers": ^0.5.0 - "@helium/idls": ^0.9.23 - "@helium/spl-utils": ^0.9.23 + "@helium/idls": ^0.9.24-alpha.0 + "@helium/spl-utils": ^0.9.24-alpha.0 bn.js: ^5.2.0 bs58: ^4.0.1 git-format-staged: ^2.1.3 @@ -271,14 +271,14 @@ __metadata: languageName: unknown linkType: soft -"@helium/spl-utils@^0.9.23": +"@helium/spl-utils@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/spl-utils@workspace:packages/spl-utils" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/account-fetch-cache": ^0.9.23 + "@helium/account-fetch-cache": ^0.9.24-alpha.0 "@helium/address": ^4.10.2 - "@helium/anchor-resolvers": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 "@metaplex-foundation/mpl-token-metadata": ^2.10.0 "@solana/spl-account-compression": ^0.1.7 "@solana/spl-token": ^0.3.8 @@ -293,15 +293,15 @@ __metadata: languageName: unknown linkType: soft -"@helium/treasury-management-sdk@^0.9.23": +"@helium/treasury-management-sdk@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/treasury-management-sdk@workspace:packages/treasury-management-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/anchor-resolvers": ^0.9.23 - "@helium/circuit-breaker-sdk": ^0.9.23 - "@helium/idls": ^0.9.23 - "@helium/spl-utils": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 + "@helium/circuit-breaker-sdk": ^0.9.24-alpha.0 + "@helium/idls": ^0.9.24-alpha.0 + "@helium/spl-utils": ^0.9.24-alpha.0 bn.js: ^5.2.0 bs58: ^4.0.1 git-format-staged: ^2.1.3 @@ -311,15 +311,15 @@ __metadata: languageName: unknown linkType: soft -"@helium/voter-stake-registry-sdk@^0.9.23": +"@helium/voter-stake-registry-sdk@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/voter-stake-registry-sdk@workspace:packages/voter-stake-registry-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/anchor-resolvers": ^0.9.23 - "@helium/idls": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 + "@helium/idls": ^0.9.24-alpha.0 "@helium/nft-proxy-sdk": ^0.0.15 - "@helium/spl-utils": ^0.9.23 + "@helium/spl-utils": ^0.9.24-alpha.0 "@metaplex-foundation/mpl-token-metadata": ^2.10.0 "@solana/spl-token": ^0.3.8 bn.js: ^5.2.0 diff --git a/packages/fanout-metadata-service/yarn.deploy.lock b/packages/fanout-metadata-service/yarn.deploy.lock index a61b95f11..58978ffd4 100644 --- a/packages/fanout-metadata-service/yarn.deploy.lock +++ b/packages/fanout-metadata-service/yarn.deploy.lock @@ -111,7 +111,7 @@ __metadata: languageName: node linkType: hard -"@helium/account-fetch-cache@^0.9.23": +"@helium/account-fetch-cache@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/account-fetch-cache@workspace:packages/account-fetch-cache" dependencies: @@ -133,7 +133,7 @@ __metadata: languageName: node linkType: hard -"@helium/anchor-resolvers@^0.9.23": +"@helium/anchor-resolvers@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/anchor-resolvers@workspace:packages/anchor-resolvers" dependencies: @@ -153,10 +153,10 @@ __metadata: dependencies: "@coral-xyz/anchor": ^0.28.0 "@fastify/cors": ^8.1.1 - "@helium/account-fetch-cache": ^0.9.23 + "@helium/account-fetch-cache": ^0.9.24-alpha.0 "@helium/address": ^4.10.2 - "@helium/fanout-sdk": ^0.9.23 - "@helium/spl-utils": ^0.9.23 + "@helium/fanout-sdk": ^0.9.24-alpha.0 + "@helium/spl-utils": ^0.9.24-alpha.0 "@metaplex-foundation/mpl-token-metadata": ^2.10.0 "@solana/spl-account-compression": ^0.1.7 "@solana/spl-token": ^0.3.8 @@ -174,14 +174,14 @@ __metadata: languageName: unknown linkType: soft -"@helium/fanout-sdk@^0.9.23": +"@helium/fanout-sdk@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/fanout-sdk@workspace:packages/fanout-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/anchor-resolvers": ^0.9.23 - "@helium/idls": ^0.9.23 - "@helium/spl-utils": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 + "@helium/idls": ^0.9.24-alpha.0 + "@helium/spl-utils": ^0.9.24-alpha.0 bn.js: ^5.2.0 bs58: ^4.0.1 git-format-staged: ^2.1.3 @@ -191,7 +191,7 @@ __metadata: languageName: unknown linkType: soft -"@helium/idls@^0.9.23": +"@helium/idls@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/idls@workspace:packages/idls" dependencies: @@ -205,14 +205,14 @@ __metadata: languageName: unknown linkType: soft -"@helium/spl-utils@^0.9.23": +"@helium/spl-utils@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/spl-utils@workspace:packages/spl-utils" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/account-fetch-cache": ^0.9.23 + "@helium/account-fetch-cache": ^0.9.24-alpha.0 "@helium/address": ^4.10.2 - "@helium/anchor-resolvers": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 "@metaplex-foundation/mpl-token-metadata": ^2.10.0 "@solana/spl-account-compression": ^0.1.7 "@solana/spl-token": ^0.3.8 diff --git a/packages/fanout-sdk/yarn.deploy.lock b/packages/fanout-sdk/yarn.deploy.lock index 49fc1c2ce..705d1aaea 100644 --- a/packages/fanout-sdk/yarn.deploy.lock +++ b/packages/fanout-sdk/yarn.deploy.lock @@ -67,7 +67,7 @@ __metadata: languageName: node linkType: hard -"@helium/account-fetch-cache@^0.9.23": +"@helium/account-fetch-cache@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/account-fetch-cache@workspace:packages/account-fetch-cache" dependencies: @@ -89,7 +89,7 @@ __metadata: languageName: node linkType: hard -"@helium/anchor-resolvers@^0.9.23": +"@helium/anchor-resolvers@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/anchor-resolvers@workspace:packages/anchor-resolvers" dependencies: @@ -108,9 +108,9 @@ __metadata: resolution: "@helium/fanout-sdk@workspace:." dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/anchor-resolvers": ^0.9.23 - "@helium/idls": ^0.9.23 - "@helium/spl-utils": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 + "@helium/idls": ^0.9.24-alpha.0 + "@helium/spl-utils": ^0.9.24-alpha.0 bn.js: ^5.2.0 bs58: ^4.0.1 git-format-staged: ^2.1.3 @@ -120,7 +120,7 @@ __metadata: languageName: unknown linkType: soft -"@helium/idls@^0.9.23": +"@helium/idls@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/idls@workspace:packages/idls" dependencies: @@ -134,14 +134,14 @@ __metadata: languageName: unknown linkType: soft -"@helium/spl-utils@^0.9.23": +"@helium/spl-utils@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/spl-utils@workspace:packages/spl-utils" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/account-fetch-cache": ^0.9.23 + "@helium/account-fetch-cache": ^0.9.24-alpha.0 "@helium/address": ^4.10.2 - "@helium/anchor-resolvers": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 "@metaplex-foundation/mpl-token-metadata": ^2.10.0 "@solana/spl-account-compression": ^0.1.7 "@solana/spl-token": ^0.3.8 diff --git a/packages/faucet-service/yarn.deploy.lock b/packages/faucet-service/yarn.deploy.lock index 1ff352f72..540c15ab4 100644 --- a/packages/faucet-service/yarn.deploy.lock +++ b/packages/faucet-service/yarn.deploy.lock @@ -111,7 +111,7 @@ __metadata: languageName: node linkType: hard -"@helium/account-fetch-cache@^0.9.23": +"@helium/account-fetch-cache@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/account-fetch-cache@workspace:packages/account-fetch-cache" dependencies: @@ -133,7 +133,7 @@ __metadata: languageName: node linkType: hard -"@helium/anchor-resolvers@^0.9.23": +"@helium/anchor-resolvers@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/anchor-resolvers@workspace:packages/anchor-resolvers" dependencies: @@ -153,8 +153,8 @@ __metadata: dependencies: "@coral-xyz/anchor": ^0.28.0 "@fastify/cors": ^8.1.1 - "@helium/idls": ^0.9.23 - "@helium/spl-utils": ^0.9.23 + "@helium/idls": ^0.9.24-alpha.0 + "@helium/spl-utils": ^0.9.24-alpha.0 "@metaplex-foundation/mpl-token-metadata": ^2.10.0 "@solana/spl-token": ^0.3.8 "@solana/web3.js": ^1.91.1 @@ -174,7 +174,7 @@ __metadata: languageName: unknown linkType: soft -"@helium/idls@^0.9.23": +"@helium/idls@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/idls@workspace:packages/idls" dependencies: @@ -188,14 +188,14 @@ __metadata: languageName: unknown linkType: soft -"@helium/spl-utils@^0.9.23": +"@helium/spl-utils@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/spl-utils@workspace:packages/spl-utils" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/account-fetch-cache": ^0.9.23 + "@helium/account-fetch-cache": ^0.9.24-alpha.0 "@helium/address": ^4.10.2 - "@helium/anchor-resolvers": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 "@metaplex-foundation/mpl-token-metadata": ^2.10.0 "@solana/spl-account-compression": ^0.1.7 "@solana/spl-token": ^0.3.8 diff --git a/packages/helium-admin-cli/package.json b/packages/helium-admin-cli/package.json index b40cddcc1..acaa0e12a 100644 --- a/packages/helium-admin-cli/package.json +++ b/packages/helium-admin-cli/package.json @@ -49,6 +49,7 @@ "@helium/helium-sub-daos-sdk": "^0.9.24-alpha.0", "@helium/lazy-distributor-sdk": "^0.9.24-alpha.0", "@helium/mobile-entity-manager-sdk": "^0.9.24-alpha.0", + "@helium/iot-routing-manager-sdk": "^0.9.24-alpha.0", "@helium/nft-proxy-sdk": "^0.0.15", "@helium/organization-sdk": "^0.0.13", "@helium/price-oracle-sdk": "^0.9.24-alpha.0", diff --git a/packages/helium-admin-cli/yarn.deploy.lock b/packages/helium-admin-cli/yarn.deploy.lock index 11d3ca3dc..156795ddb 100644 --- a/packages/helium-admin-cli/yarn.deploy.lock +++ b/packages/helium-admin-cli/yarn.deploy.lock @@ -188,7 +188,7 @@ __metadata: languageName: node linkType: hard -"@helium/account-fetch-cache@^0.9.23": +"@helium/account-fetch-cache@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/account-fetch-cache@workspace:packages/account-fetch-cache" dependencies: @@ -210,7 +210,7 @@ __metadata: languageName: node linkType: hard -"@helium/anchor-resolvers@^0.9.2, @helium/anchor-resolvers@^0.9.23": +"@helium/anchor-resolvers@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/anchor-resolvers@workspace:packages/anchor-resolvers" dependencies: @@ -248,14 +248,26 @@ __metadata: languageName: node linkType: hard -"@helium/circuit-breaker-sdk@^0.9.23": +"@helium/anchor-resolvers@npm:^0.9.2": + version: 0.9.23 + resolution: "@helium/anchor-resolvers@npm:0.9.23" + dependencies: + "@solana/spl-token": ^0.3.8 + "@solana/web3.js": ^1.91.1 + peerDependencies: + "@coral-xyz/anchor": ^0.28.0 + checksum: d6050a29235b862000c6bc9519bc0567b7c10355576392b2e200c06a5795a7827e7ee92bf4e27cfb845accec3b9d888ef4e90e91851f08728bbe05fa313d0206 + languageName: node + linkType: hard + +"@helium/circuit-breaker-sdk@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/circuit-breaker-sdk@workspace:packages/circuit-breaker-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/anchor-resolvers": ^0.9.23 - "@helium/idls": ^0.9.23 - "@helium/spl-utils": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 + "@helium/idls": ^0.9.24-alpha.0 + "@helium/spl-utils": ^0.9.24-alpha.0 bn.js: ^5.2.0 bs58: ^4.0.1 git-format-staged: ^2.1.3 @@ -276,16 +288,16 @@ __metadata: languageName: node linkType: hard -"@helium/data-credits-sdk@^0.9.23": +"@helium/data-credits-sdk@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/data-credits-sdk@workspace:packages/data-credits-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/anchor-resolvers": ^0.9.23 - "@helium/circuit-breaker-sdk": ^0.9.23 - "@helium/helium-sub-daos-sdk": ^0.9.23 - "@helium/idls": ^0.9.23 - "@helium/spl-utils": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 + "@helium/circuit-breaker-sdk": ^0.9.24-alpha.0 + "@helium/helium-sub-daos-sdk": ^0.9.24-alpha.0 + "@helium/idls": ^0.9.24-alpha.0 + "@helium/spl-utils": ^0.9.24-alpha.0 "@types/crypto-js": ^4.1.1 bn.js: ^5.2.0 bs58: ^4.0.1 @@ -297,20 +309,20 @@ __metadata: languageName: unknown linkType: soft -"@helium/distributor-oracle@^0.9.23": +"@helium/distributor-oracle@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/distributor-oracle@workspace:packages/distributor-oracle" dependencies: "@coral-xyz/anchor": ^0.28.0 "@fastify/cors": ^8.1.1 - "@helium/account-fetch-cache": ^0.9.23 + "@helium/account-fetch-cache": ^0.9.24-alpha.0 "@helium/address": ^4.10.2 - "@helium/helium-entity-manager-sdk": ^0.9.23 - "@helium/helium-sub-daos-sdk": ^0.9.23 - "@helium/idls": ^0.9.23 - "@helium/lazy-distributor-sdk": ^0.9.23 - "@helium/rewards-oracle-sdk": ^0.9.23 - "@helium/spl-utils": ^0.9.23 + "@helium/helium-entity-manager-sdk": ^0.9.24-alpha.0 + "@helium/helium-sub-daos-sdk": ^0.9.24-alpha.0 + "@helium/idls": ^0.9.24-alpha.0 + "@helium/lazy-distributor-sdk": ^0.9.24-alpha.0 + "@helium/rewards-oracle-sdk": ^0.9.24-alpha.0 + "@helium/spl-utils": ^0.9.24-alpha.0 "@helium/tuktuk-sdk": ^0.0.1 "@metaplex-foundation/mpl-bubblegum": ^0.7.0 "@solana/spl-token": ^0.3.8 @@ -340,14 +352,14 @@ __metadata: languageName: unknown linkType: soft -"@helium/fanout-sdk@^0.9.23": +"@helium/fanout-sdk@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/fanout-sdk@workspace:packages/fanout-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/anchor-resolvers": ^0.9.23 - "@helium/idls": ^0.9.23 - "@helium/spl-utils": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 + "@helium/idls": ^0.9.24-alpha.0 + "@helium/spl-utils": ^0.9.24-alpha.0 bn.js: ^5.2.0 bs58: ^4.0.1 git-format-staged: ^2.1.3 @@ -363,21 +375,21 @@ __metadata: dependencies: "@coral-xyz/anchor": ^0.28.0 "@helium/address": ^4.10.2 - "@helium/circuit-breaker-sdk": ^0.9.23 + "@helium/circuit-breaker-sdk": ^0.9.24-alpha.0 "@helium/crypto": ^4.10.2 - "@helium/data-credits-sdk": ^0.9.23 - "@helium/distributor-oracle": ^0.9.23 - "@helium/fanout-sdk": ^0.9.23 - "@helium/helium-entity-manager-sdk": ^0.9.23 - "@helium/helium-sub-daos-sdk": ^0.9.23 - "@helium/lazy-distributor-sdk": ^0.9.23 - "@helium/mobile-entity-manager-sdk": ^0.9.23 + "@helium/data-credits-sdk": ^0.9.24-alpha.0 + "@helium/distributor-oracle": ^0.9.24-alpha.0 + "@helium/fanout-sdk": ^0.9.24-alpha.0 + "@helium/helium-entity-manager-sdk": ^0.9.24-alpha.0 + "@helium/helium-sub-daos-sdk": ^0.9.24-alpha.0 + "@helium/lazy-distributor-sdk": ^0.9.24-alpha.0 + "@helium/mobile-entity-manager-sdk": ^0.9.24-alpha.0 "@helium/nft-proxy-sdk": ^0.0.15 "@helium/organization-sdk": ^0.0.13 - "@helium/price-oracle-sdk": ^0.9.23 + "@helium/price-oracle-sdk": ^0.9.24-alpha.0 "@helium/proposal-sdk": ^0.0.15 - "@helium/spl-utils": ^0.9.23 - "@helium/treasury-management-sdk": ^0.9.23 + "@helium/spl-utils": ^0.9.24-alpha.0 + "@helium/treasury-management-sdk": ^0.9.24-alpha.0 "@solana/spl-account-compression": ^0.1.7 "@solana/spl-governance": ^0.3.18 "@solana/spl-token": ^0.3.8 @@ -399,17 +411,17 @@ __metadata: languageName: unknown linkType: soft -"@helium/helium-entity-manager-sdk@^0.9.23": +"@helium/helium-entity-manager-sdk@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/helium-entity-manager-sdk@workspace:packages/helium-entity-manager-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 "@helium/address": ^4.10.2 - "@helium/anchor-resolvers": ^0.9.23 - "@helium/helium-sub-daos-sdk": ^0.9.23 - "@helium/idls": ^0.9.23 - "@helium/no-emit-sdk": ^0.9.23 - "@helium/spl-utils": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 + "@helium/helium-sub-daos-sdk": ^0.9.24-alpha.0 + "@helium/idls": ^0.9.24-alpha.0 + "@helium/no-emit-sdk": ^0.9.24-alpha.0 + "@helium/spl-utils": ^0.9.24-alpha.0 "@types/crypto-js": ^4.1.1 bn.js: ^5.2.0 bs58: ^4.0.1 @@ -422,17 +434,17 @@ __metadata: languageName: unknown linkType: soft -"@helium/helium-sub-daos-sdk@^0.9.23": +"@helium/helium-sub-daos-sdk@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/helium-sub-daos-sdk@workspace:packages/helium-sub-daos-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/anchor-resolvers": ^0.9.23 - "@helium/circuit-breaker-sdk": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 + "@helium/circuit-breaker-sdk": ^0.9.24-alpha.0 "@helium/nft-proxy-sdk": ^0.0.15 - "@helium/spl-utils": ^0.9.23 - "@helium/treasury-management-sdk": ^0.9.23 - "@helium/voter-stake-registry-sdk": ^0.9.23 + "@helium/spl-utils": ^0.9.24-alpha.0 + "@helium/treasury-management-sdk": ^0.9.24-alpha.0 + "@helium/voter-stake-registry-sdk": ^0.9.24-alpha.0 bn.js: ^5.2.0 bs58: ^4.0.1 git-format-staged: ^2.1.3 @@ -442,7 +454,7 @@ __metadata: languageName: unknown linkType: soft -"@helium/idls@^0.9.23": +"@helium/idls@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/idls@workspace:packages/idls" dependencies: @@ -456,14 +468,14 @@ __metadata: languageName: unknown linkType: soft -"@helium/lazy-distributor-sdk@^0.9.23": +"@helium/lazy-distributor-sdk@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/lazy-distributor-sdk@workspace:packages/lazy-distributor-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/anchor-resolvers": ^0.9.23 - "@helium/circuit-breaker-sdk": ^0.9.23 - "@helium/spl-utils": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 + "@helium/circuit-breaker-sdk": ^0.9.24-alpha.0 + "@helium/spl-utils": ^0.9.24-alpha.0 bn.js: ^5.2.0 bs58: ^4.0.1 git-format-staged: ^2.1.3 @@ -473,15 +485,15 @@ __metadata: languageName: unknown linkType: soft -"@helium/mobile-entity-manager-sdk@^0.9.23": +"@helium/mobile-entity-manager-sdk@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/mobile-entity-manager-sdk@workspace:packages/mobile-entity-manager-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/anchor-resolvers": ^0.9.23 - "@helium/helium-entity-manager-sdk": ^0.9.23 - "@helium/idls": ^0.9.23 - "@helium/spl-utils": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 + "@helium/helium-entity-manager-sdk": ^0.9.24-alpha.0 + "@helium/idls": ^0.9.24-alpha.0 + "@helium/spl-utils": ^0.9.24-alpha.0 "@types/crypto-js": ^4.1.1 bn.js: ^5.2.0 bs58: ^4.0.1 @@ -534,14 +546,14 @@ __metadata: languageName: node linkType: hard -"@helium/no-emit-sdk@^0.9.23": +"@helium/no-emit-sdk@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/no-emit-sdk@workspace:packages/no-emit-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 "@helium/anchor-resolvers": ^0.5.0 - "@helium/idls": ^0.9.23 - "@helium/spl-utils": ^0.9.23 + "@helium/idls": ^0.9.24-alpha.0 + "@helium/spl-utils": ^0.9.24-alpha.0 bn.js: ^5.2.0 bs58: ^4.0.1 git-format-staged: ^2.1.3 @@ -563,13 +575,13 @@ __metadata: languageName: node linkType: hard -"@helium/price-oracle-sdk@^0.9.23": +"@helium/price-oracle-sdk@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/price-oracle-sdk@workspace:packages/price-oracle-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/idls": ^0.9.23 - "@helium/spl-utils": ^0.9.23 + "@helium/idls": ^0.9.24-alpha.0 + "@helium/spl-utils": ^0.9.24-alpha.0 bn.js: ^5.2.0 bs58: ^4.0.1 git-format-staged: ^2.1.3 @@ -601,14 +613,14 @@ __metadata: languageName: node linkType: hard -"@helium/rewards-oracle-sdk@^0.9.23": +"@helium/rewards-oracle-sdk@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/rewards-oracle-sdk@workspace:packages/rewards-oracle-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/anchor-resolvers": ^0.9.23 - "@helium/idls": ^0.9.23 - "@helium/spl-utils": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 + "@helium/idls": ^0.9.24-alpha.0 + "@helium/spl-utils": ^0.9.24-alpha.0 bn.js: ^5.2.0 bs58: ^4.0.1 git-format-staged: ^2.1.3 @@ -618,14 +630,14 @@ __metadata: languageName: unknown linkType: soft -"@helium/spl-utils@^0.9.23": +"@helium/spl-utils@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/spl-utils@workspace:packages/spl-utils" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/account-fetch-cache": ^0.9.23 + "@helium/account-fetch-cache": ^0.9.24-alpha.0 "@helium/address": ^4.10.2 - "@helium/anchor-resolvers": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 "@metaplex-foundation/mpl-token-metadata": ^2.10.0 "@solana/spl-account-compression": ^0.1.7 "@solana/spl-token": ^0.3.8 @@ -640,15 +652,15 @@ __metadata: languageName: unknown linkType: soft -"@helium/treasury-management-sdk@^0.9.23": +"@helium/treasury-management-sdk@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/treasury-management-sdk@workspace:packages/treasury-management-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/anchor-resolvers": ^0.9.23 - "@helium/circuit-breaker-sdk": ^0.9.23 - "@helium/idls": ^0.9.23 - "@helium/spl-utils": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 + "@helium/circuit-breaker-sdk": ^0.9.24-alpha.0 + "@helium/idls": ^0.9.24-alpha.0 + "@helium/spl-utils": ^0.9.24-alpha.0 bn.js: ^5.2.0 bs58: ^4.0.1 git-format-staged: ^2.1.3 @@ -680,15 +692,15 @@ __metadata: languageName: node linkType: hard -"@helium/voter-stake-registry-sdk@^0.9.23": +"@helium/voter-stake-registry-sdk@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/voter-stake-registry-sdk@workspace:packages/voter-stake-registry-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/anchor-resolvers": ^0.9.23 - "@helium/idls": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 + "@helium/idls": ^0.9.24-alpha.0 "@helium/nft-proxy-sdk": ^0.0.15 - "@helium/spl-utils": ^0.9.23 + "@helium/spl-utils": ^0.9.24-alpha.0 "@metaplex-foundation/mpl-token-metadata": ^2.10.0 "@solana/spl-token": ^0.3.8 bn.js: ^5.2.0 diff --git a/packages/helium-entity-manager-sdk/src/pdas.ts b/packages/helium-entity-manager-sdk/src/pdas.ts index d3e4dc489..c1368bd9c 100644 --- a/packages/helium-entity-manager-sdk/src/pdas.ts +++ b/packages/helium-entity-manager-sdk/src/pdas.ts @@ -12,8 +12,11 @@ const TOKEN_METADATA_PROGRAM_ID = new PublicKey( export const entityCreatorKey = ( dao: PublicKey, programId: PublicKey = PROGRAM_ID -) => - PublicKey.findProgramAddressSync([Buffer.from("entity_creator", "utf-8"), dao.toBuffer()], programId); +) => + PublicKey.findProgramAddressSync( + [Buffer.from("entity_creator", "utf-8"), dao.toBuffer()], + programId + ); export const rewardableEntityConfigKey = ( subDao: PublicKey, @@ -38,16 +41,22 @@ export const hotspotCollectionKey = ( programId ); -export const dataOnlyConfigKey = (dao: PublicKey, programId: PublicKey = PROGRAM_ID) => +export const dataOnlyConfigKey = ( + dao: PublicKey, + programId: PublicKey = PROGRAM_ID +) => PublicKey.findProgramAddressSync( [Buffer.from("data_only_config", "utf-8"), dao.toBuffer()], - programId, + programId ); -export const dataOnlyEscrowKey = (dataOnly: PublicKey, programId: PublicKey = PROGRAM_ID) => +export const dataOnlyEscrowKey = ( + dataOnly: PublicKey, + programId: PublicKey = PROGRAM_ID +) => PublicKey.findProgramAddressSync( [Buffer.from("data_only_escrow", "utf-8"), dataOnly.toBuffer()], - programId, + programId ); export const sharedMerkleKey = ( @@ -62,7 +71,11 @@ export const sharedMerkleKey = ( ); }; -export const makerKey = (dao: PublicKey, name: String, programId: PublicKey = PROGRAM_ID) => +export const makerKey = ( + dao: PublicKey, + name: String, + programId: PublicKey = PROGRAM_ID +) => PublicKey.findProgramAddressSync( [Buffer.from("maker", "utf-8"), dao.toBuffer(), Buffer.from(name, "utf-8")], programId @@ -116,11 +129,11 @@ export function decodeEntityKey( keySerialization: any = { b58: {} } ): string | undefined { if (typeof keySerialization.b58 != "undefined") { - return bs58.encode(entityKey) + return bs58.encode(entityKey); } if (typeof keySerialization.utf8 != "undefined") { - return entityKey.toString("utf-8") + return entityKey.toString("utf-8"); } } @@ -130,11 +143,7 @@ export const keyToAssetKeyRaw = ( programId: PublicKey = PROGRAM_ID ) => { return PublicKey.findProgramAddressSync( - [ - Buffer.from("key_to_asset", "utf-8"), - dao.toBuffer(), - hashedEntityKey, - ], + [Buffer.from("key_to_asset", "utf-8"), dao.toBuffer(), hashedEntityKey], programId ); }; @@ -149,7 +158,7 @@ export const keyToAssetKey = ( if (encoding == "b58" || Address.isValid(entityKey)) { entityKey = Buffer.from(bs58.decode(entityKey)); } else { - entityKey = Buffer.from(entityKey, encoding) + entityKey = Buffer.from(entityKey, encoding); } } const hash = sha256(entityKey); diff --git a/packages/helium-entity-manager-sdk/src/resolvers.ts b/packages/helium-entity-manager-sdk/src/resolvers.ts index 5010392be..653346d0a 100644 --- a/packages/helium-entity-manager-sdk/src/resolvers.ts +++ b/packages/helium-entity-manager-sdk/src/resolvers.ts @@ -5,12 +5,16 @@ import { heliumCommonResolver, resolveIndividual, } from "@helium/anchor-resolvers"; -import { - getAssociatedTokenAddressSync, -} from "@solana/spl-token"; +import { getAssociatedTokenAddressSync } from "@solana/spl-token"; import { PublicKey } from "@solana/web3.js"; import { init } from "./init"; -import { iotInfoKey, keyToAssetKey, mobileInfoKey, programApprovalKey, sharedMerkleKey } from "./pdas"; +import { + iotInfoKey, + keyToAssetKey, + mobileInfoKey, + programApprovalKey, + sharedMerkleKey, +} from "./pdas"; import { notEmittedKey } from "@helium/no-emit-sdk"; export const heliumEntityManagerResolvers = combineResolvers( @@ -152,10 +156,7 @@ export const heliumEntityManagerResolvers = combineResolvers( } }), resolveIndividual(async ({ path, args }) => { - if ( - path[path.length - 1] === "sharedMerkle" && - args[0].proofSize - ) { + if (path[path.length - 1] === "sharedMerkle" && args[0].proofSize) { return sharedMerkleKey(args[0].proofSize)[0]; } }), diff --git a/packages/helium-entity-manager-sdk/yarn.deploy.lock b/packages/helium-entity-manager-sdk/yarn.deploy.lock index f2a27ab20..c73a0643a 100644 --- a/packages/helium-entity-manager-sdk/yarn.deploy.lock +++ b/packages/helium-entity-manager-sdk/yarn.deploy.lock @@ -67,7 +67,7 @@ __metadata: languageName: node linkType: hard -"@helium/account-fetch-cache@^0.9.23": +"@helium/account-fetch-cache@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/account-fetch-cache@workspace:packages/account-fetch-cache" dependencies: @@ -89,7 +89,7 @@ __metadata: languageName: node linkType: hard -"@helium/anchor-resolvers@^0.9.23": +"@helium/anchor-resolvers@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/anchor-resolvers@workspace:packages/anchor-resolvers" dependencies: @@ -127,14 +127,14 @@ __metadata: languageName: node linkType: hard -"@helium/circuit-breaker-sdk@^0.9.23": +"@helium/circuit-breaker-sdk@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/circuit-breaker-sdk@workspace:packages/circuit-breaker-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/anchor-resolvers": ^0.9.23 - "@helium/idls": ^0.9.23 - "@helium/spl-utils": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 + "@helium/idls": ^0.9.24-alpha.0 + "@helium/spl-utils": ^0.9.24-alpha.0 bn.js: ^5.2.0 bs58: ^4.0.1 git-format-staged: ^2.1.3 @@ -150,11 +150,11 @@ __metadata: dependencies: "@coral-xyz/anchor": ^0.28.0 "@helium/address": ^4.10.2 - "@helium/anchor-resolvers": ^0.9.23 - "@helium/helium-sub-daos-sdk": ^0.9.23 - "@helium/idls": ^0.9.23 - "@helium/no-emit-sdk": ^0.9.23 - "@helium/spl-utils": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 + "@helium/helium-sub-daos-sdk": ^0.9.24-alpha.0 + "@helium/idls": ^0.9.24-alpha.0 + "@helium/no-emit-sdk": ^0.9.24-alpha.0 + "@helium/spl-utils": ^0.9.24-alpha.0 "@types/crypto-js": ^4.1.1 bn.js: ^5.2.0 bs58: ^4.0.1 @@ -167,17 +167,17 @@ __metadata: languageName: unknown linkType: soft -"@helium/helium-sub-daos-sdk@^0.9.23": +"@helium/helium-sub-daos-sdk@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/helium-sub-daos-sdk@workspace:packages/helium-sub-daos-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/anchor-resolvers": ^0.9.23 - "@helium/circuit-breaker-sdk": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 + "@helium/circuit-breaker-sdk": ^0.9.24-alpha.0 "@helium/nft-proxy-sdk": ^0.0.15 - "@helium/spl-utils": ^0.9.23 - "@helium/treasury-management-sdk": ^0.9.23 - "@helium/voter-stake-registry-sdk": ^0.9.23 + "@helium/spl-utils": ^0.9.24-alpha.0 + "@helium/treasury-management-sdk": ^0.9.24-alpha.0 + "@helium/voter-stake-registry-sdk": ^0.9.24-alpha.0 bn.js: ^5.2.0 bs58: ^4.0.1 git-format-staged: ^2.1.3 @@ -187,7 +187,7 @@ __metadata: languageName: unknown linkType: soft -"@helium/idls@^0.9.23": +"@helium/idls@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/idls@workspace:packages/idls" dependencies: @@ -223,14 +223,14 @@ __metadata: languageName: node linkType: hard -"@helium/no-emit-sdk@^0.9.23": +"@helium/no-emit-sdk@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/no-emit-sdk@workspace:packages/no-emit-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 "@helium/anchor-resolvers": ^0.5.0 - "@helium/idls": ^0.9.23 - "@helium/spl-utils": ^0.9.23 + "@helium/idls": ^0.9.24-alpha.0 + "@helium/spl-utils": ^0.9.24-alpha.0 bn.js: ^5.2.0 bs58: ^4.0.1 git-format-staged: ^2.1.3 @@ -240,14 +240,14 @@ __metadata: languageName: unknown linkType: soft -"@helium/spl-utils@^0.9.23": +"@helium/spl-utils@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/spl-utils@workspace:packages/spl-utils" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/account-fetch-cache": ^0.9.23 + "@helium/account-fetch-cache": ^0.9.24-alpha.0 "@helium/address": ^4.10.2 - "@helium/anchor-resolvers": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 "@metaplex-foundation/mpl-token-metadata": ^2.10.0 "@solana/spl-account-compression": ^0.1.7 "@solana/spl-token": ^0.3.8 @@ -262,15 +262,15 @@ __metadata: languageName: unknown linkType: soft -"@helium/treasury-management-sdk@^0.9.23": +"@helium/treasury-management-sdk@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/treasury-management-sdk@workspace:packages/treasury-management-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/anchor-resolvers": ^0.9.23 - "@helium/circuit-breaker-sdk": ^0.9.23 - "@helium/idls": ^0.9.23 - "@helium/spl-utils": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 + "@helium/circuit-breaker-sdk": ^0.9.24-alpha.0 + "@helium/idls": ^0.9.24-alpha.0 + "@helium/spl-utils": ^0.9.24-alpha.0 bn.js: ^5.2.0 bs58: ^4.0.1 git-format-staged: ^2.1.3 @@ -280,15 +280,15 @@ __metadata: languageName: unknown linkType: soft -"@helium/voter-stake-registry-sdk@^0.9.23": +"@helium/voter-stake-registry-sdk@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/voter-stake-registry-sdk@workspace:packages/voter-stake-registry-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/anchor-resolvers": ^0.9.23 - "@helium/idls": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 + "@helium/idls": ^0.9.24-alpha.0 "@helium/nft-proxy-sdk": ^0.0.15 - "@helium/spl-utils": ^0.9.23 + "@helium/spl-utils": ^0.9.24-alpha.0 "@metaplex-foundation/mpl-token-metadata": ^2.10.0 "@solana/spl-token": ^0.3.8 bn.js: ^5.2.0 diff --git a/packages/helium-react-hooks/yarn.deploy.lock b/packages/helium-react-hooks/yarn.deploy.lock index 1bb06b0cf..68216385a 100644 --- a/packages/helium-react-hooks/yarn.deploy.lock +++ b/packages/helium-react-hooks/yarn.deploy.lock @@ -58,11 +58,11 @@ __metadata: languageName: node linkType: hard -"@helium/account-fetch-cache-hooks@^0.9.23": +"@helium/account-fetch-cache-hooks@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/account-fetch-cache-hooks@workspace:packages/account-fetch-cache-hooks" dependencies: - "@helium/account-fetch-cache": ^0.9.23 + "@helium/account-fetch-cache": ^0.9.24-alpha.0 "@solana/web3.js": ^1.91.1 git-format-staged: ^2.1.3 react-async-hook: ^4.0.0 @@ -74,7 +74,7 @@ __metadata: languageName: unknown linkType: soft -"@helium/account-fetch-cache@^0.9.23": +"@helium/account-fetch-cache@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/account-fetch-cache@workspace:packages/account-fetch-cache" dependencies: @@ -90,8 +90,8 @@ __metadata: resolution: "@helium/helium-react-hooks@workspace:." dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/account-fetch-cache": ^0.9.23 - "@helium/account-fetch-cache-hooks": ^0.9.23 + "@helium/account-fetch-cache": ^0.9.24-alpha.0 + "@helium/account-fetch-cache-hooks": ^0.9.24-alpha.0 "@solana/spl-token": ^0.3.8 "@solana/wallet-adapter-react": ^0.15.32 "@solana/web3.js": ^1.91.1 diff --git a/packages/helium-sub-daos-sdk/yarn.deploy.lock b/packages/helium-sub-daos-sdk/yarn.deploy.lock index a3f292f3a..00a233a76 100644 --- a/packages/helium-sub-daos-sdk/yarn.deploy.lock +++ b/packages/helium-sub-daos-sdk/yarn.deploy.lock @@ -67,7 +67,7 @@ __metadata: languageName: node linkType: hard -"@helium/account-fetch-cache@^0.9.23": +"@helium/account-fetch-cache@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/account-fetch-cache@workspace:packages/account-fetch-cache" dependencies: @@ -89,7 +89,7 @@ __metadata: languageName: node linkType: hard -"@helium/anchor-resolvers@^0.9.23": +"@helium/anchor-resolvers@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/anchor-resolvers@workspace:packages/anchor-resolvers" dependencies: @@ -115,14 +115,14 @@ __metadata: languageName: node linkType: hard -"@helium/circuit-breaker-sdk@^0.9.23": +"@helium/circuit-breaker-sdk@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/circuit-breaker-sdk@workspace:packages/circuit-breaker-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/anchor-resolvers": ^0.9.23 - "@helium/idls": ^0.9.23 - "@helium/spl-utils": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 + "@helium/idls": ^0.9.24-alpha.0 + "@helium/spl-utils": ^0.9.24-alpha.0 bn.js: ^5.2.0 bs58: ^4.0.1 git-format-staged: ^2.1.3 @@ -137,12 +137,12 @@ __metadata: resolution: "@helium/helium-sub-daos-sdk@workspace:." dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/anchor-resolvers": ^0.9.23 - "@helium/circuit-breaker-sdk": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 + "@helium/circuit-breaker-sdk": ^0.9.24-alpha.0 "@helium/nft-proxy-sdk": ^0.0.15 - "@helium/spl-utils": ^0.9.23 - "@helium/treasury-management-sdk": ^0.9.23 - "@helium/voter-stake-registry-sdk": ^0.9.23 + "@helium/spl-utils": ^0.9.24-alpha.0 + "@helium/treasury-management-sdk": ^0.9.24-alpha.0 + "@helium/voter-stake-registry-sdk": ^0.9.24-alpha.0 bn.js: ^5.2.0 bs58: ^4.0.1 git-format-staged: ^2.1.3 @@ -152,7 +152,7 @@ __metadata: languageName: unknown linkType: soft -"@helium/idls@^0.9.23": +"@helium/idls@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/idls@workspace:packages/idls" dependencies: @@ -188,14 +188,14 @@ __metadata: languageName: node linkType: hard -"@helium/spl-utils@^0.9.23": +"@helium/spl-utils@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/spl-utils@workspace:packages/spl-utils" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/account-fetch-cache": ^0.9.23 + "@helium/account-fetch-cache": ^0.9.24-alpha.0 "@helium/address": ^4.10.2 - "@helium/anchor-resolvers": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 "@metaplex-foundation/mpl-token-metadata": ^2.10.0 "@solana/spl-account-compression": ^0.1.7 "@solana/spl-token": ^0.3.8 @@ -210,15 +210,15 @@ __metadata: languageName: unknown linkType: soft -"@helium/treasury-management-sdk@^0.9.23": +"@helium/treasury-management-sdk@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/treasury-management-sdk@workspace:packages/treasury-management-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/anchor-resolvers": ^0.9.23 - "@helium/circuit-breaker-sdk": ^0.9.23 - "@helium/idls": ^0.9.23 - "@helium/spl-utils": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 + "@helium/circuit-breaker-sdk": ^0.9.24-alpha.0 + "@helium/idls": ^0.9.24-alpha.0 + "@helium/spl-utils": ^0.9.24-alpha.0 bn.js: ^5.2.0 bs58: ^4.0.1 git-format-staged: ^2.1.3 @@ -228,15 +228,15 @@ __metadata: languageName: unknown linkType: soft -"@helium/voter-stake-registry-sdk@^0.9.23": +"@helium/voter-stake-registry-sdk@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/voter-stake-registry-sdk@workspace:packages/voter-stake-registry-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/anchor-resolvers": ^0.9.23 - "@helium/idls": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 + "@helium/idls": ^0.9.24-alpha.0 "@helium/nft-proxy-sdk": ^0.0.15 - "@helium/spl-utils": ^0.9.23 + "@helium/spl-utils": ^0.9.24-alpha.0 "@metaplex-foundation/mpl-token-metadata": ^2.10.0 "@solana/spl-token": ^0.3.8 bn.js: ^5.2.0 diff --git a/packages/helium-vote-service/yarn.deploy.lock b/packages/helium-vote-service/yarn.deploy.lock index 882084fda..d952d88e9 100644 --- a/packages/helium-vote-service/yarn.deploy.lock +++ b/packages/helium-vote-service/yarn.deploy.lock @@ -145,7 +145,7 @@ __metadata: languageName: node linkType: hard -"@helium/account-fetch-cache@^0.9.23": +"@helium/account-fetch-cache@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/account-fetch-cache@workspace:packages/account-fetch-cache" dependencies: @@ -167,7 +167,7 @@ __metadata: languageName: node linkType: hard -"@helium/anchor-resolvers@^0.9.23": +"@helium/anchor-resolvers@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/anchor-resolvers@workspace:packages/anchor-resolvers" dependencies: @@ -212,8 +212,8 @@ __metadata: "@fastify/cors": ^8.1.1 "@fastify/static": ^6 "@helium/organization-sdk": ^0.0.15 - "@helium/spl-utils": ^0.9.23 - "@helium/voter-stake-registry-sdk": ^0.9.23 + "@helium/spl-utils": ^0.9.24-alpha.0 + "@helium/voter-stake-registry-sdk": ^0.9.24-alpha.0 "@solana/web3.js": ^1.91.1 "@types/bn.js": ^5.1.1 "@types/lodash": ^4.17.6 @@ -233,7 +233,7 @@ __metadata: languageName: unknown linkType: soft -"@helium/idls@^0.9.23": +"@helium/idls@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/idls@workspace:packages/idls" dependencies: @@ -302,14 +302,14 @@ __metadata: languageName: node linkType: hard -"@helium/spl-utils@^0.9.23": +"@helium/spl-utils@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/spl-utils@workspace:packages/spl-utils" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/account-fetch-cache": ^0.9.23 + "@helium/account-fetch-cache": ^0.9.24-alpha.0 "@helium/address": ^4.10.2 - "@helium/anchor-resolvers": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 "@metaplex-foundation/mpl-token-metadata": ^2.10.0 "@solana/spl-account-compression": ^0.1.7 "@solana/spl-token": ^0.3.8 @@ -324,15 +324,15 @@ __metadata: languageName: unknown linkType: soft -"@helium/voter-stake-registry-sdk@^0.9.23": +"@helium/voter-stake-registry-sdk@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/voter-stake-registry-sdk@workspace:packages/voter-stake-registry-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/anchor-resolvers": ^0.9.23 - "@helium/idls": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 + "@helium/idls": ^0.9.24-alpha.0 "@helium/nft-proxy-sdk": ^0.0.15 - "@helium/spl-utils": ^0.9.23 + "@helium/spl-utils": ^0.9.24-alpha.0 "@metaplex-foundation/mpl-token-metadata": ^2.10.0 "@solana/spl-token": ^0.3.8 bn.js: ^5.2.0 @@ -673,9 +673,9 @@ __metadata: linkType: hard "@types/lodash@npm:^4.17.6": - version: 4.17.7 - resolution: "@types/lodash@npm:4.17.7" - checksum: 09e58a119cd8a70acfb33f8623dc2fc54f74cdce3b3429b879fc2daac4807fe376190a04b9e024dd300f9a3ee1876d6623979cefe619f70654ca0fe0c47679a7 + version: 4.17.6 + resolution: "@types/lodash@npm:4.17.6" + checksum: f748c672f49c54ee631a0fab6f26d56ab99bd68a4fb91604b5d7525a72102dd1917209c12d7078c988a375edb5dc70ca600db05ac01785306fd64470048cd16c languageName: node linkType: hard @@ -973,8 +973,8 @@ __metadata: linkType: hard "aws-sdk@npm:^2.1650.0": - version: 2.1682.0 - resolution: "aws-sdk@npm:2.1682.0" + version: 2.1650.0 + resolution: "aws-sdk@npm:2.1650.0" dependencies: buffer: 4.9.2 events: 1.1.1 @@ -986,7 +986,7 @@ __metadata: util: ^0.12.4 uuid: 8.0.0 xml2js: 0.6.2 - checksum: ab3b60fdb635d89951787cbe81cc530247858c0ff095f983b3fd2e4357a85161931d4495ea363ce19bb71069e613b463c4f8047a8d60c69ba4f8eaea265d6bf9 + checksum: 60188893d4bdd81f56a3d4b5dd642e8f2ed80816519166ef68decb009fbfcb57a6b389436429f27ec9fa99450f43f21182c718e9660b8a44174485f9ab1102a6 languageName: node linkType: hard @@ -1319,7 +1319,7 @@ __metadata: version: 0.5.4 resolution: "content-disposition@npm:0.5.4" dependencies: - safe-buffer: 5.2.1 + safe-buffer: "npm:5.2.1" checksum: afb9d545e296a5171d7574fcad634b2fdf698875f4006a9dd04a3e1333880c5c0c98d47b560d01216fb6505a54a2ba6a843ee3a02ec86d7e911e8315255f56c3 languageName: node linkType: hard @@ -1378,14 +1378,14 @@ __metadata: linkType: hard "debug@npm:^4.1.1, debug@npm:^4.3.5": - version: 4.3.6 - resolution: "debug@npm:4.3.6" + version: 4.3.5 + resolution: "debug@npm:4.3.5" dependencies: ms: 2.1.2 peerDependenciesMeta: supports-color: optional: true - checksum: 1630b748dea3c581295e02137a9f5cbe2c1d85fea35c1e6597a65ca2b16a6fce68cec61b299d480787ef310ba927dc8c92d3061faba0ad06c6a724672f66be7f + checksum: 7c002b51e256257f936dda09eb37167df952758c57badf6bf44bdc40b89a4bcb8e5a0a2e4c7b53f97c69e2970dd5272d33a757378a12c8f8e64ea7bf99e8e86e languageName: node linkType: hard diff --git a/packages/hexboosting-sdk/yarn.deploy.lock b/packages/hexboosting-sdk/yarn.deploy.lock index 1c3d2a237..c6fbdfa98 100644 --- a/packages/hexboosting-sdk/yarn.deploy.lock +++ b/packages/hexboosting-sdk/yarn.deploy.lock @@ -67,7 +67,7 @@ __metadata: languageName: node linkType: hard -"@helium/account-fetch-cache@^0.9.23": +"@helium/account-fetch-cache@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/account-fetch-cache@workspace:packages/account-fetch-cache" dependencies: @@ -89,7 +89,7 @@ __metadata: languageName: node linkType: hard -"@helium/anchor-resolvers@^0.9.23": +"@helium/anchor-resolvers@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/anchor-resolvers@workspace:packages/anchor-resolvers" dependencies: @@ -115,14 +115,14 @@ __metadata: languageName: node linkType: hard -"@helium/circuit-breaker-sdk@^0.9.23": +"@helium/circuit-breaker-sdk@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/circuit-breaker-sdk@workspace:packages/circuit-breaker-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/anchor-resolvers": ^0.9.23 - "@helium/idls": ^0.9.23 - "@helium/spl-utils": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 + "@helium/idls": ^0.9.24-alpha.0 + "@helium/spl-utils": ^0.9.24-alpha.0 bn.js: ^5.2.0 bs58: ^4.0.1 git-format-staged: ^2.1.3 @@ -132,17 +132,17 @@ __metadata: languageName: unknown linkType: soft -"@helium/helium-sub-daos-sdk@^0.9.23": +"@helium/helium-sub-daos-sdk@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/helium-sub-daos-sdk@workspace:packages/helium-sub-daos-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/anchor-resolvers": ^0.9.23 - "@helium/circuit-breaker-sdk": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 + "@helium/circuit-breaker-sdk": ^0.9.24-alpha.0 "@helium/nft-proxy-sdk": ^0.0.15 - "@helium/spl-utils": ^0.9.23 - "@helium/treasury-management-sdk": ^0.9.23 - "@helium/voter-stake-registry-sdk": ^0.9.23 + "@helium/spl-utils": ^0.9.24-alpha.0 + "@helium/treasury-management-sdk": ^0.9.24-alpha.0 + "@helium/voter-stake-registry-sdk": ^0.9.24-alpha.0 bn.js: ^5.2.0 bs58: ^4.0.1 git-format-staged: ^2.1.3 @@ -157,10 +157,10 @@ __metadata: resolution: "@helium/hexboosting-sdk@workspace:." dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/anchor-resolvers": ^0.9.23 - "@helium/helium-sub-daos-sdk": ^0.9.23 - "@helium/idls": ^0.9.23 - "@helium/spl-utils": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 + "@helium/helium-sub-daos-sdk": ^0.9.24-alpha.0 + "@helium/idls": ^0.9.24-alpha.0 + "@helium/spl-utils": ^0.9.24-alpha.0 bn.js: ^5.2.0 bs58: ^4.0.1 git-format-staged: ^2.1.3 @@ -170,7 +170,7 @@ __metadata: languageName: unknown linkType: soft -"@helium/idls@^0.9.23": +"@helium/idls@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/idls@workspace:packages/idls" dependencies: @@ -206,14 +206,14 @@ __metadata: languageName: node linkType: hard -"@helium/spl-utils@^0.9.23": +"@helium/spl-utils@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/spl-utils@workspace:packages/spl-utils" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/account-fetch-cache": ^0.9.23 + "@helium/account-fetch-cache": ^0.9.24-alpha.0 "@helium/address": ^4.10.2 - "@helium/anchor-resolvers": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 "@metaplex-foundation/mpl-token-metadata": ^2.10.0 "@solana/spl-account-compression": ^0.1.7 "@solana/spl-token": ^0.3.8 @@ -228,15 +228,15 @@ __metadata: languageName: unknown linkType: soft -"@helium/treasury-management-sdk@^0.9.23": +"@helium/treasury-management-sdk@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/treasury-management-sdk@workspace:packages/treasury-management-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/anchor-resolvers": ^0.9.23 - "@helium/circuit-breaker-sdk": ^0.9.23 - "@helium/idls": ^0.9.23 - "@helium/spl-utils": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 + "@helium/circuit-breaker-sdk": ^0.9.24-alpha.0 + "@helium/idls": ^0.9.24-alpha.0 + "@helium/spl-utils": ^0.9.24-alpha.0 bn.js: ^5.2.0 bs58: ^4.0.1 git-format-staged: ^2.1.3 @@ -246,15 +246,15 @@ __metadata: languageName: unknown linkType: soft -"@helium/voter-stake-registry-sdk@^0.9.23": +"@helium/voter-stake-registry-sdk@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/voter-stake-registry-sdk@workspace:packages/voter-stake-registry-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/anchor-resolvers": ^0.9.23 - "@helium/idls": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 + "@helium/idls": ^0.9.24-alpha.0 "@helium/nft-proxy-sdk": ^0.0.15 - "@helium/spl-utils": ^0.9.23 + "@helium/spl-utils": ^0.9.24-alpha.0 "@metaplex-foundation/mpl-token-metadata": ^2.10.0 "@solana/spl-token": ^0.3.8 bn.js: ^5.2.0 diff --git a/packages/hotspot-utils/yarn.deploy.lock b/packages/hotspot-utils/yarn.deploy.lock index 0c929d9bc..70020558b 100644 --- a/packages/hotspot-utils/yarn.deploy.lock +++ b/packages/hotspot-utils/yarn.deploy.lock @@ -67,7 +67,7 @@ __metadata: languageName: node linkType: hard -"@helium/account-fetch-cache@^0.9.23": +"@helium/account-fetch-cache@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/account-fetch-cache@workspace:packages/account-fetch-cache" dependencies: @@ -89,7 +89,7 @@ __metadata: languageName: node linkType: hard -"@helium/anchor-resolvers@^0.9.23": +"@helium/anchor-resolvers@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/anchor-resolvers@workspace:packages/anchor-resolvers" dependencies: @@ -127,14 +127,14 @@ __metadata: languageName: node linkType: hard -"@helium/circuit-breaker-sdk@^0.9.23": +"@helium/circuit-breaker-sdk@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/circuit-breaker-sdk@workspace:packages/circuit-breaker-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/anchor-resolvers": ^0.9.23 - "@helium/idls": ^0.9.23 - "@helium/spl-utils": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 + "@helium/idls": ^0.9.24-alpha.0 + "@helium/spl-utils": ^0.9.24-alpha.0 bn.js: ^5.2.0 bs58: ^4.0.1 git-format-staged: ^2.1.3 @@ -144,17 +144,17 @@ __metadata: languageName: unknown linkType: soft -"@helium/helium-entity-manager-sdk@^0.9.23": +"@helium/helium-entity-manager-sdk@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/helium-entity-manager-sdk@workspace:packages/helium-entity-manager-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 "@helium/address": ^4.10.2 - "@helium/anchor-resolvers": ^0.9.23 - "@helium/helium-sub-daos-sdk": ^0.9.23 - "@helium/idls": ^0.9.23 - "@helium/no-emit-sdk": ^0.9.23 - "@helium/spl-utils": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 + "@helium/helium-sub-daos-sdk": ^0.9.24-alpha.0 + "@helium/idls": ^0.9.24-alpha.0 + "@helium/no-emit-sdk": ^0.9.24-alpha.0 + "@helium/spl-utils": ^0.9.24-alpha.0 "@types/crypto-js": ^4.1.1 bn.js: ^5.2.0 bs58: ^4.0.1 @@ -167,17 +167,17 @@ __metadata: languageName: unknown linkType: soft -"@helium/helium-sub-daos-sdk@^0.9.23": +"@helium/helium-sub-daos-sdk@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/helium-sub-daos-sdk@workspace:packages/helium-sub-daos-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/anchor-resolvers": ^0.9.23 - "@helium/circuit-breaker-sdk": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 + "@helium/circuit-breaker-sdk": ^0.9.24-alpha.0 "@helium/nft-proxy-sdk": ^0.0.15 - "@helium/spl-utils": ^0.9.23 - "@helium/treasury-management-sdk": ^0.9.23 - "@helium/voter-stake-registry-sdk": ^0.9.23 + "@helium/spl-utils": ^0.9.24-alpha.0 + "@helium/treasury-management-sdk": ^0.9.24-alpha.0 + "@helium/voter-stake-registry-sdk": ^0.9.24-alpha.0 bn.js: ^5.2.0 bs58: ^4.0.1 git-format-staged: ^2.1.3 @@ -192,16 +192,16 @@ __metadata: resolution: "@helium/hotspot-utils@workspace:." dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/helium-entity-manager-sdk": ^0.9.23 - "@helium/helium-sub-daos-sdk": ^0.9.23 - "@helium/idls": ^0.9.23 - "@helium/spl-utils": ^0.9.23 + "@helium/helium-entity-manager-sdk": ^0.9.24-alpha.0 + "@helium/helium-sub-daos-sdk": ^0.9.24-alpha.0 + "@helium/idls": ^0.9.24-alpha.0 + "@helium/spl-utils": ^0.9.24-alpha.0 "@solana/web3.js": ^1.91.1 bs58: ^4.0.1 languageName: unknown linkType: soft -"@helium/idls@^0.9.23": +"@helium/idls@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/idls@workspace:packages/idls" dependencies: @@ -237,14 +237,14 @@ __metadata: languageName: node linkType: hard -"@helium/no-emit-sdk@^0.9.23": +"@helium/no-emit-sdk@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/no-emit-sdk@workspace:packages/no-emit-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 "@helium/anchor-resolvers": ^0.5.0 - "@helium/idls": ^0.9.23 - "@helium/spl-utils": ^0.9.23 + "@helium/idls": ^0.9.24-alpha.0 + "@helium/spl-utils": ^0.9.24-alpha.0 bn.js: ^5.2.0 bs58: ^4.0.1 git-format-staged: ^2.1.3 @@ -254,14 +254,14 @@ __metadata: languageName: unknown linkType: soft -"@helium/spl-utils@^0.9.23": +"@helium/spl-utils@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/spl-utils@workspace:packages/spl-utils" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/account-fetch-cache": ^0.9.23 + "@helium/account-fetch-cache": ^0.9.24-alpha.0 "@helium/address": ^4.10.2 - "@helium/anchor-resolvers": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 "@metaplex-foundation/mpl-token-metadata": ^2.10.0 "@solana/spl-account-compression": ^0.1.7 "@solana/spl-token": ^0.3.8 @@ -276,15 +276,15 @@ __metadata: languageName: unknown linkType: soft -"@helium/treasury-management-sdk@^0.9.23": +"@helium/treasury-management-sdk@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/treasury-management-sdk@workspace:packages/treasury-management-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/anchor-resolvers": ^0.9.23 - "@helium/circuit-breaker-sdk": ^0.9.23 - "@helium/idls": ^0.9.23 - "@helium/spl-utils": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 + "@helium/circuit-breaker-sdk": ^0.9.24-alpha.0 + "@helium/idls": ^0.9.24-alpha.0 + "@helium/spl-utils": ^0.9.24-alpha.0 bn.js: ^5.2.0 bs58: ^4.0.1 git-format-staged: ^2.1.3 @@ -294,15 +294,15 @@ __metadata: languageName: unknown linkType: soft -"@helium/voter-stake-registry-sdk@^0.9.23": +"@helium/voter-stake-registry-sdk@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/voter-stake-registry-sdk@workspace:packages/voter-stake-registry-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/anchor-resolvers": ^0.9.23 - "@helium/idls": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 + "@helium/idls": ^0.9.24-alpha.0 "@helium/nft-proxy-sdk": ^0.0.15 - "@helium/spl-utils": ^0.9.23 + "@helium/spl-utils": ^0.9.24-alpha.0 "@metaplex-foundation/mpl-token-metadata": ^2.10.0 "@solana/spl-token": ^0.3.8 bn.js: ^5.2.0 diff --git a/packages/iot-routing-manager-sdk/package.json b/packages/iot-routing-manager-sdk/package.json index 5ec9aaed0..193e17d66 100644 --- a/packages/iot-routing-manager-sdk/package.json +++ b/packages/iot-routing-manager-sdk/package.json @@ -5,7 +5,7 @@ "registry": "https://registry.npmjs.org/" }, "license": "Apache-2.0", - "version": "0.9.2", + "version": "^0.9.24-alpha.0", "description": "Interface to the iot-routing-manager smart contract", "repository": { "type": "git", @@ -32,8 +32,8 @@ }, "dependencies": { "@coral-xyz/anchor": "^0.28.0", - "@helium/anchor-resolvers": "^0.9.23", - "@helium/helium-entity-manager-sdk": "^0.9.23", + "@helium/anchor-resolvers": "^0.9.24-alpha.0", + "@helium/helium-entity-manager-sdk": "^0.9.24-alpha.0", "bn.js": "^5.2.0", "bs58": "^4.0.1" }, diff --git a/packages/iot-routing-manager-sdk/src/index.ts b/packages/iot-routing-manager-sdk/src/index.ts index 50f94038d..abab885cc 100644 --- a/packages/iot-routing-manager-sdk/src/index.ts +++ b/packages/iot-routing-manager-sdk/src/index.ts @@ -3,6 +3,7 @@ import { AnchorProvider, Idl, Program } from "@coral-xyz/anchor"; import { PublicKey } from "@solana/web3.js"; import { PROGRAM_ID } from "./constants"; import { lazyDistributorResolvers } from "./resolvers"; +import { fetchBackwardsCompatibleIdl } from "@helium/spl-utils"; export * from "./constants"; export * from "./pdas"; @@ -11,11 +12,12 @@ export * from "./resolvers"; export async function init( provider: AnchorProvider, programId: PublicKey = PROGRAM_ID, - idl?: Idl | null, + idl?: Idl | null ): Promise> { if (!idl) { - idl = await Program.fetchIdl(programId, provider); + idl = await fetchBackwardsCompatibleIdl(programId, provider); } + const iotRoutingManager = new Program( idl as IotRoutingManager, programId, @@ -25,5 +27,6 @@ export async function init( return lazyDistributorResolvers; } ) as Program; + return iotRoutingManager; } diff --git a/packages/iot-routing-manager-sdk/src/resolvers.ts b/packages/iot-routing-manager-sdk/src/resolvers.ts index 30c623662..6a5013893 100644 --- a/packages/iot-routing-manager-sdk/src/resolvers.ts +++ b/packages/iot-routing-manager-sdk/src/resolvers.ts @@ -1,4 +1,4 @@ -import { Accounts, BorshAccountsCoder, Program, Provider } from "@coral-xyz/anchor"; +import { BorshAccountsCoder, Program, Provider } from "@coral-xyz/anchor"; import { heliumCommonResolver } from "@helium/anchor-resolvers"; import { ataResolver, @@ -8,8 +8,13 @@ import { import { PublicKey } from "@solana/web3.js"; import { devaddrConstraintKey, netIdKey, organizationKey } from "./pdas"; import { PROGRAM_ID } from "./constants"; -import { heliumEntityManagerResolvers, keyToAssetKey, programApprovalKey, sharedMerkleKey } from "@helium/helium-entity-manager-sdk"; -import { IDL } from "@helium/idls/lib/types/iot_routing_manager"; +import { + heliumEntityManagerResolvers, + keyToAssetKey, + programApprovalKey, + sharedMerkleKey, +} from "@helium/helium-entity-manager-sdk"; +import { fetchBackwardsCompatibleIdl } from "@helium/spl-utils"; export const lazyDistributorResolvers = combineResolvers( heliumCommonResolver, @@ -76,11 +81,11 @@ export const lazyDistributorResolvers = combineResolvers( ); async function getNetId(provider: Provider, netId: PublicKey) { - const idl = await Program.fetchIdl(PROGRAM_ID, provider); + const idl = await fetchBackwardsCompatibleIdl(PROGRAM_ID, provider); const netIdAccount = await provider.connection.getAccountInfo(netId); if (!netIdAccount) { throw new Error("NetId account not found"); } - const coder = new BorshAccountsCoder(idl!) - return coder.decode("NetIdV0", netIdAccount.data) + const coder = new BorshAccountsCoder(idl!); + return coder.decode("NetIdV0", netIdAccount.data); } diff --git a/packages/iot-routing-manager-sdk/yarn.deploy.lock b/packages/iot-routing-manager-sdk/yarn.deploy.lock index ce21dde22..1db19c49c 100644 --- a/packages/iot-routing-manager-sdk/yarn.deploy.lock +++ b/packages/iot-routing-manager-sdk/yarn.deploy.lock @@ -14,12 +14,12 @@ __metadata: languageName: node linkType: hard -"@babel/runtime@npm:^7.23.4": - version: 7.24.1 - resolution: "@babel/runtime@npm:7.24.1" +"@babel/runtime@npm:^7.25.0": + version: 7.26.0 + resolution: "@babel/runtime@npm:7.26.0" dependencies: regenerator-runtime: ^0.14.0 - checksum: 5c8f3b912ba949865f03b3cf8395c60e1f4ebd1033fbd835bdfe81b6cac8a87d85bc3c7aded5fcdf07be044c9ab8c818f467abe0deca50020c72496782639572 + checksum: c8e2c0504ab271b3467a261a8f119bf2603eb857a0d71e37791f4e3fae00f681365073cc79f141ddaa90c6077c60ba56448004ad5429d07ac73532be9f7cf28a languageName: node linkType: hard @@ -67,16 +67,14 @@ __metadata: languageName: node linkType: hard -"@helium/account-fetch-cache@^0.9.18": - version: 0.0.0-use.local - resolution: "@helium/account-fetch-cache@workspace:packages/account-fetch-cache" +"@helium/account-fetch-cache@npm:^0.9.23": + version: 0.9.23 + resolution: "@helium/account-fetch-cache@npm:0.9.23" dependencies: - "@solana/web3.js": ^1.78.8 - git-format-staged: ^2.1.3 - ts-loader: ^9.2.3 - typescript: ^5.2.2 - languageName: unknown - linkType: soft + "@solana/web3.js": ^1.91.1 + checksum: a3d2ca0cf3dc04a7ca963eba3e1e59ccf7851be64e4e3d87d9416f8dd166e3f06508b8bbf2792be04e1b6ebc14fe263f296d09def89e60a31451e2254a860f26 + languageName: node + linkType: hard "@helium/address@npm:^4.10.2": version: 4.10.2 @@ -89,20 +87,6 @@ __metadata: languageName: node linkType: hard -"@helium/anchor-resolvers@^0.9.18, @helium/anchor-resolvers@^0.9.2": - version: 0.0.0-use.local - resolution: "@helium/anchor-resolvers@workspace:packages/anchor-resolvers" - dependencies: - "@solana/spl-token": ^0.3.8 - "@solana/web3.js": ^1.78.8 - git-format-staged: ^2.1.3 - ts-loader: ^9.2.3 - typescript: ^5.2.2 - peerDependencies: - "@coral-xyz/anchor": ^0.28.0 - languageName: unknown - linkType: soft - "@helium/anchor-resolvers@npm:^0.2.17": version: 0.2.21 resolution: "@helium/anchor-resolvers@npm:0.2.21" @@ -127,87 +111,88 @@ __metadata: languageName: node linkType: hard -"@helium/circuit-breaker-sdk@^0.9.18": - version: 0.0.0-use.local - resolution: "@helium/circuit-breaker-sdk@workspace:packages/circuit-breaker-sdk" +"@helium/anchor-resolvers@npm:^0.9.23": + version: 0.9.23 + resolution: "@helium/anchor-resolvers@npm:0.9.23" + dependencies: + "@solana/spl-token": ^0.3.8 + "@solana/web3.js": ^1.91.1 + peerDependencies: + "@coral-xyz/anchor": ^0.28.0 + checksum: d6050a29235b862000c6bc9519bc0567b7c10355576392b2e200c06a5795a7827e7ee92bf4e27cfb845accec3b9d888ef4e90e91851f08728bbe05fa313d0206 + languageName: node + linkType: hard + +"@helium/circuit-breaker-sdk@npm:^0.9.23": + version: 0.9.23 + resolution: "@helium/circuit-breaker-sdk@npm:0.9.23" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/anchor-resolvers": ^0.9.18 - "@helium/idls": ^0.9.18 - "@helium/spl-utils": ^0.9.18 + "@helium/anchor-resolvers": ^0.9.23 + "@helium/idls": ^0.9.23 + "@helium/spl-utils": ^0.9.23 bn.js: ^5.2.0 bs58: ^4.0.1 - git-format-staged: ^2.1.3 - ts-loader: ^9.2.3 - ts-node: ^10.9.1 - typescript: ^5.2.2 - languageName: unknown - linkType: soft + checksum: 67a5554881d9f3222f99a2a19d9fe87459ef570e36b8a737093fc79e8b93d66d81938c985eb13580ce87681de3c254702767c9a2d3507d2dbdcc00e8947c85f1 + languageName: node + linkType: hard -"@helium/helium-entity-manager-sdk@^0.9.2": - version: 0.0.0-use.local - resolution: "@helium/helium-entity-manager-sdk@workspace:packages/helium-entity-manager-sdk" +"@helium/helium-entity-manager-sdk@npm:^0.9.23": + version: 0.9.23 + resolution: "@helium/helium-entity-manager-sdk@npm:0.9.23" dependencies: "@coral-xyz/anchor": ^0.28.0 "@helium/address": ^4.10.2 - "@helium/anchor-resolvers": ^0.9.18 - "@helium/helium-sub-daos-sdk": ^0.9.18 - "@helium/idls": ^0.9.18 - "@helium/no-emit-sdk": ^0.9.18 - "@helium/spl-utils": ^0.9.18 - "@types/crypto-js": ^4.1.1 + "@helium/anchor-resolvers": ^0.9.23 + "@helium/helium-sub-daos-sdk": ^0.9.23 + "@helium/idls": ^0.9.23 + "@helium/no-emit-sdk": ^0.9.23 + "@helium/spl-utils": ^0.9.23 bn.js: ^5.2.0 bs58: ^4.0.1 crypto-js: ^4.1.1 - git-format-staged: ^2.1.3 js-sha256: ^0.9.0 - ts-loader: ^9.2.3 - ts-node: ^10.9.1 - typescript: ^5.2.2 - languageName: unknown - linkType: soft + checksum: 02431a67e8836c24e4207c8999f057514ddb99e20073f317d742595aa8f3c1aa255504b2f045eb27fbc011ba6788d05b138fb42c988b6eaaea98b0de6fa1e8a6 + languageName: node + linkType: hard -"@helium/helium-sub-daos-sdk@^0.9.18": - version: 0.0.0-use.local - resolution: "@helium/helium-sub-daos-sdk@workspace:packages/helium-sub-daos-sdk" +"@helium/helium-sub-daos-sdk@npm:^0.9.23": + version: 0.9.23 + resolution: "@helium/helium-sub-daos-sdk@npm:0.9.23" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/anchor-resolvers": ^0.9.18 - "@helium/circuit-breaker-sdk": ^0.9.18 + "@helium/anchor-resolvers": ^0.9.23 + "@helium/circuit-breaker-sdk": ^0.9.23 "@helium/nft-proxy-sdk": ^0.0.15 - "@helium/spl-utils": ^0.9.18 - "@helium/treasury-management-sdk": ^0.9.18 - "@helium/voter-stake-registry-sdk": ^0.9.18 + "@helium/spl-utils": ^0.9.23 + "@helium/treasury-management-sdk": ^0.9.23 + "@helium/voter-stake-registry-sdk": ^0.9.23 bn.js: ^5.2.0 bs58: ^4.0.1 - git-format-staged: ^2.1.3 - ts-loader: ^9.2.3 - ts-node: ^10.9.1 - typescript: ^5.2.2 - languageName: unknown - linkType: soft + checksum: b34231527a51a4323f8af5f0937f665038473955b7789dc0c47f4015d45693f5f7849ffad69c167e45883a55bfb66e2cb2a9a7d012937d77ba4abeca56488584 + languageName: node + linkType: hard -"@helium/idls@^0.9.18": - version: 0.0.0-use.local - resolution: "@helium/idls@workspace:packages/idls" +"@helium/idls@npm:^0.9.23": + version: 0.9.23 + resolution: "@helium/idls@npm:0.9.23" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@solana/web3.js": ^1.78.8 + "@solana/web3.js": ^1.91.1 bn.js: ^5.2.0 borsh: ^0.7.0 bs58: ^4.0.1 - ts-loader: ^9.2.3 - typescript: ^5.2.2 - languageName: unknown - linkType: soft + checksum: 023ebdd5c47dc3c7a715f9a36253b01a413797445a2b298d62fdd5fe898690c1640a9a9199f796e049163686a17a220b4f0eed14ab9d15ba93a7ce01d95d2ea3 + languageName: node + linkType: hard "@helium/iot-routing-manager-sdk@workspace:.": version: 0.0.0-use.local resolution: "@helium/iot-routing-manager-sdk@workspace:." dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/anchor-resolvers": ^0.9.2 - "@helium/helium-entity-manager-sdk": ^0.9.2 + "@helium/anchor-resolvers": ^0.9.23 + "@helium/helium-entity-manager-sdk": ^0.9.23 bn.js: ^5.2.0 bs58: ^4.0.1 git-format-staged: ^2.1.3 @@ -239,82 +224,71 @@ __metadata: languageName: node linkType: hard -"@helium/no-emit-sdk@^0.9.18": - version: 0.0.0-use.local - resolution: "@helium/no-emit-sdk@workspace:packages/no-emit-sdk" +"@helium/no-emit-sdk@npm:^0.9.23": + version: 0.9.23 + resolution: "@helium/no-emit-sdk@npm:0.9.23" dependencies: "@coral-xyz/anchor": ^0.28.0 "@helium/anchor-resolvers": ^0.5.0 - "@helium/idls": ^0.9.18 - "@helium/spl-utils": ^0.9.18 + "@helium/idls": ^0.9.23 + "@helium/spl-utils": ^0.9.23 bn.js: ^5.2.0 bs58: ^4.0.1 - git-format-staged: ^2.1.3 - ts-loader: ^9.2.3 - ts-node: ^10.9.1 - typescript: ^5.2.2 - languageName: unknown - linkType: soft + checksum: 1d040326450a1f530acfaa8bb8d6be7398fe69a1e98f6898aa47440763198e5170f308ac3c07682b2c826498a6ab4ab8233e84cf9e6dab6e5f30c5dc7be161e2 + languageName: node + linkType: hard -"@helium/spl-utils@^0.9.18": - version: 0.0.0-use.local - resolution: "@helium/spl-utils@workspace:packages/spl-utils" +"@helium/spl-utils@npm:^0.9.23": + version: 0.9.23 + resolution: "@helium/spl-utils@npm:0.9.23" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/account-fetch-cache": ^0.9.18 + "@helium/account-fetch-cache": ^0.9.23 "@helium/address": ^4.10.2 - "@helium/anchor-resolvers": ^0.9.18 + "@helium/anchor-resolvers": ^0.9.23 "@metaplex-foundation/mpl-token-metadata": ^2.10.0 "@solana/spl-account-compression": ^0.1.7 "@solana/spl-token": ^0.3.8 - "@solana/web3.js": ^1.78.8 + "@solana/web3.js": ^1.91.1 axios: ^1.5.0 bn.js: ^5.2.0 borsh: ^0.7.0 bs58: ^4.0.1 - git-format-staged: ^2.1.3 - ts-loader: ^9.2.3 - typescript: ^5.2.2 - languageName: unknown - linkType: soft + checksum: 189fbba0b327327bd6e06845b89b315b3f0d9d32731d7900b3dfa3c00cb55a241119b16ad905134c0d6444b21a3ad519bb3ec0da0eb7b078e1235e6085d0a43b + languageName: node + linkType: hard -"@helium/treasury-management-sdk@^0.9.18": - version: 0.0.0-use.local - resolution: "@helium/treasury-management-sdk@workspace:packages/treasury-management-sdk" +"@helium/treasury-management-sdk@npm:^0.9.23": + version: 0.9.23 + resolution: "@helium/treasury-management-sdk@npm:0.9.23" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/anchor-resolvers": ^0.9.18 - "@helium/circuit-breaker-sdk": ^0.9.18 - "@helium/idls": ^0.9.18 - "@helium/spl-utils": ^0.9.18 + "@helium/anchor-resolvers": ^0.9.23 + "@helium/circuit-breaker-sdk": ^0.9.23 + "@helium/idls": ^0.9.23 + "@helium/spl-utils": ^0.9.23 bn.js: ^5.2.0 bs58: ^4.0.1 - git-format-staged: ^2.1.3 - ts-loader: ^9.2.3 - ts-node: ^10.9.1 - typescript: ^5.2.2 - languageName: unknown - linkType: soft + checksum: 530b5a300137ed7483306b1e597c1972342560dc60f710880ee143628d3c1ac3fe0c676bba6d4c09ab70d9d71539abd1588a4c10fce2f24616df852619f4286a + languageName: node + linkType: hard -"@helium/voter-stake-registry-sdk@^0.9.18": - version: 0.0.0-use.local - resolution: "@helium/voter-stake-registry-sdk@workspace:packages/voter-stake-registry-sdk" +"@helium/voter-stake-registry-sdk@npm:^0.9.23": + version: 0.9.23 + resolution: "@helium/voter-stake-registry-sdk@npm:0.9.23" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/anchor-resolvers": ^0.9.18 - "@helium/idls": ^0.9.18 + "@helium/anchor-resolvers": ^0.9.23 + "@helium/idls": ^0.9.23 "@helium/nft-proxy-sdk": ^0.0.15 - "@helium/spl-utils": ^0.9.18 + "@helium/spl-utils": ^0.9.23 "@metaplex-foundation/mpl-token-metadata": ^2.10.0 "@solana/spl-token": ^0.3.8 bn.js: ^5.2.0 bs58: ^4.0.1 - git-format-staged: ^2.1.3 - ts-loader: ^9.2.3 - ts-node: ^10.9.1 - typescript: ^5.2.2 - languageName: unknown - linkType: soft + checksum: 5eeb4eaaa1d2b66701c1b31747697f0a6429fdba52d54375e2d16c1ce4e4a6fd645f742d2dfbc669b94d079a6aac4a1e192f1db7abbbc6bd213ef6f00518b2c0 + languageName: node + linkType: hard "@isaacs/cliui@npm:^8.0.2": version: 8.0.2 @@ -408,12 +382,12 @@ __metadata: languageName: node linkType: hard -"@noble/curves@npm:^1.2.0": - version: 1.4.0 - resolution: "@noble/curves@npm:1.4.0" +"@noble/curves@npm:^1.4.2": + version: 1.8.0 + resolution: "@noble/curves@npm:1.8.0" dependencies: - "@noble/hashes": 1.4.0 - checksum: 0014ff561d16e98da4a57e2310a4015e4bdab3b1e1eafcd18d3f9b955c29c3501452ca5d702fddf8ca92d570bbeadfbe53fe16ebbd81a319c414f739154bb26b + "@noble/hashes": 1.7.0 + checksum: 88198bc5b8049358dfcc6c5e121125744fb81c703299127800f38f868a41697bc26bef8f88dc38f1939f4e0133b8db5f24337164eca7421a6a9480ee711f5e1b languageName: node linkType: hard @@ -424,7 +398,14 @@ __metadata: languageName: node linkType: hard -"@noble/hashes@npm:1.4.0, @noble/hashes@npm:^1.3.3": +"@noble/hashes@npm:1.7.0": + version: 1.7.0 + resolution: "@noble/hashes@npm:1.7.0" + checksum: c06949ead7f5771a74f6fc9a346c7519212b3484c5b7916c8cad6b1b0e5f5f6c997ac3a43c0884ef8b99cfc55fac89058eefb29b6aad1cb41f436c748b316a1c + languageName: node + linkType: hard + +"@noble/hashes@npm:^1.4.0": version: 1.4.0 resolution: "@noble/hashes@npm:1.4.0" checksum: 8ba816ae26c90764b8c42493eea383716396096c5f7ba6bea559993194f49d80a73c081f315f4c367e51bd2d5891700bcdfa816b421d24ab45b41cb03e4f3342 @@ -520,13 +501,13 @@ __metadata: languageName: node linkType: hard -"@solana/web3.js@npm:^1.78.8": - version: 1.91.3 - resolution: "@solana/web3.js@npm:1.91.3" +"@solana/web3.js@npm:^1.91.1": + version: 1.98.0 + resolution: "@solana/web3.js@npm:1.98.0" dependencies: - "@babel/runtime": ^7.23.4 - "@noble/curves": ^1.2.0 - "@noble/hashes": ^1.3.3 + "@babel/runtime": ^7.25.0 + "@noble/curves": ^1.4.2 + "@noble/hashes": ^1.4.0 "@solana/buffer-layout": ^4.0.1 agentkeepalive: ^4.5.0 bigint-buffer: ^1.1.5 @@ -535,11 +516,20 @@ __metadata: bs58: ^4.0.1 buffer: 6.0.3 fast-stable-stringify: ^1.0.0 - jayson: ^4.1.0 + jayson: ^4.1.1 node-fetch: ^2.7.0 - rpc-websockets: ^7.5.1 - superstruct: ^0.14.2 - checksum: 5b251915057368d0615d6a6f0de7b4d4129c3d0643599551c0a342125601418634851b633a47d19da481973406f0f2928fa4bf1a2c57fb19914e69fd5b81c302 + rpc-websockets: ^9.0.2 + superstruct: ^2.0.2 + checksum: f2c39e53e2aa4ba893565b2914112f203d15dcc23d6170edf6f696e735a24469989896827ecc456b99a8c6781c96f1a12a22277e6f82d65545b0925546ab7b8f + languageName: node + linkType: hard + +"@swc/helpers@npm:^0.5.11": + version: 0.5.11 + resolution: "@swc/helpers@npm:0.5.11" + dependencies: + tslib: ^2.4.0 + checksum: 5d85e641d993264f38871bf53e7509da959cdff7646a40d876153291146b9d0aa701518546e5bfef18fa17c5944333bbeb66c2f0d7a570e8c5535d0937d76bd9 languageName: node linkType: hard @@ -587,13 +577,6 @@ __metadata: languageName: node linkType: hard -"@types/crypto-js@npm:^4.1.1": - version: 4.1.1 - resolution: "@types/crypto-js@npm:4.1.1" - checksum: ea3d6a67b69f88baeb6af96004395903d2367a41bd5cd86306da23a44dd96589749495da50974a9b01bb5163c500764c8a33706831eade036bddae016417e3ea - languageName: node - linkType: hard - "@types/node@npm:*": version: 20.5.7 resolution: "@types/node@npm:20.5.7" @@ -608,6 +591,13 @@ __metadata: languageName: node linkType: hard +"@types/uuid@npm:^8.3.4": + version: 8.3.4 + resolution: "@types/uuid@npm:8.3.4" + checksum: 6f11f3ff70f30210edaa8071422d405e9c1d4e53abbe50fdce365150d3c698fe7bbff65c1e71ae080cbfb8fded860dbb5e174da96fdbbdfcaa3fb3daa474d20f + languageName: node + linkType: hard + "@types/ws@npm:^7.4.4": version: 7.4.7 resolution: "@types/ws@npm:7.4.7" @@ -617,6 +607,15 @@ __metadata: languageName: node linkType: hard +"@types/ws@npm:^8.2.2": + version: 8.5.10 + resolution: "@types/ws@npm:8.5.10" + dependencies: + "@types/node": "*" + checksum: 3ec416ea2be24042ebd677932a462cf16d2080393d8d7d0b1b3f5d6eaa4a7387aaf0eefb99193c0bfd29444857cf2e0c3ac89899e130550dc6c14ada8a46d25e + languageName: node + linkType: hard + "JSONStream@npm:^1.3.5": version: 1.3.5 resolution: "JSONStream@npm:1.3.5" @@ -1180,6 +1179,13 @@ __metadata: languageName: node linkType: hard +"eventemitter3@npm:^5.0.1": + version: 5.0.1 + resolution: "eventemitter3@npm:5.0.1" + checksum: 543d6c858ab699303c3c32e0f0f47fc64d360bf73c3daf0ac0b5079710e340d6fe9f15487f94e66c629f5f82cd1a8678d692f3dbb6f6fcd1190e1b97fcad36f8 + languageName: node + linkType: hard + "exponential-backoff@npm:^3.1.1": version: 3.1.1 resolution: "exponential-backoff@npm:3.1.1" @@ -1511,6 +1517,28 @@ __metadata: languageName: node linkType: hard +"jayson@npm:^4.1.1": + version: 4.1.3 + resolution: "jayson@npm:4.1.3" + dependencies: + "@types/connect": ^3.4.33 + "@types/node": ^12.12.54 + "@types/ws": ^7.4.4 + JSONStream: ^1.3.5 + commander: ^2.20.3 + delay: ^5.0.0 + es6-promisify: ^5.0.0 + eyes: ^0.1.8 + isomorphic-ws: ^4.0.1 + json-stringify-safe: ^5.0.1 + uuid: ^8.3.2 + ws: ^7.5.10 + bin: + jayson: bin/jayson.js + checksum: 3e9e0e3d5c14d7a4a85ddfc372236c9938ed713affe58e9ef61e31f075d89947c4d206a2489c5355ff5a639b8cef42906844b9ca8cad48d8147c8132480a242b + languageName: node + linkType: hard + "js-sha256@npm:^0.9.0": version: 0.9.0 resolution: "js-sha256@npm:0.9.0" @@ -1973,6 +2001,28 @@ __metadata: languageName: node linkType: hard +"rpc-websockets@npm:^9.0.2": + version: 9.0.4 + resolution: "rpc-websockets@npm:9.0.4" + dependencies: + "@swc/helpers": ^0.5.11 + "@types/uuid": ^8.3.4 + "@types/ws": ^8.2.2 + buffer: ^6.0.3 + bufferutil: ^4.0.1 + eventemitter3: ^5.0.1 + utf-8-validate: ^5.0.2 + uuid: ^8.3.2 + ws: ^8.5.0 + dependenciesMeta: + bufferutil: + optional: true + utf-8-validate: + optional: true + checksum: d5efe3a1e7fbd9858886342fb766c05ac69c645bfb3c39a907425163db33e237ae2a601b62e17451040584c06d8699152fb2311a7d6cded2a7e7d4e0e74f0c1a + languageName: node + linkType: hard + "safe-buffer@npm:^5.0.1, safe-buffer@npm:~5.2.0": version: 5.2.1 resolution: "safe-buffer@npm:5.2.1" @@ -2145,6 +2195,13 @@ __metadata: languageName: node linkType: hard +"superstruct@npm:^2.0.2": + version: 2.0.2 + resolution: "superstruct@npm:2.0.2" + checksum: a5f75b72cb8b14b86f4f7f750dae8c5ab0e4e1d92414b55e7625bae07bbcafad81c92486e7e32ccacd6ae1f553caff2b92a50ff42ad5093fd35b9cb7f4e5ec86 + languageName: node + linkType: hard + "supports-color@npm:^7.1.0": version: 7.2.0 resolution: "supports-color@npm:7.2.0" @@ -2265,7 +2322,7 @@ __metadata: languageName: node linkType: hard -"tslib@npm:^2.0.3": +"tslib@npm:^2.0.3, tslib@npm:^2.4.0": version: 2.6.2 resolution: "tslib@npm:2.6.2" checksum: 329ea56123005922f39642318e3d1f0f8265d1e7fcb92c633e0809521da75eeaca28d2cf96d7248229deb40e5c19adf408259f4b9640afd20d13aecc1430f3ad @@ -2431,6 +2488,21 @@ __metadata: languageName: node linkType: hard +"ws@npm:^7.5.10": + version: 7.5.10 + resolution: "ws@npm:7.5.10" + peerDependencies: + bufferutil: ^4.0.1 + utf-8-validate: ^5.0.2 + peerDependenciesMeta: + bufferutil: + optional: true + utf-8-validate: + optional: true + checksum: f9bb062abf54cc8f02d94ca86dcd349c3945d63851f5d07a3a61c2fcb755b15a88e943a63cf580cbdb5b74436d67ef6b67f745b8f7c0814e411379138e1863cb + languageName: node + linkType: hard + "ws@npm:^8.5.0": version: 8.13.0 resolution: "ws@npm:8.13.0" diff --git a/packages/lazy-distributor-sdk/yarn.deploy.lock b/packages/lazy-distributor-sdk/yarn.deploy.lock index 3e1ab13f2..b6dd359a6 100644 --- a/packages/lazy-distributor-sdk/yarn.deploy.lock +++ b/packages/lazy-distributor-sdk/yarn.deploy.lock @@ -67,7 +67,7 @@ __metadata: languageName: node linkType: hard -"@helium/account-fetch-cache@^0.9.23": +"@helium/account-fetch-cache@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/account-fetch-cache@workspace:packages/account-fetch-cache" dependencies: @@ -89,7 +89,7 @@ __metadata: languageName: node linkType: hard -"@helium/anchor-resolvers@^0.9.23": +"@helium/anchor-resolvers@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/anchor-resolvers@workspace:packages/anchor-resolvers" dependencies: @@ -103,14 +103,14 @@ __metadata: languageName: unknown linkType: soft -"@helium/circuit-breaker-sdk@^0.9.23": +"@helium/circuit-breaker-sdk@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/circuit-breaker-sdk@workspace:packages/circuit-breaker-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/anchor-resolvers": ^0.9.23 - "@helium/idls": ^0.9.23 - "@helium/spl-utils": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 + "@helium/idls": ^0.9.24-alpha.0 + "@helium/spl-utils": ^0.9.24-alpha.0 bn.js: ^5.2.0 bs58: ^4.0.1 git-format-staged: ^2.1.3 @@ -120,7 +120,7 @@ __metadata: languageName: unknown linkType: soft -"@helium/idls@^0.9.23": +"@helium/idls@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/idls@workspace:packages/idls" dependencies: @@ -139,9 +139,9 @@ __metadata: resolution: "@helium/lazy-distributor-sdk@workspace:." dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/anchor-resolvers": ^0.9.23 - "@helium/circuit-breaker-sdk": ^0.9.23 - "@helium/spl-utils": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 + "@helium/circuit-breaker-sdk": ^0.9.24-alpha.0 + "@helium/spl-utils": ^0.9.24-alpha.0 bn.js: ^5.2.0 bs58: ^4.0.1 git-format-staged: ^2.1.3 @@ -151,14 +151,14 @@ __metadata: languageName: unknown linkType: soft -"@helium/spl-utils@^0.9.23": +"@helium/spl-utils@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/spl-utils@workspace:packages/spl-utils" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/account-fetch-cache": ^0.9.23 + "@helium/account-fetch-cache": ^0.9.24-alpha.0 "@helium/address": ^4.10.2 - "@helium/anchor-resolvers": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 "@metaplex-foundation/mpl-token-metadata": ^2.10.0 "@solana/spl-account-compression": ^0.1.7 "@solana/spl-token": ^0.3.8 diff --git a/packages/lazy-transactions-sdk/yarn.deploy.lock b/packages/lazy-transactions-sdk/yarn.deploy.lock index 666072c75..def12c8cf 100644 --- a/packages/lazy-transactions-sdk/yarn.deploy.lock +++ b/packages/lazy-transactions-sdk/yarn.deploy.lock @@ -67,7 +67,7 @@ __metadata: languageName: node linkType: hard -"@helium/account-fetch-cache@^0.9.23": +"@helium/account-fetch-cache@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/account-fetch-cache@workspace:packages/account-fetch-cache" dependencies: @@ -89,7 +89,7 @@ __metadata: languageName: node linkType: hard -"@helium/anchor-resolvers@^0.9.23": +"@helium/anchor-resolvers@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/anchor-resolvers@workspace:packages/anchor-resolvers" dependencies: @@ -103,7 +103,7 @@ __metadata: languageName: unknown linkType: soft -"@helium/idls@^0.9.23": +"@helium/idls@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/idls@workspace:packages/idls" dependencies: @@ -122,8 +122,8 @@ __metadata: resolution: "@helium/lazy-transactions-sdk@workspace:." dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/idls": ^0.9.23 - "@helium/spl-utils": ^0.9.23 + "@helium/idls": ^0.9.24-alpha.0 + "@helium/spl-utils": ^0.9.24-alpha.0 bn.js: ^5.2.0 bs58: ^4.0.1 git-format-staged: ^2.1.3 @@ -135,14 +135,14 @@ __metadata: languageName: unknown linkType: soft -"@helium/spl-utils@^0.9.23": +"@helium/spl-utils@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/spl-utils@workspace:packages/spl-utils" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/account-fetch-cache": ^0.9.23 + "@helium/account-fetch-cache": ^0.9.24-alpha.0 "@helium/address": ^4.10.2 - "@helium/anchor-resolvers": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 "@metaplex-foundation/mpl-token-metadata": ^2.10.0 "@solana/spl-account-compression": ^0.1.7 "@solana/spl-token": ^0.3.8 diff --git a/packages/metadata-service/yarn.deploy.lock b/packages/metadata-service/yarn.deploy.lock index 7884b5485..a6f0847e7 100644 --- a/packages/metadata-service/yarn.deploy.lock +++ b/packages/metadata-service/yarn.deploy.lock @@ -135,7 +135,7 @@ __metadata: languageName: node linkType: hard -"@helium/account-fetch-cache@^0.9.23": +"@helium/account-fetch-cache@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/account-fetch-cache@workspace:packages/account-fetch-cache" dependencies: @@ -157,7 +157,7 @@ __metadata: languageName: node linkType: hard -"@helium/anchor-resolvers@^0.9.23": +"@helium/anchor-resolvers@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/anchor-resolvers@workspace:packages/anchor-resolvers" dependencies: @@ -195,14 +195,14 @@ __metadata: languageName: node linkType: hard -"@helium/circuit-breaker-sdk@^0.9.23": +"@helium/circuit-breaker-sdk@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/circuit-breaker-sdk@workspace:packages/circuit-breaker-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/anchor-resolvers": ^0.9.23 - "@helium/idls": ^0.9.23 - "@helium/spl-utils": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 + "@helium/idls": ^0.9.24-alpha.0 + "@helium/spl-utils": ^0.9.24-alpha.0 bn.js: ^5.2.0 bs58: ^4.0.1 git-format-staged: ^2.1.3 @@ -212,16 +212,16 @@ __metadata: languageName: unknown linkType: soft -"@helium/data-credits-sdk@^0.9.23": +"@helium/data-credits-sdk@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/data-credits-sdk@workspace:packages/data-credits-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/anchor-resolvers": ^0.9.23 - "@helium/circuit-breaker-sdk": ^0.9.23 - "@helium/helium-sub-daos-sdk": ^0.9.23 - "@helium/idls": ^0.9.23 - "@helium/spl-utils": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 + "@helium/circuit-breaker-sdk": ^0.9.24-alpha.0 + "@helium/helium-sub-daos-sdk": ^0.9.24-alpha.0 + "@helium/idls": ^0.9.24-alpha.0 + "@helium/spl-utils": ^0.9.24-alpha.0 "@types/crypto-js": ^4.1.1 bn.js: ^5.2.0 bs58: ^4.0.1 @@ -233,17 +233,17 @@ __metadata: languageName: unknown linkType: soft -"@helium/helium-entity-manager-sdk@^0.9.23": +"@helium/helium-entity-manager-sdk@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/helium-entity-manager-sdk@workspace:packages/helium-entity-manager-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 "@helium/address": ^4.10.2 - "@helium/anchor-resolvers": ^0.9.23 - "@helium/helium-sub-daos-sdk": ^0.9.23 - "@helium/idls": ^0.9.23 - "@helium/no-emit-sdk": ^0.9.23 - "@helium/spl-utils": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 + "@helium/helium-sub-daos-sdk": ^0.9.24-alpha.0 + "@helium/idls": ^0.9.24-alpha.0 + "@helium/no-emit-sdk": ^0.9.24-alpha.0 + "@helium/spl-utils": ^0.9.24-alpha.0 "@types/crypto-js": ^4.1.1 bn.js: ^5.2.0 bs58: ^4.0.1 @@ -256,17 +256,17 @@ __metadata: languageName: unknown linkType: soft -"@helium/helium-sub-daos-sdk@^0.9.23": +"@helium/helium-sub-daos-sdk@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/helium-sub-daos-sdk@workspace:packages/helium-sub-daos-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/anchor-resolvers": ^0.9.23 - "@helium/circuit-breaker-sdk": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 + "@helium/circuit-breaker-sdk": ^0.9.24-alpha.0 "@helium/nft-proxy-sdk": ^0.0.15 - "@helium/spl-utils": ^0.9.23 - "@helium/treasury-management-sdk": ^0.9.23 - "@helium/voter-stake-registry-sdk": ^0.9.23 + "@helium/spl-utils": ^0.9.24-alpha.0 + "@helium/treasury-management-sdk": ^0.9.24-alpha.0 + "@helium/voter-stake-registry-sdk": ^0.9.24-alpha.0 bn.js: ^5.2.0 bs58: ^4.0.1 git-format-staged: ^2.1.3 @@ -276,7 +276,7 @@ __metadata: languageName: unknown linkType: soft -"@helium/idls@^0.9.23": +"@helium/idls@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/idls@workspace:packages/idls" dependencies: @@ -297,13 +297,13 @@ __metadata: "@coral-xyz/anchor": ^0.28.0 "@fastify/cors": ^8.1.1 "@grpc/grpc-js": ^1.10.1 - "@helium/account-fetch-cache": ^0.9.23 + "@helium/account-fetch-cache": ^0.9.24-alpha.0 "@helium/address": ^4.10.2 - "@helium/data-credits-sdk": ^0.9.23 - "@helium/helium-entity-manager-sdk": ^0.9.23 - "@helium/helium-sub-daos-sdk": ^0.9.23 - "@helium/idls": ^0.9.23 - "@helium/spl-utils": ^0.9.23 + "@helium/data-credits-sdk": ^0.9.24-alpha.0 + "@helium/helium-entity-manager-sdk": ^0.9.24-alpha.0 + "@helium/helium-sub-daos-sdk": ^0.9.24-alpha.0 + "@helium/idls": ^0.9.24-alpha.0 + "@helium/spl-utils": ^0.9.24-alpha.0 "@metaplex-foundation/mpl-token-metadata": ^2.10.0 "@solana/spl-token": ^0.3.8 "@solana/web3.js": ^1.91.1 @@ -352,14 +352,14 @@ __metadata: languageName: node linkType: hard -"@helium/no-emit-sdk@^0.9.23": +"@helium/no-emit-sdk@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/no-emit-sdk@workspace:packages/no-emit-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 "@helium/anchor-resolvers": ^0.5.0 - "@helium/idls": ^0.9.23 - "@helium/spl-utils": ^0.9.23 + "@helium/idls": ^0.9.24-alpha.0 + "@helium/spl-utils": ^0.9.24-alpha.0 bn.js: ^5.2.0 bs58: ^4.0.1 git-format-staged: ^2.1.3 @@ -369,14 +369,14 @@ __metadata: languageName: unknown linkType: soft -"@helium/spl-utils@^0.9.23": +"@helium/spl-utils@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/spl-utils@workspace:packages/spl-utils" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/account-fetch-cache": ^0.9.23 + "@helium/account-fetch-cache": ^0.9.24-alpha.0 "@helium/address": ^4.10.2 - "@helium/anchor-resolvers": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 "@metaplex-foundation/mpl-token-metadata": ^2.10.0 "@solana/spl-account-compression": ^0.1.7 "@solana/spl-token": ^0.3.8 @@ -391,15 +391,15 @@ __metadata: languageName: unknown linkType: soft -"@helium/treasury-management-sdk@^0.9.23": +"@helium/treasury-management-sdk@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/treasury-management-sdk@workspace:packages/treasury-management-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/anchor-resolvers": ^0.9.23 - "@helium/circuit-breaker-sdk": ^0.9.23 - "@helium/idls": ^0.9.23 - "@helium/spl-utils": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 + "@helium/circuit-breaker-sdk": ^0.9.24-alpha.0 + "@helium/idls": ^0.9.24-alpha.0 + "@helium/spl-utils": ^0.9.24-alpha.0 bn.js: ^5.2.0 bs58: ^4.0.1 git-format-staged: ^2.1.3 @@ -409,15 +409,15 @@ __metadata: languageName: unknown linkType: soft -"@helium/voter-stake-registry-sdk@^0.9.23": +"@helium/voter-stake-registry-sdk@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/voter-stake-registry-sdk@workspace:packages/voter-stake-registry-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/anchor-resolvers": ^0.9.23 - "@helium/idls": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 + "@helium/idls": ^0.9.24-alpha.0 "@helium/nft-proxy-sdk": ^0.0.15 - "@helium/spl-utils": ^0.9.23 + "@helium/spl-utils": ^0.9.24-alpha.0 "@metaplex-foundation/mpl-token-metadata": ^2.10.0 "@solana/spl-token": ^0.3.8 bn.js: ^5.2.0 diff --git a/packages/migration-service/yarn.deploy.lock b/packages/migration-service/yarn.deploy.lock index d14130969..3f451f46b 100644 --- a/packages/migration-service/yarn.deploy.lock +++ b/packages/migration-service/yarn.deploy.lock @@ -198,7 +198,7 @@ __metadata: languageName: node linkType: hard -"@helium/account-fetch-cache@^0.9.23": +"@helium/account-fetch-cache@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/account-fetch-cache@workspace:packages/account-fetch-cache" dependencies: @@ -220,7 +220,7 @@ __metadata: languageName: node linkType: hard -"@helium/anchor-resolvers@^0.9.2, @helium/anchor-resolvers@^0.9.23": +"@helium/anchor-resolvers@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/anchor-resolvers@workspace:packages/anchor-resolvers" dependencies: @@ -258,14 +258,26 @@ __metadata: languageName: node linkType: hard -"@helium/circuit-breaker-sdk@^0.9.23": +"@helium/anchor-resolvers@npm:^0.9.2": + version: 0.9.23 + resolution: "@helium/anchor-resolvers@npm:0.9.23" + dependencies: + "@solana/spl-token": ^0.3.8 + "@solana/web3.js": ^1.91.1 + peerDependencies: + "@coral-xyz/anchor": ^0.28.0 + checksum: d6050a29235b862000c6bc9519bc0567b7c10355576392b2e200c06a5795a7827e7ee92bf4e27cfb845accec3b9d888ef4e90e91851f08728bbe05fa313d0206 + languageName: node + linkType: hard + +"@helium/circuit-breaker-sdk@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/circuit-breaker-sdk@workspace:packages/circuit-breaker-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/anchor-resolvers": ^0.9.23 - "@helium/idls": ^0.9.23 - "@helium/spl-utils": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 + "@helium/idls": ^0.9.24-alpha.0 + "@helium/spl-utils": ^0.9.24-alpha.0 bn.js: ^5.2.0 bs58: ^4.0.1 git-format-staged: ^2.1.3 @@ -286,16 +298,16 @@ __metadata: languageName: node linkType: hard -"@helium/data-credits-sdk@^0.9.23": +"@helium/data-credits-sdk@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/data-credits-sdk@workspace:packages/data-credits-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/anchor-resolvers": ^0.9.23 - "@helium/circuit-breaker-sdk": ^0.9.23 - "@helium/helium-sub-daos-sdk": ^0.9.23 - "@helium/idls": ^0.9.23 - "@helium/spl-utils": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 + "@helium/circuit-breaker-sdk": ^0.9.24-alpha.0 + "@helium/helium-sub-daos-sdk": ^0.9.24-alpha.0 + "@helium/idls": ^0.9.24-alpha.0 + "@helium/spl-utils": ^0.9.24-alpha.0 "@types/crypto-js": ^4.1.1 bn.js: ^5.2.0 bs58: ^4.0.1 @@ -307,20 +319,20 @@ __metadata: languageName: unknown linkType: soft -"@helium/distributor-oracle@^0.9.23": +"@helium/distributor-oracle@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/distributor-oracle@workspace:packages/distributor-oracle" dependencies: "@coral-xyz/anchor": ^0.28.0 "@fastify/cors": ^8.1.1 - "@helium/account-fetch-cache": ^0.9.23 + "@helium/account-fetch-cache": ^0.9.24-alpha.0 "@helium/address": ^4.10.2 - "@helium/helium-entity-manager-sdk": ^0.9.23 - "@helium/helium-sub-daos-sdk": ^0.9.23 - "@helium/idls": ^0.9.23 - "@helium/lazy-distributor-sdk": ^0.9.23 - "@helium/rewards-oracle-sdk": ^0.9.23 - "@helium/spl-utils": ^0.9.23 + "@helium/helium-entity-manager-sdk": ^0.9.24-alpha.0 + "@helium/helium-sub-daos-sdk": ^0.9.24-alpha.0 + "@helium/idls": ^0.9.24-alpha.0 + "@helium/lazy-distributor-sdk": ^0.9.24-alpha.0 + "@helium/rewards-oracle-sdk": ^0.9.24-alpha.0 + "@helium/spl-utils": ^0.9.24-alpha.0 "@helium/tuktuk-sdk": ^0.0.1 "@metaplex-foundation/mpl-bubblegum": ^0.7.0 "@solana/spl-token": ^0.3.8 @@ -350,17 +362,17 @@ __metadata: languageName: unknown linkType: soft -"@helium/helium-entity-manager-sdk@^0.9.23": +"@helium/helium-entity-manager-sdk@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/helium-entity-manager-sdk@workspace:packages/helium-entity-manager-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 "@helium/address": ^4.10.2 - "@helium/anchor-resolvers": ^0.9.23 - "@helium/helium-sub-daos-sdk": ^0.9.23 - "@helium/idls": ^0.9.23 - "@helium/no-emit-sdk": ^0.9.23 - "@helium/spl-utils": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 + "@helium/helium-sub-daos-sdk": ^0.9.24-alpha.0 + "@helium/idls": ^0.9.24-alpha.0 + "@helium/no-emit-sdk": ^0.9.24-alpha.0 + "@helium/spl-utils": ^0.9.24-alpha.0 "@types/crypto-js": ^4.1.1 bn.js: ^5.2.0 bs58: ^4.0.1 @@ -373,17 +385,17 @@ __metadata: languageName: unknown linkType: soft -"@helium/helium-sub-daos-sdk@^0.9.23": +"@helium/helium-sub-daos-sdk@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/helium-sub-daos-sdk@workspace:packages/helium-sub-daos-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/anchor-resolvers": ^0.9.23 - "@helium/circuit-breaker-sdk": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 + "@helium/circuit-breaker-sdk": ^0.9.24-alpha.0 "@helium/nft-proxy-sdk": ^0.0.15 - "@helium/spl-utils": ^0.9.23 - "@helium/treasury-management-sdk": ^0.9.23 - "@helium/voter-stake-registry-sdk": ^0.9.23 + "@helium/spl-utils": ^0.9.24-alpha.0 + "@helium/treasury-management-sdk": ^0.9.24-alpha.0 + "@helium/voter-stake-registry-sdk": ^0.9.24-alpha.0 bn.js: ^5.2.0 bs58: ^4.0.1 git-format-staged: ^2.1.3 @@ -393,7 +405,7 @@ __metadata: languageName: unknown linkType: soft -"@helium/idls@^0.9.23": +"@helium/idls@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/idls@workspace:packages/idls" dependencies: @@ -407,14 +419,14 @@ __metadata: languageName: unknown linkType: soft -"@helium/lazy-distributor-sdk@^0.9.23": +"@helium/lazy-distributor-sdk@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/lazy-distributor-sdk@workspace:packages/lazy-distributor-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/anchor-resolvers": ^0.9.23 - "@helium/circuit-breaker-sdk": ^0.9.23 - "@helium/spl-utils": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 + "@helium/circuit-breaker-sdk": ^0.9.24-alpha.0 + "@helium/spl-utils": ^0.9.24-alpha.0 bn.js: ^5.2.0 bs58: ^4.0.1 git-format-staged: ^2.1.3 @@ -424,13 +436,13 @@ __metadata: languageName: unknown linkType: soft -"@helium/lazy-transactions-sdk@^0.9.23": +"@helium/lazy-transactions-sdk@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/lazy-transactions-sdk@workspace:packages/lazy-transactions-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/idls": ^0.9.23 - "@helium/spl-utils": ^0.9.23 + "@helium/idls": ^0.9.24-alpha.0 + "@helium/spl-utils": ^0.9.24-alpha.0 bn.js: ^5.2.0 bs58: ^4.0.1 git-format-staged: ^2.1.3 @@ -449,18 +461,18 @@ __metadata: "@clockwork-xyz/sdk": ^0.3.0 "@coral-xyz/anchor": ^0.28.0 "@fastify/cors": ^8.1.1 - "@helium/account-fetch-cache": ^0.9.23 + "@helium/account-fetch-cache": ^0.9.24-alpha.0 "@helium/address": ^4.10.2 - "@helium/circuit-breaker-sdk": ^0.9.23 + "@helium/circuit-breaker-sdk": ^0.9.24-alpha.0 "@helium/crypto": ^4.10.2 - "@helium/data-credits-sdk": ^0.9.23 - "@helium/distributor-oracle": ^0.9.23 - "@helium/helium-entity-manager-sdk": ^0.9.23 - "@helium/helium-sub-daos-sdk": ^0.9.23 - "@helium/lazy-distributor-sdk": ^0.9.23 - "@helium/lazy-transactions-sdk": ^0.9.23 - "@helium/treasury-management-sdk": ^0.9.23 - "@helium/voter-stake-registry-sdk": ^0.9.23 + "@helium/data-credits-sdk": ^0.9.24-alpha.0 + "@helium/distributor-oracle": ^0.9.24-alpha.0 + "@helium/helium-entity-manager-sdk": ^0.9.24-alpha.0 + "@helium/helium-sub-daos-sdk": ^0.9.24-alpha.0 + "@helium/lazy-distributor-sdk": ^0.9.24-alpha.0 + "@helium/lazy-transactions-sdk": ^0.9.24-alpha.0 + "@helium/treasury-management-sdk": ^0.9.24-alpha.0 + "@helium/voter-stake-registry-sdk": ^0.9.24-alpha.0 "@metaplex-foundation/mpl-token-metadata": ^2.10.0 "@project-serum/borsh": ^0.2.5 "@solana/buffer-layout": ^4.0.0 @@ -512,14 +524,14 @@ __metadata: languageName: node linkType: hard -"@helium/no-emit-sdk@^0.9.23": +"@helium/no-emit-sdk@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/no-emit-sdk@workspace:packages/no-emit-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 "@helium/anchor-resolvers": ^0.5.0 - "@helium/idls": ^0.9.23 - "@helium/spl-utils": ^0.9.23 + "@helium/idls": ^0.9.24-alpha.0 + "@helium/spl-utils": ^0.9.24-alpha.0 bn.js: ^5.2.0 bs58: ^4.0.1 git-format-staged: ^2.1.3 @@ -529,14 +541,14 @@ __metadata: languageName: unknown linkType: soft -"@helium/rewards-oracle-sdk@^0.9.23": +"@helium/rewards-oracle-sdk@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/rewards-oracle-sdk@workspace:packages/rewards-oracle-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/anchor-resolvers": ^0.9.23 - "@helium/idls": ^0.9.23 - "@helium/spl-utils": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 + "@helium/idls": ^0.9.24-alpha.0 + "@helium/spl-utils": ^0.9.24-alpha.0 bn.js: ^5.2.0 bs58: ^4.0.1 git-format-staged: ^2.1.3 @@ -546,14 +558,14 @@ __metadata: languageName: unknown linkType: soft -"@helium/spl-utils@^0.9.23": +"@helium/spl-utils@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/spl-utils@workspace:packages/spl-utils" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/account-fetch-cache": ^0.9.23 + "@helium/account-fetch-cache": ^0.9.24-alpha.0 "@helium/address": ^4.10.2 - "@helium/anchor-resolvers": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 "@metaplex-foundation/mpl-token-metadata": ^2.10.0 "@solana/spl-account-compression": ^0.1.7 "@solana/spl-token": ^0.3.8 @@ -568,15 +580,15 @@ __metadata: languageName: unknown linkType: soft -"@helium/treasury-management-sdk@^0.9.23": +"@helium/treasury-management-sdk@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/treasury-management-sdk@workspace:packages/treasury-management-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/anchor-resolvers": ^0.9.23 - "@helium/circuit-breaker-sdk": ^0.9.23 - "@helium/idls": ^0.9.23 - "@helium/spl-utils": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 + "@helium/circuit-breaker-sdk": ^0.9.24-alpha.0 + "@helium/idls": ^0.9.24-alpha.0 + "@helium/spl-utils": ^0.9.24-alpha.0 bn.js: ^5.2.0 bs58: ^4.0.1 git-format-staged: ^2.1.3 @@ -608,15 +620,15 @@ __metadata: languageName: node linkType: hard -"@helium/voter-stake-registry-sdk@^0.9.23": +"@helium/voter-stake-registry-sdk@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/voter-stake-registry-sdk@workspace:packages/voter-stake-registry-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/anchor-resolvers": ^0.9.23 - "@helium/idls": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 + "@helium/idls": ^0.9.24-alpha.0 "@helium/nft-proxy-sdk": ^0.0.15 - "@helium/spl-utils": ^0.9.23 + "@helium/spl-utils": ^0.9.24-alpha.0 "@metaplex-foundation/mpl-token-metadata": ^2.10.0 "@solana/spl-token": ^0.3.8 bn.js: ^5.2.0 diff --git a/packages/mobile-entity-manager-sdk/yarn.deploy.lock b/packages/mobile-entity-manager-sdk/yarn.deploy.lock index e3962cd5f..3eb72839f 100644 --- a/packages/mobile-entity-manager-sdk/yarn.deploy.lock +++ b/packages/mobile-entity-manager-sdk/yarn.deploy.lock @@ -67,7 +67,7 @@ __metadata: languageName: node linkType: hard -"@helium/account-fetch-cache@^0.9.23": +"@helium/account-fetch-cache@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/account-fetch-cache@workspace:packages/account-fetch-cache" dependencies: @@ -89,7 +89,7 @@ __metadata: languageName: node linkType: hard -"@helium/anchor-resolvers@^0.9.23": +"@helium/anchor-resolvers@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/anchor-resolvers@workspace:packages/anchor-resolvers" dependencies: @@ -127,14 +127,14 @@ __metadata: languageName: node linkType: hard -"@helium/circuit-breaker-sdk@^0.9.23": +"@helium/circuit-breaker-sdk@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/circuit-breaker-sdk@workspace:packages/circuit-breaker-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/anchor-resolvers": ^0.9.23 - "@helium/idls": ^0.9.23 - "@helium/spl-utils": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 + "@helium/idls": ^0.9.24-alpha.0 + "@helium/spl-utils": ^0.9.24-alpha.0 bn.js: ^5.2.0 bs58: ^4.0.1 git-format-staged: ^2.1.3 @@ -144,17 +144,17 @@ __metadata: languageName: unknown linkType: soft -"@helium/helium-entity-manager-sdk@^0.9.23": +"@helium/helium-entity-manager-sdk@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/helium-entity-manager-sdk@workspace:packages/helium-entity-manager-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 "@helium/address": ^4.10.2 - "@helium/anchor-resolvers": ^0.9.23 - "@helium/helium-sub-daos-sdk": ^0.9.23 - "@helium/idls": ^0.9.23 - "@helium/no-emit-sdk": ^0.9.23 - "@helium/spl-utils": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 + "@helium/helium-sub-daos-sdk": ^0.9.24-alpha.0 + "@helium/idls": ^0.9.24-alpha.0 + "@helium/no-emit-sdk": ^0.9.24-alpha.0 + "@helium/spl-utils": ^0.9.24-alpha.0 "@types/crypto-js": ^4.1.1 bn.js: ^5.2.0 bs58: ^4.0.1 @@ -167,17 +167,17 @@ __metadata: languageName: unknown linkType: soft -"@helium/helium-sub-daos-sdk@^0.9.23": +"@helium/helium-sub-daos-sdk@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/helium-sub-daos-sdk@workspace:packages/helium-sub-daos-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/anchor-resolvers": ^0.9.23 - "@helium/circuit-breaker-sdk": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 + "@helium/circuit-breaker-sdk": ^0.9.24-alpha.0 "@helium/nft-proxy-sdk": ^0.0.15 - "@helium/spl-utils": ^0.9.23 - "@helium/treasury-management-sdk": ^0.9.23 - "@helium/voter-stake-registry-sdk": ^0.9.23 + "@helium/spl-utils": ^0.9.24-alpha.0 + "@helium/treasury-management-sdk": ^0.9.24-alpha.0 + "@helium/voter-stake-registry-sdk": ^0.9.24-alpha.0 bn.js: ^5.2.0 bs58: ^4.0.1 git-format-staged: ^2.1.3 @@ -187,7 +187,7 @@ __metadata: languageName: unknown linkType: soft -"@helium/idls@^0.9.23": +"@helium/idls@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/idls@workspace:packages/idls" dependencies: @@ -206,10 +206,10 @@ __metadata: resolution: "@helium/mobile-entity-manager-sdk@workspace:." dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/anchor-resolvers": ^0.9.23 - "@helium/helium-entity-manager-sdk": ^0.9.23 - "@helium/idls": ^0.9.23 - "@helium/spl-utils": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 + "@helium/helium-entity-manager-sdk": ^0.9.24-alpha.0 + "@helium/idls": ^0.9.24-alpha.0 + "@helium/spl-utils": ^0.9.24-alpha.0 "@types/crypto-js": ^4.1.1 bn.js: ^5.2.0 bs58: ^4.0.1 @@ -242,14 +242,14 @@ __metadata: languageName: node linkType: hard -"@helium/no-emit-sdk@^0.9.23": +"@helium/no-emit-sdk@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/no-emit-sdk@workspace:packages/no-emit-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 "@helium/anchor-resolvers": ^0.5.0 - "@helium/idls": ^0.9.23 - "@helium/spl-utils": ^0.9.23 + "@helium/idls": ^0.9.24-alpha.0 + "@helium/spl-utils": ^0.9.24-alpha.0 bn.js: ^5.2.0 bs58: ^4.0.1 git-format-staged: ^2.1.3 @@ -259,14 +259,14 @@ __metadata: languageName: unknown linkType: soft -"@helium/spl-utils@^0.9.23": +"@helium/spl-utils@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/spl-utils@workspace:packages/spl-utils" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/account-fetch-cache": ^0.9.23 + "@helium/account-fetch-cache": ^0.9.24-alpha.0 "@helium/address": ^4.10.2 - "@helium/anchor-resolvers": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 "@metaplex-foundation/mpl-token-metadata": ^2.10.0 "@solana/spl-account-compression": ^0.1.7 "@solana/spl-token": ^0.3.8 @@ -281,15 +281,15 @@ __metadata: languageName: unknown linkType: soft -"@helium/treasury-management-sdk@^0.9.23": +"@helium/treasury-management-sdk@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/treasury-management-sdk@workspace:packages/treasury-management-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/anchor-resolvers": ^0.9.23 - "@helium/circuit-breaker-sdk": ^0.9.23 - "@helium/idls": ^0.9.23 - "@helium/spl-utils": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 + "@helium/circuit-breaker-sdk": ^0.9.24-alpha.0 + "@helium/idls": ^0.9.24-alpha.0 + "@helium/spl-utils": ^0.9.24-alpha.0 bn.js: ^5.2.0 bs58: ^4.0.1 git-format-staged: ^2.1.3 @@ -299,15 +299,15 @@ __metadata: languageName: unknown linkType: soft -"@helium/voter-stake-registry-sdk@^0.9.23": +"@helium/voter-stake-registry-sdk@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/voter-stake-registry-sdk@workspace:packages/voter-stake-registry-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/anchor-resolvers": ^0.9.23 - "@helium/idls": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 + "@helium/idls": ^0.9.24-alpha.0 "@helium/nft-proxy-sdk": ^0.0.15 - "@helium/spl-utils": ^0.9.23 + "@helium/spl-utils": ^0.9.24-alpha.0 "@metaplex-foundation/mpl-token-metadata": ^2.10.0 "@solana/spl-token": ^0.3.8 bn.js: ^5.2.0 diff --git a/packages/monitor-service/yarn.deploy.lock b/packages/monitor-service/yarn.deploy.lock index ce7f50e14..6f343c236 100644 --- a/packages/monitor-service/yarn.deploy.lock +++ b/packages/monitor-service/yarn.deploy.lock @@ -101,7 +101,7 @@ __metadata: languageName: node linkType: hard -"@helium/account-fetch-cache@^0.9.23": +"@helium/account-fetch-cache@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/account-fetch-cache@workspace:packages/account-fetch-cache" dependencies: @@ -123,7 +123,7 @@ __metadata: languageName: node linkType: hard -"@helium/anchor-resolvers@^0.9.23": +"@helium/anchor-resolvers@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/anchor-resolvers@workspace:packages/anchor-resolvers" dependencies: @@ -161,14 +161,14 @@ __metadata: languageName: node linkType: hard -"@helium/circuit-breaker-sdk@^0.9.23": +"@helium/circuit-breaker-sdk@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/circuit-breaker-sdk@workspace:packages/circuit-breaker-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/anchor-resolvers": ^0.9.23 - "@helium/idls": ^0.9.23 - "@helium/spl-utils": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 + "@helium/idls": ^0.9.24-alpha.0 + "@helium/spl-utils": ^0.9.24-alpha.0 bn.js: ^5.2.0 bs58: ^4.0.1 git-format-staged: ^2.1.3 @@ -178,16 +178,16 @@ __metadata: languageName: unknown linkType: soft -"@helium/data-credits-sdk@^0.9.23": +"@helium/data-credits-sdk@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/data-credits-sdk@workspace:packages/data-credits-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/anchor-resolvers": ^0.9.23 - "@helium/circuit-breaker-sdk": ^0.9.23 - "@helium/helium-sub-daos-sdk": ^0.9.23 - "@helium/idls": ^0.9.23 - "@helium/spl-utils": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 + "@helium/circuit-breaker-sdk": ^0.9.24-alpha.0 + "@helium/helium-sub-daos-sdk": ^0.9.24-alpha.0 + "@helium/idls": ^0.9.24-alpha.0 + "@helium/spl-utils": ^0.9.24-alpha.0 "@types/crypto-js": ^4.1.1 bn.js: ^5.2.0 bs58: ^4.0.1 @@ -199,17 +199,17 @@ __metadata: languageName: unknown linkType: soft -"@helium/helium-entity-manager-sdk@^0.9.23": +"@helium/helium-entity-manager-sdk@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/helium-entity-manager-sdk@workspace:packages/helium-entity-manager-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 "@helium/address": ^4.10.2 - "@helium/anchor-resolvers": ^0.9.23 - "@helium/helium-sub-daos-sdk": ^0.9.23 - "@helium/idls": ^0.9.23 - "@helium/no-emit-sdk": ^0.9.23 - "@helium/spl-utils": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 + "@helium/helium-sub-daos-sdk": ^0.9.24-alpha.0 + "@helium/idls": ^0.9.24-alpha.0 + "@helium/no-emit-sdk": ^0.9.24-alpha.0 + "@helium/spl-utils": ^0.9.24-alpha.0 "@types/crypto-js": ^4.1.1 bn.js: ^5.2.0 bs58: ^4.0.1 @@ -222,17 +222,17 @@ __metadata: languageName: unknown linkType: soft -"@helium/helium-sub-daos-sdk@^0.9.23": +"@helium/helium-sub-daos-sdk@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/helium-sub-daos-sdk@workspace:packages/helium-sub-daos-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/anchor-resolvers": ^0.9.23 - "@helium/circuit-breaker-sdk": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 + "@helium/circuit-breaker-sdk": ^0.9.24-alpha.0 "@helium/nft-proxy-sdk": ^0.0.15 - "@helium/spl-utils": ^0.9.23 - "@helium/treasury-management-sdk": ^0.9.23 - "@helium/voter-stake-registry-sdk": ^0.9.23 + "@helium/spl-utils": ^0.9.24-alpha.0 + "@helium/treasury-management-sdk": ^0.9.24-alpha.0 + "@helium/voter-stake-registry-sdk": ^0.9.24-alpha.0 bn.js: ^5.2.0 bs58: ^4.0.1 git-format-staged: ^2.1.3 @@ -242,7 +242,7 @@ __metadata: languageName: unknown linkType: soft -"@helium/idls@^0.9.23": +"@helium/idls@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/idls@workspace:packages/idls" dependencies: @@ -256,14 +256,14 @@ __metadata: languageName: unknown linkType: soft -"@helium/lazy-distributor-sdk@^0.9.23": +"@helium/lazy-distributor-sdk@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/lazy-distributor-sdk@workspace:packages/lazy-distributor-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/anchor-resolvers": ^0.9.23 - "@helium/circuit-breaker-sdk": ^0.9.23 - "@helium/spl-utils": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 + "@helium/circuit-breaker-sdk": ^0.9.24-alpha.0 + "@helium/spl-utils": ^0.9.24-alpha.0 bn.js: ^5.2.0 bs58: ^4.0.1 git-format-staged: ^2.1.3 @@ -273,13 +273,13 @@ __metadata: languageName: unknown linkType: soft -"@helium/lazy-transactions-sdk@^0.9.23": +"@helium/lazy-transactions-sdk@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/lazy-transactions-sdk@workspace:packages/lazy-transactions-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/idls": ^0.9.23 - "@helium/spl-utils": ^0.9.23 + "@helium/idls": ^0.9.24-alpha.0 + "@helium/spl-utils": ^0.9.24-alpha.0 bn.js: ^5.2.0 bs58: ^4.0.1 git-format-staged: ^2.1.3 @@ -306,16 +306,16 @@ __metadata: resolution: "@helium/monitor-service@workspace:." dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/account-fetch-cache": ^0.9.23 - "@helium/circuit-breaker-sdk": ^0.9.23 - "@helium/data-credits-sdk": ^0.9.23 - "@helium/helium-entity-manager-sdk": ^0.9.23 - "@helium/helium-sub-daos-sdk": ^0.9.23 - "@helium/idls": ^0.9.23 - "@helium/lazy-distributor-sdk": ^0.9.23 - "@helium/lazy-transactions-sdk": ^0.9.23 - "@helium/price-oracle-sdk": ^0.9.23 - "@helium/spl-utils": ^0.9.23 + "@helium/account-fetch-cache": ^0.9.24-alpha.0 + "@helium/circuit-breaker-sdk": ^0.9.24-alpha.0 + "@helium/data-credits-sdk": ^0.9.24-alpha.0 + "@helium/helium-entity-manager-sdk": ^0.9.24-alpha.0 + "@helium/helium-sub-daos-sdk": ^0.9.24-alpha.0 + "@helium/idls": ^0.9.24-alpha.0 + "@helium/lazy-distributor-sdk": ^0.9.24-alpha.0 + "@helium/lazy-transactions-sdk": ^0.9.24-alpha.0 + "@helium/price-oracle-sdk": ^0.9.24-alpha.0 + "@helium/spl-utils": ^0.9.24-alpha.0 "@metaplex-foundation/mpl-bubblegum": ^0.7.0 "@metaplex-foundation/mpl-token-metadata": ^2.10.0 "@solana/spl-account-compression": ^0.1.7 @@ -354,14 +354,14 @@ __metadata: languageName: node linkType: hard -"@helium/no-emit-sdk@^0.9.23": +"@helium/no-emit-sdk@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/no-emit-sdk@workspace:packages/no-emit-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 "@helium/anchor-resolvers": ^0.5.0 - "@helium/idls": ^0.9.23 - "@helium/spl-utils": ^0.9.23 + "@helium/idls": ^0.9.24-alpha.0 + "@helium/spl-utils": ^0.9.24-alpha.0 bn.js: ^5.2.0 bs58: ^4.0.1 git-format-staged: ^2.1.3 @@ -371,13 +371,13 @@ __metadata: languageName: unknown linkType: soft -"@helium/price-oracle-sdk@^0.9.23": +"@helium/price-oracle-sdk@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/price-oracle-sdk@workspace:packages/price-oracle-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/idls": ^0.9.23 - "@helium/spl-utils": ^0.9.23 + "@helium/idls": ^0.9.24-alpha.0 + "@helium/spl-utils": ^0.9.24-alpha.0 bn.js: ^5.2.0 bs58: ^4.0.1 git-format-staged: ^2.1.3 @@ -387,14 +387,14 @@ __metadata: languageName: unknown linkType: soft -"@helium/spl-utils@^0.9.23": +"@helium/spl-utils@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/spl-utils@workspace:packages/spl-utils" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/account-fetch-cache": ^0.9.23 + "@helium/account-fetch-cache": ^0.9.24-alpha.0 "@helium/address": ^4.10.2 - "@helium/anchor-resolvers": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 "@metaplex-foundation/mpl-token-metadata": ^2.10.0 "@solana/spl-account-compression": ^0.1.7 "@solana/spl-token": ^0.3.8 @@ -409,15 +409,15 @@ __metadata: languageName: unknown linkType: soft -"@helium/treasury-management-sdk@^0.9.23": +"@helium/treasury-management-sdk@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/treasury-management-sdk@workspace:packages/treasury-management-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/anchor-resolvers": ^0.9.23 - "@helium/circuit-breaker-sdk": ^0.9.23 - "@helium/idls": ^0.9.23 - "@helium/spl-utils": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 + "@helium/circuit-breaker-sdk": ^0.9.24-alpha.0 + "@helium/idls": ^0.9.24-alpha.0 + "@helium/spl-utils": ^0.9.24-alpha.0 bn.js: ^5.2.0 bs58: ^4.0.1 git-format-staged: ^2.1.3 @@ -427,15 +427,15 @@ __metadata: languageName: unknown linkType: soft -"@helium/voter-stake-registry-sdk@^0.9.23": +"@helium/voter-stake-registry-sdk@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/voter-stake-registry-sdk@workspace:packages/voter-stake-registry-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/anchor-resolvers": ^0.9.23 - "@helium/idls": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 + "@helium/idls": ^0.9.24-alpha.0 "@helium/nft-proxy-sdk": ^0.0.15 - "@helium/spl-utils": ^0.9.23 + "@helium/spl-utils": ^0.9.24-alpha.0 "@metaplex-foundation/mpl-token-metadata": ^2.10.0 "@solana/spl-token": ^0.3.8 bn.js: ^5.2.0 diff --git a/packages/no-emit-sdk/yarn.deploy.lock b/packages/no-emit-sdk/yarn.deploy.lock index 1ec79eeee..c3c1c7d52 100644 --- a/packages/no-emit-sdk/yarn.deploy.lock +++ b/packages/no-emit-sdk/yarn.deploy.lock @@ -67,7 +67,7 @@ __metadata: languageName: node linkType: hard -"@helium/account-fetch-cache@^0.9.23": +"@helium/account-fetch-cache@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/account-fetch-cache@workspace:packages/account-fetch-cache" dependencies: @@ -89,7 +89,7 @@ __metadata: languageName: node linkType: hard -"@helium/anchor-resolvers@^0.9.23": +"@helium/anchor-resolvers@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/anchor-resolvers@workspace:packages/anchor-resolvers" dependencies: @@ -115,7 +115,7 @@ __metadata: languageName: node linkType: hard -"@helium/idls@^0.9.23": +"@helium/idls@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/idls@workspace:packages/idls" dependencies: @@ -135,8 +135,8 @@ __metadata: dependencies: "@coral-xyz/anchor": ^0.28.0 "@helium/anchor-resolvers": ^0.5.0 - "@helium/idls": ^0.9.23 - "@helium/spl-utils": ^0.9.23 + "@helium/idls": ^0.9.24-alpha.0 + "@helium/spl-utils": ^0.9.24-alpha.0 bn.js: ^5.2.0 bs58: ^4.0.1 git-format-staged: ^2.1.3 @@ -146,14 +146,14 @@ __metadata: languageName: unknown linkType: soft -"@helium/spl-utils@^0.9.23": +"@helium/spl-utils@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/spl-utils@workspace:packages/spl-utils" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/account-fetch-cache": ^0.9.23 + "@helium/account-fetch-cache": ^0.9.24-alpha.0 "@helium/address": ^4.10.2 - "@helium/anchor-resolvers": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 "@metaplex-foundation/mpl-token-metadata": ^2.10.0 "@solana/spl-account-compression": ^0.1.7 "@solana/spl-token": ^0.3.8 diff --git a/packages/price-oracle-sdk/yarn.deploy.lock b/packages/price-oracle-sdk/yarn.deploy.lock index fb683acdb..97aa2c90f 100644 --- a/packages/price-oracle-sdk/yarn.deploy.lock +++ b/packages/price-oracle-sdk/yarn.deploy.lock @@ -67,7 +67,7 @@ __metadata: languageName: node linkType: hard -"@helium/account-fetch-cache@^0.9.23": +"@helium/account-fetch-cache@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/account-fetch-cache@workspace:packages/account-fetch-cache" dependencies: @@ -89,7 +89,7 @@ __metadata: languageName: node linkType: hard -"@helium/anchor-resolvers@^0.9.23": +"@helium/anchor-resolvers@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/anchor-resolvers@workspace:packages/anchor-resolvers" dependencies: @@ -103,7 +103,7 @@ __metadata: languageName: unknown linkType: soft -"@helium/idls@^0.9.23": +"@helium/idls@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/idls@workspace:packages/idls" dependencies: @@ -122,8 +122,8 @@ __metadata: resolution: "@helium/price-oracle-sdk@workspace:." dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/idls": ^0.9.23 - "@helium/spl-utils": ^0.9.23 + "@helium/idls": ^0.9.24-alpha.0 + "@helium/spl-utils": ^0.9.24-alpha.0 bn.js: ^5.2.0 bs58: ^4.0.1 git-format-staged: ^2.1.3 @@ -133,14 +133,14 @@ __metadata: languageName: unknown linkType: soft -"@helium/spl-utils@^0.9.23": +"@helium/spl-utils@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/spl-utils@workspace:packages/spl-utils" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/account-fetch-cache": ^0.9.23 + "@helium/account-fetch-cache": ^0.9.24-alpha.0 "@helium/address": ^4.10.2 - "@helium/anchor-resolvers": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 "@metaplex-foundation/mpl-token-metadata": ^2.10.0 "@solana/spl-account-compression": ^0.1.7 "@solana/spl-token": ^0.3.8 diff --git a/packages/rewards-oracle-sdk/yarn.deploy.lock b/packages/rewards-oracle-sdk/yarn.deploy.lock index c24835efb..69a94b591 100644 --- a/packages/rewards-oracle-sdk/yarn.deploy.lock +++ b/packages/rewards-oracle-sdk/yarn.deploy.lock @@ -67,7 +67,7 @@ __metadata: languageName: node linkType: hard -"@helium/account-fetch-cache@^0.9.23": +"@helium/account-fetch-cache@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/account-fetch-cache@workspace:packages/account-fetch-cache" dependencies: @@ -89,7 +89,7 @@ __metadata: languageName: node linkType: hard -"@helium/anchor-resolvers@^0.9.23": +"@helium/anchor-resolvers@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/anchor-resolvers@workspace:packages/anchor-resolvers" dependencies: @@ -103,7 +103,7 @@ __metadata: languageName: unknown linkType: soft -"@helium/idls@^0.9.23": +"@helium/idls@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/idls@workspace:packages/idls" dependencies: @@ -122,9 +122,9 @@ __metadata: resolution: "@helium/rewards-oracle-sdk@workspace:." dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/anchor-resolvers": ^0.9.23 - "@helium/idls": ^0.9.23 - "@helium/spl-utils": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 + "@helium/idls": ^0.9.24-alpha.0 + "@helium/spl-utils": ^0.9.24-alpha.0 bn.js: ^5.2.0 bs58: ^4.0.1 git-format-staged: ^2.1.3 @@ -134,14 +134,14 @@ __metadata: languageName: unknown linkType: soft -"@helium/spl-utils@^0.9.23": +"@helium/spl-utils@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/spl-utils@workspace:packages/spl-utils" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/account-fetch-cache": ^0.9.23 + "@helium/account-fetch-cache": ^0.9.24-alpha.0 "@helium/address": ^4.10.2 - "@helium/anchor-resolvers": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 "@metaplex-foundation/mpl-token-metadata": ^2.10.0 "@solana/spl-account-compression": ^0.1.7 "@solana/spl-token": ^0.3.8 diff --git a/packages/spl-utils/src/idl/iot_routing_manager.json b/packages/spl-utils/src/idl/iot_routing_manager.json new file mode 100644 index 000000000..91f3c744e --- /dev/null +++ b/packages/spl-utils/src/idl/iot_routing_manager.json @@ -0,0 +1,1541 @@ +{ + "version": "0.1.2", + "name": "iot_routing_manager", + "instructions": [ + { + "name": "initializeDevaddrConstraintV0", + "accounts": [ + { + "name": "payer", + "isMut": true, + "isSigner": true + }, + { + "name": "authority", + "isMut": false, + "isSigner": true + }, + { + "name": "netId", + "isMut": true, + "isSigner": false + }, + { + "name": "routingManager", + "isMut": false, + "isSigner": false, + "relations": [ + "iot_mint", + "iot_price_oracle" + ] + }, + { + "name": "organization", + "isMut": false, + "isSigner": false, + "relations": [ + "net_id", + "routing_manager", + "authority" + ] + }, + { + "name": "iotMint", + "isMut": true, + "isSigner": false + }, + { + "name": "payerIotAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "iotPriceOracle", + "isMut": false, + "isSigner": false + }, + { + "name": "devaddrConstraint", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "args", + "type": { + "defined": "InitializeDevaddrConstraintArgsV0" + } + } + ] + }, + { + "name": "removeDevaddrConstraintV0", + "accounts": [ + { + "name": "rentRefund", + "isMut": true, + "isSigner": false + }, + { + "name": "authority", + "isMut": false, + "isSigner": true + }, + { + "name": "netId", + "isMut": false, + "isSigner": false, + "relations": [ + "authority" + ] + }, + { + "name": "devaddrConstraint", + "isMut": true, + "isSigner": false + } + ], + "args": [] + }, + { + "name": "initializeNetIdV0", + "accounts": [ + { + "name": "payer", + "isMut": true, + "isSigner": true + }, + { + "name": "netIdAuthority", + "isMut": false, + "isSigner": true + }, + { + "name": "authority", + "isMut": false, + "isSigner": false + }, + { + "name": "routingManager", + "isMut": false, + "isSigner": false, + "relations": [ + "net_id_authority" + ] + }, + { + "name": "netId", + "isMut": true, + "isSigner": false + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "args", + "type": { + "defined": "InitializeNetIdArgsV0" + } + } + ] + }, + { + "name": "initializeOrganizationV0", + "accounts": [ + { + "name": "payer", + "isMut": true, + "isSigner": true + }, + { + "name": "programApproval", + "isMut": false, + "isSigner": false + }, + { + "name": "routingManager", + "isMut": true, + "isSigner": false, + "relations": [ + "collection", + "sub_dao", + "iot_mint", + "iot_price_oracle" + ] + }, + { + "name": "netId", + "isMut": false, + "isSigner": false, + "relations": [ + "routing_manager" + ] + }, + { + "name": "iotMint", + "isMut": true, + "isSigner": false + }, + { + "name": "payerIotAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "iotPriceOracle", + "isMut": false, + "isSigner": false + }, + { + "name": "authority", + "isMut": false, + "isSigner": false + }, + { + "name": "organization", + "isMut": true, + "isSigner": false + }, + { + "name": "collection", + "isMut": false, + "isSigner": false + }, + { + "name": "collectionMetadata", + "isMut": true, + "isSigner": false, + "pda": { + "seeds": [ + { + "kind": "const", + "type": "string", + "value": "metadata" + }, + { + "kind": "account", + "type": "publicKey", + "path": "token_metadata_program" + }, + { + "kind": "account", + "type": "publicKey", + "account": "Mint", + "path": "collection" + } + ], + "programId": { + "kind": "account", + "type": "publicKey", + "path": "token_metadata_program" + } + } + }, + { + "name": "collectionMasterEdition", + "isMut": false, + "isSigner": false, + "pda": { + "seeds": [ + { + "kind": "const", + "type": "string", + "value": "metadata" + }, + { + "kind": "account", + "type": "publicKey", + "path": "token_metadata_program" + }, + { + "kind": "account", + "type": "publicKey", + "account": "Mint", + "path": "collection" + }, + { + "kind": "const", + "type": "string", + "value": "edition" + } + ], + "programId": { + "kind": "account", + "type": "publicKey", + "path": "token_metadata_program" + } + } + }, + { + "name": "entityCreator", + "isMut": false, + "isSigner": false, + "pda": { + "seeds": [ + { + "kind": "const", + "type": "string", + "value": "entity_creator" + }, + { + "kind": "account", + "type": "publicKey", + "account": "DaoV0", + "path": "dao" + } + ], + "programId": { + "kind": "account", + "type": "publicKey", + "path": "helium_entity_manager_program" + } + } + }, + { + "name": "dao", + "isMut": false, + "isSigner": false + }, + { + "name": "subDao", + "isMut": false, + "isSigner": false, + "relations": [ + "dao" + ] + }, + { + "name": "keyToAsset", + "isMut": true, + "isSigner": false + }, + { + "name": "treeAuthority", + "isMut": true, + "isSigner": false, + "pda": { + "seeds": [ + { + "kind": "account", + "type": "publicKey", + "path": "merkle_tree" + } + ], + "programId": { + "kind": "account", + "type": "publicKey", + "path": "bubblegum_program" + } + } + }, + { + "name": "recipient", + "isMut": false, + "isSigner": false + }, + { + "name": "merkleTree", + "isMut": true, + "isSigner": false + }, + { + "name": "bubblegumSigner", + "isMut": false, + "isSigner": false, + "pda": { + "seeds": [ + { + "kind": "const", + "type": "string", + "value": "collection_cpi" + } + ], + "programId": { + "kind": "account", + "type": "publicKey", + "path": "bubblegum_program" + } + } + }, + { + "name": "sharedMerkle", + "isMut": true, + "isSigner": false, + "relations": [ + "merkle_tree" + ] + }, + { + "name": "tokenMetadataProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "logWrapper", + "isMut": false, + "isSigner": false + }, + { + "name": "bubblegumProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "compressionProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "heliumEntityManagerProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false + } + ], + "args": [] + }, + { + "name": "initializeRoutingManagerV0", + "accounts": [ + { + "name": "payer", + "isMut": true, + "isSigner": true + }, + { + "name": "authority", + "isMut": false, + "isSigner": true + }, + { + "name": "updateAuthority", + "isMut": false, + "isSigner": false + }, + { + "name": "netIdAuthority", + "isMut": false, + "isSigner": false + }, + { + "name": "routingManager", + "isMut": true, + "isSigner": false, + "pda": { + "seeds": [ + { + "kind": "const", + "type": "string", + "value": "routing_manager" + }, + { + "kind": "account", + "type": "publicKey", + "account": "SubDaoV0", + "path": "sub_dao" + } + ] + } + }, + { + "name": "subDao", + "isMut": false, + "isSigner": false, + "relations": [ + "authority", + "dnt_mint" + ] + }, + { + "name": "dntMint", + "isMut": false, + "isSigner": false + }, + { + "name": "iotPriceOracle", + "isMut": false, + "isSigner": false + }, + { + "name": "collection", + "isMut": true, + "isSigner": false, + "pda": { + "seeds": [ + { + "kind": "const", + "type": "string", + "value": "collection" + }, + { + "kind": "account", + "type": "publicKey", + "account": "IotRoutingManagerV0", + "path": "routing_manager" + } + ] + } + }, + { + "name": "metadata", + "isMut": true, + "isSigner": false, + "pda": { + "seeds": [ + { + "kind": "const", + "type": "string", + "value": "metadata" + }, + { + "kind": "account", + "type": "publicKey", + "path": "token_metadata_program" + }, + { + "kind": "account", + "type": "publicKey", + "account": "Mint", + "path": "collection" + } + ], + "programId": { + "kind": "account", + "type": "publicKey", + "path": "token_metadata_program" + } + } + }, + { + "name": "masterEdition", + "isMut": true, + "isSigner": false, + "pda": { + "seeds": [ + { + "kind": "const", + "type": "string", + "value": "metadata" + }, + { + "kind": "account", + "type": "publicKey", + "path": "token_metadata_program" + }, + { + "kind": "account", + "type": "publicKey", + "account": "Mint", + "path": "collection" + }, + { + "kind": "const", + "type": "string", + "value": "edition" + } + ], + "programId": { + "kind": "account", + "type": "publicKey", + "path": "token_metadata_program" + } + } + }, + { + "name": "tokenAccount", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenMetadataProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "associatedTokenProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "rent", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "args", + "type": { + "defined": "InitializeRoutingManagerArgsV0" + } + } + ] + }, + { + "name": "initializeOrganizationDelegateV0", + "accounts": [ + { + "name": "payer", + "isMut": true, + "isSigner": true + }, + { + "name": "authority", + "isMut": false, + "isSigner": true + }, + { + "name": "organization", + "isMut": false, + "isSigner": false, + "relations": [ + "authority" + ] + }, + { + "name": "organizationDelegate", + "isMut": true, + "isSigner": false, + "pda": { + "seeds": [ + { + "kind": "const", + "type": "string", + "value": "organization_delegate" + }, + { + "kind": "account", + "type": "publicKey", + "account": "OrganizationV0", + "path": "organization" + }, + { + "kind": "account", + "type": "publicKey", + "path": "delegate" + } + ] + } + }, + { + "name": "delegate", + "isMut": false, + "isSigner": false + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false + } + ], + "args": [] + }, + { + "name": "removeOrganizationDelegateV0", + "accounts": [ + { + "name": "rentRefund", + "isMut": true, + "isSigner": false + }, + { + "name": "authority", + "isMut": false, + "isSigner": true + }, + { + "name": "organization", + "isMut": false, + "isSigner": false, + "relations": [ + "authority" + ] + }, + { + "name": "organizationDelegate", + "isMut": true, + "isSigner": false + } + ], + "args": [] + }, + { + "name": "approveOrganizationV0", + "accounts": [ + { + "name": "authority", + "isMut": false, + "isSigner": true + }, + { + "name": "netId", + "isMut": false, + "isSigner": false, + "relations": [ + "authority" + ] + }, + { + "name": "organization", + "isMut": true, + "isSigner": false, + "relations": [ + "net_id" + ] + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false + } + ], + "args": [] + }, + { + "name": "updateRoutingManagerV0", + "accounts": [ + { + "name": "updateAuthority", + "isMut": false, + "isSigner": true + }, + { + "name": "routingManager", + "isMut": true, + "isSigner": false, + "relations": [ + "update_authority" + ] + } + ], + "args": [ + { + "name": "args", + "type": { + "defined": "UpdateRoutingManagerArgsV0" + } + } + ] + }, + { + "name": "updateNetIdV0", + "accounts": [ + { + "name": "authority", + "isMut": false, + "isSigner": true + }, + { + "name": "netId", + "isMut": true, + "isSigner": false, + "relations": [ + "authority" + ] + } + ], + "args": [ + { + "name": "args", + "type": { + "defined": "UpdateNetIdArgsV0" + } + } + ] + }, + { + "name": "updateOrganizationV0", + "accounts": [ + { + "name": "authority", + "isMut": false, + "isSigner": true + }, + { + "name": "organization", + "isMut": true, + "isSigner": false, + "relations": [ + "authority" + ] + } + ], + "args": [ + { + "name": "args", + "type": { + "defined": "UpdateOrganizationArgsV0" + } + } + ] + }, + { + "name": "tempBackfillOrganization", + "accounts": [ + { + "name": "payer", + "isMut": true, + "isSigner": true + }, + { + "name": "programApproval", + "isMut": false, + "isSigner": false + }, + { + "name": "routingManager", + "isMut": true, + "isSigner": false, + "relations": [ + "collection", + "sub_dao", + "iot_mint" + ] + }, + { + "name": "netId", + "isMut": false, + "isSigner": false, + "relations": [ + "routing_manager" + ] + }, + { + "name": "iotMint", + "isMut": true, + "isSigner": false + }, + { + "name": "authority", + "isMut": false, + "isSigner": false + }, + { + "name": "organization", + "isMut": true, + "isSigner": false, + "pda": { + "seeds": [ + { + "kind": "const", + "type": "string", + "value": "organization" + }, + { + "kind": "account", + "type": "publicKey", + "account": "IotRoutingManagerV0", + "path": "routing_manager" + }, + { + "kind": "arg", + "type": { + "defined": "TempBackfillOrganizationArgs" + }, + "path": "args.oui" + } + ] + } + }, + { + "name": "collection", + "isMut": false, + "isSigner": false + }, + { + "name": "collectionMetadata", + "isMut": true, + "isSigner": false, + "pda": { + "seeds": [ + { + "kind": "const", + "type": "string", + "value": "metadata" + }, + { + "kind": "account", + "type": "publicKey", + "path": "token_metadata_program" + }, + { + "kind": "account", + "type": "publicKey", + "account": "Mint", + "path": "collection" + } + ], + "programId": { + "kind": "account", + "type": "publicKey", + "path": "token_metadata_program" + } + } + }, + { + "name": "collectionMasterEdition", + "isMut": false, + "isSigner": false, + "pda": { + "seeds": [ + { + "kind": "const", + "type": "string", + "value": "metadata" + }, + { + "kind": "account", + "type": "publicKey", + "path": "token_metadata_program" + }, + { + "kind": "account", + "type": "publicKey", + "account": "Mint", + "path": "collection" + }, + { + "kind": "const", + "type": "string", + "value": "edition" + } + ], + "programId": { + "kind": "account", + "type": "publicKey", + "path": "token_metadata_program" + } + } + }, + { + "name": "entityCreator", + "isMut": false, + "isSigner": false, + "pda": { + "seeds": [ + { + "kind": "const", + "type": "string", + "value": "entity_creator" + }, + { + "kind": "account", + "type": "publicKey", + "account": "DaoV0", + "path": "dao" + } + ], + "programId": { + "kind": "account", + "type": "publicKey", + "path": "helium_entity_manager_program" + } + } + }, + { + "name": "dao", + "isMut": false, + "isSigner": false + }, + { + "name": "subDao", + "isMut": false, + "isSigner": false, + "relations": [ + "dao" + ] + }, + { + "name": "keyToAsset", + "isMut": true, + "isSigner": false + }, + { + "name": "treeAuthority", + "isMut": true, + "isSigner": false, + "pda": { + "seeds": [ + { + "kind": "account", + "type": "publicKey", + "path": "merkle_tree" + } + ], + "programId": { + "kind": "account", + "type": "publicKey", + "path": "bubblegum_program" + } + } + }, + { + "name": "recipient", + "isMut": false, + "isSigner": false + }, + { + "name": "merkleTree", + "isMut": true, + "isSigner": false + }, + { + "name": "bubblegumSigner", + "isMut": false, + "isSigner": false, + "pda": { + "seeds": [ + { + "kind": "const", + "type": "string", + "value": "collection_cpi" + } + ], + "programId": { + "kind": "account", + "type": "publicKey", + "path": "bubblegum_program" + } + } + }, + { + "name": "sharedMerkle", + "isMut": true, + "isSigner": false, + "relations": [ + "merkle_tree" + ] + }, + { + "name": "tokenMetadataProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "logWrapper", + "isMut": false, + "isSigner": false + }, + { + "name": "bubblegumProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "compressionProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "heliumEntityManagerProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "args", + "type": { + "defined": "TempBackfillOrganizationArgs" + } + } + ] + }, + { + "name": "tempBackfillOrganizationDelegate", + "accounts": [ + { + "name": "payer", + "isMut": true, + "isSigner": true + }, + { + "name": "organization", + "isMut": false, + "isSigner": false + }, + { + "name": "organizationDelegate", + "isMut": true, + "isSigner": false, + "pda": { + "seeds": [ + { + "kind": "const", + "type": "string", + "value": "organization_delegate" + }, + { + "kind": "account", + "type": "publicKey", + "account": "OrganizationV0", + "path": "organization" + }, + { + "kind": "account", + "type": "publicKey", + "path": "delegate" + } + ] + } + }, + { + "name": "delegate", + "isMut": false, + "isSigner": false + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false + } + ], + "args": [] + }, + { + "name": "tempBackfillDevaddrConstraint", + "accounts": [ + { + "name": "payer", + "isMut": true, + "isSigner": true + }, + { + "name": "netId", + "isMut": true, + "isSigner": false + }, + { + "name": "routingManager", + "isMut": false, + "isSigner": false, + "relations": [ + "iot_mint" + ] + }, + { + "name": "organization", + "isMut": false, + "isSigner": false, + "relations": [ + "net_id", + "routing_manager" + ] + }, + { + "name": "iotMint", + "isMut": true, + "isSigner": false + }, + { + "name": "devaddrConstraint", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "args", + "type": { + "defined": "TempBackfillDevaddrConstraintArgs" + } + } + ] + } + ], + "accounts": [ + { + "name": "IotRoutingManagerV0", + "type": { + "kind": "struct", + "fields": [ + { + "name": "subDao", + "type": "publicKey" + }, + { + "name": "iotMint", + "type": "publicKey" + }, + { + "name": "iotPriceOracle", + "type": "publicKey" + }, + { + "name": "updateAuthority", + "type": "publicKey" + }, + { + "name": "netIdAuthority", + "type": "publicKey" + }, + { + "name": "collection", + "type": "publicKey" + }, + { + "name": "devaddrPriceUsd", + "type": "u64" + }, + { + "name": "ouiPriceUsd", + "type": "u64" + }, + { + "name": "nextOuiId", + "type": "u64" + }, + { + "name": "bumpSeed", + "type": "u8" + } + ] + } + }, + { + "name": "OrganizationV0", + "type": { + "kind": "struct", + "fields": [ + { + "name": "routingManager", + "type": "publicKey" + }, + { + "name": "netId", + "type": "publicKey" + }, + { + "name": "authority", + "type": "publicKey" + }, + { + "name": "oui", + "type": "u64" + }, + { + "name": "escrowKey", + "type": "string" + }, + { + "name": "approved", + "type": "bool" + }, + { + "name": "bumpSeed", + "type": "u8" + } + ] + } + }, + { + "name": "NetIdV0", + "type": { + "kind": "struct", + "fields": [ + { + "name": "routingManager", + "type": "publicKey" + }, + { + "name": "id", + "type": "u32" + }, + { + "name": "authority", + "type": "publicKey" + }, + { + "name": "currentAddrOffset", + "type": "u64" + }, + { + "name": "bumpSeed", + "type": "u8" + } + ] + } + }, + { + "name": "DevaddrConstraintV0", + "type": { + "kind": "struct", + "fields": [ + { + "name": "routingManager", + "type": "publicKey" + }, + { + "name": "netId", + "type": "publicKey" + }, + { + "name": "organization", + "type": "publicKey" + }, + { + "name": "startAddr", + "type": "u64" + }, + { + "name": "endAddr", + "type": "u64" + }, + { + "name": "bumpSeed", + "type": "u8" + } + ] + } + }, + { + "name": "OrganizationDelegateV0", + "type": { + "kind": "struct", + "fields": [ + { + "name": "organization", + "type": "publicKey" + }, + { + "name": "delegate", + "type": "publicKey" + }, + { + "name": "bumpSeed", + "type": "u8" + } + ] + } + } + ], + "types": [ + { + "name": "InitializeDevaddrConstraintArgsV0", + "type": { + "kind": "struct", + "fields": [ + { + "name": "numBlocks", + "type": "u32" + } + ] + } + }, + { + "name": "InitializeNetIdArgsV0", + "type": { + "kind": "struct", + "fields": [ + { + "name": "netId", + "type": "u32" + } + ] + } + }, + { + "name": "InitializeRoutingManagerArgsV0", + "type": { + "kind": "struct", + "fields": [ + { + "name": "metadataUrl", + "type": "string" + }, + { + "name": "devaddrPriceUsd", + "type": "u64" + }, + { + "name": "ouiPriceUsd", + "type": "u64" + } + ] + } + }, + { + "name": "TempBackfillDevaddrConstraintArgs", + "type": { + "kind": "struct", + "fields": [ + { + "name": "numBlocks", + "type": "u32" + }, + { + "name": "startAddr", + "type": "u64" + } + ] + } + }, + { + "name": "TempBackfillOrganizationArgs", + "type": { + "kind": "struct", + "fields": [ + { + "name": "oui", + "type": "u64" + }, + { + "name": "escrowKeyOverride", + "type": "string" + } + ] + } + }, + { + "name": "UpdateNetIdArgsV0", + "type": { + "kind": "struct", + "fields": [ + { + "name": "authority", + "type": { + "option": "publicKey" + } + } + ] + } + }, + { + "name": "UpdateOrganizationArgsV0", + "type": { + "kind": "struct", + "fields": [ + { + "name": "authority", + "type": { + "option": "publicKey" + } + } + ] + } + }, + { + "name": "UpdateRoutingManagerArgsV0", + "type": { + "kind": "struct", + "fields": [ + { + "name": "updateAuthority", + "type": { + "option": "publicKey" + } + }, + { + "name": "netIdAuthority", + "type": { + "option": "publicKey" + } + }, + { + "name": "devaddrPriceUsd", + "type": { + "option": "u64" + } + }, + { + "name": "ouiPriceUsd", + "type": { + "option": "u64" + } + } + ] + } + } + ], + "errors": [ + { + "code": 6000, + "name": "CarrierNotApproved", + "msg": "The carrier is not approved" + }, + { + "code": 6001, + "name": "InvalidStringLength", + "msg": "Names, symbols and urls must be less than 32, 10, and 200 characters respectively" + }, + { + "code": 6002, + "name": "TreeNotFull", + "msg": "Cannot swap tree until it is close to full" + }, + { + "code": 6003, + "name": "ArithmeticError", + "msg": "Arithmetic error" + }, + { + "code": 6004, + "name": "PythPriceNotFound", + "msg": "Pyth price is not available" + }, + { + "code": 6005, + "name": "PythPriceFeedStale", + "msg": "Pyth price is stale" + }, + { + "code": 6006, + "name": "OrganizationNotApproved", + "msg": "Organization is not approved" + } + ] +} \ No newline at end of file diff --git a/packages/spl-utils/yarn.deploy.lock b/packages/spl-utils/yarn.deploy.lock index 169b19e5b..d7c487b2c 100644 --- a/packages/spl-utils/yarn.deploy.lock +++ b/packages/spl-utils/yarn.deploy.lock @@ -58,7 +58,7 @@ __metadata: languageName: node linkType: hard -"@helium/account-fetch-cache@^0.9.23": +"@helium/account-fetch-cache@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/account-fetch-cache@workspace:packages/account-fetch-cache" dependencies: @@ -80,7 +80,7 @@ __metadata: languageName: node linkType: hard -"@helium/anchor-resolvers@^0.9.23": +"@helium/anchor-resolvers@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/anchor-resolvers@workspace:packages/anchor-resolvers" dependencies: @@ -99,9 +99,9 @@ __metadata: resolution: "@helium/spl-utils@workspace:." dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/account-fetch-cache": ^0.9.23 + "@helium/account-fetch-cache": ^0.9.24-alpha.0 "@helium/address": ^4.10.2 - "@helium/anchor-resolvers": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 "@metaplex-foundation/mpl-token-metadata": ^2.10.0 "@solana/spl-account-compression": ^0.1.7 "@solana/spl-token": ^0.3.8 diff --git a/packages/tokens-to-rent-service/yarn.deploy.lock b/packages/tokens-to-rent-service/yarn.deploy.lock index 230f6d8d5..76bc3dec4 100644 --- a/packages/tokens-to-rent-service/yarn.deploy.lock +++ b/packages/tokens-to-rent-service/yarn.deploy.lock @@ -111,7 +111,7 @@ __metadata: languageName: node linkType: hard -"@helium/account-fetch-cache@^0.9.23": +"@helium/account-fetch-cache@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/account-fetch-cache@workspace:packages/account-fetch-cache" dependencies: @@ -133,7 +133,7 @@ __metadata: languageName: node linkType: hard -"@helium/anchor-resolvers@^0.9.23": +"@helium/anchor-resolvers@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/anchor-resolvers@workspace:packages/anchor-resolvers" dependencies: @@ -147,14 +147,14 @@ __metadata: languageName: unknown linkType: soft -"@helium/spl-utils@^0.9.23": +"@helium/spl-utils@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/spl-utils@workspace:packages/spl-utils" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/account-fetch-cache": ^0.9.23 + "@helium/account-fetch-cache": ^0.9.24-alpha.0 "@helium/address": ^4.10.2 - "@helium/anchor-resolvers": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 "@metaplex-foundation/mpl-token-metadata": ^2.10.0 "@solana/spl-account-compression": ^0.1.7 "@solana/spl-token": ^0.3.8 @@ -175,9 +175,9 @@ __metadata: dependencies: "@coral-xyz/anchor": ^0.28.0 "@fastify/cors": ^8.1.1 - "@helium/account-fetch-cache": ^0.9.23 + "@helium/account-fetch-cache": ^0.9.24-alpha.0 "@helium/address": ^4.10.2 - "@helium/spl-utils": ^0.9.23 + "@helium/spl-utils": ^0.9.24-alpha.0 "@jup-ag/api": ^6.0.6 "@solana/spl-token": ^0.3.8 "@solana/web3.js": ^1.91.1 diff --git a/packages/treasury-management-sdk/yarn.deploy.lock b/packages/treasury-management-sdk/yarn.deploy.lock index 26abafddb..c3cb2d965 100644 --- a/packages/treasury-management-sdk/yarn.deploy.lock +++ b/packages/treasury-management-sdk/yarn.deploy.lock @@ -67,7 +67,7 @@ __metadata: languageName: node linkType: hard -"@helium/account-fetch-cache@^0.9.23": +"@helium/account-fetch-cache@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/account-fetch-cache@workspace:packages/account-fetch-cache" dependencies: @@ -89,7 +89,7 @@ __metadata: languageName: node linkType: hard -"@helium/anchor-resolvers@^0.9.23": +"@helium/anchor-resolvers@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/anchor-resolvers@workspace:packages/anchor-resolvers" dependencies: @@ -103,14 +103,14 @@ __metadata: languageName: unknown linkType: soft -"@helium/circuit-breaker-sdk@^0.9.23": +"@helium/circuit-breaker-sdk@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/circuit-breaker-sdk@workspace:packages/circuit-breaker-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/anchor-resolvers": ^0.9.23 - "@helium/idls": ^0.9.23 - "@helium/spl-utils": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 + "@helium/idls": ^0.9.24-alpha.0 + "@helium/spl-utils": ^0.9.24-alpha.0 bn.js: ^5.2.0 bs58: ^4.0.1 git-format-staged: ^2.1.3 @@ -120,7 +120,7 @@ __metadata: languageName: unknown linkType: soft -"@helium/idls@^0.9.23": +"@helium/idls@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/idls@workspace:packages/idls" dependencies: @@ -134,14 +134,14 @@ __metadata: languageName: unknown linkType: soft -"@helium/spl-utils@^0.9.23": +"@helium/spl-utils@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/spl-utils@workspace:packages/spl-utils" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/account-fetch-cache": ^0.9.23 + "@helium/account-fetch-cache": ^0.9.24-alpha.0 "@helium/address": ^4.10.2 - "@helium/anchor-resolvers": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 "@metaplex-foundation/mpl-token-metadata": ^2.10.0 "@solana/spl-account-compression": ^0.1.7 "@solana/spl-token": ^0.3.8 @@ -161,10 +161,10 @@ __metadata: resolution: "@helium/treasury-management-sdk@workspace:." dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/anchor-resolvers": ^0.9.23 - "@helium/circuit-breaker-sdk": ^0.9.23 - "@helium/idls": ^0.9.23 - "@helium/spl-utils": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 + "@helium/circuit-breaker-sdk": ^0.9.24-alpha.0 + "@helium/idls": ^0.9.24-alpha.0 + "@helium/spl-utils": ^0.9.24-alpha.0 bn.js: ^5.2.0 bs58: ^4.0.1 git-format-staged: ^2.1.3 diff --git a/packages/voter-stake-registry-hooks/yarn.deploy.lock b/packages/voter-stake-registry-hooks/yarn.deploy.lock index 5722f783e..48aa579c3 100644 --- a/packages/voter-stake-registry-hooks/yarn.deploy.lock +++ b/packages/voter-stake-registry-hooks/yarn.deploy.lock @@ -67,11 +67,11 @@ __metadata: languageName: node linkType: hard -"@helium/account-fetch-cache-hooks@^0.9.23": +"@helium/account-fetch-cache-hooks@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/account-fetch-cache-hooks@workspace:packages/account-fetch-cache-hooks" dependencies: - "@helium/account-fetch-cache": ^0.9.23 + "@helium/account-fetch-cache": ^0.9.24-alpha.0 "@solana/web3.js": ^1.91.1 git-format-staged: ^2.1.3 react-async-hook: ^4.0.0 @@ -97,7 +97,7 @@ __metadata: languageName: node linkType: hard -"@helium/account-fetch-cache@^0.9.23": +"@helium/account-fetch-cache@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/account-fetch-cache@workspace:packages/account-fetch-cache" dependencies: @@ -128,7 +128,7 @@ __metadata: languageName: node linkType: hard -"@helium/anchor-resolvers@^0.9.23": +"@helium/anchor-resolvers@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/anchor-resolvers@workspace:packages/anchor-resolvers" dependencies: @@ -166,14 +166,14 @@ __metadata: languageName: node linkType: hard -"@helium/circuit-breaker-sdk@^0.9.23": +"@helium/circuit-breaker-sdk@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/circuit-breaker-sdk@workspace:packages/circuit-breaker-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/anchor-resolvers": ^0.9.23 - "@helium/idls": ^0.9.23 - "@helium/spl-utils": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 + "@helium/idls": ^0.9.24-alpha.0 + "@helium/spl-utils": ^0.9.24-alpha.0 bn.js: ^5.2.0 bs58: ^4.0.1 git-format-staged: ^2.1.3 @@ -183,13 +183,13 @@ __metadata: languageName: unknown linkType: soft -"@helium/helium-react-hooks@^0.9.23": +"@helium/helium-react-hooks@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/helium-react-hooks@workspace:packages/helium-react-hooks" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/account-fetch-cache": ^0.9.23 - "@helium/account-fetch-cache-hooks": ^0.9.23 + "@helium/account-fetch-cache": ^0.9.24-alpha.0 + "@helium/account-fetch-cache-hooks": ^0.9.24-alpha.0 "@solana/spl-token": ^0.3.8 "@solana/wallet-adapter-react": ^0.15.32 "@solana/web3.js": ^1.91.1 @@ -226,17 +226,17 @@ __metadata: languageName: node linkType: hard -"@helium/helium-sub-daos-sdk@^0.9.23": +"@helium/helium-sub-daos-sdk@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/helium-sub-daos-sdk@workspace:packages/helium-sub-daos-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/anchor-resolvers": ^0.9.23 - "@helium/circuit-breaker-sdk": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 + "@helium/circuit-breaker-sdk": ^0.9.24-alpha.0 "@helium/nft-proxy-sdk": ^0.0.15 - "@helium/spl-utils": ^0.9.23 - "@helium/treasury-management-sdk": ^0.9.23 - "@helium/voter-stake-registry-sdk": ^0.9.23 + "@helium/spl-utils": ^0.9.24-alpha.0 + "@helium/treasury-management-sdk": ^0.9.24-alpha.0 + "@helium/voter-stake-registry-sdk": ^0.9.24-alpha.0 bn.js: ^5.2.0 bs58: ^4.0.1 git-format-staged: ^2.1.3 @@ -246,7 +246,7 @@ __metadata: languageName: unknown linkType: soft -"@helium/idls@^0.9.23": +"@helium/idls@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/idls@workspace:packages/idls" dependencies: @@ -333,14 +333,14 @@ __metadata: languageName: node linkType: hard -"@helium/spl-utils@^0.9.23": +"@helium/spl-utils@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/spl-utils@workspace:packages/spl-utils" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/account-fetch-cache": ^0.9.23 + "@helium/account-fetch-cache": ^0.9.24-alpha.0 "@helium/address": ^4.10.2 - "@helium/anchor-resolvers": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 "@metaplex-foundation/mpl-token-metadata": ^2.10.0 "@solana/spl-account-compression": ^0.1.7 "@solana/spl-token": ^0.3.8 @@ -355,15 +355,15 @@ __metadata: languageName: unknown linkType: soft -"@helium/treasury-management-sdk@^0.9.23": +"@helium/treasury-management-sdk@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/treasury-management-sdk@workspace:packages/treasury-management-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/anchor-resolvers": ^0.9.23 - "@helium/circuit-breaker-sdk": ^0.9.23 - "@helium/idls": ^0.9.23 - "@helium/spl-utils": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 + "@helium/circuit-breaker-sdk": ^0.9.24-alpha.0 + "@helium/idls": ^0.9.24-alpha.0 + "@helium/spl-utils": ^0.9.24-alpha.0 bn.js: ^5.2.0 bs58: ^4.0.1 git-format-staged: ^2.1.3 @@ -378,15 +378,15 @@ __metadata: resolution: "@helium/voter-stake-registry-hooks@workspace:." dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/account-fetch-cache": ^0.9.23 - "@helium/account-fetch-cache-hooks": ^0.9.23 - "@helium/circuit-breaker-sdk": ^0.9.23 - "@helium/helium-react-hooks": ^0.9.23 - "@helium/helium-sub-daos-sdk": ^0.9.23 + "@helium/account-fetch-cache": ^0.9.24-alpha.0 + "@helium/account-fetch-cache-hooks": ^0.9.24-alpha.0 + "@helium/circuit-breaker-sdk": ^0.9.24-alpha.0 + "@helium/helium-react-hooks": ^0.9.24-alpha.0 + "@helium/helium-sub-daos-sdk": ^0.9.24-alpha.0 "@helium/modular-governance-hooks": ^0.0.15 "@helium/modular-governance-idls": ^0.0.15 - "@helium/spl-utils": ^0.9.23 - "@helium/voter-stake-registry-sdk": ^0.9.23 + "@helium/spl-utils": ^0.9.24-alpha.0 + "@helium/voter-stake-registry-sdk": ^0.9.24-alpha.0 "@solana/wallet-adapter-base": ^0.9.22 "@solana/web3.js": ^1.91.1 "@tanstack/react-query": ^5.45.0 @@ -403,15 +403,15 @@ __metadata: languageName: unknown linkType: soft -"@helium/voter-stake-registry-sdk@^0.9.23": +"@helium/voter-stake-registry-sdk@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/voter-stake-registry-sdk@workspace:packages/voter-stake-registry-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/anchor-resolvers": ^0.9.23 - "@helium/idls": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 + "@helium/idls": ^0.9.24-alpha.0 "@helium/nft-proxy-sdk": ^0.0.15 - "@helium/spl-utils": ^0.9.23 + "@helium/spl-utils": ^0.9.24-alpha.0 "@metaplex-foundation/mpl-token-metadata": ^2.10.0 "@solana/spl-token": ^0.3.8 bn.js: ^5.2.0 @@ -804,21 +804,21 @@ __metadata: languageName: node linkType: hard -"@tanstack/query-core@npm:5.52.0": - version: 5.52.0 - resolution: "@tanstack/query-core@npm:5.52.0" - checksum: 1e142995fa9b0eec88009dd1083cd226eaec9125dc668b6485699639f45edb1386e4acd634e0eddc33d3a29e0c9636302824c42ac8c4106935d776fdc41d2638 +"@tanstack/query-core@npm:5.45.0": + version: 5.45.0 + resolution: "@tanstack/query-core@npm:5.45.0" + checksum: a3c13d90cfa12955d22fa754ebfddbea70081fc0128111083269bdd78ed0d25678f050007b753164a929a00fdef9ee5ebba945deb8e360120ae3cbae06e655a5 languageName: node linkType: hard "@tanstack/react-query@npm:^5.45.0": - version: 5.52.1 - resolution: "@tanstack/react-query@npm:5.52.1" + version: 5.45.0 + resolution: "@tanstack/react-query@npm:5.45.0" dependencies: - "@tanstack/query-core": 5.52.0 + "@tanstack/query-core": 5.45.0 peerDependencies: - react: ^18 || ^19 - checksum: f46bf1f85cc03b8329aee5d8a5a96b4e30dc88aff04d5256ebd0efefe1f507720b42a4be4a9bee340d3ade6cf0ae7b59187de90d87ea973c0f67e3764f76260c + react: ^18.0.0 + checksum: 3f2896e132e2fc4f5a2b77e015719cd8f74a3b5ce958d3d2ffc83cc9bd8a1a265ed54835a8751daf00b85af7bf15f8ad1a9fe123dafdfdfe3e81f17e585d0e95 languageName: node linkType: hard diff --git a/packages/voter-stake-registry-sdk/yarn.deploy.lock b/packages/voter-stake-registry-sdk/yarn.deploy.lock index 2144d9af3..42843019a 100644 --- a/packages/voter-stake-registry-sdk/yarn.deploy.lock +++ b/packages/voter-stake-registry-sdk/yarn.deploy.lock @@ -67,7 +67,7 @@ __metadata: languageName: node linkType: hard -"@helium/account-fetch-cache@^0.9.23": +"@helium/account-fetch-cache@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/account-fetch-cache@workspace:packages/account-fetch-cache" dependencies: @@ -89,7 +89,7 @@ __metadata: languageName: node linkType: hard -"@helium/anchor-resolvers@^0.9.23": +"@helium/anchor-resolvers@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/anchor-resolvers@workspace:packages/anchor-resolvers" dependencies: @@ -115,7 +115,7 @@ __metadata: languageName: node linkType: hard -"@helium/idls@^0.9.23": +"@helium/idls@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/idls@workspace:packages/idls" dependencies: @@ -151,14 +151,14 @@ __metadata: languageName: node linkType: hard -"@helium/spl-utils@^0.9.23": +"@helium/spl-utils@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/spl-utils@workspace:packages/spl-utils" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/account-fetch-cache": ^0.9.23 + "@helium/account-fetch-cache": ^0.9.24-alpha.0 "@helium/address": ^4.10.2 - "@helium/anchor-resolvers": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 "@metaplex-foundation/mpl-token-metadata": ^2.10.0 "@solana/spl-account-compression": ^0.1.7 "@solana/spl-token": ^0.3.8 @@ -178,10 +178,10 @@ __metadata: resolution: "@helium/voter-stake-registry-sdk@workspace:." dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/anchor-resolvers": ^0.9.23 - "@helium/idls": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 + "@helium/idls": ^0.9.24-alpha.0 "@helium/nft-proxy-sdk": ^0.0.15 - "@helium/spl-utils": ^0.9.23 + "@helium/spl-utils": ^0.9.24-alpha.0 "@metaplex-foundation/mpl-token-metadata": ^2.10.0 "@solana/spl-token": ^0.3.8 bn.js: ^5.2.0 diff --git a/packages/vsr-metadata-service/yarn.deploy.lock b/packages/vsr-metadata-service/yarn.deploy.lock index bc16cd347..f933996fe 100644 --- a/packages/vsr-metadata-service/yarn.deploy.lock +++ b/packages/vsr-metadata-service/yarn.deploy.lock @@ -111,7 +111,7 @@ __metadata: languageName: node linkType: hard -"@helium/account-fetch-cache@^0.9.23": +"@helium/account-fetch-cache@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/account-fetch-cache@workspace:packages/account-fetch-cache" dependencies: @@ -133,7 +133,7 @@ __metadata: languageName: node linkType: hard -"@helium/anchor-resolvers@^0.9.23": +"@helium/anchor-resolvers@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/anchor-resolvers@workspace:packages/anchor-resolvers" dependencies: @@ -159,7 +159,7 @@ __metadata: languageName: node linkType: hard -"@helium/idls@^0.9.23": +"@helium/idls@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/idls@workspace:packages/idls" dependencies: @@ -195,14 +195,14 @@ __metadata: languageName: node linkType: hard -"@helium/spl-utils@^0.9.23": +"@helium/spl-utils@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/spl-utils@workspace:packages/spl-utils" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/account-fetch-cache": ^0.9.23 + "@helium/account-fetch-cache": ^0.9.24-alpha.0 "@helium/address": ^4.10.2 - "@helium/anchor-resolvers": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 "@metaplex-foundation/mpl-token-metadata": ^2.10.0 "@solana/spl-account-compression": ^0.1.7 "@solana/spl-token": ^0.3.8 @@ -217,15 +217,15 @@ __metadata: languageName: unknown linkType: soft -"@helium/voter-stake-registry-sdk@^0.9.23": +"@helium/voter-stake-registry-sdk@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/voter-stake-registry-sdk@workspace:packages/voter-stake-registry-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/anchor-resolvers": ^0.9.23 - "@helium/idls": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 + "@helium/idls": ^0.9.24-alpha.0 "@helium/nft-proxy-sdk": ^0.0.15 - "@helium/spl-utils": ^0.9.23 + "@helium/spl-utils": ^0.9.24-alpha.0 "@metaplex-foundation/mpl-token-metadata": ^2.10.0 "@solana/spl-token": ^0.3.8 bn.js: ^5.2.0 @@ -243,10 +243,10 @@ __metadata: dependencies: "@coral-xyz/anchor": ^0.28.0 "@fastify/cors": ^8.1.1 - "@helium/account-fetch-cache": ^0.9.23 + "@helium/account-fetch-cache": ^0.9.24-alpha.0 "@helium/address": ^4.10.2 - "@helium/spl-utils": ^0.9.23 - "@helium/voter-stake-registry-sdk": ^0.9.23 + "@helium/spl-utils": ^0.9.24-alpha.0 + "@helium/voter-stake-registry-sdk": ^0.9.24-alpha.0 "@metaplex-foundation/mpl-token-metadata": ^2.10.0 "@solana/spl-account-compression": ^0.1.7 "@solana/spl-token": ^0.3.8 diff --git a/yarn.lock b/yarn.lock index 9b46bdcf2..4c1604e9d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -580,6 +580,15 @@ __metadata: languageName: node linkType: hard +"@helium/account-fetch-cache@npm:^0.9.23": + version: 0.9.23 + resolution: "@helium/account-fetch-cache@npm:0.9.23" + dependencies: + "@solana/web3.js": ^1.91.1 + checksum: a3d2ca0cf3dc04a7ca963eba3e1e59ccf7851be64e4e3d87d9416f8dd166e3f06508b8bbf2792be04e1b6ebc14fe263f296d09def89e60a31451e2254a860f26 + languageName: node + linkType: hard + "@helium/account-postgres-sink-service@workspace:packages/account-postgres-sink-service": version: 0.0.0-use.local resolution: "@helium/account-postgres-sink-service@workspace:packages/account-postgres-sink-service" @@ -699,7 +708,7 @@ __metadata: languageName: node linkType: hard -"@helium/anchor-resolvers@npm:^0.9.2": +"@helium/anchor-resolvers@npm:^0.9.2, @helium/anchor-resolvers@npm:^0.9.23": version: 0.9.23 resolution: "@helium/anchor-resolvers@npm:0.9.23" dependencies: @@ -728,6 +737,20 @@ __metadata: languageName: unknown linkType: soft +"@helium/circuit-breaker-sdk@npm:^0.9.23": + version: 0.9.23 + resolution: "@helium/circuit-breaker-sdk@npm:0.9.23" + dependencies: + "@coral-xyz/anchor": ^0.28.0 + "@helium/anchor-resolvers": ^0.9.23 + "@helium/idls": ^0.9.23 + "@helium/spl-utils": ^0.9.23 + bn.js: ^5.2.0 + bs58: ^4.0.1 + checksum: 67a5554881d9f3222f99a2a19d9fe87459ef570e36b8a737093fc79e8b93d66d81938c985eb13580ce87681de3c254702767c9a2d3507d2dbdcc00e8947c85f1 + languageName: node + linkType: hard + "@helium/crons@workspace:packages/crons": version: 0.0.0-use.local resolution: "@helium/crons@workspace:packages/crons" @@ -1030,6 +1053,25 @@ __metadata: languageName: unknown linkType: soft +"@helium/helium-entity-manager-sdk@npm:^0.9.23": + version: 0.9.23 + resolution: "@helium/helium-entity-manager-sdk@npm:0.9.23" + dependencies: + "@coral-xyz/anchor": ^0.28.0 + "@helium/address": ^4.10.2 + "@helium/anchor-resolvers": ^0.9.23 + "@helium/helium-sub-daos-sdk": ^0.9.23 + "@helium/idls": ^0.9.23 + "@helium/no-emit-sdk": ^0.9.23 + "@helium/spl-utils": ^0.9.23 + bn.js: ^5.2.0 + bs58: ^4.0.1 + crypto-js: ^4.1.1 + js-sha256: ^0.9.0 + checksum: 02431a67e8836c24e4207c8999f057514ddb99e20073f317d742595aa8f3c1aa255504b2f045eb27fbc011ba6788d05b138fb42c988b6eaaea98b0de6fa1e8a6 + languageName: node + linkType: hard + "@helium/helium-react-hooks@^0.9.24-alpha.0, @helium/helium-react-hooks@workspace:packages/helium-react-hooks": version: 0.0.0-use.local resolution: "@helium/helium-react-hooks@workspace:packages/helium-react-hooks" @@ -1093,6 +1135,23 @@ __metadata: languageName: unknown linkType: soft +"@helium/helium-sub-daos-sdk@npm:^0.9.23": + version: 0.9.23 + resolution: "@helium/helium-sub-daos-sdk@npm:0.9.23" + dependencies: + "@coral-xyz/anchor": ^0.28.0 + "@helium/anchor-resolvers": ^0.9.23 + "@helium/circuit-breaker-sdk": ^0.9.23 + "@helium/nft-proxy-sdk": ^0.0.15 + "@helium/spl-utils": ^0.9.23 + "@helium/treasury-management-sdk": ^0.9.23 + "@helium/voter-stake-registry-sdk": ^0.9.23 + bn.js: ^5.2.0 + bs58: ^4.0.1 + checksum: b34231527a51a4323f8af5f0937f665038473955b7789dc0c47f4015d45693f5f7849ffad69c167e45883a55bfb66e2cb2a9a7d012937d77ba4abeca56488584 + languageName: node + linkType: hard + "@helium/helium-vote-service@workspace:packages/helium-vote-service": version: 0.0.0-use.local resolution: "@helium/helium-vote-service@workspace:packages/helium-vote-service" @@ -1167,6 +1226,19 @@ __metadata: languageName: unknown linkType: soft +"@helium/idls@npm:^0.9.23": + version: 0.9.23 + resolution: "@helium/idls@npm:0.9.23" + dependencies: + "@coral-xyz/anchor": ^0.28.0 + "@solana/web3.js": ^1.91.1 + bn.js: ^5.2.0 + borsh: ^0.7.0 + bs58: ^4.0.1 + checksum: 023ebdd5c47dc3c7a715f9a36253b01a413797445a2b298d62fdd5fe898690c1640a9a9199f796e049163686a17a220b4f0eed14ab9d15ba93a7ce01d95d2ea3 + languageName: node + linkType: hard + "@helium/iot-routing-manager-sdk@workspace:packages/iot-routing-manager-sdk": version: 0.0.0-use.local resolution: "@helium/iot-routing-manager-sdk@workspace:packages/iot-routing-manager-sdk" @@ -1183,7 +1255,6 @@ __metadata: languageName: unknown linkType: soft -"@helium/lazy-distributor-sdk@^0.9.23, @helium/lazy-distributor-sdk@workspace:packages/lazy-distributor-sdk": "@helium/lazy-distributor-sdk@^0.9.24-alpha.0, @helium/lazy-distributor-sdk@workspace:packages/lazy-distributor-sdk": version: 0.0.0-use.local resolution: "@helium/lazy-distributor-sdk@workspace:packages/lazy-distributor-sdk" @@ -1444,6 +1515,20 @@ __metadata: languageName: unknown linkType: soft +"@helium/no-emit-sdk@npm:^0.9.23": + version: 0.9.23 + resolution: "@helium/no-emit-sdk@npm:0.9.23" + dependencies: + "@coral-xyz/anchor": ^0.28.0 + "@helium/anchor-resolvers": ^0.5.0 + "@helium/idls": ^0.9.23 + "@helium/spl-utils": ^0.9.23 + bn.js: ^5.2.0 + bs58: ^4.0.1 + checksum: 1d040326450a1f530acfaa8bb8d6be7398fe69a1e98f6898aa47440763198e5170f308ac3c07682b2c826498a6ab4ab8233e84cf9e6dab6e5f30c5dc7be161e2 + languageName: node + linkType: hard + "@helium/organization-sdk@npm:^0.0.13": version: 0.0.13 resolution: "@helium/organization-sdk@npm:0.0.13" @@ -1574,6 +1659,26 @@ __metadata: languageName: unknown linkType: soft +"@helium/spl-utils@npm:^0.9.23": + version: 0.9.23 + resolution: "@helium/spl-utils@npm:0.9.23" + dependencies: + "@coral-xyz/anchor": ^0.28.0 + "@helium/account-fetch-cache": ^0.9.23 + "@helium/address": ^4.10.2 + "@helium/anchor-resolvers": ^0.9.23 + "@metaplex-foundation/mpl-token-metadata": ^2.10.0 + "@solana/spl-account-compression": ^0.1.7 + "@solana/spl-token": ^0.3.8 + "@solana/web3.js": ^1.91.1 + axios: ^1.5.0 + bn.js: ^5.2.0 + borsh: ^0.7.0 + bs58: ^4.0.1 + checksum: 189fbba0b327327bd6e06845b89b315b3f0d9d32731d7900b3dfa3c00cb55a241119b16ad905134c0d6444b21a3ad519bb3ec0da0eb7b078e1235e6085d0a43b + languageName: node + linkType: hard + "@helium/state-controller-sdk@npm:^0.0.15": version: 0.0.15 resolution: "@helium/state-controller-sdk@npm:0.0.15" @@ -1658,6 +1763,21 @@ __metadata: languageName: unknown linkType: soft +"@helium/treasury-management-sdk@npm:^0.9.23": + version: 0.9.23 + resolution: "@helium/treasury-management-sdk@npm:0.9.23" + dependencies: + "@coral-xyz/anchor": ^0.28.0 + "@helium/anchor-resolvers": ^0.9.23 + "@helium/circuit-breaker-sdk": ^0.9.23 + "@helium/idls": ^0.9.23 + "@helium/spl-utils": ^0.9.23 + bn.js: ^5.2.0 + bs58: ^4.0.1 + checksum: 530b5a300137ed7483306b1e597c1972342560dc60f710880ee143628d3c1ac3fe0c676bba6d4c09ab70d9d71539abd1588a4c10fce2f24616df852619f4286a + languageName: node + linkType: hard + "@helium/tuktuk-idls@npm:^0.0.1": version: 0.0.1 resolution: "@helium/tuktuk-idls@npm:0.0.1" @@ -1730,6 +1850,23 @@ __metadata: languageName: unknown linkType: soft +"@helium/voter-stake-registry-sdk@npm:^0.9.23": + version: 0.9.23 + resolution: "@helium/voter-stake-registry-sdk@npm:0.9.23" + dependencies: + "@coral-xyz/anchor": ^0.28.0 + "@helium/anchor-resolvers": ^0.9.23 + "@helium/idls": ^0.9.23 + "@helium/nft-proxy-sdk": ^0.0.15 + "@helium/spl-utils": ^0.9.23 + "@metaplex-foundation/mpl-token-metadata": ^2.10.0 + "@solana/spl-token": ^0.3.8 + bn.js: ^5.2.0 + bs58: ^4.0.1 + checksum: 5eeb4eaaa1d2b66701c1b31747697f0a6429fdba52d54375e2d16c1ce4e4a6fd645f742d2dfbc669b94d079a6aac4a1e192f1db7abbbc6bd213ef6f00518b2c0 + languageName: node + linkType: hard + "@helium/vsr-metadata-service@workspace:packages/vsr-metadata-service": version: 0.0.0-use.local resolution: "@helium/vsr-metadata-service@workspace:packages/vsr-metadata-service" @@ -3937,21 +4074,21 @@ __metadata: languageName: node linkType: hard -"@tanstack/query-core@npm:5.52.0": - version: 5.52.0 - resolution: "@tanstack/query-core@npm:5.52.0" - checksum: 1e142995fa9b0eec88009dd1083cd226eaec9125dc668b6485699639f45edb1386e4acd634e0eddc33d3a29e0c9636302824c42ac8c4106935d776fdc41d2638 +"@tanstack/query-core@npm:5.45.0": + version: 5.45.0 + resolution: "@tanstack/query-core@npm:5.45.0" + checksum: a3c13d90cfa12955d22fa754ebfddbea70081fc0128111083269bdd78ed0d25678f050007b753164a929a00fdef9ee5ebba945deb8e360120ae3cbae06e655a5 languageName: node linkType: hard "@tanstack/react-query@npm:^5.45.0": - version: 5.52.1 - resolution: "@tanstack/react-query@npm:5.52.1" + version: 5.45.0 + resolution: "@tanstack/react-query@npm:5.45.0" dependencies: - "@tanstack/query-core": 5.52.0 + "@tanstack/query-core": 5.45.0 peerDependencies: - react: ^18 || ^19 - checksum: f46bf1f85cc03b8329aee5d8a5a96b4e30dc88aff04d5256ebd0efefe1f507720b42a4be4a9bee340d3ade6cf0ae7b59187de90d87ea973c0f67e3764f76260c + react: ^18.0.0 + checksum: 3f2896e132e2fc4f5a2b77e015719cd8f74a3b5ce958d3d2ffc83cc9bd8a1a265ed54835a8751daf00b85af7bf15f8ad1a9fe123dafdfdfe3e81f17e585d0e95 languageName: node linkType: hard @@ -4231,9 +4368,9 @@ __metadata: linkType: hard "@types/lodash@npm:^4.17.6": - version: 4.17.7 - resolution: "@types/lodash@npm:4.17.7" - checksum: 09e58a119cd8a70acfb33f8623dc2fc54f74cdce3b3429b879fc2daac4807fe376190a04b9e024dd300f9a3ee1876d6623979cefe619f70654ca0fe0c47679a7 + version: 4.17.6 + resolution: "@types/lodash@npm:4.17.6" + checksum: f748c672f49c54ee631a0fab6f26d56ab99bd68a4fb91604b5d7525a72102dd1917209c12d7078c988a375edb5dc70ca600db05ac01785306fd64470048cd16c languageName: node linkType: hard @@ -5300,8 +5437,8 @@ __metadata: linkType: hard "aws-sdk@npm:^2.1650.0": - version: 2.1682.0 - resolution: "aws-sdk@npm:2.1682.0" + version: 2.1650.0 + resolution: "aws-sdk@npm:2.1650.0" dependencies: buffer: 4.9.2 events: 1.1.1 @@ -5313,7 +5450,7 @@ __metadata: util: ^0.12.4 uuid: 8.0.0 xml2js: 0.6.2 - checksum: ab3b60fdb635d89951787cbe81cc530247858c0ff095f983b3fd2e4357a85161931d4495ea363ce19bb71069e613b463c4f8047a8d60c69ba4f8eaea265d6bf9 + checksum: 60188893d4bdd81f56a3d4b5dd642e8f2ed80816519166ef68decb009fbfcb57a6b389436429f27ec9fa99450f43f21182c718e9660b8a44174485f9ab1102a6 languageName: node linkType: hard @@ -6331,7 +6468,7 @@ __metadata: version: 0.5.4 resolution: "content-disposition@npm:0.5.4" dependencies: - safe-buffer: 5.2.1 + safe-buffer: "npm:5.2.1" checksum: afb9d545e296a5171d7574fcad634b2fdf698875f4006a9dd04a3e1333880c5c0c98d47b560d01216fb6505a54a2ba6a843ee3a02ec86d7e911e8315255f56c3 languageName: node linkType: hard @@ -6678,14 +6815,14 @@ __metadata: linkType: hard "debug@npm:^4.1.1, debug@npm:^4.3.5": - version: 4.3.6 - resolution: "debug@npm:4.3.6" + version: 4.3.5 + resolution: "debug@npm:4.3.5" dependencies: ms: 2.1.2 peerDependenciesMeta: supports-color: optional: true - checksum: 1630b748dea3c581295e02137a9f5cbe2c1d85fea35c1e6597a65ca2b16a6fce68cec61b299d480787ef310ba927dc8c92d3061faba0ad06c6a724672f66be7f + checksum: 7c002b51e256257f936dda09eb37167df952758c57badf6bf44bdc40b89a4bcb8e5a0a2e4c7b53f97c69e2970dd5272d33a757378a12c8f8e64ea7bf99e8e86e languageName: node linkType: hard From ba343be88be02e0ab8503be2d91c1c754a47d4f9 Mon Sep 17 00:00:00 2001 From: bry Date: Thu, 13 Feb 2025 16:40:23 -0600 Subject: [PATCH 47/63] pr feedback 2 --- packages/helium-admin-cli/src/backfill-ouis.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/packages/helium-admin-cli/src/backfill-ouis.ts b/packages/helium-admin-cli/src/backfill-ouis.ts index fea2206e8..0425dd7ad 100644 --- a/packages/helium-admin-cli/src/backfill-ouis.ts +++ b/packages/helium-admin-cli/src/backfill-ouis.ts @@ -216,7 +216,6 @@ export async function run(args: any = process.argv) { .instruction(), ], { - computeUnitLimit: 500000, signers: [merkle], } ); @@ -303,9 +302,7 @@ export async function run(args: any = process.argv) { ).filter(truthy); console.log(`Initializing (${orgIxs.length}) organizations`); - await batchParallelInstructionsWithPriorityFee(provider, orgIxs, { - computeUnitLimit: 500000, - }); + await batchParallelInstructionsWithPriorityFee(provider, orgIxs); const orgApprovalIxs = ( await Promise.all( From 408604b22eac6ea9dda616f0527110bc2b0b2b19 Mon Sep 17 00:00:00 2001 From: bry Date: Wed, 19 Feb 2025 13:56:35 -0600 Subject: [PATCH 48/63] fix version --- .gitignore | 2 + packages/helium-admin-cli/package.json | 2 +- packages/helium-admin-cli/yarn.deploy.lock | 17 ++ packages/iot-routing-manager-sdk/package.json | 2 +- .../iot-routing-manager-sdk/yarn.deploy.lock | 217 ++++++++++-------- yarn.lock | 147 +----------- 6 files changed, 151 insertions(+), 236 deletions(-) diff --git a/.gitignore b/.gitignore index 303667a08..54ac80aef 100644 --- a/.gitignore +++ b/.gitignore @@ -27,3 +27,5 @@ accounts !.yarn/versions packages/helium-vote-service/helium-vote-proxies/ !packages/docsite/src/data +.yalc +yalc.lock diff --git a/packages/helium-admin-cli/package.json b/packages/helium-admin-cli/package.json index acaa0e12a..ab9d12b63 100644 --- a/packages/helium-admin-cli/package.json +++ b/packages/helium-admin-cli/package.json @@ -47,9 +47,9 @@ "@helium/fanout-sdk": "^0.9.24-alpha.0", "@helium/helium-entity-manager-sdk": "^0.9.24-alpha.0", "@helium/helium-sub-daos-sdk": "^0.9.24-alpha.0", + "@helium/iot-routing-manager-sdk": "^0.9.24-alpha.0", "@helium/lazy-distributor-sdk": "^0.9.24-alpha.0", "@helium/mobile-entity-manager-sdk": "^0.9.24-alpha.0", - "@helium/iot-routing-manager-sdk": "^0.9.24-alpha.0", "@helium/nft-proxy-sdk": "^0.0.15", "@helium/organization-sdk": "^0.0.13", "@helium/price-oracle-sdk": "^0.9.24-alpha.0", diff --git a/packages/helium-admin-cli/yarn.deploy.lock b/packages/helium-admin-cli/yarn.deploy.lock index 156795ddb..92fb9ee52 100644 --- a/packages/helium-admin-cli/yarn.deploy.lock +++ b/packages/helium-admin-cli/yarn.deploy.lock @@ -382,6 +382,7 @@ __metadata: "@helium/fanout-sdk": ^0.9.24-alpha.0 "@helium/helium-entity-manager-sdk": ^0.9.24-alpha.0 "@helium/helium-sub-daos-sdk": ^0.9.24-alpha.0 + "@helium/iot-routing-manager-sdk": ^0.9.24-alpha.0 "@helium/lazy-distributor-sdk": ^0.9.24-alpha.0 "@helium/mobile-entity-manager-sdk": ^0.9.24-alpha.0 "@helium/nft-proxy-sdk": ^0.0.15 @@ -468,6 +469,22 @@ __metadata: languageName: unknown linkType: soft +"@helium/iot-routing-manager-sdk@^0.9.24-alpha.0": + version: 0.0.0-use.local + resolution: "@helium/iot-routing-manager-sdk@workspace:packages/iot-routing-manager-sdk" + dependencies: + "@coral-xyz/anchor": ^0.28.0 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 + "@helium/helium-entity-manager-sdk": ^0.9.24-alpha.0 + bn.js: ^5.2.0 + bs58: ^4.0.1 + git-format-staged: ^2.1.3 + ts-loader: ^9.2.3 + ts-node: ^10.9.1 + typescript: ^5.2.2 + languageName: unknown + linkType: soft + "@helium/lazy-distributor-sdk@^0.9.24-alpha.0": version: 0.0.0-use.local resolution: "@helium/lazy-distributor-sdk@workspace:packages/lazy-distributor-sdk" diff --git a/packages/iot-routing-manager-sdk/package.json b/packages/iot-routing-manager-sdk/package.json index 193e17d66..63af4ae0d 100644 --- a/packages/iot-routing-manager-sdk/package.json +++ b/packages/iot-routing-manager-sdk/package.json @@ -5,7 +5,7 @@ "registry": "https://registry.npmjs.org/" }, "license": "Apache-2.0", - "version": "^0.9.24-alpha.0", + "version": "0.9.24-alpha.0", "description": "Interface to the iot-routing-manager smart contract", "repository": { "type": "git", diff --git a/packages/iot-routing-manager-sdk/yarn.deploy.lock b/packages/iot-routing-manager-sdk/yarn.deploy.lock index 1db19c49c..2982901d7 100644 --- a/packages/iot-routing-manager-sdk/yarn.deploy.lock +++ b/packages/iot-routing-manager-sdk/yarn.deploy.lock @@ -67,14 +67,16 @@ __metadata: languageName: node linkType: hard -"@helium/account-fetch-cache@npm:^0.9.23": - version: 0.9.23 - resolution: "@helium/account-fetch-cache@npm:0.9.23" +"@helium/account-fetch-cache@^0.9.24-alpha.0": + version: 0.0.0-use.local + resolution: "@helium/account-fetch-cache@workspace:packages/account-fetch-cache" dependencies: "@solana/web3.js": ^1.91.1 - checksum: a3d2ca0cf3dc04a7ca963eba3e1e59ccf7851be64e4e3d87d9416f8dd166e3f06508b8bbf2792be04e1b6ebc14fe263f296d09def89e60a31451e2254a860f26 - languageName: node - linkType: hard + git-format-staged: ^2.1.3 + ts-loader: ^9.2.3 + typescript: ^5.2.2 + languageName: unknown + linkType: soft "@helium/address@npm:^4.10.2": version: 4.10.2 @@ -87,6 +89,20 @@ __metadata: languageName: node linkType: hard +"@helium/anchor-resolvers@^0.9.24-alpha.0": + version: 0.0.0-use.local + resolution: "@helium/anchor-resolvers@workspace:packages/anchor-resolvers" + dependencies: + "@solana/spl-token": ^0.3.8 + "@solana/web3.js": ^1.91.1 + git-format-staged: ^2.1.3 + ts-loader: ^9.2.3 + typescript: ^5.2.2 + peerDependencies: + "@coral-xyz/anchor": ^0.28.0 + languageName: unknown + linkType: soft + "@helium/anchor-resolvers@npm:^0.2.17": version: 0.2.21 resolution: "@helium/anchor-resolvers@npm:0.2.21" @@ -111,88 +127,87 @@ __metadata: languageName: node linkType: hard -"@helium/anchor-resolvers@npm:^0.9.23": - version: 0.9.23 - resolution: "@helium/anchor-resolvers@npm:0.9.23" - dependencies: - "@solana/spl-token": ^0.3.8 - "@solana/web3.js": ^1.91.1 - peerDependencies: - "@coral-xyz/anchor": ^0.28.0 - checksum: d6050a29235b862000c6bc9519bc0567b7c10355576392b2e200c06a5795a7827e7ee92bf4e27cfb845accec3b9d888ef4e90e91851f08728bbe05fa313d0206 - languageName: node - linkType: hard - -"@helium/circuit-breaker-sdk@npm:^0.9.23": - version: 0.9.23 - resolution: "@helium/circuit-breaker-sdk@npm:0.9.23" +"@helium/circuit-breaker-sdk@^0.9.24-alpha.0": + version: 0.0.0-use.local + resolution: "@helium/circuit-breaker-sdk@workspace:packages/circuit-breaker-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/anchor-resolvers": ^0.9.23 - "@helium/idls": ^0.9.23 - "@helium/spl-utils": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 + "@helium/idls": ^0.9.24-alpha.0 + "@helium/spl-utils": ^0.9.24-alpha.0 bn.js: ^5.2.0 bs58: ^4.0.1 - checksum: 67a5554881d9f3222f99a2a19d9fe87459ef570e36b8a737093fc79e8b93d66d81938c985eb13580ce87681de3c254702767c9a2d3507d2dbdcc00e8947c85f1 - languageName: node - linkType: hard + git-format-staged: ^2.1.3 + ts-loader: ^9.2.3 + ts-node: ^10.9.1 + typescript: ^5.2.2 + languageName: unknown + linkType: soft -"@helium/helium-entity-manager-sdk@npm:^0.9.23": - version: 0.9.23 - resolution: "@helium/helium-entity-manager-sdk@npm:0.9.23" +"@helium/helium-entity-manager-sdk@^0.9.24-alpha.0": + version: 0.0.0-use.local + resolution: "@helium/helium-entity-manager-sdk@workspace:packages/helium-entity-manager-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 "@helium/address": ^4.10.2 - "@helium/anchor-resolvers": ^0.9.23 - "@helium/helium-sub-daos-sdk": ^0.9.23 - "@helium/idls": ^0.9.23 - "@helium/no-emit-sdk": ^0.9.23 - "@helium/spl-utils": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 + "@helium/helium-sub-daos-sdk": ^0.9.24-alpha.0 + "@helium/idls": ^0.9.24-alpha.0 + "@helium/no-emit-sdk": ^0.9.24-alpha.0 + "@helium/spl-utils": ^0.9.24-alpha.0 + "@types/crypto-js": ^4.1.1 bn.js: ^5.2.0 bs58: ^4.0.1 crypto-js: ^4.1.1 + git-format-staged: ^2.1.3 js-sha256: ^0.9.0 - checksum: 02431a67e8836c24e4207c8999f057514ddb99e20073f317d742595aa8f3c1aa255504b2f045eb27fbc011ba6788d05b138fb42c988b6eaaea98b0de6fa1e8a6 - languageName: node - linkType: hard + ts-loader: ^9.2.3 + ts-node: ^10.9.1 + typescript: ^5.2.2 + languageName: unknown + linkType: soft -"@helium/helium-sub-daos-sdk@npm:^0.9.23": - version: 0.9.23 - resolution: "@helium/helium-sub-daos-sdk@npm:0.9.23" +"@helium/helium-sub-daos-sdk@^0.9.24-alpha.0": + version: 0.0.0-use.local + resolution: "@helium/helium-sub-daos-sdk@workspace:packages/helium-sub-daos-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/anchor-resolvers": ^0.9.23 - "@helium/circuit-breaker-sdk": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 + "@helium/circuit-breaker-sdk": ^0.9.24-alpha.0 "@helium/nft-proxy-sdk": ^0.0.15 - "@helium/spl-utils": ^0.9.23 - "@helium/treasury-management-sdk": ^0.9.23 - "@helium/voter-stake-registry-sdk": ^0.9.23 + "@helium/spl-utils": ^0.9.24-alpha.0 + "@helium/treasury-management-sdk": ^0.9.24-alpha.0 + "@helium/voter-stake-registry-sdk": ^0.9.24-alpha.0 bn.js: ^5.2.0 bs58: ^4.0.1 - checksum: b34231527a51a4323f8af5f0937f665038473955b7789dc0c47f4015d45693f5f7849ffad69c167e45883a55bfb66e2cb2a9a7d012937d77ba4abeca56488584 - languageName: node - linkType: hard + git-format-staged: ^2.1.3 + ts-loader: ^9.2.3 + ts-node: ^10.9.1 + typescript: ^5.2.2 + languageName: unknown + linkType: soft -"@helium/idls@npm:^0.9.23": - version: 0.9.23 - resolution: "@helium/idls@npm:0.9.23" +"@helium/idls@^0.9.24-alpha.0": + version: 0.0.0-use.local + resolution: "@helium/idls@workspace:packages/idls" dependencies: "@coral-xyz/anchor": ^0.28.0 "@solana/web3.js": ^1.91.1 bn.js: ^5.2.0 borsh: ^0.7.0 bs58: ^4.0.1 - checksum: 023ebdd5c47dc3c7a715f9a36253b01a413797445a2b298d62fdd5fe898690c1640a9a9199f796e049163686a17a220b4f0eed14ab9d15ba93a7ce01d95d2ea3 - languageName: node - linkType: hard + ts-loader: ^9.2.3 + typescript: ^5.2.2 + languageName: unknown + linkType: soft "@helium/iot-routing-manager-sdk@workspace:.": version: 0.0.0-use.local resolution: "@helium/iot-routing-manager-sdk@workspace:." dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/anchor-resolvers": ^0.9.23 - "@helium/helium-entity-manager-sdk": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 + "@helium/helium-entity-manager-sdk": ^0.9.24-alpha.0 bn.js: ^5.2.0 bs58: ^4.0.1 git-format-staged: ^2.1.3 @@ -224,28 +239,31 @@ __metadata: languageName: node linkType: hard -"@helium/no-emit-sdk@npm:^0.9.23": - version: 0.9.23 - resolution: "@helium/no-emit-sdk@npm:0.9.23" +"@helium/no-emit-sdk@^0.9.24-alpha.0": + version: 0.0.0-use.local + resolution: "@helium/no-emit-sdk@workspace:packages/no-emit-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 "@helium/anchor-resolvers": ^0.5.0 - "@helium/idls": ^0.9.23 - "@helium/spl-utils": ^0.9.23 + "@helium/idls": ^0.9.24-alpha.0 + "@helium/spl-utils": ^0.9.24-alpha.0 bn.js: ^5.2.0 bs58: ^4.0.1 - checksum: 1d040326450a1f530acfaa8bb8d6be7398fe69a1e98f6898aa47440763198e5170f308ac3c07682b2c826498a6ab4ab8233e84cf9e6dab6e5f30c5dc7be161e2 - languageName: node - linkType: hard + git-format-staged: ^2.1.3 + ts-loader: ^9.2.3 + ts-node: ^10.9.1 + typescript: ^5.2.2 + languageName: unknown + linkType: soft -"@helium/spl-utils@npm:^0.9.23": - version: 0.9.23 - resolution: "@helium/spl-utils@npm:0.9.23" +"@helium/spl-utils@^0.9.24-alpha.0": + version: 0.0.0-use.local + resolution: "@helium/spl-utils@workspace:packages/spl-utils" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/account-fetch-cache": ^0.9.23 + "@helium/account-fetch-cache": ^0.9.24-alpha.0 "@helium/address": ^4.10.2 - "@helium/anchor-resolvers": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 "@metaplex-foundation/mpl-token-metadata": ^2.10.0 "@solana/spl-account-compression": ^0.1.7 "@solana/spl-token": ^0.3.8 @@ -254,41 +272,49 @@ __metadata: bn.js: ^5.2.0 borsh: ^0.7.0 bs58: ^4.0.1 - checksum: 189fbba0b327327bd6e06845b89b315b3f0d9d32731d7900b3dfa3c00cb55a241119b16ad905134c0d6444b21a3ad519bb3ec0da0eb7b078e1235e6085d0a43b - languageName: node - linkType: hard + git-format-staged: ^2.1.3 + ts-loader: ^9.2.3 + typescript: ^5.2.2 + languageName: unknown + linkType: soft -"@helium/treasury-management-sdk@npm:^0.9.23": - version: 0.9.23 - resolution: "@helium/treasury-management-sdk@npm:0.9.23" +"@helium/treasury-management-sdk@^0.9.24-alpha.0": + version: 0.0.0-use.local + resolution: "@helium/treasury-management-sdk@workspace:packages/treasury-management-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/anchor-resolvers": ^0.9.23 - "@helium/circuit-breaker-sdk": ^0.9.23 - "@helium/idls": ^0.9.23 - "@helium/spl-utils": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 + "@helium/circuit-breaker-sdk": ^0.9.24-alpha.0 + "@helium/idls": ^0.9.24-alpha.0 + "@helium/spl-utils": ^0.9.24-alpha.0 bn.js: ^5.2.0 bs58: ^4.0.1 - checksum: 530b5a300137ed7483306b1e597c1972342560dc60f710880ee143628d3c1ac3fe0c676bba6d4c09ab70d9d71539abd1588a4c10fce2f24616df852619f4286a - languageName: node - linkType: hard + git-format-staged: ^2.1.3 + ts-loader: ^9.2.3 + ts-node: ^10.9.1 + typescript: ^5.2.2 + languageName: unknown + linkType: soft -"@helium/voter-stake-registry-sdk@npm:^0.9.23": - version: 0.9.23 - resolution: "@helium/voter-stake-registry-sdk@npm:0.9.23" +"@helium/voter-stake-registry-sdk@^0.9.24-alpha.0": + version: 0.0.0-use.local + resolution: "@helium/voter-stake-registry-sdk@workspace:packages/voter-stake-registry-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/anchor-resolvers": ^0.9.23 - "@helium/idls": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 + "@helium/idls": ^0.9.24-alpha.0 "@helium/nft-proxy-sdk": ^0.0.15 - "@helium/spl-utils": ^0.9.23 + "@helium/spl-utils": ^0.9.24-alpha.0 "@metaplex-foundation/mpl-token-metadata": ^2.10.0 "@solana/spl-token": ^0.3.8 bn.js: ^5.2.0 bs58: ^4.0.1 - checksum: 5eeb4eaaa1d2b66701c1b31747697f0a6429fdba52d54375e2d16c1ce4e4a6fd645f742d2dfbc669b94d079a6aac4a1e192f1db7abbbc6bd213ef6f00518b2c0 - languageName: node - linkType: hard + git-format-staged: ^2.1.3 + ts-loader: ^9.2.3 + ts-node: ^10.9.1 + typescript: ^5.2.2 + languageName: unknown + linkType: soft "@isaacs/cliui@npm:^8.0.2": version: 8.0.2 @@ -577,6 +603,13 @@ __metadata: languageName: node linkType: hard +"@types/crypto-js@npm:^4.1.1": + version: 4.1.1 + resolution: "@types/crypto-js@npm:4.1.1" + checksum: ea3d6a67b69f88baeb6af96004395903d2367a41bd5cd86306da23a44dd96589749495da50974a9b01bb5163c500764c8a33706831eade036bddae016417e3ea + languageName: node + linkType: hard + "@types/node@npm:*": version: 20.5.7 resolution: "@types/node@npm:20.5.7" diff --git a/yarn.lock b/yarn.lock index 4c1604e9d..2b4124212 100644 --- a/yarn.lock +++ b/yarn.lock @@ -580,15 +580,6 @@ __metadata: languageName: node linkType: hard -"@helium/account-fetch-cache@npm:^0.9.23": - version: 0.9.23 - resolution: "@helium/account-fetch-cache@npm:0.9.23" - dependencies: - "@solana/web3.js": ^1.91.1 - checksum: a3d2ca0cf3dc04a7ca963eba3e1e59ccf7851be64e4e3d87d9416f8dd166e3f06508b8bbf2792be04e1b6ebc14fe263f296d09def89e60a31451e2254a860f26 - languageName: node - linkType: hard - "@helium/account-postgres-sink-service@workspace:packages/account-postgres-sink-service": version: 0.0.0-use.local resolution: "@helium/account-postgres-sink-service@workspace:packages/account-postgres-sink-service" @@ -708,7 +699,7 @@ __metadata: languageName: node linkType: hard -"@helium/anchor-resolvers@npm:^0.9.2, @helium/anchor-resolvers@npm:^0.9.23": +"@helium/anchor-resolvers@npm:^0.9.2": version: 0.9.23 resolution: "@helium/anchor-resolvers@npm:0.9.23" dependencies: @@ -737,20 +728,6 @@ __metadata: languageName: unknown linkType: soft -"@helium/circuit-breaker-sdk@npm:^0.9.23": - version: 0.9.23 - resolution: "@helium/circuit-breaker-sdk@npm:0.9.23" - dependencies: - "@coral-xyz/anchor": ^0.28.0 - "@helium/anchor-resolvers": ^0.9.23 - "@helium/idls": ^0.9.23 - "@helium/spl-utils": ^0.9.23 - bn.js: ^5.2.0 - bs58: ^4.0.1 - checksum: 67a5554881d9f3222f99a2a19d9fe87459ef570e36b8a737093fc79e8b93d66d81938c985eb13580ce87681de3c254702767c9a2d3507d2dbdcc00e8947c85f1 - languageName: node - linkType: hard - "@helium/crons@workspace:packages/crons": version: 0.0.0-use.local resolution: "@helium/crons@workspace:packages/crons" @@ -1001,6 +978,7 @@ __metadata: "@helium/fanout-sdk": ^0.9.24-alpha.0 "@helium/helium-entity-manager-sdk": ^0.9.24-alpha.0 "@helium/helium-sub-daos-sdk": ^0.9.24-alpha.0 + "@helium/iot-routing-manager-sdk": ^0.9.24-alpha.0 "@helium/lazy-distributor-sdk": ^0.9.24-alpha.0 "@helium/mobile-entity-manager-sdk": ^0.9.24-alpha.0 "@helium/nft-proxy-sdk": ^0.0.15 @@ -1053,25 +1031,6 @@ __metadata: languageName: unknown linkType: soft -"@helium/helium-entity-manager-sdk@npm:^0.9.23": - version: 0.9.23 - resolution: "@helium/helium-entity-manager-sdk@npm:0.9.23" - dependencies: - "@coral-xyz/anchor": ^0.28.0 - "@helium/address": ^4.10.2 - "@helium/anchor-resolvers": ^0.9.23 - "@helium/helium-sub-daos-sdk": ^0.9.23 - "@helium/idls": ^0.9.23 - "@helium/no-emit-sdk": ^0.9.23 - "@helium/spl-utils": ^0.9.23 - bn.js: ^5.2.0 - bs58: ^4.0.1 - crypto-js: ^4.1.1 - js-sha256: ^0.9.0 - checksum: 02431a67e8836c24e4207c8999f057514ddb99e20073f317d742595aa8f3c1aa255504b2f045eb27fbc011ba6788d05b138fb42c988b6eaaea98b0de6fa1e8a6 - languageName: node - linkType: hard - "@helium/helium-react-hooks@^0.9.24-alpha.0, @helium/helium-react-hooks@workspace:packages/helium-react-hooks": version: 0.0.0-use.local resolution: "@helium/helium-react-hooks@workspace:packages/helium-react-hooks" @@ -1135,23 +1094,6 @@ __metadata: languageName: unknown linkType: soft -"@helium/helium-sub-daos-sdk@npm:^0.9.23": - version: 0.9.23 - resolution: "@helium/helium-sub-daos-sdk@npm:0.9.23" - dependencies: - "@coral-xyz/anchor": ^0.28.0 - "@helium/anchor-resolvers": ^0.9.23 - "@helium/circuit-breaker-sdk": ^0.9.23 - "@helium/nft-proxy-sdk": ^0.0.15 - "@helium/spl-utils": ^0.9.23 - "@helium/treasury-management-sdk": ^0.9.23 - "@helium/voter-stake-registry-sdk": ^0.9.23 - bn.js: ^5.2.0 - bs58: ^4.0.1 - checksum: b34231527a51a4323f8af5f0937f665038473955b7789dc0c47f4015d45693f5f7849ffad69c167e45883a55bfb66e2cb2a9a7d012937d77ba4abeca56488584 - languageName: node - linkType: hard - "@helium/helium-vote-service@workspace:packages/helium-vote-service": version: 0.0.0-use.local resolution: "@helium/helium-vote-service@workspace:packages/helium-vote-service" @@ -1226,26 +1168,13 @@ __metadata: languageName: unknown linkType: soft -"@helium/idls@npm:^0.9.23": - version: 0.9.23 - resolution: "@helium/idls@npm:0.9.23" - dependencies: - "@coral-xyz/anchor": ^0.28.0 - "@solana/web3.js": ^1.91.1 - bn.js: ^5.2.0 - borsh: ^0.7.0 - bs58: ^4.0.1 - checksum: 023ebdd5c47dc3c7a715f9a36253b01a413797445a2b298d62fdd5fe898690c1640a9a9199f796e049163686a17a220b4f0eed14ab9d15ba93a7ce01d95d2ea3 - languageName: node - linkType: hard - -"@helium/iot-routing-manager-sdk@workspace:packages/iot-routing-manager-sdk": +"@helium/iot-routing-manager-sdk@^0.9.24-alpha.0, @helium/iot-routing-manager-sdk@workspace:packages/iot-routing-manager-sdk": version: 0.0.0-use.local resolution: "@helium/iot-routing-manager-sdk@workspace:packages/iot-routing-manager-sdk" dependencies: "@coral-xyz/anchor": ^0.28.0 - "@helium/anchor-resolvers": ^0.9.23 - "@helium/helium-entity-manager-sdk": ^0.9.23 + "@helium/anchor-resolvers": ^0.9.24-alpha.0 + "@helium/helium-entity-manager-sdk": ^0.9.24-alpha.0 bn.js: ^5.2.0 bs58: ^4.0.1 git-format-staged: ^2.1.3 @@ -1515,20 +1444,6 @@ __metadata: languageName: unknown linkType: soft -"@helium/no-emit-sdk@npm:^0.9.23": - version: 0.9.23 - resolution: "@helium/no-emit-sdk@npm:0.9.23" - dependencies: - "@coral-xyz/anchor": ^0.28.0 - "@helium/anchor-resolvers": ^0.5.0 - "@helium/idls": ^0.9.23 - "@helium/spl-utils": ^0.9.23 - bn.js: ^5.2.0 - bs58: ^4.0.1 - checksum: 1d040326450a1f530acfaa8bb8d6be7398fe69a1e98f6898aa47440763198e5170f308ac3c07682b2c826498a6ab4ab8233e84cf9e6dab6e5f30c5dc7be161e2 - languageName: node - linkType: hard - "@helium/organization-sdk@npm:^0.0.13": version: 0.0.13 resolution: "@helium/organization-sdk@npm:0.0.13" @@ -1659,26 +1574,6 @@ __metadata: languageName: unknown linkType: soft -"@helium/spl-utils@npm:^0.9.23": - version: 0.9.23 - resolution: "@helium/spl-utils@npm:0.9.23" - dependencies: - "@coral-xyz/anchor": ^0.28.0 - "@helium/account-fetch-cache": ^0.9.23 - "@helium/address": ^4.10.2 - "@helium/anchor-resolvers": ^0.9.23 - "@metaplex-foundation/mpl-token-metadata": ^2.10.0 - "@solana/spl-account-compression": ^0.1.7 - "@solana/spl-token": ^0.3.8 - "@solana/web3.js": ^1.91.1 - axios: ^1.5.0 - bn.js: ^5.2.0 - borsh: ^0.7.0 - bs58: ^4.0.1 - checksum: 189fbba0b327327bd6e06845b89b315b3f0d9d32731d7900b3dfa3c00cb55a241119b16ad905134c0d6444b21a3ad519bb3ec0da0eb7b078e1235e6085d0a43b - languageName: node - linkType: hard - "@helium/state-controller-sdk@npm:^0.0.15": version: 0.0.15 resolution: "@helium/state-controller-sdk@npm:0.0.15" @@ -1763,21 +1658,6 @@ __metadata: languageName: unknown linkType: soft -"@helium/treasury-management-sdk@npm:^0.9.23": - version: 0.9.23 - resolution: "@helium/treasury-management-sdk@npm:0.9.23" - dependencies: - "@coral-xyz/anchor": ^0.28.0 - "@helium/anchor-resolvers": ^0.9.23 - "@helium/circuit-breaker-sdk": ^0.9.23 - "@helium/idls": ^0.9.23 - "@helium/spl-utils": ^0.9.23 - bn.js: ^5.2.0 - bs58: ^4.0.1 - checksum: 530b5a300137ed7483306b1e597c1972342560dc60f710880ee143628d3c1ac3fe0c676bba6d4c09ab70d9d71539abd1588a4c10fce2f24616df852619f4286a - languageName: node - linkType: hard - "@helium/tuktuk-idls@npm:^0.0.1": version: 0.0.1 resolution: "@helium/tuktuk-idls@npm:0.0.1" @@ -1850,23 +1730,6 @@ __metadata: languageName: unknown linkType: soft -"@helium/voter-stake-registry-sdk@npm:^0.9.23": - version: 0.9.23 - resolution: "@helium/voter-stake-registry-sdk@npm:0.9.23" - dependencies: - "@coral-xyz/anchor": ^0.28.0 - "@helium/anchor-resolvers": ^0.9.23 - "@helium/idls": ^0.9.23 - "@helium/nft-proxy-sdk": ^0.0.15 - "@helium/spl-utils": ^0.9.23 - "@metaplex-foundation/mpl-token-metadata": ^2.10.0 - "@solana/spl-token": ^0.3.8 - bn.js: ^5.2.0 - bs58: ^4.0.1 - checksum: 5eeb4eaaa1d2b66701c1b31747697f0a6429fdba52d54375e2d16c1ce4e4a6fd645f742d2dfbc669b94d079a6aac4a1e192f1db7abbbc6bd213ef6f00518b2c0 - languageName: node - linkType: hard - "@helium/vsr-metadata-service@workspace:packages/vsr-metadata-service": version: 0.0.0-use.local resolution: "@helium/vsr-metadata-service@workspace:packages/vsr-metadata-service" From e3d8d2485106ca726b9bf43f2acb9a20486814f1 Mon Sep 17 00:00:00 2001 From: bry Date: Mon, 24 Feb 2025 14:00:16 -0600 Subject: [PATCH 49/63] Convert to DC --- Cargo.lock | 2 +- .../helium-admin-cli/src/backfill-ouis.ts | 10 +- programs/iot-routing-manager/Cargo.toml | 2 +- .../initialize_devaddr_constraint_v0.rs | 111 +++++++----------- .../initialize_organization_v0.rs | 104 ++++++++-------- .../initialize_routing_manager_v0.rs | 23 ++-- .../temp_backfill_devaddr_constraint.rs | 4 +- .../temp_backfill_organization.rs | 4 +- .../instructions/update_routing_manager_v0.rs | 4 +- programs/iot-routing-manager/src/lib.rs | 2 + programs/iot-routing-manager/src/state.rs | 7 +- 11 files changed, 121 insertions(+), 152 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6dc902346..43cfa8ab3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2255,11 +2255,11 @@ dependencies = [ "bs58 0.3.1", "bubblegum-cpi", "bytemuck", + "data-credits", "default-env", "helium-entity-manager", "helium-sub-daos", "mpl-token-metadata", - "pyth-solana-receiver-sdk", "shared-utils", "solana-program", "solana-security-txt", diff --git a/packages/helium-admin-cli/src/backfill-ouis.ts b/packages/helium-admin-cli/src/backfill-ouis.ts index 0425dd7ad..cc7380611 100644 --- a/packages/helium-admin-cli/src/backfill-ouis.ts +++ b/packages/helium-admin-cli/src/backfill-ouis.ts @@ -18,8 +18,8 @@ import { import { batchParallelInstructionsWithPriorityFee, HNT_MINT, + DC_MINT, IOT_MINT, - IOT_PRICE_FEED, sendInstructionsWithPriorityFee, truthy, } from "@helium/spl-utils"; @@ -229,15 +229,15 @@ export async function run(args: any = process.argv) { await irm.methods .initializeRoutingManagerV0({ metadataUrl: argv.metadataUrl, - devaddrPriceUsd: new anchor.BN(100_000000), - ouiPriceUsd: new anchor.BN(100_000000), + devaddrFeeUsd: new anchor.BN(100_000000), + ouiFeeUsd: new anchor.BN(100_000000), }) .accounts({ updateAuthority: wallet.publicKey, netIdAuthority: wallet.publicKey, - dntMint: IOT_MINT, + dcMint: DC_MINT, subDao, - iotPriceOracle: IOT_PRICE_FEED, + dao, }) .instruction(), ], diff --git a/programs/iot-routing-manager/Cargo.toml b/programs/iot-routing-manager/Cargo.toml index cee0506d6..c647d7ef2 100644 --- a/programs/iot-routing-manager/Cargo.toml +++ b/programs/iot-routing-manager/Cargo.toml @@ -34,5 +34,5 @@ helium-entity-manager = { workspace = true } helium-sub-daos = { workspace = true } solana-security-txt = { workspace = true } default-env = { workspace = true } -pyth-solana-receiver-sdk = "0.3.0" solana-program = "1.16.13" +data-credits = { workspace = true, features = ["cpi"] } diff --git a/programs/iot-routing-manager/src/instructions/initialize_devaddr_constraint_v0.rs b/programs/iot-routing-manager/src/instructions/initialize_devaddr_constraint_v0.rs index 8848ccd71..f96aafea4 100644 --- a/programs/iot-routing-manager/src/instructions/initialize_devaddr_constraint_v0.rs +++ b/programs/iot-routing-manager/src/instructions/initialize_devaddr_constraint_v0.rs @@ -1,12 +1,20 @@ use crate::error::ErrorCode; use anchor_lang::prelude::*; -use anchor_spl::token::{burn, Burn, Mint, Token, TokenAccount}; -use pyth_solana_receiver_sdk::price_update::{PriceUpdateV2, VerificationLevel}; +use anchor_spl::{ + associated_token::AssociatedToken, + token::{Mint, Token, TokenAccount}, +}; +use data_credits::{ + cpi::{ + accounts::{BurnCommonV0, BurnWithoutTrackingV0}, + burn_without_tracking_v0, + }, + program::DataCredits, + BurnWithoutTrackingArgsV0, DataCreditsV0, +}; use crate::{DevaddrConstraintV0, IotRoutingManagerV0, NetIdV0, OrganizationV0}; -pub const TESTING: bool = std::option_env!("TESTING").is_some(); - #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)] pub struct InitializeDevaddrConstraintArgsV0 { pub num_blocks: u32, @@ -21,8 +29,7 @@ pub struct InitializeDevaddrConstraintV0<'info> { #[account(mut)] pub net_id: Box>, #[account( - has_one = iot_mint, - has_one = iot_price_oracle, + has_one = dc_mint, )] pub routing_manager: Box>, #[account( @@ -32,18 +39,24 @@ pub struct InitializeDevaddrConstraintV0<'info> { constraint = organization.approved @ ErrorCode::OrganizationNotApproved, )] pub organization: Box>, + #[account( + seeds=[ + "dc".as_bytes(), + dc_mint.key().as_ref(), + ], + seeds::program = data_credits_program.key(), + bump = data_credits.data_credits_bump, + has_one = dc_mint + )] + pub data_credits: Box>, #[account(mut)] - pub iot_mint: Box>, + pub dc_mint: Box>, #[account( mut, - associated_token::mint = iot_mint, + associated_token::mint = dc_mint, associated_token::authority = payer, )] - pub payer_iot_account: Box>, - #[account( - constraint = iot_price_oracle.verification_level == VerificationLevel::Full @ ErrorCode::PythPriceFeedStale, - )] - pub iot_price_oracle: Box>, + pub payer_dc_account: Box>, #[account( init, payer = payer, @@ -54,6 +67,8 @@ pub struct InitializeDevaddrConstraintV0<'info> { pub devaddr_constraint: Box>, pub token_program: Program<'info, Token>, pub system_program: Program<'info, System>, + pub associated_token_program: Program<'info, AssociatedToken>, + pub data_credits_program: Program<'info, DataCredits>, } pub fn handler( @@ -69,61 +84,25 @@ pub fn handler( ctx.accounts.net_id.current_addr_offset = end_addr + 1; } - let message = ctx.accounts.iot_price_oracle.price_message; - let current_time = Clock::get()?.unix_timestamp; - require_gte!( - message - .publish_time - .saturating_add(if TESTING { 6000000 } else { 10 * 60 }.into()), - current_time, - ErrorCode::PythPriceNotFound - ); - let iot_price = message.ema_price; - require_gt!(iot_price, 0); + let dc_fee: u64 = ctx.accounts.routing_manager.devaddr_fee_usd; - // Remove the confidence from the price to use the most conservative price - // https://docs.pyth.network/price-feeds/solana-price-feeds/best-practices#confidence-intervals - let iot_price_with_conf = iot_price - .checked_sub(i64::try_from(message.ema_conf.checked_mul(2).unwrap()).unwrap()) - .unwrap(); - // Exponent is a negative number, likely -8 - // Since the price is multiplied by an extra 10^8, and we're dividing by that price, need to also multiply - // by the exponent - let exponent_dec = 10_u64 - .checked_pow(u32::try_from(-message.exponent).unwrap()) - .ok_or_else(|| error!(ErrorCode::ArithmeticError))?; - - require_gt!(iot_price_with_conf, 0); - let iot_fee = ctx - .accounts - .routing_manager - .devaddr_price_usd - .checked_mul(exponent_dec) - .unwrap() - .checked_div(iot_price_with_conf.try_into().unwrap()) - .unwrap() - .checked_mul( - end_addr - .checked_sub(start_addr) - .unwrap() - .checked_div(8) - .unwrap(), - ) - .unwrap(); - - if iot_fee > 0 { - burn( - CpiContext::new( - ctx.accounts.token_program.to_account_info(), - Burn { - mint: ctx.accounts.iot_mint.to_account_info(), - from: ctx.accounts.payer_iot_account.to_account_info(), - authority: ctx.accounts.payer.to_account_info(), + burn_without_tracking_v0( + CpiContext::new( + ctx.accounts.data_credits_program.to_account_info(), + BurnWithoutTrackingV0 { + burn_accounts: BurnCommonV0 { + data_credits: ctx.accounts.data_credits.to_account_info(), + owner: ctx.accounts.payer.to_account_info(), + dc_mint: ctx.accounts.dc_mint.to_account_info(), + burner: ctx.accounts.payer_dc_account.to_account_info(), + associated_token_program: ctx.accounts.associated_token_program.to_account_info(), + token_program: ctx.accounts.token_program.to_account_info(), + system_program: ctx.accounts.system_program.to_account_info(), }, - ), - iot_fee, - )?; - } + }, + ), + BurnWithoutTrackingArgsV0 { amount: dc_fee }, + )?; ctx .accounts diff --git a/programs/iot-routing-manager/src/instructions/initialize_organization_v0.rs b/programs/iot-routing-manager/src/instructions/initialize_organization_v0.rs index cfec7871e..60cc143c9 100644 --- a/programs/iot-routing-manager/src/instructions/initialize_organization_v0.rs +++ b/programs/iot-routing-manager/src/instructions/initialize_organization_v0.rs @@ -1,18 +1,27 @@ -use crate::error::ErrorCode; -use crate::{net_id_seeds, routing_manager_seeds, state::*, TESTING}; +use crate::{net_id_seeds, routing_manager_seeds, state::*}; use account_compression_cpi::{program::SplAccountCompression, Noop}; use anchor_lang::prelude::*; use anchor_lang::solana_program::hash::hash; -use anchor_spl::token::{burn, Burn, Mint, Token, TokenAccount}; +use anchor_spl::{ + associated_token::AssociatedToken, + token::{Mint, Token, TokenAccount}, +}; use bubblegum_cpi::program::Bubblegum; use bubblegum_cpi::TreeConfig; +use data_credits::{ + cpi::{ + accounts::{BurnCommonV0, BurnWithoutTrackingV0}, + burn_without_tracking_v0, + }, + program::DataCredits, + BurnWithoutTrackingArgsV0, DataCreditsV0, +}; use helium_entity_manager::program::HeliumEntityManager; use helium_entity_manager::{ cpi::accounts::IssueProgramEntityV0, cpi::issue_program_entity_v0, ProgramApprovalV0, }; use helium_entity_manager::{IssueProgramEntityArgsV0, KeySerialization, SharedMerkleV0}; use helium_sub_daos::{DaoV0, SubDaoV0}; -use pyth_solana_receiver_sdk::price_update::{PriceUpdateV2, VerificationLevel}; #[cfg(feature = "devnet")] pub const ENTITY_METADATA_URL: &str = "https://entities.nft.test-helium.com"; @@ -34,26 +43,31 @@ pub struct InitializeOrganizationV0<'info> { mut, has_one = collection, has_one = sub_dao, - has_one = iot_mint, - has_one = iot_price_oracle, + has_one = dc_mint, )] pub routing_manager: Box>, #[account( has_one = routing_manager, )] pub net_id: Box>, + #[account( + seeds=[ + "dc".as_bytes(), + dc_mint.key().as_ref(), + ], + seeds::program = data_credits_program.key(), + bump = data_credits.data_credits_bump, + has_one = dc_mint + )] + pub data_credits: Box>, #[account(mut)] - pub iot_mint: Box>, + pub dc_mint: Box>, #[account( mut, - associated_token::mint = iot_mint, + associated_token::mint = dc_mint, associated_token::authority = payer, )] - pub payer_iot_account: Box>, - #[account( - constraint = iot_price_oracle.verification_level == VerificationLevel::Full @ ErrorCode::PythPriceFeedStale, - )] - pub iot_price_oracle: Box>, + pub payer_dc_account: Box>, /// CHECK: The new authority for this OUI pub authority: AccountInfo<'info>, #[account( @@ -141,6 +155,8 @@ pub struct InitializeOrganizationV0<'info> { pub system_program: Program<'info, System>, pub helium_entity_manager_program: Program<'info, HeliumEntityManager>, pub token_program: Program<'info, Token>, + pub associated_token_program: Program<'info, AssociatedToken>, + pub data_credits_program: Program<'info, DataCredits>, } pub fn handler(ctx: Context) -> Result<()> { @@ -204,53 +220,25 @@ pub fn handler(ctx: Context) -> Result<()> { }, )?; - let message = ctx.accounts.iot_price_oracle.price_message; - let current_time = Clock::get()?.unix_timestamp; - require_gte!( - message - .publish_time - .saturating_add(if TESTING { 6000000 } else { 10 * 60 }.into()), - current_time, - ErrorCode::PythPriceNotFound - ); - let iot_price = message.ema_price; - require_gt!(iot_price, 0); - - // Remove the confidence from the price to use the most conservative price - // https://docs.pyth.network/price-feeds/solana-price-feeds/best-practices#confidence-intervals - let iot_price_with_conf = iot_price - .checked_sub(i64::try_from(message.ema_conf.checked_mul(2).unwrap()).unwrap()) - .unwrap(); - // Exponent is a negative number, likely -8 - // Since the price is multiplied by an extra 10^8, and we're dividing by that price, need to also multiply - // by the exponent - let exponent_dec = 10_u64 - .checked_pow(u32::try_from(-message.exponent).unwrap()) - .ok_or_else(|| error!(ErrorCode::ArithmeticError))?; - - require_gt!(iot_price_with_conf, 0); - let iot_fee = ctx - .accounts - .routing_manager - .oui_price_usd - .checked_mul(exponent_dec) - .unwrap() - .checked_div(iot_price_with_conf.try_into().unwrap()) - .unwrap(); + let dc_fee: u64 = ctx.accounts.routing_manager.oui_fee_usd; - if iot_fee > 0 { - burn( - CpiContext::new( - ctx.accounts.token_program.to_account_info(), - Burn { - mint: ctx.accounts.iot_mint.to_account_info(), - from: ctx.accounts.payer_iot_account.to_account_info(), - authority: ctx.accounts.payer.to_account_info(), + burn_without_tracking_v0( + CpiContext::new( + ctx.accounts.data_credits_program.to_account_info(), + BurnWithoutTrackingV0 { + burn_accounts: BurnCommonV0 { + data_credits: ctx.accounts.data_credits.to_account_info(), + owner: ctx.accounts.payer.to_account_info(), + dc_mint: ctx.accounts.dc_mint.to_account_info(), + burner: ctx.accounts.payer_dc_account.to_account_info(), + associated_token_program: ctx.accounts.associated_token_program.to_account_info(), + token_program: ctx.accounts.token_program.to_account_info(), + system_program: ctx.accounts.system_program.to_account_info(), }, - ), - iot_fee, - )?; - } + }, + ), + BurnWithoutTrackingArgsV0 { amount: dc_fee }, + )?; ctx.accounts.routing_manager.next_oui_id += 1; Ok(()) diff --git a/programs/iot-routing-manager/src/instructions/initialize_routing_manager_v0.rs b/programs/iot-routing-manager/src/instructions/initialize_routing_manager_v0.rs index dc9f2658d..9fda26eed 100644 --- a/programs/iot-routing-manager/src/instructions/initialize_routing_manager_v0.rs +++ b/programs/iot-routing-manager/src/instructions/initialize_routing_manager_v0.rs @@ -5,9 +5,8 @@ use anchor_spl::{ associated_token::AssociatedToken, token::{self, Mint, MintTo, Token, TokenAccount}, }; -use helium_sub_daos::SubDaoV0; +use helium_sub_daos::{DaoV0, SubDaoV0}; use mpl_token_metadata::types::{CollectionDetails, DataV2}; -use pyth_solana_receiver_sdk::price_update::PriceUpdateV2; use shared_utils::create_metadata_accounts_v3; use shared_utils::token_metadata::{ create_master_edition_v3, CreateMasterEditionV3, CreateMetadataAccountsV3, @@ -17,8 +16,8 @@ use shared_utils::token_metadata::{ #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)] pub struct InitializeRoutingManagerArgsV0 { pub metadata_url: String, - pub devaddr_price_usd: u64, - pub oui_price_usd: u64, + pub devaddr_fee_usd: u64, + pub oui_fee_usd: u64, } #[derive(Accounts)] @@ -39,13 +38,16 @@ pub struct InitializeRoutingManagerV0<'info> { bump, )] pub routing_manager: Box>, + #[account( + has_one = dc_mint + )] + pub dao: Box>, #[account( has_one = authority, - has_one = dnt_mint, + has_one = dao )] pub sub_dao: Box>, - pub dnt_mint: Box>, - pub iot_price_oracle: Box>, + pub dc_mint: Box>, #[account( init, payer = payer, @@ -114,11 +116,10 @@ pub fn handler( collection: ctx.accounts.collection.key(), // Initialized via set_carrier_tree bump_seed: ctx.bumps["routing_manager"], - iot_mint: ctx.accounts.dnt_mint.key(), - iot_price_oracle: ctx.accounts.iot_price_oracle.key(), + dc_mint: ctx.accounts.dc_mint.key(), sub_dao: ctx.accounts.sub_dao.key(), - devaddr_price_usd: args.devaddr_price_usd, - oui_price_usd: args.oui_price_usd, + devaddr_fee_usd: args.devaddr_fee_usd, + oui_fee_usd: args.oui_fee_usd, next_oui_id: 1, }); diff --git a/programs/iot-routing-manager/src/instructions/temp_backfill_devaddr_constraint.rs b/programs/iot-routing-manager/src/instructions/temp_backfill_devaddr_constraint.rs index 21f1516ad..f48acec1d 100644 --- a/programs/iot-routing-manager/src/instructions/temp_backfill_devaddr_constraint.rs +++ b/programs/iot-routing-manager/src/instructions/temp_backfill_devaddr_constraint.rs @@ -22,7 +22,7 @@ pub struct TempBackfillDevaddrConstraint<'info> { #[account(mut)] pub net_id: Box>, #[account( - has_one = iot_mint, + has_one = dc_mint, )] pub routing_manager: Box>, #[account( @@ -32,7 +32,7 @@ pub struct TempBackfillDevaddrConstraint<'info> { )] pub organization: Box>, #[account(mut)] - pub iot_mint: Box>, + pub dc_mint: Box>, #[account( init, payer = payer, diff --git a/programs/iot-routing-manager/src/instructions/temp_backfill_organization.rs b/programs/iot-routing-manager/src/instructions/temp_backfill_organization.rs index 86f25bcd0..3440c0390 100644 --- a/programs/iot-routing-manager/src/instructions/temp_backfill_organization.rs +++ b/programs/iot-routing-manager/src/instructions/temp_backfill_organization.rs @@ -44,7 +44,7 @@ pub struct TempBackfillOrganization<'info> { mut, has_one = collection, has_one = sub_dao, - has_one = iot_mint, + has_one = dc_mint, )] pub routing_manager: Box>, #[account( @@ -52,7 +52,7 @@ pub struct TempBackfillOrganization<'info> { )] pub net_id: Box>, #[account(mut)] - pub iot_mint: Box>, + pub dc_mint: Box>, /// CHECK: The new authority for this OUI pub authority: AccountInfo<'info>, #[account( diff --git a/programs/iot-routing-manager/src/instructions/update_routing_manager_v0.rs b/programs/iot-routing-manager/src/instructions/update_routing_manager_v0.rs index 2823443ae..93dbf2ca4 100644 --- a/programs/iot-routing-manager/src/instructions/update_routing_manager_v0.rs +++ b/programs/iot-routing-manager/src/instructions/update_routing_manager_v0.rs @@ -35,11 +35,11 @@ pub fn handler( } if args.devaddr_price_usd.is_some() { - routing_manager.devaddr_price_usd = args.devaddr_price_usd.unwrap(); + routing_manager.devaddr_fee_usd = args.devaddr_price_usd.unwrap(); } if args.oui_price_usd.is_some() { - routing_manager.oui_price_usd = args.oui_price_usd.unwrap(); + routing_manager.oui_fee_usd = args.oui_price_usd.unwrap(); } Ok(()) diff --git a/programs/iot-routing-manager/src/lib.rs b/programs/iot-routing-manager/src/lib.rs index f3f057f8c..8b4bbd137 100644 --- a/programs/iot-routing-manager/src/lib.rs +++ b/programs/iot-routing-manager/src/lib.rs @@ -11,6 +11,8 @@ pub mod state; pub use instructions::*; pub use state::*; +pub const TESTING: bool = std::option_env!("TESTING").is_some(); + #[cfg(not(feature = "no-entrypoint"))] security_txt! { name: "IOT Routing Manager", diff --git a/programs/iot-routing-manager/src/state.rs b/programs/iot-routing-manager/src/state.rs index 591e5faa0..97ea99d6e 100644 --- a/programs/iot-routing-manager/src/state.rs +++ b/programs/iot-routing-manager/src/state.rs @@ -4,14 +4,13 @@ use anchor_lang::prelude::*; #[derive(Default, InitSpace)] pub struct IotRoutingManagerV0 { pub sub_dao: Pubkey, - pub iot_mint: Pubkey, - pub iot_price_oracle: Pubkey, + pub dc_mint: Pubkey, pub update_authority: Pubkey, pub net_id_authority: Pubkey, pub collection: Pubkey, // The metaplex collection to be issued for Rewardable Entities // with 6 decimals of precision - pub devaddr_price_usd: u64, - pub oui_price_usd: u64, + pub devaddr_fee_usd: u64, + pub oui_fee_usd: u64, pub next_oui_id: u64, pub bump_seed: u8, } From 746cc5cc961f6fbf9c737743eef45468c89a1d93 Mon Sep 17 00:00:00 2001 From: bry Date: Mon, 24 Feb 2025 14:08:26 -0600 Subject: [PATCH 50/63] Proper dc_fee logic --- .../src/instructions/initialize_devaddr_constraint_v0.rs | 2 +- .../src/instructions/initialize_organization_v0.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/programs/iot-routing-manager/src/instructions/initialize_devaddr_constraint_v0.rs b/programs/iot-routing-manager/src/instructions/initialize_devaddr_constraint_v0.rs index f96aafea4..42338fd6e 100644 --- a/programs/iot-routing-manager/src/instructions/initialize_devaddr_constraint_v0.rs +++ b/programs/iot-routing-manager/src/instructions/initialize_devaddr_constraint_v0.rs @@ -84,7 +84,7 @@ pub fn handler( ctx.accounts.net_id.current_addr_offset = end_addr + 1; } - let dc_fee: u64 = ctx.accounts.routing_manager.devaddr_fee_usd; + let dc_fee: u64 = ctx.accounts.routing_manager.devaddr_fee_usd * 100_000_u64; burn_without_tracking_v0( CpiContext::new( diff --git a/programs/iot-routing-manager/src/instructions/initialize_organization_v0.rs b/programs/iot-routing-manager/src/instructions/initialize_organization_v0.rs index 60cc143c9..bd91839fa 100644 --- a/programs/iot-routing-manager/src/instructions/initialize_organization_v0.rs +++ b/programs/iot-routing-manager/src/instructions/initialize_organization_v0.rs @@ -220,7 +220,7 @@ pub fn handler(ctx: Context) -> Result<()> { }, )?; - let dc_fee: u64 = ctx.accounts.routing_manager.oui_fee_usd; + let dc_fee: u64 = ctx.accounts.routing_manager.oui_fee_usd * 100_000_u64; burn_without_tracking_v0( CpiContext::new( From 060e542c10fee925d49a8978d9019b409bfa0674 Mon Sep 17 00:00:00 2001 From: bry Date: Mon, 24 Feb 2025 14:26:07 -0600 Subject: [PATCH 51/63] fix test --- .../helium-admin-cli/src/backfill-ouis.ts | 4 +-- .../instructions/update_routing_manager_v0.rs | 12 ++++----- tests/iot-routing-manager.ts | 26 +++++++++---------- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/packages/helium-admin-cli/src/backfill-ouis.ts b/packages/helium-admin-cli/src/backfill-ouis.ts index cc7380611..ea76e80ad 100644 --- a/packages/helium-admin-cli/src/backfill-ouis.ts +++ b/packages/helium-admin-cli/src/backfill-ouis.ts @@ -413,8 +413,8 @@ export async function run(args: any = process.argv) { .updateRoutingManagerV0({ updateAuthority: null, netIdAuthority: ouiWallet, - devaddrPriceUsd: null, - ouiPriceUsd: null, + devaddrFeeUsd: null, + ouiFeeUsd: null, }) .accounts({ updateAuthority: wallet.publicKey, diff --git a/programs/iot-routing-manager/src/instructions/update_routing_manager_v0.rs b/programs/iot-routing-manager/src/instructions/update_routing_manager_v0.rs index 93dbf2ca4..7ea936d2f 100644 --- a/programs/iot-routing-manager/src/instructions/update_routing_manager_v0.rs +++ b/programs/iot-routing-manager/src/instructions/update_routing_manager_v0.rs @@ -6,8 +6,8 @@ use crate::IotRoutingManagerV0; pub struct UpdateRoutingManagerArgsV0 { update_authority: Option, net_id_authority: Option, - devaddr_price_usd: Option, - oui_price_usd: Option, + devaddr_fee_usd: Option, + oui_fee_usd: Option, } #[derive(Accounts)] @@ -34,12 +34,12 @@ pub fn handler( routing_manager.net_id_authority = args.net_id_authority.unwrap(); } - if args.devaddr_price_usd.is_some() { - routing_manager.devaddr_fee_usd = args.devaddr_price_usd.unwrap(); + if args.devaddr_fee_usd.is_some() { + routing_manager.devaddr_fee_usd = args.devaddr_fee_usd.unwrap(); } - if args.oui_price_usd.is_some() { - routing_manager.oui_fee_usd = args.oui_price_usd.unwrap(); + if args.oui_fee_usd.is_some() { + routing_manager.oui_fee_usd = args.oui_fee_usd.unwrap(); } Ok(()) diff --git a/tests/iot-routing-manager.ts b/tests/iot-routing-manager.ts index 82fffb4b5..f4d7f3e9c 100644 --- a/tests/iot-routing-manager.ts +++ b/tests/iot-routing-manager.ts @@ -120,8 +120,8 @@ describe("iot-routing-manager", () => { } = await irmProgram.methods .initializeRoutingManagerV0({ metadataUrl: "https://some/url", - devaddrPriceUsd: new anchor.BN(100_000000), - ouiPriceUsd: new anchor.BN(100_000000), + devaddrFeeUsd: new anchor.BN(100_000000), + ouiFeeUsd: new anchor.BN(100_000000), }) .preInstructions([ ComputeBudgetProgram.setComputeUnitLimit({ units: 500000 }), @@ -129,9 +129,9 @@ describe("iot-routing-manager", () => { .accounts({ updateAuthority: me, netIdAuthority: me, - dntMint: iotMint, + dcMint: dcMint, subDao, - iotPriceOracle: IOT_PRICE_FEED, + dao, }) .rpcAndKeys({ skipPreflight: true }); @@ -151,8 +151,8 @@ describe("iot-routing-manager", () => { } = await irmProgram.methods .initializeRoutingManagerV0({ metadataUrl: "https://some/url", - devaddrPriceUsd: new anchor.BN(100_000000), - ouiPriceUsd: new anchor.BN(100_000000), + devaddrFeeUsd: new anchor.BN(100_000000), + ouiFeeUsd: new anchor.BN(100_000000), }) .preInstructions([ ComputeBudgetProgram.setComputeUnitLimit({ units: 500000 }), @@ -161,7 +161,7 @@ describe("iot-routing-manager", () => { updateAuthority: me, netIdAuthority: me, subDao, - iotPriceOracle: IOT_PRICE_FEED, + dao, }) .rpcAndKeys({ skipPreflight: true }); routingManager = routingManagerK!; @@ -307,8 +307,8 @@ describe("iot-routing-manager", () => { .updateRoutingManagerV0({ updateAuthority: PublicKey.default, netIdAuthority: PublicKey.default, - devaddrPriceUsd: new anchor.BN(10_000000), - ouiPriceUsd: new anchor.BN(10_000000), + devaddrFeeUsd: new anchor.BN(100_000000), + ouiFeeUsd: new anchor.BN(100_000000), }) .accounts({ routingManager, @@ -323,11 +323,11 @@ describe("iot-routing-manager", () => { expect(routingManagerAcc.netIdAuthority.toBase58).to.eq( PublicKey.default.toBase58() ); - expect(routingManagerAcc.devaddrPriceUsd.toNumber()).to.eq( - new anchor.BN(10_000000).toNumber() + expect(routingManagerAcc.devaddrFeeUsd.toNumber()).to.eq( + new anchor.BN(100_000000).toNumber() ); - expect(routingManagerAcc.ouiPriceUsd.toNumber()).to.eq( - new anchor.BN(10_000000).toNumber() + expect(routingManagerAcc.ouiFeeUsd.toNumber()).to.eq( + new anchor.BN(100_000000).toNumber() ); }); }); From 5b9a0c845acce35d888dacf46d254f2750a1059c Mon Sep 17 00:00:00 2001 From: bry Date: Mon, 24 Feb 2025 15:03:25 -0600 Subject: [PATCH 52/63] use checked_mul --- .../src/instructions/initialize_devaddr_constraint_v0.rs | 7 ++++++- .../src/instructions/initialize_organization_v0.rs | 9 +++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/programs/iot-routing-manager/src/instructions/initialize_devaddr_constraint_v0.rs b/programs/iot-routing-manager/src/instructions/initialize_devaddr_constraint_v0.rs index 42338fd6e..9a806cd81 100644 --- a/programs/iot-routing-manager/src/instructions/initialize_devaddr_constraint_v0.rs +++ b/programs/iot-routing-manager/src/instructions/initialize_devaddr_constraint_v0.rs @@ -84,7 +84,12 @@ pub fn handler( ctx.accounts.net_id.current_addr_offset = end_addr + 1; } - let dc_fee: u64 = ctx.accounts.routing_manager.devaddr_fee_usd * 100_000_u64; + let dc_fee: u64 = ctx + .accounts + .routing_manager + .devaddr_fee_usd + .checked_mul(100_000) + .ok_or(ErrorCode::ArithmeticError)?; burn_without_tracking_v0( CpiContext::new( diff --git a/programs/iot-routing-manager/src/instructions/initialize_organization_v0.rs b/programs/iot-routing-manager/src/instructions/initialize_organization_v0.rs index bd91839fa..8f2df7a40 100644 --- a/programs/iot-routing-manager/src/instructions/initialize_organization_v0.rs +++ b/programs/iot-routing-manager/src/instructions/initialize_organization_v0.rs @@ -1,4 +1,4 @@ -use crate::{net_id_seeds, routing_manager_seeds, state::*}; +use crate::{error::ErrorCode, net_id_seeds, routing_manager_seeds, state::*}; use account_compression_cpi::{program::SplAccountCompression, Noop}; use anchor_lang::prelude::*; use anchor_lang::solana_program::hash::hash; @@ -220,7 +220,12 @@ pub fn handler(ctx: Context) -> Result<()> { }, )?; - let dc_fee: u64 = ctx.accounts.routing_manager.oui_fee_usd * 100_000_u64; + let dc_fee: u64 = ctx + .accounts + .routing_manager + .oui_fee_usd + .checked_mul(100_000) + .ok_or(ErrorCode::ArithmeticError)?; burn_without_tracking_v0( CpiContext::new( From e702ceedaf47d7249d43348d07481ab81a13420c Mon Sep 17 00:00:00 2001 From: bry Date: Tue, 25 Feb 2025 12:41:16 -0600 Subject: [PATCH 53/63] proper conversion logic from usd to dc --- .../src/instructions/initialize_devaddr_constraint_v0.rs | 1 + .../src/instructions/initialize_organization_v0.rs | 1 + 2 files changed, 2 insertions(+) diff --git a/programs/iot-routing-manager/src/instructions/initialize_devaddr_constraint_v0.rs b/programs/iot-routing-manager/src/instructions/initialize_devaddr_constraint_v0.rs index 9a806cd81..f4e7b7322 100644 --- a/programs/iot-routing-manager/src/instructions/initialize_devaddr_constraint_v0.rs +++ b/programs/iot-routing-manager/src/instructions/initialize_devaddr_constraint_v0.rs @@ -89,6 +89,7 @@ pub fn handler( .routing_manager .devaddr_fee_usd .checked_mul(100_000) + .and_then(|result| result.checked_div(1_000_000)) .ok_or(ErrorCode::ArithmeticError)?; burn_without_tracking_v0( diff --git a/programs/iot-routing-manager/src/instructions/initialize_organization_v0.rs b/programs/iot-routing-manager/src/instructions/initialize_organization_v0.rs index 8f2df7a40..6bb77917a 100644 --- a/programs/iot-routing-manager/src/instructions/initialize_organization_v0.rs +++ b/programs/iot-routing-manager/src/instructions/initialize_organization_v0.rs @@ -225,6 +225,7 @@ pub fn handler(ctx: Context) -> Result<()> { .routing_manager .oui_fee_usd .checked_mul(100_000) + .and_then(|result| result.checked_div(1_000_000)) .ok_or(ErrorCode::ArithmeticError)?; burn_without_tracking_v0( From 7d04ed0456d68009b1cfa1caa57e6c1f1148e46e Mon Sep 17 00:00:00 2001 From: bry Date: Fri, 21 Mar 2025 11:06:52 -0500 Subject: [PATCH 54/63] updated and working --- packages/helium-admin-cli/src/backfill-ouis.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/helium-admin-cli/src/backfill-ouis.ts b/packages/helium-admin-cli/src/backfill-ouis.ts index ea76e80ad..e5e8fb315 100644 --- a/packages/helium-admin-cli/src/backfill-ouis.ts +++ b/packages/helium-admin-cli/src/backfill-ouis.ts @@ -217,6 +217,7 @@ export async function run(args: any = process.argv) { ], { signers: [merkle], + computeUnitLimit: 500000, } ); } From 9df40a6f111e7b8efcf75cc2c1280a638f656fb1 Mon Sep 17 00:00:00 2001 From: bry Date: Fri, 21 Mar 2025 15:58:44 -0500 Subject: [PATCH 55/63] fix cargo --- Cargo.lock | 15 --------------- programs/iot-routing-manager/Cargo.toml | 2 +- 2 files changed, 1 insertion(+), 16 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 44917f8eb..cbd83d72d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -942,15 +942,6 @@ dependencies = [ "generic-array", ] -[[package]] -name = "instant" -version = "0.1.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" -dependencies = [ - "cfg-if", -] - [[package]] name = "iot-routing-manager" version = "0.1.2" @@ -972,12 +963,6 @@ dependencies = [ "solana-security-txt", ] -[[package]] -name = "ipnet" -version = "2.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28b29a3cd74f0f4598934efe3aeba42bae0eb4680554128851ebbecb02af14e6" - [[package]] name = "itertools" version = "0.10.5" diff --git a/programs/iot-routing-manager/Cargo.toml b/programs/iot-routing-manager/Cargo.toml index c647d7ef2..c2d209012 100644 --- a/programs/iot-routing-manager/Cargo.toml +++ b/programs/iot-routing-manager/Cargo.toml @@ -34,5 +34,5 @@ helium-entity-manager = { workspace = true } helium-sub-daos = { workspace = true } solana-security-txt = { workspace = true } default-env = { workspace = true } -solana-program = "1.16.13" +solana-program = { workspace = true } data-credits = { workspace = true, features = ["cpi"] } From 9cc51ca51d8eba204581f1a20f1d010d2bb851a2 Mon Sep 17 00:00:00 2001 From: bry Date: Mon, 24 Mar 2025 08:53:05 -0500 Subject: [PATCH 56/63] bump compute to 2m --- packages/spl-utils/src/priorityFees.ts | 34 +++++++++++++++++--------- 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/packages/spl-utils/src/priorityFees.ts b/packages/spl-utils/src/priorityFees.ts index f1c728c78..588e95325 100644 --- a/packages/spl-utils/src/priorityFees.ts +++ b/packages/spl-utils/src/priorityFees.ts @@ -29,7 +29,9 @@ export async function estimatePrioritizationFee( maxPriorityFee: number = MAX_PRIO_FEE, priorityFeeOptions: any = {} ): Promise { - const accounts = ixs.map((x) => x.keys.filter(k => k.isWritable).map((k) => k.pubkey)).flat(); + const accounts = ixs + .map((x) => x.keys.filter((k) => k.isWritable).map((k) => k.pubkey)) + .flat(); const uniqueAccounts = [...new Set(accounts.map((x) => x.toBase58()))] .map((a) => new PublicKey(a)) .slice(0, MAX_RECENT_PRIORITY_FEE_ACCOUNTS); @@ -51,7 +53,10 @@ export async function estimatePrioritizationFee( }, ]) ); - return Math.min(maxPriorityFee, Math.max(basePriorityFee || 1, Math.ceil(priorityFeeEstimate))); + return Math.min( + maxPriorityFee, + Math.max(basePriorityFee || 1, Math.ceil(priorityFeeEstimate)) + ); } catch (e: any) { console.error( "Failed to use getPriorityFeeEstimate, falling back to getRecentPrioritizationFees", @@ -106,17 +111,21 @@ export const estimateComputeUnits = async ( retries: number = 5 ): Promise => { const sim = (await connection.simulateTransaction(tx)).value; - if (sim.err && sim.err.toString().includes("BlockhashNotFound") && retries > 0) { - await sleep(500) - return estimateComputeUnits(connection, tx, retries - 1) + if ( + sim.err && + sim.err.toString().includes("BlockhashNotFound") && + retries > 0 + ) { + await sleep(500); + return estimateComputeUnits(connection, tx, retries - 1); } - // Default to 1m compute if it failed + // Default to 2m compute if it failed if (sim.err) { - return Math.max(sim.unitsConsumed || 0, 1000000) + return Math.max(sim.unitsConsumed || 0, 2000000); } - return sim.unitsConsumed + return sim.unitsConsumed; }; async function sleep(ms: number): Promise { @@ -149,7 +158,7 @@ export async function withPriorityFees({ instructions, basePriorityFee, maxPriorityFee, - priorityFeeOptions, + priorityFeeOptions ); if (!computeUnits) { const temp = { @@ -166,7 +175,7 @@ export async function withPriorityFees({ ) { ixWithComputeUnits = [ ComputeBudgetProgram.setComputeUnitLimit({ - units: 1000000, + units: 2000000, }), ComputeBudgetProgram.setComputeUnitPrice({ microLamports: 1, @@ -174,7 +183,10 @@ export async function withPriorityFees({ ...tx.instructions, ]; } - const estimatedFee = await estimateComputeUnits(connection, toVersionedTx({ ...tx, instructions: ixWithComputeUnits })); + const estimatedFee = await estimateComputeUnits( + connection, + toVersionedTx({ ...tx, instructions: ixWithComputeUnits }) + ); if (estimatedFee) { computeUnits = Math.ceil(estimatedFee * (computeScaleUp || 1.1)); } else { From c99e59d82fc9f491a03d9efbe1acc89acdcbcc57 Mon Sep 17 00:00:00 2001 From: bry Date: Mon, 24 Mar 2025 14:37:48 -0500 Subject: [PATCH 57/63] upgrade iot-routing-manager to latest anchor --- packages/docsite/src/data/navigation.js | 5 + .../docs/api/helium-entity-manager-sdk.md | 62 ++ .../pages/docs/api/iot-routing-manager-sdk.md | 582 ++++++++++++++++++ .../helium-admin-cli/src/backfill-ouis.ts | 20 +- packages/iot-routing-manager-sdk/src/index.ts | 7 +- .../iot-routing-manager-sdk/src/resolvers.ts | 7 +- .../initialize_shared_merkle_v0.rs | 12 +- .../src/instructions/issue_entity_v0.rs | 2 +- .../instructions/issue_program_entity_v0.rs | 7 +- .../swap_shared_merkle_tree_v0.rs | 6 +- programs/iot-routing-manager/Cargo.toml | 1 + .../initialize_devaddr_constraint_v0.rs | 4 +- .../src/instructions/initialize_net_id_v0.rs | 4 +- .../initialize_organization_delegate_v0.rs | 4 +- .../initialize_organization_v0.rs | 25 +- .../initialize_routing_manager_v0.rs | 26 +- .../temp_backfill_devaddr_constraint.rs | 4 +- .../temp_backfill_organization.rs | 28 +- .../temp_backfill_organization_delegate.rs | 4 +- tests/iot-routing-manager.ts | 25 +- 20 files changed, 741 insertions(+), 94 deletions(-) create mode 100644 packages/docsite/src/pages/docs/api/iot-routing-manager-sdk.md diff --git a/packages/docsite/src/data/navigation.js b/packages/docsite/src/data/navigation.js index b05dac2d0..0c6824a9f 100644 --- a/packages/docsite/src/data/navigation.js +++ b/packages/docsite/src/data/navigation.js @@ -109,6 +109,11 @@ export const navigation = [ { title: "Lazy distributor", href: "/docs/api/lazy-distributor-sdk" }, + { + title: "Iot routing manager", + href: "/docs/api/iot-routing-manager-sdk", + }, + { title: "Hpl crons", href: "/docs/api/hpl-crons-sdk" }, { title: "Hexboosting", href: "/docs/api/hexboosting-sdk" }, diff --git a/packages/docsite/src/pages/docs/api/helium-entity-manager-sdk.md b/packages/docsite/src/pages/docs/api/helium-entity-manager-sdk.md index b15c60e09..8e06afc0b 100644 --- a/packages/docsite/src/pages/docs/api/helium-entity-manager-sdk.md +++ b/packages/docsite/src/pages/docs/api/helium-entity-manager-sdk.md @@ -119,6 +119,27 @@ If you are looking for a quick start guide, check out the [Getting Started](/doc | ---- | --------------- | ---- | | args | [object Object] | | +### initialize_shared_merkle_v0 + +#### Accounts + +| Name | Mutability | Signer | Docs | +| ------------------- | ---------- | ------ | ---- | +| payer | immut | no | | +| shared_merkle | immut | no | | +| tree_authority | immut | no | | +| merkle_tree | immut | no | | +| system_program | immut | no | | +| log_wrapper | immut | no | | +| bubblegum_program | immut | no | | +| compression_program | immut | no | | + +#### Args + +| Name | Type | Docs | +| ---- | --------------- | ---- | +| args | [object Object] | | + ### issue_data_only_entity_v0 #### Accounts @@ -262,6 +283,7 @@ If you are looking for a quick start guide, check out the [Getting Started](/doc | bubblegum_program | immut | no | | | compression_program | immut | no | | | system_program | immut | no | | +| shared_merkle | immut | no | | #### Args @@ -512,6 +534,27 @@ If you are looking for a quick start guide, check out the [Getting Started](/doc | Name | Type | Docs | | ---- | ---- | ---- | +### swap_shared_merkle_tree_v0 + +#### Accounts + +| Name | Mutability | Signer | Docs | +| ------------------- | ---------- | ------ | ---- | +| payer | immut | no | | +| shared_merkle | immut | no | | +| tree_authority | immut | no | | +| new_tree_authority | immut | no | | +| new_merkle_tree | immut | no | | +| log_wrapper | immut | no | | +| system_program | immut | no | | +| bubblegum_program | immut | no | | +| compression_program | immut | no | | + +#### Args + +| Name | Type | Docs | +| ---- | ---- | ---- | + ### temp_backfill_mobile_info #### Accounts @@ -766,6 +809,10 @@ undefined undefined +### SharedMerkleV0 + +undefined + ### SubDaoV0 undefined @@ -907,6 +954,12 @@ undefined | settings | [object Object] | | staking_requirement | u64 | +### InitializeSharedMerkleArgsV0 + +| Field | Type | +| ---------- | ---- | +| proof_size | u8 | + ### IotHotspotInfoV0 | Field | Type | @@ -1149,6 +1202,15 @@ undefined | max_depth | u32 | | max_buffer_size | u32 | +### SharedMerkleV0 + +| Field | Type | +| -------------- | ------ | +| proof_size | u8 | +| price_per_mint | u64 | +| merkle_tree | pubkey | +| bump_seed | u8 | + ### SubDaoV0 | Field | Type | diff --git a/packages/docsite/src/pages/docs/api/iot-routing-manager-sdk.md b/packages/docsite/src/pages/docs/api/iot-routing-manager-sdk.md new file mode 100644 index 000000000..025cbe7ad --- /dev/null +++ b/packages/docsite/src/pages/docs/api/iot-routing-manager-sdk.md @@ -0,0 +1,582 @@ +# Iot Routing Manager SDK + +{% callout title="Quick tip" %} +If you are looking for a quick start guide, check out the [Getting Started](/docs/learn/getting_started) guide. We also have some react examples [here](/docs/learn/react). +{% /callout %} + +## Instructions + +### approve_organization_v0 + +#### Accounts + +| Name | Mutability | Signer | Docs | +| -------------- | ---------- | ------ | ---- | +| authority | immut | no | | +| net_id | immut | no | | +| organization | immut | no | | +| system_program | immut | no | | + +#### Args + +| Name | Type | Docs | +| ---- | ---- | ---- | + +### initialize_devaddr_constraint_v0 + +#### Accounts + +| Name | Mutability | Signer | Docs | +| ------------------------ | ---------- | ------ | ---- | +| payer | immut | no | | +| authority | immut | no | | +| net_id | immut | no | | +| routing_manager | immut | no | | +| organization | immut | no | | +| data_credits | immut | no | | +| dc_mint | immut | no | | +| payer_dc_account | immut | no | | +| devaddr_constraint | immut | no | | +| token_program | immut | no | | +| system_program | immut | no | | +| associated_token_program | immut | no | | +| data_credits_program | immut | no | | + +#### Args + +| Name | Type | Docs | +| ---- | --------------- | ---- | +| args | [object Object] | | + +### initialize_net_id_v0 + +#### Accounts + +| Name | Mutability | Signer | Docs | +| ---------------- | ---------- | ------ | ---- | +| payer | immut | no | | +| net_id_authority | immut | no | | +| authority | immut | no | | +| routing_manager | immut | no | | +| net_id | immut | no | | +| system_program | immut | no | | + +#### Args + +| Name | Type | Docs | +| ---- | --------------- | ---- | +| args | [object Object] | | + +### initialize_organization_delegate_v0 + +#### Accounts + +| Name | Mutability | Signer | Docs | +| --------------------- | ---------- | ------ | ---- | +| payer | immut | no | | +| authority | immut | no | | +| organization | immut | no | | +| organization_delegate | immut | no | | +| delegate | immut | no | | +| system_program | immut | no | | + +#### Args + +| Name | Type | Docs | +| ---- | ---- | ---- | + +### initialize_organization_v0 + +#### Accounts + +| Name | Mutability | Signer | Docs | +| ----------------------------- | ---------- | ------ | ---- | +| payer | immut | no | | +| program_approval | immut | no | | +| routing_manager | immut | no | | +| net_id | immut | no | | +| data_credits | immut | no | | +| dc_mint | immut | no | | +| payer_dc_account | immut | no | | +| authority | immut | no | | +| organization | immut | no | | +| collection | immut | no | | +| collection_metadata | immut | no | | +| collection_master_edition | immut | no | | +| entity_creator | immut | no | | +| dao | immut | no | | +| sub_dao | immut | no | | +| key_to_asset | immut | no | | +| tree_authority | immut | no | | +| recipient | immut | no | | +| merkle_tree | immut | no | | +| bubblegum_signer | immut | no | | +| shared_merkle | immut | no | | +| token_metadata_program | immut | no | | +| log_wrapper | immut | no | | +| bubblegum_program | immut | no | | +| compression_program | immut | no | | +| system_program | immut | no | | +| helium_entity_manager_program | immut | no | | +| token_program | immut | no | | +| associated_token_program | immut | no | | +| data_credits_program | immut | no | | + +#### Args + +| Name | Type | Docs | +| ---- | ---- | ---- | + +### initialize_routing_manager_v0 + +#### Accounts + +| Name | Mutability | Signer | Docs | +| ------------------------ | ---------- | ------ | ---- | +| payer | immut | no | | +| authority | immut | no | | +| update_authority | immut | no | | +| net_id_authority | immut | no | | +| routing_manager | immut | no | | +| dao | immut | no | | +| sub_dao | immut | no | | +| dc_mint | immut | no | | +| collection | immut | no | | +| metadata | immut | no | | +| master_edition | immut | no | | +| token_account | immut | no | | +| token_metadata_program | immut | no | | +| associated_token_program | immut | no | | +| system_program | immut | no | | +| token_program | immut | no | | +| rent | immut | no | | + +#### Args + +| Name | Type | Docs | +| ---- | --------------- | ---- | +| args | [object Object] | | + +### remove_devaddr_constraint_v0 + +#### Accounts + +| Name | Mutability | Signer | Docs | +| ------------------ | ---------- | ------ | ---- | +| rent_refund | immut | no | | +| authority | immut | no | | +| net_id | immut | no | | +| devaddr_constraint | immut | no | | + +#### Args + +| Name | Type | Docs | +| ---- | ---- | ---- | + +### remove_organization_delegate_v0 + +#### Accounts + +| Name | Mutability | Signer | Docs | +| --------------------- | ---------- | ------ | ---- | +| rent_refund | immut | no | | +| authority | immut | no | | +| organization | immut | no | | +| organization_delegate | immut | no | | + +#### Args + +| Name | Type | Docs | +| ---- | ---- | ---- | + +### temp_backfill_devaddr_constraint + +#### Accounts + +| Name | Mutability | Signer | Docs | +| ------------------ | ---------- | ------ | ---- | +| payer | immut | no | | +| net_id | immut | no | | +| routing_manager | immut | no | | +| organization | immut | no | | +| dc_mint | immut | no | | +| devaddr_constraint | immut | no | | +| token_program | immut | no | | +| system_program | immut | no | | + +#### Args + +| Name | Type | Docs | +| ---- | --------------- | ---- | +| args | [object Object] | | + +### temp_backfill_organization + +#### Accounts + +| Name | Mutability | Signer | Docs | +| ----------------------------- | ---------- | ------ | ---- | +| payer | immut | no | | +| program_approval | immut | no | | +| routing_manager | immut | no | | +| net_id | immut | no | | +| dc_mint | immut | no | | +| authority | immut | no | | +| organization | immut | no | | +| collection | immut | no | | +| collection_metadata | immut | no | | +| collection_master_edition | immut | no | | +| entity_creator | immut | no | | +| dao | immut | no | | +| sub_dao | immut | no | | +| key_to_asset | immut | no | | +| tree_authority | immut | no | | +| recipient | immut | no | | +| merkle_tree | immut | no | | +| bubblegum_signer | immut | no | | +| shared_merkle | immut | no | | +| token_metadata_program | immut | no | | +| log_wrapper | immut | no | | +| bubblegum_program | immut | no | | +| compression_program | immut | no | | +| system_program | immut | no | | +| helium_entity_manager_program | immut | no | | +| token_program | immut | no | | + +#### Args + +| Name | Type | Docs | +| ---- | --------------- | ---- | +| args | [object Object] | | + +### temp_backfill_organization_delegate + +#### Accounts + +| Name | Mutability | Signer | Docs | +| --------------------- | ---------- | ------ | ---- | +| payer | immut | no | | +| organization | immut | no | | +| organization_delegate | immut | no | | +| delegate | immut | no | | +| system_program | immut | no | | + +#### Args + +| Name | Type | Docs | +| ---- | ---- | ---- | + +### update_net_id_v0 + +#### Accounts + +| Name | Mutability | Signer | Docs | +| --------- | ---------- | ------ | ---- | +| authority | immut | no | | +| net_id | immut | no | | + +#### Args + +| Name | Type | Docs | +| ---- | --------------- | ---- | +| args | [object Object] | | + +### update_organization_v0 + +#### Accounts + +| Name | Mutability | Signer | Docs | +| ------------ | ---------- | ------ | ---- | +| authority | immut | no | | +| organization | immut | no | | + +#### Args + +| Name | Type | Docs | +| ---- | --------------- | ---- | +| args | [object Object] | | + +### update_routing_manager_v0 + +#### Accounts + +| Name | Mutability | Signer | Docs | +| ---------------- | ---------- | ------ | ---- | +| update_authority | immut | no | | +| routing_manager | immut | no | | + +#### Args + +| Name | Type | Docs | +| ---- | --------------- | ---- | +| args | [object Object] | | + +## Accounts + +### DaoV0 + +undefined + +### DataCreditsV0 + +undefined + +### DevaddrConstraintV0 + +undefined + +### IotRoutingManagerV0 + +undefined + +### NetIdV0 + +undefined + +### OrganizationDelegateV0 + +undefined + +### OrganizationV0 + +undefined + +### ProgramApprovalV0 + +undefined + +### SharedMerkleV0 + +undefined + +### SubDaoV0 + +undefined + +### TreeConfig + +undefined + +## Types + +### DaoV0 + +| Field | Type | +| ------------------------- | --------------- | +| hnt_mint | pubkey | +| dc_mint | pubkey | +| authority | pubkey | +| registrar | pubkey | +| hst_pool | pubkey | +| net_emissions_cap | u64 | +| num_sub_daos | u32 | +| emission_schedule | [object Object] | +| hst_emission_schedule | [object Object] | +| bump_seed | u8 | +| rewards_escrow | pubkey | +| delegator_pool | pubkey | +| delegator_rewards_percent | u64 | +| proposal_namespace | pubkey | +| recent_proposals | [object Object] | + +### DataCreditsV0 + +| Field | Type | +| ------------------ | ------ | +| dc_mint | pubkey | +| hnt_mint | pubkey | +| authority | pubkey | +| hnt_price_oracle | pubkey | +| data_credits_bump | u8 | +| account_payer | pubkey | +| account_payer_bump | u8 | + +### DecompressibleState + +| Variant | Fields | +| -------- | ------ | +| Enabled | | +| Disabled | | + +### DevaddrConstraintV0 + +| Field | Type | +| --------------- | ------ | +| routing_manager | pubkey | +| net_id | pubkey | +| organization | pubkey | +| start_addr | u64 | +| end_addr | u64 | +| bump_seed | u8 | + +### EmissionScheduleItem + +| Field | Type | +| ------------------- | ---- | +| start_unix_time | i64 | +| emissions_per_epoch | u64 | + +### InitializeDevaddrConstraintArgsV0 + +| Field | Type | +| ---------- | ---- | +| num_blocks | u32 | + +### InitializeNetIdArgsV0 + +| Field | Type | +| ------ | ---- | +| net_id | u32 | + +### InitializeRoutingManagerArgsV0 + +| Field | Type | +| --------------- | ------ | +| metadata_url | string | +| devaddr_fee_usd | u64 | +| oui_fee_usd | u64 | + +### IotRoutingManagerV0 + +| Field | Type | +| ---------------- | ------ | +| sub_dao | pubkey | +| dc_mint | pubkey | +| update_authority | pubkey | +| net_id_authority | pubkey | +| collection | pubkey | +| devaddr_fee_usd | u64 | +| oui_fee_usd | u64 | +| next_oui_id | u64 | +| bump_seed | u8 | + +### NetIdV0 + +| Field | Type | +| ------------------- | ------ | +| routing_manager | pubkey | +| id | u32 | +| authority | pubkey | +| current_addr_offset | u64 | +| bump_seed | u8 | + +### OrganizationDelegateV0 + +| Field | Type | +| ------------ | ------ | +| organization | pubkey | +| delegate | pubkey | +| bump_seed | u8 | + +### OrganizationV0 + +| Field | Type | +| --------------- | ------ | +| routing_manager | pubkey | +| net_id | pubkey | +| authority | pubkey | +| oui | u64 | +| escrow_key | string | +| approved | bool | +| bump_seed | u8 | + +### PercentItem + +| Field | Type | +| --------------- | ---- | +| start_unix_time | i64 | +| percent | u8 | + +### ProgramApprovalV0 + +| Field | Type | +| ---------- | ------ | +| dao | pubkey | +| program_id | pubkey | +| bump_seed | u8 | + +### RecentProposal + +| Field | Type | +| -------- | ------ | +| proposal | pubkey | +| ts | i64 | + +### SharedMerkleV0 + +| Field | Type | +| -------------- | ------ | +| proof_size | u8 | +| price_per_mint | u64 | +| merkle_tree | pubkey | +| bump_seed | u8 | + +### SubDaoV0 + +| Field | Type | +| -------------------------------------- | --------------- | +| dao | pubkey | +| dnt_mint | pubkey | +| treasury | pubkey | +| rewards_escrow | pubkey | +| delegator_pool | pubkey | +| vehnt_delegated | u128 | +| vehnt_last_calculated_ts | i64 | +| vehnt_fall_rate | u128 | +| authority | pubkey | +| \_deprecated_active_device_aggregator | pubkey | +| dc_burn_authority | pubkey | +| onboarding_dc_fee | u64 | +| emission_schedule | [object Object] | +| bump_seed | u8 | +| registrar | pubkey | +| \_deprecated_delegator_rewards_percent | u64 | +| onboarding_data_only_dc_fee | u64 | +| dc_onboarding_fees_paid | u64 | +| active_device_authority | pubkey | + +### TempBackfillDevaddrConstraintArgs + +| Field | Type | +| ---------- | ---- | +| num_blocks | u32 | +| start_addr | u64 | + +### TempBackfillOrganizationArgs + +| Field | Type | +| ------------------- | ------ | +| oui | u64 | +| escrow_key_override | string | + +### TreeConfig + +| Field | Type | +| ------------------- | --------------- | +| tree_creator | pubkey | +| tree_delegate | pubkey | +| total_mint_capacity | u64 | +| num_minted | u64 | +| is_public | bool | +| is_decompressible | [object Object] | + +### UpdateNetIdArgsV0 + +| Field | Type | +| --------- | ------ | +| authority | pubkey | + +### UpdateOrganizationArgsV0 + +| Field | Type | +| --------- | ------ | +| authority | pubkey | + +### UpdateRoutingManagerArgsV0 + +| Field | Type | +| ---------------- | ------ | +| update_authority | pubkey | +| net_id_authority | pubkey | +| devaddr_fee_usd | u64 | +| oui_fee_usd | u64 | diff --git a/packages/helium-admin-cli/src/backfill-ouis.ts b/packages/helium-admin-cli/src/backfill-ouis.ts index e5e8fb315..f1d1caf3e 100644 --- a/packages/helium-admin-cli/src/backfill-ouis.ts +++ b/packages/helium-admin-cli/src/backfill-ouis.ts @@ -191,7 +191,7 @@ export async function run(args: any = process.argv) { .approveProgramV0({ programId: irm.programId, }) - .accounts({ dao }) + .accountsPartial({ dao }) .instruction(), ]); } @@ -212,7 +212,7 @@ export async function run(args: any = process.argv) { }), await hem.methods .initializeSharedMerkleV0({ proofSize: 3 }) - .accounts({ merkleTree: merkle.publicKey }) + .accountsPartial({ merkleTree: merkle.publicKey }) .instruction(), ], { @@ -233,7 +233,7 @@ export async function run(args: any = process.argv) { devaddrFeeUsd: new anchor.BN(100_000000), ouiFeeUsd: new anchor.BN(100_000000), }) - .accounts({ + .accountsPartial({ updateAuthority: wallet.publicKey, netIdAuthority: wallet.publicKey, dcMint: DC_MINT, @@ -258,7 +258,7 @@ export async function run(args: any = process.argv) { .initializeNetIdV0({ netId, }) - .accounts({ + .accountsPartial({ authority: wallet.publicKey, routingManager, }) @@ -292,7 +292,7 @@ export async function run(args: any = process.argv) { oui: new anchor.BN(org.oui), escrowKeyOverride: org.payer_pubkey, }) - .accounts({ + .accountsPartial({ authority: ownerSolAddr, netId: netIdK, }) @@ -315,7 +315,7 @@ export async function run(args: any = process.argv) { ) { return await irm.methods .approveOrganizationV0() - .accounts({ organization: orgK }) + .accountsPartial({ organization: orgK }) .instruction(); } }) @@ -349,7 +349,7 @@ export async function run(args: any = process.argv) { if (!(await exists(conn, orgDelegateK))) { return await irm.methods .tempBackfillOrganizationDelegate() - .accounts({ + .accountsPartial({ payer: wallet.publicKey, organization: orgK, delegate: delegateSolAddr, @@ -390,7 +390,7 @@ export async function run(args: any = process.argv) { startAddr: startAddrBn, numBlocks: numBlocksBn.toNumber(), }) - .accounts({ + .accountsPartial({ organization: orgK, }) .instruction(); @@ -417,7 +417,7 @@ export async function run(args: any = process.argv) { devaddrFeeUsd: null, ouiFeeUsd: null, }) - .accounts({ + .accountsPartial({ updateAuthority: wallet.publicKey, routingManager, }) @@ -437,7 +437,7 @@ export async function run(args: any = process.argv) { .updateNetIdV0({ authority: ouiWallet, }) - .accounts({ + .accountsPartial({ authority: wallet.publicKey, netId: netIdK, }) diff --git a/packages/iot-routing-manager-sdk/src/index.ts b/packages/iot-routing-manager-sdk/src/index.ts index abab885cc..f045d0b69 100644 --- a/packages/iot-routing-manager-sdk/src/index.ts +++ b/packages/iot-routing-manager-sdk/src/index.ts @@ -2,7 +2,7 @@ import { IotRoutingManager } from "@helium/idls/lib/types/iot_routing_manager"; import { AnchorProvider, Idl, Program } from "@coral-xyz/anchor"; import { PublicKey } from "@solana/web3.js"; import { PROGRAM_ID } from "./constants"; -import { lazyDistributorResolvers } from "./resolvers"; +import { iotRoutingManagerResolvers } from "./resolvers"; import { fetchBackwardsCompatibleIdl } from "@helium/spl-utils"; export * from "./constants"; @@ -20,12 +20,9 @@ export async function init( const iotRoutingManager = new Program( idl as IotRoutingManager, - programId, provider, undefined, - () => { - return lazyDistributorResolvers; - } + () => iotRoutingManagerResolvers ) as Program; return iotRoutingManager; diff --git a/packages/iot-routing-manager-sdk/src/resolvers.ts b/packages/iot-routing-manager-sdk/src/resolvers.ts index 6a5013893..1be363ddd 100644 --- a/packages/iot-routing-manager-sdk/src/resolvers.ts +++ b/packages/iot-routing-manager-sdk/src/resolvers.ts @@ -1,4 +1,4 @@ -import { BorshAccountsCoder, Program, Provider } from "@coral-xyz/anchor"; +import { BorshAccountsCoder, Provider } from "@coral-xyz/anchor"; import { heliumCommonResolver } from "@helium/anchor-resolvers"; import { ataResolver, @@ -16,7 +16,7 @@ import { } from "@helium/helium-entity-manager-sdk"; import { fetchBackwardsCompatibleIdl } from "@helium/spl-utils"; -export const lazyDistributorResolvers = combineResolvers( +export const iotRoutingManagerResolvers = combineResolvers( heliumCommonResolver, heliumEntityManagerResolvers, ataResolver({ @@ -70,8 +70,7 @@ export const lazyDistributorResolvers = combineResolvers( return ( await keyToAssetKey( accounts.dao as PublicKey, - `OUI_${args[args.length - 1].oui}`, - "utf-8" + Buffer.from(`OUI_${args[args.length - 1].oui}`, "utf-8") ) )[0]; } else if (path[path.length - 1] === "sharedMerkle") { diff --git a/programs/helium-entity-manager/src/instructions/initialize_shared_merkle_v0.rs b/programs/helium-entity-manager/src/instructions/initialize_shared_merkle_v0.rs index 13c88bd19..885d15bc5 100644 --- a/programs/helium-entity-manager/src/instructions/initialize_shared_merkle_v0.rs +++ b/programs/helium-entity-manager/src/instructions/initialize_shared_merkle_v0.rs @@ -1,7 +1,9 @@ -use account_compression_cpi::{program::SplAccountCompression, Noop}; +use account_compression_cpi::{account_compression::program::SplAccountCompression, Noop}; use anchor_lang::prelude::*; -use bubblegum_cpi::cpi::{accounts::CreateTree, create_tree}; -use bubblegum_cpi::program::Bubblegum; +use bubblegum_cpi::bubblegum::{ + cpi::{accounts::CreateTree, create_tree}, + program::Bubblegum, +}; use crate::{shared_merkle_seeds, state::SharedMerkleV0}; @@ -17,7 +19,7 @@ pub struct InitializeSharedMerkleV0<'info> { pub payer: Signer<'info>, #[account( init, - seeds = [b"shared_merkle", &args.proof_size.to_le_bytes()[..]], + seeds = ["shared_merkle".as_bytes(), &args.proof_size.to_le_bytes()[..]], bump, payer = payer, space = 8 + SharedMerkleV0::INIT_SPACE + 32, @@ -59,7 +61,7 @@ pub fn handler( proof_size: args.proof_size, price_per_mint: div_ceil(total_lamports, 2u64.pow(depth) - 3), // because we can swap with 3 left merkle_tree: ctx.accounts.merkle_tree.key(), - bump_seed: ctx.bumps["shared_merkle"], + bump_seed: ctx.bumps.shared_merkle, }); let signer_seeds = shared_merkle_seeds!(ctx.accounts.shared_merkle); create_tree( diff --git a/programs/helium-entity-manager/src/instructions/issue_entity_v0.rs b/programs/helium-entity-manager/src/instructions/issue_entity_v0.rs index 1e7a1724a..b9b6f582d 100644 --- a/programs/helium-entity-manager/src/instructions/issue_entity_v0.rs +++ b/programs/helium-entity-manager/src/instructions/issue_entity_v0.rs @@ -103,7 +103,7 @@ pub struct IssueEntityV0<'info> { /// CHECK: Used in cpi pub bubblegum_signer: UncheckedAccount<'info>, - /// CHECK: Verified by constraint + /// CHECK: Verified by constraint #[account(address = mpl_token_metadata::ID)] pub token_metadata_program: AccountInfo<'info>, pub log_wrapper: Program<'info, Noop>, diff --git a/programs/helium-entity-manager/src/instructions/issue_program_entity_v0.rs b/programs/helium-entity-manager/src/instructions/issue_program_entity_v0.rs index 69e004ac3..439aa46c2 100644 --- a/programs/helium-entity-manager/src/instructions/issue_program_entity_v0.rs +++ b/programs/helium-entity-manager/src/instructions/issue_program_entity_v0.rs @@ -1,5 +1,8 @@ use account_compression_cpi::{account_compression::program::SplAccountCompression, Noop}; -use anchor_lang::prelude::*; +use anchor_lang::{ + prelude::*, + solana_program::{program::invoke, system_instruction}, +}; use anchor_spl::token::Mint; use bubblegum_cpi::{ bubblegum::{ @@ -207,7 +210,7 @@ pub fn handler(ctx: Context, args: IssueProgramEntityArgsV }; let entity_creator_seeds: &[&[&[u8]]] = &[&[ - b"entity_creator", + "entity_creator".as_bytes(), ctx.accounts.dao.to_account_info().key.as_ref(), &[ctx.bumps.entity_creator], ]]; diff --git a/programs/helium-entity-manager/src/instructions/swap_shared_merkle_tree_v0.rs b/programs/helium-entity-manager/src/instructions/swap_shared_merkle_tree_v0.rs index 57800d406..263d47829 100644 --- a/programs/helium-entity-manager/src/instructions/swap_shared_merkle_tree_v0.rs +++ b/programs/helium-entity-manager/src/instructions/swap_shared_merkle_tree_v0.rs @@ -1,10 +1,10 @@ use crate::{shared_merkle_seeds, state::*, BUFFER_SIZE, STARTING_DEPTH}; -use account_compression_cpi::{program::SplAccountCompression, Noop}; +use account_compression_cpi::{account_compression::program::SplAccountCompression, Noop}; use anchor_lang::prelude::*; -use bubblegum_cpi::{ +use bubblegum_cpi::bubblegum::{ + accounts::TreeConfig, cpi::{accounts::CreateTree, create_tree}, program::Bubblegum, - TreeConfig, }; #[derive(Accounts)] diff --git a/programs/iot-routing-manager/Cargo.toml b/programs/iot-routing-manager/Cargo.toml index c2d209012..4a204e16f 100644 --- a/programs/iot-routing-manager/Cargo.toml +++ b/programs/iot-routing-manager/Cargo.toml @@ -9,6 +9,7 @@ crate-type = ["cdylib", "lib"] name = "iot_routing_manager" [features] +idl-build = ["anchor-lang/idl-build", "anchor-spl/idl-build"] devnet = [] no-genesis = [] no-entrypoint = [] diff --git a/programs/iot-routing-manager/src/instructions/initialize_devaddr_constraint_v0.rs b/programs/iot-routing-manager/src/instructions/initialize_devaddr_constraint_v0.rs index f4e7b7322..a7ddfc8ad 100644 --- a/programs/iot-routing-manager/src/instructions/initialize_devaddr_constraint_v0.rs +++ b/programs/iot-routing-manager/src/instructions/initialize_devaddr_constraint_v0.rs @@ -60,7 +60,7 @@ pub struct InitializeDevaddrConstraintV0<'info> { #[account( init, payer = payer, - seeds = [b"devaddr_constraint", organization.key().as_ref(), &net_id.current_addr_offset.to_le_bytes()[..]], + seeds = ["devaddr_constraint".as_bytes(), organization.key().as_ref(), &net_id.current_addr_offset.to_le_bytes()[..]], bump, space = 8 + DevaddrConstraintV0::INIT_SPACE + 60 )] @@ -119,7 +119,7 @@ pub fn handler( organization: ctx.accounts.organization.key(), start_addr, end_addr, - bump_seed: ctx.bumps["devaddr_constraint"], + bump_seed: ctx.bumps.devaddr_constraint, }); Ok(()) } diff --git a/programs/iot-routing-manager/src/instructions/initialize_net_id_v0.rs b/programs/iot-routing-manager/src/instructions/initialize_net_id_v0.rs index d970c7b04..a928eb829 100644 --- a/programs/iot-routing-manager/src/instructions/initialize_net_id_v0.rs +++ b/programs/iot-routing-manager/src/instructions/initialize_net_id_v0.rs @@ -23,7 +23,7 @@ pub struct InitializeNetIdV0<'info> { init, payer = payer, space = 8 + NetIdV0::INIT_SPACE + 60, - seeds = [b"net_id", routing_manager.key().as_ref(), &args.net_id.to_le_bytes()[..]], + seeds = ["net_id".as_bytes(), routing_manager.key().as_ref(), &args.net_id.to_le_bytes()[..]], bump, )] pub net_id: Account<'info, NetIdV0>, @@ -36,7 +36,7 @@ pub fn handler(ctx: Context, args: InitializeNetIdArgsV0) -> routing_manager: ctx.accounts.routing_manager.key(), authority: ctx.accounts.authority.key(), current_addr_offset: 0, - bump_seed: ctx.bumps["net_id"], + bump_seed: ctx.bumps.net_id, }); Ok(()) } diff --git a/programs/iot-routing-manager/src/instructions/initialize_organization_delegate_v0.rs b/programs/iot-routing-manager/src/instructions/initialize_organization_delegate_v0.rs index 98c60a9da..828d63d0f 100644 --- a/programs/iot-routing-manager/src/instructions/initialize_organization_delegate_v0.rs +++ b/programs/iot-routing-manager/src/instructions/initialize_organization_delegate_v0.rs @@ -15,7 +15,7 @@ pub struct InitializeOrganizationDelegateV0<'info> { init, payer = payer, space = 8 + OrganizationDelegateV0::INIT_SPACE + 32, - seeds = [b"organization_delegate", organization.key().as_ref(), delegate.key().as_ref()], + seeds = ["organization_delegate".as_bytes(), organization.key().as_ref(), delegate.key().as_ref()], bump, )] pub organization_delegate: Account<'info, OrganizationDelegateV0>, @@ -31,7 +31,7 @@ pub fn handler(ctx: Context) -> Result<()> { .set_inner(OrganizationDelegateV0 { organization: ctx.accounts.organization.key(), delegate: ctx.accounts.delegate.key(), - bump_seed: ctx.bumps["organization_delegate"], + bump_seed: ctx.bumps.organization_delegate, }); Ok(()) } diff --git a/programs/iot-routing-manager/src/instructions/initialize_organization_v0.rs b/programs/iot-routing-manager/src/instructions/initialize_organization_v0.rs index 6bb77917a..434822abb 100644 --- a/programs/iot-routing-manager/src/instructions/initialize_organization_v0.rs +++ b/programs/iot-routing-manager/src/instructions/initialize_organization_v0.rs @@ -1,13 +1,10 @@ -use crate::{error::ErrorCode, net_id_seeds, routing_manager_seeds, state::*}; -use account_compression_cpi::{program::SplAccountCompression, Noop}; +use account_compression_cpi::{account_compression::program::SplAccountCompression, Noop}; use anchor_lang::prelude::*; -use anchor_lang::solana_program::hash::hash; use anchor_spl::{ associated_token::AssociatedToken, token::{Mint, Token, TokenAccount}, }; -use bubblegum_cpi::program::Bubblegum; -use bubblegum_cpi::TreeConfig; +use bubblegum_cpi::bubblegum::{accounts::TreeConfig, program::Bubblegum}; use data_credits::{ cpi::{ accounts::{BurnCommonV0, BurnWithoutTrackingV0}, @@ -16,18 +13,16 @@ use data_credits::{ program::DataCredits, BurnWithoutTrackingArgsV0, DataCreditsV0, }; -use helium_entity_manager::program::HeliumEntityManager; use helium_entity_manager::{ - cpi::accounts::IssueProgramEntityV0, cpi::issue_program_entity_v0, ProgramApprovalV0, + constants::ENTITY_METADATA_URL, + cpi::{accounts::IssueProgramEntityV0, issue_program_entity_v0}, + hash_entity_key, + program::HeliumEntityManager, + IssueProgramEntityArgsV0, KeySerialization, ProgramApprovalV0, SharedMerkleV0, }; -use helium_entity_manager::{IssueProgramEntityArgsV0, KeySerialization, SharedMerkleV0}; use helium_sub_daos::{DaoV0, SubDaoV0}; -#[cfg(feature = "devnet")] -pub const ENTITY_METADATA_URL: &str = "https://entities.nft.test-helium.com"; - -#[cfg(not(feature = "devnet"))] -pub const ENTITY_METADATA_URL: &str = "https://entities.nft.helium.io"; +use crate::{error::ErrorCode, net_id_seeds, routing_manager_seeds, state::*}; #[derive(Accounts)] pub struct InitializeOrganizationV0<'info> { @@ -111,7 +106,7 @@ pub struct InitializeOrganizationV0<'info> { seeds = [ "key_to_asset".as_bytes(), dao.key().as_ref(), - &hash(format!("OUI_{}", &routing_manager.next_oui_id).as_bytes()).to_bytes() + &hash_entity_key(format!("OUI_{}", &routing_manager.next_oui_id).as_bytes()) ], seeds::program = helium_entity_manager_program.key(), bump @@ -172,7 +167,7 @@ pub fn handler(ctx: Context) -> Result<()> { routing_manager: ctx.accounts.routing_manager.key(), authority: ctx.accounts.authority.key(), escrow_key, - bump_seed: ctx.bumps["organization"], + bump_seed: ctx.bumps.organization, net_id: ctx.accounts.net_id.key(), approved: false, }); diff --git a/programs/iot-routing-manager/src/instructions/initialize_routing_manager_v0.rs b/programs/iot-routing-manager/src/instructions/initialize_routing_manager_v0.rs index 9fda26eed..62d78f59a 100644 --- a/programs/iot-routing-manager/src/instructions/initialize_routing_manager_v0.rs +++ b/programs/iot-routing-manager/src/instructions/initialize_routing_manager_v0.rs @@ -3,15 +3,14 @@ use crate::{routing_manager_seeds, state::*}; use anchor_lang::prelude::*; use anchor_spl::{ associated_token::AssociatedToken, + metadata::{ + create_master_edition_v3, create_metadata_accounts_v3, + mpl_token_metadata::types::CollectionDetails, mpl_token_metadata::types::DataV2, + CreateMasterEditionV3, CreateMetadataAccountsV3, Metadata as MetadataProgram, + }, token::{self, Mint, MintTo, Token, TokenAccount}, }; use helium_sub_daos::{DaoV0, SubDaoV0}; -use mpl_token_metadata::types::{CollectionDetails, DataV2}; -use shared_utils::create_metadata_accounts_v3; -use shared_utils::token_metadata::{ - create_master_edition_v3, CreateMasterEditionV3, CreateMetadataAccountsV3, - Metadata as MetadataProgram, -}; #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)] pub struct InitializeRoutingManagerArgsV0 { @@ -115,7 +114,7 @@ pub fn handler( net_id_authority: ctx.accounts.net_id_authority.key(), collection: ctx.accounts.collection.key(), // Initialized via set_carrier_tree - bump_seed: ctx.bumps["routing_manager"], + bump_seed: ctx.bumps.routing_manager, dc_mint: ctx.accounts.dc_mint.key(), sub_dao: ctx.accounts.sub_dao.key(), devaddr_fee_usd: args.devaddr_fee_usd, @@ -140,7 +139,11 @@ pub fn handler( payer: ctx.accounts.payer.to_account_info().clone(), update_authority: ctx.accounts.routing_manager.to_account_info().clone(), system_program: ctx.accounts.system_program.to_account_info().clone(), - token_metadata_program: ctx.accounts.token_metadata_program.clone(), + rent: ctx + .accounts + .token_metadata_program + .to_account_info() + .clone(), }, signer_seeds, ), @@ -154,6 +157,7 @@ pub fn handler( uses: None, }, true, + true, Some(CollectionDetails::V1 { size: 0 }), )?; @@ -173,7 +177,11 @@ pub fn handler( payer: ctx.accounts.payer.to_account_info().clone(), token_program: ctx.accounts.token_program.to_account_info().clone(), system_program: ctx.accounts.system_program.to_account_info().clone(), - token_metadata_program: ctx.accounts.token_metadata_program.clone(), + rent: ctx + .accounts + .token_metadata_program + .to_account_info() + .clone(), }, signer_seeds, ), diff --git a/programs/iot-routing-manager/src/instructions/temp_backfill_devaddr_constraint.rs b/programs/iot-routing-manager/src/instructions/temp_backfill_devaddr_constraint.rs index f48acec1d..eeffd9277 100644 --- a/programs/iot-routing-manager/src/instructions/temp_backfill_devaddr_constraint.rs +++ b/programs/iot-routing-manager/src/instructions/temp_backfill_devaddr_constraint.rs @@ -36,7 +36,7 @@ pub struct TempBackfillDevaddrConstraint<'info> { #[account( init, payer = payer, - seeds = [b"devaddr_constraint", organization.key().as_ref(), &args.start_addr.to_le_bytes()[..]], + seeds = ["devaddr_constraint".as_bytes(), organization.key().as_ref(), &args.start_addr.to_le_bytes()[..]], bump, space = 8 + DevaddrConstraintV0::INIT_SPACE + 60 )] @@ -67,7 +67,7 @@ pub fn handler( organization: ctx.accounts.organization.key(), start_addr, end_addr, - bump_seed: ctx.bumps["devaddr_constraint"], + bump_seed: ctx.bumps.devaddr_constraint, }); Ok(()) } diff --git a/programs/iot-routing-manager/src/instructions/temp_backfill_organization.rs b/programs/iot-routing-manager/src/instructions/temp_backfill_organization.rs index 3440c0390..69d46bb7b 100644 --- a/programs/iot-routing-manager/src/instructions/temp_backfill_organization.rs +++ b/programs/iot-routing-manager/src/instructions/temp_backfill_organization.rs @@ -1,24 +1,18 @@ -use crate::{net_id_seeds, routing_manager_seeds, state::*}; -use account_compression_cpi::{program::SplAccountCompression, Noop}; +use std::cmp::max; +use std::str::FromStr; + +use account_compression_cpi::{account_compression::program::SplAccountCompression, Noop}; use anchor_lang::prelude::*; -use anchor_lang::solana_program::hash::hash; use anchor_spl::token::{Mint, Token}; -use bubblegum_cpi::program::Bubblegum; -use bubblegum_cpi::TreeConfig; -use helium_entity_manager::program::HeliumEntityManager; +use bubblegum_cpi::bubblegum::{accounts::TreeConfig, program::Bubblegum}; use helium_entity_manager::{ - cpi::accounts::IssueProgramEntityV0, cpi::issue_program_entity_v0, ProgramApprovalV0, + constants::ENTITY_METADATA_URL, cpi::accounts::IssueProgramEntityV0, + cpi::issue_program_entity_v0, hash_entity_key, program::HeliumEntityManager, + IssueProgramEntityArgsV0, KeySerialization, ProgramApprovalV0, SharedMerkleV0, }; -use helium_entity_manager::{IssueProgramEntityArgsV0, KeySerialization, SharedMerkleV0}; use helium_sub_daos::{DaoV0, SubDaoV0}; -use std::cmp::max; -use std::str::FromStr; -#[cfg(feature = "devnet")] -pub const ENTITY_METADATA_URL: &str = "https://entities.nft.test-helium.com"; - -#[cfg(not(feature = "devnet"))] -pub const ENTITY_METADATA_URL: &str = "https://entities.nft.helium.io"; +use crate::{net_id_seeds, routing_manager_seeds, state::*}; #[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)] pub struct TempBackfillOrganizationArgs { @@ -96,7 +90,7 @@ pub struct TempBackfillOrganization<'info> { seeds = [ "key_to_asset".as_bytes(), dao.key().as_ref(), - &hash(format!("OUI_{}", args.oui).as_bytes()).to_bytes() + &hash_entity_key(format!("OUI_{}", args.oui).as_bytes()) ], seeds::program = helium_entity_manager_program.key(), bump @@ -157,7 +151,7 @@ pub fn handler( routing_manager: ctx.accounts.routing_manager.key(), authority: ctx.accounts.authority.key(), escrow_key: args.escrow_key_override, - bump_seed: ctx.bumps["organization"], + bump_seed: ctx.bumps.organization, net_id: ctx.accounts.net_id.key(), approved: false, }); diff --git a/programs/iot-routing-manager/src/instructions/temp_backfill_organization_delegate.rs b/programs/iot-routing-manager/src/instructions/temp_backfill_organization_delegate.rs index c79e9d3dd..d27c01f37 100644 --- a/programs/iot-routing-manager/src/instructions/temp_backfill_organization_delegate.rs +++ b/programs/iot-routing-manager/src/instructions/temp_backfill_organization_delegate.rs @@ -15,7 +15,7 @@ pub struct TempBackfillOrganizationDelegate<'info> { init, payer = payer, space = 8 + OrganizationDelegateV0::INIT_SPACE + 32, - seeds = [b"organization_delegate", organization.key().as_ref(), delegate.key().as_ref()], + seeds = ["organization_delegate".as_bytes(), organization.key().as_ref(), delegate.key().as_ref()], bump, )] pub organization_delegate: Account<'info, OrganizationDelegateV0>, @@ -31,7 +31,7 @@ pub fn handler(ctx: Context) -> Result<()> { .set_inner(OrganizationDelegateV0 { organization: ctx.accounts.organization.key(), delegate: ctx.accounts.delegate.key(), - bump_seed: ctx.bumps["organization_delegate"], + bump_seed: ctx.bumps.organization_delegate, }); Ok(()) } diff --git a/tests/iot-routing-manager.ts b/tests/iot-routing-manager.ts index f4d7f3e9c..1ca95c852 100644 --- a/tests/iot-routing-manager.ts +++ b/tests/iot-routing-manager.ts @@ -24,7 +24,6 @@ import { const { expect } = chai; import chaiAsPromised from "chai-as-promised"; import { HeliumEntityManager } from "../target/types/helium_entity_manager"; -import { IOT_PRICE_FEED } from "@helium/spl-utils"; chai.use(chaiAsPromised); @@ -106,7 +105,7 @@ describe("iot-routing-manager", () => { .approveProgramV0({ programId: irmProgram.programId, }) - .accounts({ dao }); + .accountsPartial({ dao }); programApproval = (await approve.pubkeys()).programApproval!; await approve.rpc({ skipPreflight: true }); @@ -126,7 +125,7 @@ describe("iot-routing-manager", () => { .preInstructions([ ComputeBudgetProgram.setComputeUnitLimit({ units: 500000 }), ]) - .accounts({ + .accountsPartial({ updateAuthority: me, netIdAuthority: me, dcMint: dcMint, @@ -157,7 +156,7 @@ describe("iot-routing-manager", () => { .preInstructions([ ComputeBudgetProgram.setComputeUnitLimit({ units: 500000 }), ]) - .accounts({ + .accountsPartial({ updateAuthority: me, netIdAuthority: me, subDao, @@ -174,7 +173,7 @@ describe("iot-routing-manager", () => { .initializeNetIdV0({ netId: 1, }) - .accounts({ + .accountsPartial({ authority: me, routingManager, }) @@ -194,7 +193,7 @@ describe("iot-routing-manager", () => { .initializeNetIdV0({ netId: 1, }) - .accounts({ + .accountsPartial({ authority: me, routingManager, }) @@ -210,7 +209,7 @@ describe("iot-routing-manager", () => { .preInstructions([ ComputeBudgetProgram.setComputeUnitLimit({ units: 500000 }), ]) - .accounts({ + .accountsPartial({ authority: me, netId, }) @@ -233,7 +232,7 @@ describe("iot-routing-manager", () => { .updateNetIdV0({ authority: PublicKey.default, }) - .accounts({ netId }) + .accountsPartial({ netId }) .rpc(); const netIdAcc = await irmProgram.account.netIdV0.fetch(netId); @@ -252,7 +251,7 @@ describe("iot-routing-manager", () => { .preInstructions([ ComputeBudgetProgram.setComputeUnitLimit({ units: 500000 }), ]) - .accounts({ + .accountsPartial({ authority: me, netId, }) @@ -262,7 +261,7 @@ describe("iot-routing-manager", () => { await irmProgram.methods .approveOrganizationV0() - .accounts({ + .accountsPartial({ organization, }) .rpc({ skipPreflight: true }); @@ -275,7 +274,7 @@ describe("iot-routing-manager", () => { .initializeDevaddrConstraintV0({ numBlocks: 2, }) - .accounts({ + .accountsPartial({ organization, }) .rpcAndKeys({ skipPreflight: true }); @@ -291,7 +290,7 @@ describe("iot-routing-manager", () => { .updateOrganizationV0({ authority: PublicKey.default, }) - .accounts({ organization }) + .accountsPartial({ organization }) .rpc(); const orgAcc = await irmProgram.account.netIdV0.fetch(netId); @@ -310,7 +309,7 @@ describe("iot-routing-manager", () => { devaddrFeeUsd: new anchor.BN(100_000000), ouiFeeUsd: new anchor.BN(100_000000), }) - .accounts({ + .accountsPartial({ routingManager, }) .rpc(); From b2c4e0ad2469ab83c76ec01129d057e4ab374169 Mon Sep 17 00:00:00 2001 From: bry Date: Mon, 24 Mar 2025 18:10:33 -0500 Subject: [PATCH 58/63] Add tests to workflow --- .github/workflows/tests.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 172f71762..e9942ffbc 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -151,6 +151,7 @@ jobs: - tests/voter-stake-registry.ts - tests/fanout.ts - tests/sus.ts + - tests/iot-routing-manager.ts steps: - uses: actions/checkout@v3 - uses: ./.github/actions/build-anchor/ @@ -169,4 +170,4 @@ jobs: env: TESTING: true TEST: ${{ matrix.test }} - ANCHOR_PROVIDER_URL: http://localhost:8899 \ No newline at end of file + ANCHOR_PROVIDER_URL: http://localhost:8899 From 19e2641551ebab9af95b7960eb2e5d5f0c25202d Mon Sep 17 00:00:00 2001 From: bry Date: Tue, 25 Mar 2025 19:59:26 -0500 Subject: [PATCH 59/63] Fix tests --- .../src/resolvers.ts | 6 +- .../iot-routing-manager-sdk/src/resolvers.ts | 27 ---- tests/iot-routing-manager.ts | 151 +++++++++++++----- tests/utils/fixtures.ts | 66 +++++--- 4 files changed, 159 insertions(+), 91 deletions(-) diff --git a/packages/helium-entity-manager-sdk/src/resolvers.ts b/packages/helium-entity-manager-sdk/src/resolvers.ts index 653346d0a..fc4029aeb 100644 --- a/packages/helium-entity-manager-sdk/src/resolvers.ts +++ b/packages/helium-entity-manager-sdk/src/resolvers.ts @@ -156,7 +156,11 @@ export const heliumEntityManagerResolvers = combineResolvers( } }), resolveIndividual(async ({ path, args }) => { - if (path[path.length - 1] === "sharedMerkle" && args[0].proofSize) { + if ( + path[path.length - 1] === "sharedMerkle" && + args[0] && + args[0].proofSize + ) { return sharedMerkleKey(args[0].proofSize)[0]; } }), diff --git a/packages/iot-routing-manager-sdk/src/resolvers.ts b/packages/iot-routing-manager-sdk/src/resolvers.ts index 1be363ddd..36d4bd065 100644 --- a/packages/iot-routing-manager-sdk/src/resolvers.ts +++ b/packages/iot-routing-manager-sdk/src/resolvers.ts @@ -14,7 +14,6 @@ import { programApprovalKey, sharedMerkleKey, } from "@helium/helium-entity-manager-sdk"; -import { fetchBackwardsCompatibleIdl } from "@helium/spl-utils"; export const iotRoutingManagerResolvers = combineResolvers( heliumCommonResolver, @@ -25,11 +24,6 @@ export const iotRoutingManagerResolvers = combineResolvers( mint: "collection", owner: "routingManager", }), - ataResolver({ - account: "payerIotAccount", - mint: "iotMint", - owner: "payer", - }), resolveIndividual(async ({ args, path, accounts, provider }) => { if ( args[0] && @@ -48,17 +42,6 @@ export const iotRoutingManagerResolvers = combineResolvers( accounts.routingManager as PublicKey, args[0].oui )[0]; - } else if ( - path[path.length - 1] === "devaddrConstraint" && - accounts.organization && - accounts.netId - ) { - return devaddrConstraintKey( - accounts.organization as PublicKey, - (args[0] && args[0].startAddr) ?? - (await getNetId(provider, accounts.netId as PublicKey)) - .currentAddrOffset - )[0]; } else if (path[path.length - 1] == "programApproval" && accounts.dao) { return programApprovalKey(accounts.dao as PublicKey, PROGRAM_ID)[0]; } else if ( @@ -78,13 +61,3 @@ export const iotRoutingManagerResolvers = combineResolvers( } }) ); - -async function getNetId(provider: Provider, netId: PublicKey) { - const idl = await fetchBackwardsCompatibleIdl(PROGRAM_ID, provider); - const netIdAccount = await provider.connection.getAccountInfo(netId); - if (!netIdAccount) { - throw new Error("NetId account not found"); - } - const coder = new BorshAccountsCoder(idl!); - return coder.decode("NetIdV0", netIdAccount.data); -} diff --git a/tests/iot-routing-manager.ts b/tests/iot-routing-manager.ts index 1ca95c852..8bc76aa64 100644 --- a/tests/iot-routing-manager.ts +++ b/tests/iot-routing-manager.ts @@ -4,19 +4,23 @@ import { init as initDataCredits } from "@helium/data-credits-sdk"; import { init as initHeliumSubDaos } from "@helium/helium-sub-daos-sdk"; import { PublicKey, ComputeBudgetProgram } from "@solana/web3.js"; import chai from "chai"; -import { init as initIotRoutingManager } from "../packages/iot-routing-manager-sdk/src"; -import { init as initHeliumEntityManager } from "../packages/helium-entity-manager-sdk/src"; -import { init as initVsr } from "../packages/voter-stake-registry-sdk/src"; +import { + devaddrConstraintKey, + init as initIotRoutingManager, + organizationKey, +} from "../packages/iot-routing-manager-sdk/src"; +import { + init as initHeliumEntityManager, + keyToAssetKey, +} from "../packages/helium-entity-manager-sdk/src"; import { DataCredits } from "../target/types/data_credits"; import { HeliumSubDaos } from "../target/types/helium_sub_daos"; import { IotRoutingManager } from "../target/types/iot_routing_manager"; -import { VoterStakeRegistry } from "../target/types/voter_stake_registry"; import { initTestDao, initTestSubdao } from "./utils/daos"; import { ensureIrmIdl, ensureDCIdl, ensureHSDIdl, - ensureVSRIdl, initTestDataCredits, initSharedMerkle, ensureHEMIdl, @@ -34,15 +38,14 @@ describe("iot-routing-manager", () => { let hsdProgram: Program; let hemProgram: Program; let irmProgram: Program; - let vsrProgram: Program; const provider = anchor.getProvider() as anchor.AnchorProvider; const me = provider.wallet.publicKey; let dao: PublicKey; let subDao: PublicKey; - let iotMint: PublicKey | undefined; let dcMint: PublicKey; - let programApproval: PublicKey; + let merkle: PublicKey; + let sharedMerkle: PublicKey; beforeEach(async () => { dcProgram = await initDataCredits( @@ -74,31 +77,34 @@ describe("iot-routing-manager", () => { anchor.workspace.IotRoutingManager.idl ); ensureIrmIdl(irmProgram); - - vsrProgram = await initVsr( - provider, - anchor.workspace.VoterStakeRegistry.programId, - anchor.workspace.VoterStakeRegistry.idl - ); - ensureVSRIdl(vsrProgram); - const dataCredits = await initTestDataCredits(dcProgram, provider); + const hntMint = dataCredits.hntMint; dcMint = dataCredits.dcMint; + await dcProgram.methods + .mintDataCreditsV0({ + dcAmount: new anchor.BN("10000000000"), + hntAmount: null, + }) + .accountsPartial({ + dcMint, + recipient: me, + }) + .rpc({ skipPreflight: true }); + ({ dao } = await initTestDao( hsdProgram, provider, 100, me, - dataCredits.dcMint + dataCredits.dcMint, + hntMint )); - ({ subDao, mint: iotMint } = await initTestSubdao({ + ({ subDao } = await initTestSubdao({ hsdProgram, - vsrProgram, provider, authority: me, dao, - numTokens: new anchor.BN("500000000000000"), })); const approve = await hemProgram.methods @@ -107,10 +113,8 @@ describe("iot-routing-manager", () => { }) .accountsPartial({ dao }); - programApproval = (await approve.pubkeys()).programApproval!; await approve.rpc({ skipPreflight: true }); - - await initSharedMerkle(hemProgram); + ({ merkle, sharedMerkle } = await initSharedMerkle(hemProgram)); }); it("should initialize a routing manager", async () => { @@ -159,6 +163,7 @@ describe("iot-routing-manager", () => { .accountsPartial({ updateAuthority: me, netIdAuthority: me, + dcMint: dcMint, subDao, dao, }) @@ -202,9 +207,21 @@ describe("iot-routing-manager", () => { }); it("should initialize an organization", async () => { - const { - pubkeys: { organization }, - } = await irmProgram.methods + let routingManagerAcc = + await irmProgram.account.iotRoutingManagerV0.fetch(routingManager); + let nextOuiId = routingManagerAcc.nextOuiId; + + const [organization] = organizationKey( + routingManager, + routingManagerAcc.nextOuiId + ); + + const [keyToAsset] = keyToAssetKey( + dao, + Buffer.from(`OUI_${nextOuiId.toNumber()}`, "utf-8") + ); + + await irmProgram.methods .initializeOrganizationV0() .preInstructions([ ComputeBudgetProgram.setComputeUnitLimit({ units: 500000 }), @@ -212,12 +229,22 @@ describe("iot-routing-manager", () => { .accountsPartial({ authority: me, netId, + dao, + merkleTree: merkle, + sharedMerkle, + organization, + keyToAsset, }) - .rpcAndKeys({ skipPreflight: true }); + .rpc({ skipPreflight: true }); const organizationAcc = await irmProgram.account.organizationV0.fetch( organization! ); + + routingManagerAcc = await irmProgram.account.iotRoutingManagerV0.fetch( + routingManager + ); + expect(organizationAcc.authority.toBase58()).to.eq(me.toBase58()); expect(organizationAcc.oui.toNumber()).to.eq(1); expect(organizationAcc.escrowKey.toString()).to.eq("OUI_1"); @@ -225,6 +252,9 @@ describe("iot-routing-manager", () => { expect(organizationAcc.routingManager.toBase58()).to.eq( routingManager.toBase58() ); + expect(routingManagerAcc.nextOuiId.toNumber()).to.eq( + nextOuiId.addn(1).toNumber() + ); }); it("should update the net id", async () => { @@ -244,9 +274,23 @@ describe("iot-routing-manager", () => { describe("with an organization", () => { let organization: PublicKey; beforeEach(async () => { - const { - pubkeys: { organization: organizationK }, - } = await irmProgram.methods + const routingManagerAcc = + await irmProgram.account.iotRoutingManagerV0.fetch(routingManager); + + organization = organizationKey( + routingManager, + routingManagerAcc.nextOuiId + )[0]; + + const [keyToAsset] = keyToAssetKey( + dao, + Buffer.from( + `OUI_${routingManagerAcc.nextOuiId.toNumber()}`, + "utf-8" + ) + ); + + await irmProgram.methods .initializeOrganizationV0() .preInstructions([ ComputeBudgetProgram.setComputeUnitLimit({ units: 500000 }), @@ -254,10 +298,13 @@ describe("iot-routing-manager", () => { .accountsPartial({ authority: me, netId, + dao, + merkleTree: merkle, + sharedMerkle, + organization, + keyToAsset, }) - .rpcAndKeys({ skipPreflight: true }); - - organization = organizationK!; + .rpc({ skipPreflight: true }); await irmProgram.methods .approveOrganizationV0() @@ -268,21 +315,36 @@ describe("iot-routing-manager", () => { }); it("should initialize a devaddr constraint", async () => { - const { - pubkeys: { devaddrConstraint }, - } = await irmProgram.methods + let netIdAcc = await irmProgram.account.netIdV0.fetch(netId); + let currAddrOffset = netIdAcc.currentAddrOffset; + + const [devaddrConstraint] = devaddrConstraintKey( + organization, + currAddrOffset + ); + + await irmProgram.methods .initializeDevaddrConstraintV0({ numBlocks: 2, }) .accountsPartial({ organization, + devaddrConstraint, + netId, + routingManager, }) - .rpcAndKeys({ skipPreflight: true }); - const devaddr = await irmProgram.account.devaddrConstraintV0.fetch( + .rpc({ skipPreflight: true }); + + const devaddrAcc = await irmProgram.account.devaddrConstraintV0.fetch( devaddrConstraint! ); - expect(devaddr.startAddr.toNumber()).to.eq(0); - expect(devaddr.endAddr.toNumber()).to.eq(16); + + netIdAcc = await irmProgram.account.netIdV0.fetch(netId); + expect(devaddrAcc.startAddr.toNumber()).to.eq(0); + expect(devaddrAcc.endAddr.toNumber()).to.eq(16); + expect(netIdAcc.currentAddrOffset.toNumber()).to.eq( + currAddrOffset.addn(16 + 1).toNumber() // 1 is added on avoid overlap + ); }); it("should update the organization", async () => { @@ -293,7 +355,9 @@ describe("iot-routing-manager", () => { .accountsPartial({ organization }) .rpc(); - const orgAcc = await irmProgram.account.netIdV0.fetch(netId); + const orgAcc = await irmProgram.account.organizationV0.fetch( + organization + ); expect(orgAcc.authority.toBase58()).to.eq( PublicKey.default.toBase58() ); @@ -316,10 +380,11 @@ describe("iot-routing-manager", () => { const routingManagerAcc = await irmProgram.account.iotRoutingManagerV0.fetch(routingManager); - expect(routingManagerAcc.updateAuthority.toBase58).to.eq( + + expect(routingManagerAcc.updateAuthority.toBase58()).to.eq( PublicKey.default.toBase58() ); - expect(routingManagerAcc.netIdAuthority.toBase58).to.eq( + expect(routingManagerAcc.netIdAuthority.toBase58()).to.eq( PublicKey.default.toBase58() ); expect(routingManagerAcc.devaddrFeeUsd.toNumber()).to.eq( diff --git a/tests/utils/fixtures.ts b/tests/utils/fixtures.ts index 591ae873e..9ea839c36 100644 --- a/tests/utils/fixtures.ts +++ b/tests/utils/fixtures.ts @@ -13,7 +13,12 @@ import { SPL_ACCOUNT_COMPRESSION_PROGRAM_ID, getConcurrentMerkleTreeAccountSize, } from "@solana/spl-account-compression"; -import { Keypair, PublicKey, SystemProgram } from "@solana/web3.js"; +import { + Keypair, + PublicKey, + SystemProgram, + ComputeBudgetProgram, +} from "@solana/web3.js"; import { execSync } from "child_process"; import { ThresholdType } from "../../packages/circuit-breaker-sdk/src"; import { @@ -121,37 +126,58 @@ export const initTestRewardableEntityConfig = async ( export const initSharedMerkle = async ( program: Program -) => { +): Promise<{ + merkle: PublicKey; + sharedMerkle: PublicKey; +}> => { const sharedMerkle = sharedMerkleKey(3)[0]; - const exists = !!(await program.provider.connection.getAccountInfo( + const accountInfo = await program.provider.connection.getAccountInfo( sharedMerkle - )); + ); + const exists = !!accountInfo; + if (exists) { - return sharedMerkle; + try { + const acc = await program.account.sharedMerkleV0.fetch(sharedMerkle); + return { merkle: acc.merkleTree, sharedMerkle }; + } catch (error) { + throw error; + } } + const merkle = Keypair.generate(); const space = getConcurrentMerkleTreeAccountSize(20, 64, 17); + const lamports = await ( + program.provider as anchor.AnchorProvider + ).connection.getMinimumBalanceForRentExemption(space); + const createMerkle = SystemProgram.createAccount({ fromPubkey: (program.provider as anchor.AnchorProvider).wallet.publicKey, newAccountPubkey: merkle.publicKey, - lamports: await ( - program.provider as anchor.AnchorProvider - ).connection.getMinimumBalanceForRentExemption(space), - space: space, + lamports, + space, programId: SPL_ACCOUNT_COMPRESSION_PROGRAM_ID, }); - await program.methods - .initializeSharedMerkleV0({ - proofSize: 3, - }) - .preInstructions([createMerkle]) - .signers([merkle]) - .accountsPartial({ - merkleTree: merkle.publicKey, - }) - .rpc({ skipPreflight: true }); - return sharedMerkle; + try { + await program.methods + .initializeSharedMerkleV0({ + proofSize: 3, + }) + .preInstructions([ + ComputeBudgetProgram.setComputeUnitLimit({ units: 500000 }), + createMerkle, + ]) + .signers([merkle]) + .accountsPartial({ + merkleTree: merkle.publicKey, + }) + .rpc({ skipPreflight: true }); + } catch (error) { + throw error; + } + + return { merkle: merkle.publicKey, sharedMerkle }; }; export const initTestMaker = async ( From 399d2401c51d969092e6d3704ea8696478fb98f2 Mon Sep 17 00:00:00 2001 From: bry Date: Wed, 26 Mar 2025 09:47:33 -0500 Subject: [PATCH 60/63] Add delegate test --- tests/iot-routing-manager.ts | 325 ++++++++++++++++++----------------- 1 file changed, 170 insertions(+), 155 deletions(-) diff --git a/tests/iot-routing-manager.ts b/tests/iot-routing-manager.ts index 8bc76aa64..ad60040ed 100644 --- a/tests/iot-routing-manager.ts +++ b/tests/iot-routing-manager.ts @@ -28,10 +28,17 @@ import { const { expect } = chai; import chaiAsPromised from "chai-as-promised"; import { HeliumEntityManager } from "../target/types/helium_entity_manager"; +import { Keypair } from "@solana/web3.js"; chai.use(chaiAsPromised); describe("iot-routing-manager", () => { + const TEST_URL = "https://some/url"; + const DEFAULT_COMPUTE_UNITS = 500000; + const DEFAULT_FEE_USD = new anchor.BN(100_000000); + const DEFAULT_DC_AMOUNT = new anchor.BN("10000000000"); + const DEFAULT_NET_ID = 1; + anchor.setProvider(anchor.AnchorProvider.local("http://127.0.0.1:8899")); let dcProgram: Program; @@ -47,13 +54,12 @@ describe("iot-routing-manager", () => { let merkle: PublicKey; let sharedMerkle: PublicKey; - beforeEach(async () => { + const initializePrograms = async () => { dcProgram = await initDataCredits( provider, anchor.workspace.DataCredits.programId, anchor.workspace.DataCredits.idl ); - ensureDCIdl(dcProgram); hsdProgram = await initHeliumSubDaos( @@ -61,7 +67,6 @@ describe("iot-routing-manager", () => { anchor.workspace.HeliumSubDaos.programId, anchor.workspace.HeliumSubDaos.idl ); - ensureHSDIdl(hsdProgram); hemProgram = await initHeliumEntityManager( @@ -77,12 +82,16 @@ describe("iot-routing-manager", () => { anchor.workspace.IotRoutingManager.idl ); ensureIrmIdl(irmProgram); + }; + + const setupDataCredits = async () => { const dataCredits = await initTestDataCredits(dcProgram, provider); const hntMint = dataCredits.hntMint; dcMint = dataCredits.dcMint; + await dcProgram.methods .mintDataCreditsV0({ - dcAmount: new anchor.BN("10000000000"), + dcAmount: DEFAULT_DC_AMOUNT, hntAmount: null, }) .accountsPartial({ @@ -91,12 +100,16 @@ describe("iot-routing-manager", () => { }) .rpc({ skipPreflight: true }); + return { hntMint }; + }; + + const setupDaoStructure = async (hntMint: PublicKey) => { ({ dao } = await initTestDao( hsdProgram, provider, 100, me, - dataCredits.dcMint, + dcMint, hntMint )); @@ -106,28 +119,21 @@ describe("iot-routing-manager", () => { authority: me, dao, })); + }; - const approve = await hemProgram.methods - .approveProgramV0({ - programId: irmProgram.programId, - }) - .accountsPartial({ dao }); - - await approve.rpc({ skipPreflight: true }); - ({ merkle, sharedMerkle } = await initSharedMerkle(hemProgram)); - }); - - it("should initialize a routing manager", async () => { + const initializeRoutingManager = async () => { const { pubkeys: { routingManager }, } = await irmProgram.methods .initializeRoutingManagerV0({ - metadataUrl: "https://some/url", - devaddrFeeUsd: new anchor.BN(100_000000), - ouiFeeUsd: new anchor.BN(100_000000), + metadataUrl: TEST_URL, + devaddrFeeUsd: DEFAULT_FEE_USD, + ouiFeeUsd: DEFAULT_FEE_USD, }) .preInstructions([ - ComputeBudgetProgram.setComputeUnitLimit({ units: 500000 }), + ComputeBudgetProgram.setComputeUnitLimit({ + units: DEFAULT_COMPUTE_UNITS, + }), ]) .accountsPartial({ updateAuthority: me, @@ -138,72 +144,136 @@ describe("iot-routing-manager", () => { }) .rpcAndKeys({ skipPreflight: true }); + return routingManager!; + }; + + const initializeNetId = async ( + routingManager: PublicKey, + id = DEFAULT_NET_ID + ) => { + const { + pubkeys: { netId }, + } = await irmProgram.methods + .initializeNetIdV0({ + netId: id, + }) + .accountsPartial({ + authority: me, + routingManager, + }) + .rpcAndKeys({ skipPreflight: true }); + + return netId!; + }; + + const initializeOrganization = async ( + routingManager: PublicKey, + netId: PublicKey + ) => { + const routingManagerAcc = + await irmProgram.account.iotRoutingManagerV0.fetch(routingManager); + const nextOuiId = routingManagerAcc.nextOuiId; + const [organization] = organizationKey(routingManager, nextOuiId); + const [keyToAsset] = keyToAssetKey( + dao, + Buffer.from(`OUI_${nextOuiId.toNumber()}`, "utf-8") + ); + + await irmProgram.methods + .initializeOrganizationV0() + .preInstructions([ + ComputeBudgetProgram.setComputeUnitLimit({ + units: DEFAULT_COMPUTE_UNITS, + }), + ]) + .accountsPartial({ + authority: me, + netId, + dao, + merkleTree: merkle, + sharedMerkle, + organization, + keyToAsset, + }) + .rpc({ skipPreflight: true }); + + return organization; + }; + + beforeEach(async () => { + await initializePrograms(); + const { hntMint } = await setupDataCredits(); + await setupDaoStructure(hntMint); + const approve = await hemProgram.methods + .approveProgramV0({ + programId: irmProgram.programId, + }) + .accountsPartial({ dao }); + + await approve.rpc({ skipPreflight: true }); + ({ merkle, sharedMerkle } = await initSharedMerkle(hemProgram)); + }); + + it("should initialize a routing manager", async () => { + const routingManager = await initializeRoutingManager(); const routingManagerAcc = - await irmProgram.account.iotRoutingManagerV0.fetch(routingManager!); + await irmProgram.account.iotRoutingManagerV0.fetch(routingManager); expect(routingManagerAcc.updateAuthority.toBase58()).to.eq(me.toBase58()); expect(routingManagerAcc.netIdAuthority.toBase58()).to.eq(me.toBase58()); }); + it("should update the routing manager", async () => { + const routingManager = await initializeRoutingManager(); + await irmProgram.methods + .updateRoutingManagerV0({ + updateAuthority: PublicKey.default, + netIdAuthority: PublicKey.default, + devaddrFeeUsd: DEFAULT_FEE_USD, + ouiFeeUsd: DEFAULT_FEE_USD, + }) + .accountsPartial({ + routingManager, + }) + .rpc(); + + const routingManagerAcc = + await irmProgram.account.iotRoutingManagerV0.fetch(routingManager); + + expect(routingManagerAcc.updateAuthority.toBase58()).to.eq( + PublicKey.default.toBase58() + ); + expect(routingManagerAcc.netIdAuthority.toBase58()).to.eq( + PublicKey.default.toBase58() + ); + expect(routingManagerAcc.devaddrFeeUsd.toNumber()).to.eq( + DEFAULT_FEE_USD.toNumber() + ); + expect(routingManagerAcc.ouiFeeUsd.toNumber()).to.eq( + DEFAULT_FEE_USD.toNumber() + ); + }); + describe("with a routing manager", async () => { let routingManager: PublicKey; beforeEach(async () => { - const { - pubkeys: { routingManager: routingManagerK }, - } = await irmProgram.methods - .initializeRoutingManagerV0({ - metadataUrl: "https://some/url", - devaddrFeeUsd: new anchor.BN(100_000000), - ouiFeeUsd: new anchor.BN(100_000000), - }) - .preInstructions([ - ComputeBudgetProgram.setComputeUnitLimit({ units: 500000 }), - ]) - .accountsPartial({ - updateAuthority: me, - netIdAuthority: me, - dcMint: dcMint, - subDao, - dao, - }) - .rpcAndKeys({ skipPreflight: true }); - routingManager = routingManagerK!; + routingManager = await initializeRoutingManager(); }); it("should initialize a net id", async () => { - const { - pubkeys: { netId }, - } = await irmProgram.methods - .initializeNetIdV0({ - netId: 1, - }) - .accountsPartial({ - authority: me, - routingManager, - }) - .rpcAndKeys({ skipPreflight: true }); + const netId = await initializeNetId(routingManager); + const netIdAcc = await irmProgram.account.netIdV0.fetch(netId); - const netIdAcc = await irmProgram.account.netIdV0.fetch(netId!); expect(netIdAcc.authority.toBase58()).to.eq(me.toBase58()); - expect(netIdAcc.id).to.eq(1); + expect(netIdAcc.id).to.eq(DEFAULT_NET_ID); }); describe("with net id", async () => { let netId: PublicKey; + beforeEach(async () => { - const { - pubkeys: { netId: netIdK }, - } = await irmProgram.methods - .initializeNetIdV0({ - netId: 1, - }) - .accountsPartial({ - authority: me, - routingManager, - }) - .rpcAndKeys({ skipPreflight: true }); - netId = netIdK!; + netId = await initializeNetId(routingManager); }); it("should initialize an organization", async () => { @@ -211,34 +281,12 @@ describe("iot-routing-manager", () => { await irmProgram.account.iotRoutingManagerV0.fetch(routingManager); let nextOuiId = routingManagerAcc.nextOuiId; - const [organization] = organizationKey( + const organization = await initializeOrganization( routingManager, - routingManagerAcc.nextOuiId - ); - - const [keyToAsset] = keyToAssetKey( - dao, - Buffer.from(`OUI_${nextOuiId.toNumber()}`, "utf-8") + netId ); - - await irmProgram.methods - .initializeOrganizationV0() - .preInstructions([ - ComputeBudgetProgram.setComputeUnitLimit({ units: 500000 }), - ]) - .accountsPartial({ - authority: me, - netId, - dao, - merkleTree: merkle, - sharedMerkle, - organization, - keyToAsset, - }) - .rpc({ skipPreflight: true }); - const organizationAcc = await irmProgram.account.organizationV0.fetch( - organization! + organization ); routingManagerAcc = await irmProgram.account.iotRoutingManagerV0.fetch( @@ -273,38 +321,9 @@ describe("iot-routing-manager", () => { describe("with an organization", () => { let organization: PublicKey; - beforeEach(async () => { - const routingManagerAcc = - await irmProgram.account.iotRoutingManagerV0.fetch(routingManager); - - organization = organizationKey( - routingManager, - routingManagerAcc.nextOuiId - )[0]; - - const [keyToAsset] = keyToAssetKey( - dao, - Buffer.from( - `OUI_${routingManagerAcc.nextOuiId.toNumber()}`, - "utf-8" - ) - ); - await irmProgram.methods - .initializeOrganizationV0() - .preInstructions([ - ComputeBudgetProgram.setComputeUnitLimit({ units: 500000 }), - ]) - .accountsPartial({ - authority: me, - netId, - dao, - merkleTree: merkle, - sharedMerkle, - organization, - keyToAsset, - }) - .rpc({ skipPreflight: true }); + beforeEach(async () => { + organization = await initializeOrganization(routingManager, netId); await irmProgram.methods .approveOrganizationV0() @@ -336,14 +355,40 @@ describe("iot-routing-manager", () => { .rpc({ skipPreflight: true }); const devaddrAcc = await irmProgram.account.devaddrConstraintV0.fetch( - devaddrConstraint! + devaddrConstraint ); - netIdAcc = await irmProgram.account.netIdV0.fetch(netId); + expect(devaddrAcc.startAddr.toNumber()).to.eq(0); expect(devaddrAcc.endAddr.toNumber()).to.eq(16); expect(netIdAcc.currentAddrOffset.toNumber()).to.eq( - currAddrOffset.addn(16 + 1).toNumber() // 1 is added on avoid overlap + currAddrOffset.addn(16 + 1).toNumber() // 1 is added to avoid overlap + ); + }); + + it("should initialize a delegate", async () => { + const delegate = Keypair.generate(); + + const { + pubkeys: { organizationDelegate }, + } = await irmProgram.methods + .initializeOrganizationDelegateV0() + .accountsPartial({ + organization, + delegate: delegate.publicKey, + }) + .rpcAndKeys({ skipPreflight: true }); + + const delegateAcc = + await irmProgram.account.organizationDelegateV0.fetch( + organizationDelegate + ); + + expect(delegateAcc.delegate.toBase58()).to.eq( + delegate.publicKey.toBase58() + ); + expect(delegateAcc.organization.toBase58()).to.eq( + organization.toBase58() ); }); @@ -364,35 +409,5 @@ describe("iot-routing-manager", () => { }); }); }); - - it("should update the routing manager", async () => { - await irmProgram.methods - .updateRoutingManagerV0({ - updateAuthority: PublicKey.default, - netIdAuthority: PublicKey.default, - devaddrFeeUsd: new anchor.BN(100_000000), - ouiFeeUsd: new anchor.BN(100_000000), - }) - .accountsPartial({ - routingManager, - }) - .rpc(); - - const routingManagerAcc = - await irmProgram.account.iotRoutingManagerV0.fetch(routingManager); - - expect(routingManagerAcc.updateAuthority.toBase58()).to.eq( - PublicKey.default.toBase58() - ); - expect(routingManagerAcc.netIdAuthority.toBase58()).to.eq( - PublicKey.default.toBase58() - ); - expect(routingManagerAcc.devaddrFeeUsd.toNumber()).to.eq( - new anchor.BN(100_000000).toNumber() - ); - expect(routingManagerAcc.ouiFeeUsd.toNumber()).to.eq( - new anchor.BN(100_000000).toNumber() - ); - }); }); }); From 0a2b5e6913e70467b72964c9f1c97724ba3e1c08 Mon Sep 17 00:00:00 2001 From: bry Date: Thu, 1 May 2025 12:56:23 -0500 Subject: [PATCH 61/63] merged dev in and built --- .../iot-routing-manager-sdk/yarn.deploy.lock | 68 +++++++++---------- yarn.lock | 5 +- 2 files changed, 36 insertions(+), 37 deletions(-) diff --git a/packages/iot-routing-manager-sdk/yarn.deploy.lock b/packages/iot-routing-manager-sdk/yarn.deploy.lock index 354a624e6..d0780fa04 100644 --- a/packages/iot-routing-manager-sdk/yarn.deploy.lock +++ b/packages/iot-routing-manager-sdk/yarn.deploy.lock @@ -107,7 +107,7 @@ __metadata: languageName: node linkType: hard -"@helium/account-fetch-cache@^0.10.3": +"@helium/account-fetch-cache@^0.10.11": version: 0.0.0-use.local resolution: "@helium/account-fetch-cache@workspace:packages/account-fetch-cache" dependencies: @@ -129,7 +129,7 @@ __metadata: languageName: node linkType: hard -"@helium/anchor-resolvers@^0.10.0-alpha.6, @helium/anchor-resolvers@^0.10.2, @helium/anchor-resolvers@^0.10.3": +"@helium/anchor-resolvers@^0.10.0-alpha.6, @helium/anchor-resolvers@^0.10.11, @helium/anchor-resolvers@^0.10.2": version: 0.0.0-use.local resolution: "@helium/anchor-resolvers@workspace:packages/anchor-resolvers" dependencies: @@ -143,14 +143,14 @@ __metadata: languageName: unknown linkType: soft -"@helium/circuit-breaker-sdk@^0.10.3": +"@helium/circuit-breaker-sdk@^0.10.11": version: 0.0.0-use.local resolution: "@helium/circuit-breaker-sdk@workspace:packages/circuit-breaker-sdk" dependencies: "@coral-xyz/anchor": ^0.31.0 - "@helium/anchor-resolvers": ^0.10.3 - "@helium/idls": ^0.10.3 - "@helium/spl-utils": ^0.10.3 + "@helium/anchor-resolvers": ^0.10.11 + "@helium/idls": ^0.10.11 + "@helium/spl-utils": ^0.10.11 bn.js: ^5.2.0 bs58: ^4.0.1 git-format-staged: ^2.1.3 @@ -166,11 +166,11 @@ __metadata: dependencies: "@coral-xyz/anchor": ^0.31.0 "@helium/address": ^4.12.0 - "@helium/anchor-resolvers": ^0.10.3 - "@helium/helium-sub-daos-sdk": ^0.10.3 - "@helium/idls": ^0.10.3 - "@helium/no-emit-sdk": ^0.10.3 - "@helium/spl-utils": ^0.10.3 + "@helium/anchor-resolvers": ^0.10.11 + "@helium/helium-sub-daos-sdk": ^0.10.11 + "@helium/idls": ^0.10.11 + "@helium/no-emit-sdk": ^0.10.11 + "@helium/spl-utils": ^0.10.11 "@types/crypto-js": ^4.1.1 bn.js: ^5.2.0 bs58: ^4.0.1 @@ -183,17 +183,17 @@ __metadata: languageName: unknown linkType: soft -"@helium/helium-sub-daos-sdk@^0.10.3": +"@helium/helium-sub-daos-sdk@^0.10.11": version: 0.0.0-use.local resolution: "@helium/helium-sub-daos-sdk@workspace:packages/helium-sub-daos-sdk" dependencies: "@coral-xyz/anchor": ^0.31.0 - "@helium/anchor-resolvers": ^0.10.3 - "@helium/circuit-breaker-sdk": ^0.10.3 + "@helium/anchor-resolvers": ^0.10.11 + "@helium/circuit-breaker-sdk": ^0.10.11 "@helium/nft-proxy-sdk": ^0.1.5-alpha.0 - "@helium/spl-utils": ^0.10.3 - "@helium/treasury-management-sdk": ^0.10.3 - "@helium/voter-stake-registry-sdk": ^0.10.3 + "@helium/spl-utils": ^0.10.11 + "@helium/treasury-management-sdk": ^0.10.11 + "@helium/voter-stake-registry-sdk": ^0.10.11 bn.js: ^5.2.0 bs58: ^4.0.1 git-format-staged: ^2.1.3 @@ -203,7 +203,7 @@ __metadata: languageName: unknown linkType: soft -"@helium/idls@^0.10.3": +"@helium/idls@^0.10.11": version: 0.0.0-use.local resolution: "@helium/idls@workspace:packages/idls" dependencies: @@ -256,14 +256,14 @@ __metadata: languageName: node linkType: hard -"@helium/no-emit-sdk@^0.10.3": +"@helium/no-emit-sdk@^0.10.11": version: 0.0.0-use.local resolution: "@helium/no-emit-sdk@workspace:packages/no-emit-sdk" dependencies: "@coral-xyz/anchor": ^0.31.0 - "@helium/anchor-resolvers": ^0.10.3 - "@helium/idls": ^0.10.3 - "@helium/spl-utils": ^0.10.3 + "@helium/anchor-resolvers": ^0.10.11 + "@helium/idls": ^0.10.11 + "@helium/spl-utils": ^0.10.11 bn.js: ^5.2.0 bs58: ^4.0.1 git-format-staged: ^2.1.3 @@ -273,14 +273,14 @@ __metadata: languageName: unknown linkType: soft -"@helium/spl-utils@^0.10.3": +"@helium/spl-utils@^0.10.11": version: 0.0.0-use.local resolution: "@helium/spl-utils@workspace:packages/spl-utils" dependencies: "@coral-xyz/anchor": ^0.31.0 - "@helium/account-fetch-cache": ^0.10.3 + "@helium/account-fetch-cache": ^0.10.11 "@helium/address": ^4.12.0 - "@helium/anchor-resolvers": ^0.10.3 + "@helium/anchor-resolvers": ^0.10.11 "@metaplex-foundation/mpl-token-metadata": ^2.10.0 "@solana/spl-account-compression": ^0.1.7 "@solana/spl-token": ^0.3.8 @@ -295,15 +295,15 @@ __metadata: languageName: unknown linkType: soft -"@helium/treasury-management-sdk@^0.10.3": +"@helium/treasury-management-sdk@^0.10.11": version: 0.0.0-use.local resolution: "@helium/treasury-management-sdk@workspace:packages/treasury-management-sdk" dependencies: "@coral-xyz/anchor": ^0.31.0 - "@helium/anchor-resolvers": ^0.10.3 - "@helium/circuit-breaker-sdk": ^0.10.3 - "@helium/idls": ^0.10.3 - "@helium/spl-utils": ^0.10.3 + "@helium/anchor-resolvers": ^0.10.11 + "@helium/circuit-breaker-sdk": ^0.10.11 + "@helium/idls": ^0.10.11 + "@helium/spl-utils": ^0.10.11 bn.js: ^5.2.0 bs58: ^4.0.1 git-format-staged: ^2.1.3 @@ -313,15 +313,15 @@ __metadata: languageName: unknown linkType: soft -"@helium/voter-stake-registry-sdk@^0.10.3": +"@helium/voter-stake-registry-sdk@^0.10.11": version: 0.0.0-use.local resolution: "@helium/voter-stake-registry-sdk@workspace:packages/voter-stake-registry-sdk" dependencies: "@coral-xyz/anchor": ^0.31.0 - "@helium/anchor-resolvers": ^0.10.3 - "@helium/idls": ^0.10.3 + "@helium/anchor-resolvers": ^0.10.11 + "@helium/idls": ^0.10.11 "@helium/nft-proxy-sdk": ^0.1.5-alpha.0 - "@helium/spl-utils": ^0.10.3 + "@helium/spl-utils": ^0.10.11 "@metaplex-foundation/mpl-token-metadata": ^2.10.0 "@solana/spl-token": ^0.3.8 bn.js: ^5.2.0 diff --git a/yarn.lock b/yarn.lock index 7697a1f65..9030b1dd1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -813,7 +813,7 @@ __metadata: languageName: node linkType: hard -"@helium/anchor-resolvers@^0.10.0-alpha.4, @helium/anchor-resolvers@^0.10.0-alpha.6, @helium/anchor-resolvers@^0.10.11, @helium/anchor-resolvers@workspace:packages/anchor-resolvers": +"@helium/anchor-resolvers@^0.10.0-alpha.4, @helium/anchor-resolvers@^0.10.0-alpha.6, @helium/anchor-resolvers@^0.10.11, @helium/anchor-resolvers@^0.10.2, @helium/anchor-resolvers@workspace:packages/anchor-resolvers": version: 0.0.0-use.local resolution: "@helium/anchor-resolvers@workspace:packages/anchor-resolvers" dependencies: @@ -1165,7 +1165,7 @@ __metadata: languageName: unknown linkType: soft -"@helium/helium-entity-manager-sdk@^0.10.11, @helium/helium-entity-manager-sdk@workspace:packages/helium-entity-manager-sdk": +"@helium/helium-entity-manager-sdk@^0.10.11, @helium/helium-entity-manager-sdk@^0.10.2, @helium/helium-entity-manager-sdk@workspace:packages/helium-entity-manager-sdk": version: 0.0.0-use.local resolution: "@helium/helium-entity-manager-sdk@workspace:packages/helium-entity-manager-sdk" dependencies: @@ -1357,7 +1357,6 @@ __metadata: languageName: unknown linkType: soft -"@helium/lazy-distributor-sdk@^0.10.3, @helium/lazy-distributor-sdk@workspace:packages/lazy-distributor-sdk": "@helium/lazy-distributor-sdk@^0.10.11, @helium/lazy-distributor-sdk@workspace:packages/lazy-distributor-sdk": version: 0.0.0-use.local resolution: "@helium/lazy-distributor-sdk@workspace:packages/lazy-distributor-sdk" From fa034d4ade1be302f47cb7ce3aba6dbb0395b45c Mon Sep 17 00:00:00 2001 From: bry Date: Thu, 15 May 2025 13:33:36 -0500 Subject: [PATCH 62/63] built --- packages/docsite/src/data/navigation.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/packages/docsite/src/data/navigation.js b/packages/docsite/src/data/navigation.js index a3c0c810e..0c6824a9f 100644 --- a/packages/docsite/src/data/navigation.js +++ b/packages/docsite/src/data/navigation.js @@ -94,8 +94,6 @@ export const navigation = [ href: "/docs/api/treasury-management-sdk", }, - { title: "Sessions", href: "/docs/api/sessions-sdk" }, - { title: "Rewards oracle", href: "/docs/api/rewards-oracle-sdk" }, { title: "Price oracle", href: "/docs/api/price-oracle-sdk" }, From 2237fd766b63d9c41e9cb8bf4818ce5803e58f33 Mon Sep 17 00:00:00 2001 From: bry Date: Thu, 15 May 2025 16:04:37 -0500 Subject: [PATCH 63/63] fix backfill-oui --- packages/helium-admin-cli/src/backfill-ouis.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/helium-admin-cli/src/backfill-ouis.ts b/packages/helium-admin-cli/src/backfill-ouis.ts index f1d1caf3e..872777332 100644 --- a/packages/helium-admin-cli/src/backfill-ouis.ts +++ b/packages/helium-admin-cli/src/backfill-ouis.ts @@ -392,6 +392,7 @@ export async function run(args: any = process.argv) { }) .accountsPartial({ organization: orgK, + devaddrConstraint: devaddrConstraintK, }) .instruction(); }