@helium/helium-admin-cli 0.9.20-next.23 → 0.9.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/lib/esm/tsconfig.esm.tsbuildinfo +1 -1
  2. package/package.json +13 -13
  3. package/lib/cjs/fix-claimed-epochs.js +0 -91
  4. package/lib/cjs/fix-claimed-epochs.js.map +0 -1
  5. package/lib/cjs/unrug-hotspots.js +0 -167
  6. package/lib/cjs/unrug-hotspots.js.map +0 -1
  7. package/lib/cjs/update-matching-destinations.js +0 -116
  8. package/lib/cjs/update-matching-destinations.js.map +0 -1
  9. package/lib/cjs/update-mathing-destinations.js +0 -103
  10. package/lib/cjs/update-mathing-destinations.js.map +0 -1
  11. package/lib/cjs/update-proxy-config.js +0 -128
  12. package/lib/cjs/update-proxy-config.js.map +0 -1
  13. package/lib/esm/src/fix-claimed-epochs.js +0 -50
  14. package/lib/esm/src/fix-claimed-epochs.js.map +0 -1
  15. package/lib/esm/src/unrug-hotspots.js +0 -126
  16. package/lib/esm/src/unrug-hotspots.js.map +0 -1
  17. package/lib/esm/src/update-matching-destinations.js +0 -75
  18. package/lib/esm/src/update-matching-destinations.js.map +0 -1
  19. package/lib/esm/src/update-mathing-destinations.js +0 -62
  20. package/lib/esm/src/update-mathing-destinations.js.map +0 -1
  21. package/lib/esm/src/update-proxy-config.js +0 -87
  22. package/lib/esm/src/update-proxy-config.js.map +0 -1
  23. package/lib/types/src/fix-claimed-epochs.d.ts +0 -2
  24. package/lib/types/src/fix-claimed-epochs.d.ts.map +0 -1
  25. package/lib/types/src/unrug-hotspots.d.ts +0 -2
  26. package/lib/types/src/unrug-hotspots.d.ts.map +0 -1
  27. package/lib/types/src/update-matching-destinations.d.ts +0 -2
  28. package/lib/types/src/update-matching-destinations.d.ts.map +0 -1
  29. package/lib/types/src/update-mathing-destinations.d.ts +0 -2
  30. package/lib/types/src/update-mathing-destinations.d.ts.map +0 -1
  31. package/lib/types/src/update-proxy-config.d.ts +0 -2
  32. package/lib/types/src/update-proxy-config.d.ts.map +0 -1
@@ -1,128 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
26
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
27
- return new (P || (P = Promise))(function (resolve, reject) {
28
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
29
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
30
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
31
- step((generator = generator.apply(thisArg, _arguments || [])).next());
32
- });
33
- };
34
- var __importDefault = (this && this.__importDefault) || function (mod) {
35
- return (mod && mod.__esModule) ? mod : { "default": mod };
36
- };
37
- Object.defineProperty(exports, "__esModule", { value: true });
38
- exports.run = void 0;
39
- const anchor = __importStar(require("@coral-xyz/anchor"));
40
- const nft_proxy_sdk_1 = require("@helium/nft-proxy-sdk");
41
- const web3_js_1 = require("@solana/web3.js");
42
- const sdk_1 = __importDefault(require("@sqds/sdk"));
43
- const fs_1 = __importDefault(require("fs"));
44
- const os_1 = __importDefault(require("os"));
45
- const yargs_1 = __importDefault(require("yargs/yargs"));
46
- const utils_1 = require("./utils");
47
- function run(args = process.argv) {
48
- return __awaiter(this, void 0, void 0, function* () {
49
- const yarg = (0, yargs_1.default)(args).options({
50
- wallet: {
51
- alias: "k",
52
- describe: "Anchor wallet keypair",
53
- default: `${os_1.default.homedir()}/.config/solana/id.json`,
54
- },
55
- url: {
56
- alias: "u",
57
- default: "http://127.0.0.1:8899",
58
- describe: "The solana url",
59
- },
60
- name: {
61
- required: true,
62
- type: "string",
63
- describe: "Name of the proxy config to be updated",
64
- },
65
- maxProxyTime: {
66
- required: false,
67
- describe: "New max proxy time",
68
- type: "string",
69
- default: null,
70
- },
71
- proxySeasonsFile: {
72
- type: "string",
73
- default: `${__dirname}/../../proxy-seasons.json`,
74
- },
75
- executeTransaction: {
76
- type: "boolean",
77
- },
78
- multisig: {
79
- type: "string",
80
- describe: "Address of the squads multisig to be authority. If not provided, your wallet will be the authority",
81
- },
82
- authorityIndex: {
83
- type: "number",
84
- describe: "Authority index for squads. Defaults to 1",
85
- default: 1,
86
- },
87
- });
88
- const argv = yield yarg.argv;
89
- process.env.ANCHOR_WALLET = argv.wallet;
90
- process.env.ANCHOR_PROVIDER_URL = argv.url;
91
- anchor.setProvider(anchor.AnchorProvider.local(argv.url));
92
- const provider = anchor.getProvider();
93
- const wallet = new anchor.Wallet((0, utils_1.loadKeypair)(argv.wallet));
94
- const proxySeasonsFile = fs_1.default.readFileSync(argv.proxySeasonsFile, "utf8");
95
- const seasons = JSON.parse(proxySeasonsFile).map((s) => ({
96
- start: new anchor.BN(Math.floor(Date.parse(s.start) / 1000)),
97
- end: new anchor.BN(Math.floor(Date.parse(s.end) / 1000)),
98
- }));
99
- const program = yield (0, nft_proxy_sdk_1.init)(provider);
100
- const instructions = [];
101
- const proxyConfig = (0, nft_proxy_sdk_1.proxyConfigKey)(argv.name)[0];
102
- const proxyConfigAcc = yield program.account.proxyConfigV0.fetch(proxyConfig);
103
- instructions.push(yield program.methods
104
- .updateProxyConfigV0({
105
- maxProxyTime: argv.maxProxyTime ? new anchor.BN(argv.maxProxyTime) : null,
106
- seasons,
107
- })
108
- .accounts({
109
- proxyConfig,
110
- authority: proxyConfigAcc.authority,
111
- })
112
- .instruction());
113
- const squads = sdk_1.default.endpoint(process.env.ANCHOR_PROVIDER_URL, wallet, {
114
- commitmentOrConfig: "finalized",
115
- });
116
- yield (0, utils_1.sendInstructionsOrSquads)({
117
- provider,
118
- instructions,
119
- executeTransaction: argv.executeTransaction,
120
- squads,
121
- multisig: argv.multisig ? new web3_js_1.PublicKey(argv.multisig) : undefined,
122
- authorityIndex: argv.authorityIndex,
123
- signers: [],
124
- });
125
- });
126
- }
127
- exports.run = run;
128
- //# sourceMappingURL=update-proxy-config.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"update-proxy-config.js","sourceRoot":"","sources":["../../src/update-proxy-config.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,0DAA4C;AAC5C,yDAG+B;AAC/B,6CAAoE;AACpE,oDAA+B;AAC/B,4CAAoB;AACpB,4CAAoB;AACpB,wDAAgC;AAChC,mCAGiB;AAEjB,SAAsB,GAAG,CAAC,OAAY,OAAO,CAAC,IAAI;;QAChD,MAAM,IAAI,GAAG,IAAA,eAAK,EAAC,IAAI,CAAC,CAAC,OAAO,CAAC;YAC/B,MAAM,EAAE;gBACN,KAAK,EAAE,GAAG;gBACV,QAAQ,EAAE,uBAAuB;gBACjC,OAAO,EAAE,GAAG,YAAE,CAAC,OAAO,EAAE,yBAAyB;aAClD;YACD,GAAG,EAAE;gBACH,KAAK,EAAE,GAAG;gBACV,OAAO,EAAE,uBAAuB;gBAChC,QAAQ,EAAE,gBAAgB;aAC3B;YACD,IAAI,EAAE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CAAC,CAAC,IAAI,mBAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,SAAS;YAClE,cAAc,EAAE,IAAI,CAAC,cAAc;YACnC,OAAO,EAAE,EAAE;SACZ,CAAC,CAAC;IACL,CAAC;CAAA;AApFD,kBAoFC"}
@@ -1,50 +0,0 @@
1
- import * as anchor from "@coral-xyz/anchor";
2
- import { init as initHsd } from "@helium/helium-sub-daos-sdk";
3
- import { batchParallelInstructionsWithPriorityFee } from "@helium/spl-utils";
4
- import { PublicKey } from "@solana/web3.js";
5
- import fs from "fs";
6
- import os from "os";
7
- import yargs from "yargs/yargs";
8
- import { loadKeypair, } from "./utils";
9
- export async function run(args = process.argv) {
10
- const yarg = yargs(args).options({
11
- wallet: {
12
- alias: "k",
13
- describe: "Anchor wallet keypair",
14
- default: `${os.homedir()}/.config/solana/id.json`,
15
- },
16
- url: {
17
- alias: "u",
18
- default: "http://127.0.0.1:8899",
19
- describe: "The solana url",
20
- },
21
- delegatedPositions: {
22
- type: "string",
23
- describe: "Path to the delegated positions file",
24
- default: __dirname + "/delegatedPositions.txt",
25
- },
26
- });
27
- const argv = await yarg.argv;
28
- process.env.ANCHOR_WALLET = argv.wallet;
29
- process.env.ANCHOR_PROVIDER_URL = argv.url;
30
- anchor.setProvider(anchor.AnchorProvider.local(argv.url));
31
- const provider = anchor.getProvider();
32
- const wallet = new anchor.Wallet(loadKeypair(argv.wallet));
33
- const hsdProgram = await initHsd(provider);
34
- const delegatedPositions = fs.readFileSync(argv.delegatedPositions, "utf-8")
35
- .split("\n")
36
- .filter(line => line.trim() !== ""); // Remove empty lines
37
- const instructions = [];
38
- for (const delegatedPosition of delegatedPositions) {
39
- console.log(delegatedPosition, new PublicKey(delegatedPosition).toBase58());
40
- instructions.push(await hsdProgram.methods
41
- .tempFixClaimedEpoch()
42
- .accounts({
43
- authority: wallet.publicKey,
44
- delegatedPosition: new PublicKey(delegatedPosition),
45
- })
46
- .instruction());
47
- }
48
- await batchParallelInstructionsWithPriorityFee(provider, instructions, { maxSignatureBatch: 100 });
49
- }
50
- //# sourceMappingURL=fix-claimed-epochs.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"fix-claimed-epochs.js","sourceRoot":"","sources":["../../../src/fix-claimed-epochs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,mBAAmB,CAAC;AAI5C,OAAO,EAAE,IAAI,IAAI,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAG9D,OAAO,EACL,wCAAwC,EACzC,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,SAAS,EAA0B,MAAM,iBAAiB,CAAC;AAEpE,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,KAAK,MAAM,aAAa,CAAC;AAChC,OAAO,EACL,WAAW,GAGZ,MAAM,SAAS,CAAC;AAEjB,MAAM,CAAC,KAAK,UAAU,GAAG,CAAC,OAAY,OAAO,CAAC,IAAI;IAChD,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC;QAC/B,MAAM,EAAE;YACN,KAAK,EAAE,GAAG;YACV,QAAQ,EAAE,uBAAuB;YACjC,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,EAAE,yBAAyB;SAClD;QACD,GAAG,EAAE;YACH,KAAK,EAAE,GAAG;YACV,OAAO,EAAE,uBAAuB;YAChC,QAAQ,EAAE,gBAAgB;SAC3B;QACD,kBAAkB,EAAE;YAClB,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,sCAAsC;YAChD,OAAO,EAAE,SAAS,GAAG,yBAAyB;SAC/C;KACF,CAAC,CAAC;IACH,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC;IAC7B,OAAO,CAAC,GAAG,CAAC,aAAa,GAAG,IAAI,CAAC,MAAM,CAAC;IACxC,OAAO,CAAC,GAAG,CAAC,mBAAmB,GAAG,IAAI,CAAC,GAAG,CAAC;IAC3C,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,cAAc,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;IAC1D,MAAM,QAAQ,GAAG,MAAM,CAAC,WAAW,EAA2B,CAAC;IAC/D,MAAM,MAAM,GAAG,IAAI,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;IAC3D,MAAM,UAAU,GAAG,MAAM,OAAO,CAAC,QAAQ,CAAC,CAAC;IAE3C,MAAM,kBAAkB,GAAG,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,kBAAkB,EAAE,OAAO,CAAC;SACzE,KAAK,CAAC,IAAI,CAAC;SACX,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,qBAAqB;IAE5D,MAAM,YAAY,GAA6B,EAAE,CAAC;IAClD,KAAK,MAAM,iBAAiB,IAAI,kBAAkB,EAAE;QAClD,OAAO,CAAC,GAAG,CAAC,iBAAiB,EAAE,IAAI,SAAS,CAAC,iBAAiB,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC;QAC5E,YAAY,CAAC,IAAI,CACf,MAAM,UAAU,CAAC,OAAO;aACrB,mBAAmB,EAAE;aACrB,QAAQ,CAAC;YACR,SAAS,EAAE,MAAM,CAAC,SAAS;YAC3B,iBAAiB,EAAE,IAAI,SAAS,CAAC,iBAAiB,CAAC;SACpD,CAAC;aACD,WAAW,EAAE,CACjB,CAAC;KACH;IACD,MAAM,wCAAwC,CAAC,QAAQ,EAAE,YAAY,EAAE,EAAC,iBAAiB,EAAE,GAAG,EAAC,CAAC,CAAC;AACnG,CAAC"}
@@ -1,126 +0,0 @@
1
- import * as anchor from "@coral-xyz/anchor";
2
- import { entityCreatorKey } from "@helium/helium-entity-manager-sdk";
3
- import { daoKey } from "@helium/helium-sub-daos-sdk";
4
- import { bulkSendRawTransactions, getAssetProof, HNT_MINT, populateMissingDraftInfo, searchAssets, toVersionedTx, withPriorityFees, } from "@helium/spl-utils";
5
- import { createTransferInstruction } from "@metaplex-foundation/mpl-bubblegum";
6
- import { ConcurrentMerkleTreeAccount, SPL_ACCOUNT_COMPRESSION_PROGRAM_ID, SPL_NOOP_PROGRAM_ID, } from "@solana/spl-account-compression";
7
- import { PublicKey, } from "@solana/web3.js";
8
- import bs58 from "bs58";
9
- import os from "os";
10
- import yargs from "yargs/yargs";
11
- import { loadKeypair } from "./utils";
12
- export async function run(args = process.argv) {
13
- const yarg = yargs(args).options({
14
- ruggedWallet: {
15
- describe: "Anchor wallet keypair",
16
- required: true,
17
- type: "string",
18
- },
19
- recipient: {
20
- describe: "Recipient of the hotspots",
21
- type: "string",
22
- required: true,
23
- },
24
- wallet: {
25
- alias: "k",
26
- describe: "Anchor wallet keypair",
27
- default: `${os.homedir()}/.config/solana/id.json`,
28
- },
29
- url: {
30
- alias: "u",
31
- default: "http://127.0.0.1:8899",
32
- describe: "The solana url",
33
- },
34
- hntMint: {
35
- type: "string",
36
- describe: "HNT mint of the dao to be updated",
37
- default: HNT_MINT.toBase58(),
38
- },
39
- });
40
- const argv = await yarg.argv;
41
- process.env.ANCHOR_WALLET = argv.wallet;
42
- process.env.ANCHOR_PROVIDER_URL = argv.url;
43
- anchor.setProvider(anchor.AnchorProvider.local(argv.url));
44
- const provider = anchor.getProvider();
45
- const ruggedWallet = new anchor.Wallet(loadKeypair(argv.ruggedWallet));
46
- const ruggedWalletKeypair = loadKeypair(argv.ruggedWallet);
47
- const myKeypair = loadKeypair(argv.wallet);
48
- const cNFTs = await searchAssets(provider.connection.rpcEndpoint, {
49
- ownerAddress: ruggedWallet.publicKey.toBase58(),
50
- limit: 1000,
51
- creatorVerified: true,
52
- burnt: false,
53
- creatorAddress: entityCreatorKey(daoKey(HNT_MINT)[0])[0].toBase58(),
54
- });
55
- const drafts = [];
56
- for (const cNFT of cNFTs) {
57
- const draft = await transferCompressedCollectable(provider.connection, provider.wallet.publicKey, cNFT, new PublicKey(argv.recipient));
58
- drafts.push(draft);
59
- }
60
- for (const draft of drafts) {
61
- const tx = await toVersionedTx(await populateMissingDraftInfo(provider.connection, draft));
62
- await tx.sign([ruggedWalletKeypair, myKeypair]);
63
- await bulkSendRawTransactions(provider.connection, [Buffer.from(tx.serialize())], console.log);
64
- }
65
- }
66
- function getBubblegumAuthorityPDA(merkleRollPubKey) {
67
- const [bubblegumAuthorityPDAKey] = PublicKey.findProgramAddressSync([merkleRollPubKey.toBuffer()], new PublicKey("BGUMAp9Gq7iTEuizy4pqaxsTyUCBK68MDfK752saRPUY"));
68
- return bubblegumAuthorityPDAKey;
69
- }
70
- function bufferToArray(buffer) {
71
- const nums = [];
72
- for (let i = 0; i < buffer.length; i += 1) {
73
- nums.push(buffer[i]);
74
- }
75
- return nums;
76
- }
77
- const mapProof = (assetProof) => {
78
- if (!assetProof.proof || assetProof.proof.length === 0) {
79
- throw new Error("Proof is empty");
80
- }
81
- return assetProof.proof.map((node) => ({
82
- pubkey: new PublicKey(node),
83
- isSigner: false,
84
- isWritable: false,
85
- }));
86
- };
87
- const transferCompressedCollectable = async (conn, payer, collectable, recipientPubKey) => {
88
- const instructions = [];
89
- const assetProof = (await getAssetProof(conn.rpcEndpoint, collectable.id));
90
- const treeAuthority = getBubblegumAuthorityPDA(new PublicKey(assetProof.treeId));
91
- const leafDelegate = collectable.ownership.delegate
92
- ? new PublicKey(collectable.ownership.delegate)
93
- : new PublicKey(collectable.ownership.owner);
94
- const merkleTree = new PublicKey(assetProof.treeId);
95
- const tree = await ConcurrentMerkleTreeAccount.fromAccountAddress(conn, merkleTree, "confirmed");
96
- const canopyHeight = tree.getCanopyDepth();
97
- const proofPath = mapProof(assetProof);
98
- const anchorRemainingAccounts = proofPath.slice(0, proofPath.length - (canopyHeight || 0));
99
- const ix = createTransferInstruction({
100
- treeAuthority,
101
- leafOwner: new PublicKey(collectable.ownership.owner),
102
- leafDelegate,
103
- newLeafOwner: recipientPubKey,
104
- merkleTree,
105
- logWrapper: SPL_NOOP_PROGRAM_ID,
106
- compressionProgram: SPL_ACCOUNT_COMPRESSION_PROGRAM_ID,
107
- anchorRemainingAccounts,
108
- }, {
109
- root: bufferToArray(assetProof.root.toBuffer()),
110
- dataHash: bufferToArray(Buffer.from(bs58.decode(collectable.compression.data_hash.trim()))),
111
- creatorHash: bufferToArray(Buffer.from(bs58.decode(collectable.compression.creator_hash.trim()))),
112
- nonce: collectable.compression.leaf_id,
113
- index: collectable.compression.leaf_id,
114
- });
115
- ix.keys[1].isSigner = true;
116
- instructions.push(ix);
117
- return {
118
- instructions: await withPriorityFees({
119
- connection: conn,
120
- instructions,
121
- feePayer: payer,
122
- }),
123
- feePayer: payer,
124
- };
125
- };
126
- //# sourceMappingURL=unrug-hotspots.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"unrug-hotspots.js","sourceRoot":"","sources":["../../../src/unrug-hotspots.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AACrE,OAAO,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AACrD,OAAO,EAEL,uBAAuB,EAEvB,aAAa,EACb,QAAQ,EACR,wBAAwB,EACxB,YAAY,EACZ,aAAa,EAEb,gBAAgB,GACjB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,yBAAyB,EAAE,MAAM,oCAAoC,CAAC;AAC/E,OAAO,EACL,2BAA2B,EAC3B,kCAAkC,EAClC,mBAAmB,GACpB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAGL,SAAS,GAEV,MAAM,iBAAiB,CAAC;AACzB,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,KAAK,MAAM,aAAa,CAAC;AAChC,OAAO,EAAE,WAAW,EAAE,MAAM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,CAAC,WAAW,CAAC,OAAO;KACvC,CACF,CAAC;IACF,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,QAAQ,GAAG,IAAI,CAAC;IAC3B,YAAY,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAEtB,OAAO;QACL,YAAY,EAAE,MAAM,gBAAgB,CAAC;YACnC,UAAU,EAAE,IAAI;YAChB,YAAY;YACZ,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,QAAQ,EAAE,KAAK;KAChB,CAAC;AACJ,CAAC,CAAC"}
@@ -1,75 +0,0 @@
1
- import * as anchor from "@coral-xyz/anchor";
2
- import { initializeCompressionRecipient, init as initLazy, } from "@helium/lazy-distributor-sdk";
3
- import { batchParallelInstructionsWithPriorityFee } from "@helium/spl-utils";
4
- import { PublicKey } from "@solana/web3.js";
5
- import os from "os";
6
- import yargs from "yargs/yargs";
7
- export async function run(args = process.argv) {
8
- const yarg = yargs(args).options({
9
- wallet: {
10
- alias: "k",
11
- describe: "Anchor wallet keypair",
12
- default: `${os.homedir()}/.config/solana/id.json`,
13
- },
14
- url: {
15
- alias: "u",
16
- default: "http://127.0.0.1:8899",
17
- describe: "The solana url",
18
- },
19
- name: {
20
- default: "nJWGUMOK",
21
- describe: "The lazy transactions instance name",
22
- },
23
- });
24
- const argv = await yarg.argv;
25
- process.env.ANCHOR_WALLET = argv.wallet;
26
- process.env.ANCHOR_PROVIDER_URL = argv.url;
27
- anchor.setProvider(anchor.AnchorProvider.local(argv.url));
28
- const provider = anchor.getProvider();
29
- const lazyProgram = await initLazy(provider);
30
- const recipients = await lazyProgram.account.recipientV0.all();
31
- const LD_IOT = new PublicKey("37eiz5KzYwpAdLgrSh8GT1isKiJ6hcE5ET86dqaoCugL");
32
- const LD_MOBILE = new PublicKey("GZtTp3AUo2AHdQe9BCJ6gXR9KqfruRvHnZ4QiJUALMcz");
33
- const LD_HNT = new PublicKey("6gcZXjHgKUBMedc2V1aZLFPwh8M1rPVRw7kpo2KqNrFq");
34
- const needUpdate = recipients.filter((r) => !r.account.destination.equals(PublicKey.default) &&
35
- (r.account.lazyDistributor.equals(LD_IOT) ||
36
- r.account.lazyDistributor.equals(LD_MOBILE)));
37
- const hntRecipientsByKey = recipients
38
- .filter((r) => r.account.lazyDistributor.equals(LD_HNT))
39
- .reduce((acc, r) => {
40
- acc[r.account.destination.toString()] = r;
41
- return acc;
42
- }, {});
43
- const instructions = [];
44
- for (const r of needUpdate) {
45
- const asset = r.account.asset;
46
- const assetOnChain = await provider.connection.getAccountInfo(asset);
47
- // Only doing this to cNFTs
48
- if (!assetOnChain) {
49
- const hntRecipient = hntRecipientsByKey[r.account.destination.toString()];
50
- if (!hntRecipient || hntRecipient?.account.destination.equals(PublicKey.default)) {
51
- let hntRecipientKey = hntRecipient?.publicKey;
52
- if (!hntRecipient) {
53
- const { instruction, pubkeys } = await (await initializeCompressionRecipient({
54
- program: lazyProgram,
55
- assetId: asset,
56
- lazyDistributor: LD_HNT,
57
- payer: provider.wallet.publicKey,
58
- })).prepare();
59
- hntRecipientKey = pubkeys.recipient;
60
- instructions.push(instruction);
61
- }
62
- instructions.push(await lazyProgram.methods
63
- .tempUpdateMatchingDestination()
64
- .accountsStrict({
65
- recipient: hntRecipientKey,
66
- authority: provider.wallet.publicKey,
67
- originalRecipient: r.publicKey,
68
- })
69
- .instruction());
70
- }
71
- }
72
- }
73
- await batchParallelInstructionsWithPriorityFee(provider, instructions);
74
- }
75
- //# sourceMappingURL=update-matching-destinations.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"update-matching-destinations.js","sourceRoot":"","sources":["../../../src/update-matching-destinations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EACL,8BAA8B,EAC9B,IAAI,IAAI,QAAQ,GACjB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,wCAAwC,EAAE,MAAM,mBAAmB,CAAC;AAC7E,OAAO,EAAE,SAAS,EAA0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EAAE;oBACjB,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,GAAG,MAAM,CACrC,MAAM,8BAA8B,CAAC;wBACnC,OAAO,EAAE,WAAW;wBACpB,OAAO,EAAE,KAAK;wBACd,eAAe,EAAE,MAAM;wBACvB,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,SAAS;qBACjC,CAAC,CACH,CAAC,OAAO,EAAE,CAAC;oBACZ,eAAe,GAAG,OAAO,CAAC,SAAS,CAAC;oBACpC,YAAY,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;iBAChC;gBAED,YAAY,CAAC,IAAI,CACf,MAAM,WAAW,CAAC,OAAO;qBACtB,6BAA6B,EAAE;qBAC/B,cAAc,CAAC;oBACd,SAAS,EAAE,eAAe;oBAC1B,SAAS,EAAE,QAAQ,CAAC,MAAM,CAAC,SAAS;oBACpC,iBAAiB,EAAE,CAAC,CAAC,SAAS;iBAC/B,CAAC;qBACD,WAAW,EAAE,CACjB,CAAC;aACH;SACF;KACF;IAED,MAAM,wCAAwC,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;AACzE,CAAC"}
@@ -1,62 +0,0 @@
1
- import * as anchor from "@coral-xyz/anchor";
2
- import { initializeCompressionRecipient, init as initLazy, } from "@helium/lazy-distributor-sdk";
3
- import { PublicKey, } from "@solana/web3.js";
4
- import os from "os";
5
- import yargs from "yargs/yargs";
6
- export async function run(args = process.argv) {
7
- const yarg = yargs(args).options({
8
- wallet: {
9
- alias: "k",
10
- describe: "Anchor wallet keypair",
11
- default: `${os.homedir()}/.config/solana/id.json`,
12
- },
13
- url: {
14
- alias: "u",
15
- default: "http://127.0.0.1:8899",
16
- describe: "The solana url",
17
- },
18
- name: {
19
- default: "nJWGUMOK",
20
- describe: "The lazy transactions instance name",
21
- },
22
- });
23
- const argv = await yarg.argv;
24
- process.env.ANCHOR_WALLET = argv.wallet;
25
- process.env.ANCHOR_PROVIDER_URL = argv.url;
26
- anchor.setProvider(anchor.AnchorProvider.local(argv.url));
27
- const provider = anchor.getProvider();
28
- const lazyProgram = await initLazy(provider);
29
- const recipients = await lazyProgram.account.recipientV0.all();
30
- const LD_IOT = new PublicKey("37eiz5KzYwpAdLgrSh8GT1isKiJ6hcE5ET86dqaoCugL");
31
- const LD_MOBILE = new PublicKey("GZtTp3AUo2AHdQe9BCJ6gXR9KqfruRvHnZ4QiJUALMcz");
32
- const LD_HNT = new PublicKey("6gcZXjHgKUBMedc2V1aZLFPwh8M1rPVRw7kpo2KqNrFq");
33
- const needUpdate = recipients.filter((r) => !r.account.destination.equals(PublicKey.default) &&
34
- (r.account.lazyDistributor.equals(LD_IOT) ||
35
- r.account.lazyDistributor.equals(LD_MOBILE)));
36
- const hntRecipientsByKey = recipients
37
- .filter((r) => r.account.lazyDistributor.equals(LD_HNT))
38
- .reduce((acc, r) => {
39
- acc[r.account.destination.toString()] = r;
40
- return acc;
41
- }, {});
42
- const instructions = [];
43
- for (const r of needUpdate) {
44
- const asset = r.account.asset;
45
- const assetOnChain = await provider.connection.getAccountInfo(asset);
46
- // Only doing this to cNFTs
47
- if (!assetOnChain) {
48
- const hntRecipient = hntRecipientsByKey[r.account.destination.toString()];
49
- if (!hntRecipient) {
50
- instructions.push(await (await initializeCompressionRecipient({
51
- program: lazyProgram,
52
- assetId: asset,
53
- lazyDistributor: LD_HNT,
54
- payer: provider.wallet.publicKey,
55
- })).instruction());
56
- }
57
- instructions.push();
58
- }
59
- }
60
- console.log("Done");
61
- }
62
- //# sourceMappingURL=update-mathing-destinations.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"update-mathing-destinations.js","sourceRoot":"","sources":["../../../src/update-mathing-destinations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EACL,8BAA8B,EAC9B,IAAI,IAAI,QAAQ,GACjB,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EAEL,SAAS,GAGV,MAAM,iBAAiB,CAAC;AACzB,OAAO,EA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jC,CAAC,CACH,CAAC,WAAW,EAAE,CAChB,CAAC;aACH;YAED,YAAY,CAAC,IAAI,EAChB,CAAC;SACH;KACF;IACD,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACtB,CAAC"}
@@ -1,87 +0,0 @@
1
- import * as anchor from "@coral-xyz/anchor";
2
- import { init as initProxy, proxyConfigKey, } from "@helium/nft-proxy-sdk";
3
- import { PublicKey } from "@solana/web3.js";
4
- import Squads from "@sqds/sdk";
5
- import fs from "fs";
6
- import os from "os";
7
- import yargs from "yargs/yargs";
8
- import { loadKeypair, sendInstructionsOrSquads } from "./utils";
9
- export async function run(args = process.argv) {
10
- const yarg = yargs(args).options({
11
- wallet: {
12
- alias: "k",
13
- describe: "Anchor wallet keypair",
14
- default: `${os.homedir()}/.config/solana/id.json`,
15
- },
16
- url: {
17
- alias: "u",
18
- default: "http://127.0.0.1:8899",
19
- describe: "The solana url",
20
- },
21
- name: {
22
- required: true,
23
- type: "string",
24
- describe: "Name of the proxy config to be updated",
25
- },
26
- maxProxyTime: {
27
- required: false,
28
- describe: "New max proxy time",
29
- type: "string",
30
- default: null,
31
- },
32
- proxySeasonsFile: {
33
- type: "string",
34
- default: `${__dirname}/../../proxy-seasons.json`,
35
- },
36
- executeTransaction: {
37
- type: "boolean",
38
- },
39
- multisig: {
40
- type: "string",
41
- describe: "Address of the squads multisig to be authority. If not provided, your wallet will be the authority",
42
- },
43
- authorityIndex: {
44
- type: "number",
45
- describe: "Authority index for squads. Defaults to 1",
46
- default: 1,
47
- },
48
- });
49
- const argv = await yarg.argv;
50
- process.env.ANCHOR_WALLET = argv.wallet;
51
- process.env.ANCHOR_PROVIDER_URL = argv.url;
52
- anchor.setProvider(anchor.AnchorProvider.local(argv.url));
53
- const provider = anchor.getProvider();
54
- const wallet = new anchor.Wallet(loadKeypair(argv.wallet));
55
- const proxySeasonsFile = fs.readFileSync(argv.proxySeasonsFile, "utf8");
56
- const seasons = JSON.parse(proxySeasonsFile).map((s) => ({
57
- start: new anchor.BN(Math.floor(Date.parse(s.start) / 1000)),
58
- end: new anchor.BN(Math.floor(Date.parse(s.end) / 1000)),
59
- }));
60
- const program = await initProxy(provider);
61
- const instructions = [];
62
- const proxyConfig = proxyConfigKey(argv.name)[0];
63
- const proxyConfigAcc = await program.account.proxyConfigV0.fetch(proxyConfig);
64
- instructions.push(await program.methods
65
- .updateProxyConfigV0({
66
- maxProxyTime: argv.maxProxyTime ? new anchor.BN(argv.maxProxyTime) : null,
67
- seasons,
68
- })
69
- .accounts({
70
- proxyConfig,
71
- authority: proxyConfigAcc.authority,
72
- })
73
- .instruction());
74
- const squads = Squads.endpoint(process.env.ANCHOR_PROVIDER_URL, wallet, {
75
- commitmentOrConfig: "finalized",
76
- });
77
- await sendInstructionsOrSquads({
78
- provider,
79
- instructions,
80
- executeTransaction: argv.executeTransaction,
81
- squads,
82
- multisig: argv.multisig ? new PublicKey(argv.multisig) : undefined,
83
- authorityIndex: argv.authorityIndex,
84
- signers: [],
85
- });
86
- }
87
- //# sourceMappingURL=update-proxy-config.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"update-proxy-config.js","sourceRoot":"","sources":["../../../src/update-proxy-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EACL,IAAI,IAAI,SAAS,EACjB,cAAc,GACf,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,SAAS,EAA0B,MAAM,iBAAiB,CAAC;AACpE,OAAO,MAAM,MAAM,WAAW,CAAC;AAC/B,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,KAAK,MAAM,aAAa,CAAC;AAChC,OAAO,EACL,WAAW,EACX,wBAAwB,EACzB,MAAM,SAAS,CAAC;AAEjB,MAAM,CAAC,KAAK,UAAU,GAAG,CAAC,OAAY,OAAO,CAAC,IAAI;IAChD,MAAM,IAAI,GAAG,KAAK,C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AAC,GAAG,CAAC,mBAAmB,EAAE,MAAM,EAAE;QACtE,kBAAkB,EAAE,WAAW;KAChC,CAAC,CAAC;IACH,MAAM,wBAAwB,CAAC;QAC7B,QAAQ;QACR,YAAY;QACZ,kBAAkB,EAAE,IAAI,CAAC,kBAAkB;QAC3C,MAAM;QACN,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,SAAS;QAClE,cAAc,EAAE,IAAI,CAAC,cAAc;QACnC,OAAO,EAAE,EAAE;KACZ,CAAC,CAAC;AACL,CAAC"}
@@ -1,2 +0,0 @@
1
- export declare function run(args?: any): Promise<void>;
2
- //# sourceMappingURL=fix-claimed-epochs.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"fix-claimed-epochs.d.ts","sourceRoot":"","sources":["../../../src/fix-claimed-epochs.ts"],"names":[],"mappings":"AAsBA,wBAAsB,GAAG,CAAC,IAAI,GAAE,GAAkB,iBA4CjD"}
@@ -1,2 +0,0 @@
1
- export declare function run(args?: any): Promise<void>;
2
- //# sourceMappingURL=unrug-hotspots.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"unrug-hotspots.d.ts","sourceRoot":"","sources":["../../../src/unrug-hotspots.ts"],"names":[],"mappings":"AAgCA,wBAAsB,GAAG,CAAC,IAAI,GAAE,GAAkB,iBAiEjD"}
@@ -1,2 +0,0 @@
1
- export declare function run(args?: any): Promise<void>;
2
- //# sourceMappingURL=update-matching-destinations.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"update-matching-destinations.d.ts","sourceRoot":"","sources":["../../../src/update-matching-destinations.ts"],"names":[],"mappings":"AAUA,wBAAsB,GAAG,CAAC,IAAI,GAAE,GAAkB,iBAiFjD"}
@@ -1,2 +0,0 @@
1
- export declare function run(args?: any): Promise<void>;
2
- //# sourceMappingURL=update-mathing-destinations.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"update-mathing-destinations.d.ts","sourceRoot":"","sources":["../../../src/update-mathing-destinations.ts"],"names":[],"mappings":"AAeA,wBAAsB,GAAG,CAAC,IAAI,GAAE,GAAkB,iBAqEjD"}
@@ -1,2 +0,0 @@
1
- export declare function run(args?: any): Promise<void>;
2
- //# sourceMappingURL=update-proxy-config.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"update-proxy-config.d.ts","sourceRoot":"","sources":["../../../src/update-proxy-config.ts"],"names":[],"mappings":"AAeA,wBAAsB,GAAG,CAAC,IAAI,GAAE,GAAkB,iBAoFjD"}