@helium/helium-admin-cli 0.9.22 → 0.9.24-alpha.0
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.
- package/lib/cjs/fix-claimed-epochs.js +91 -0
- package/lib/cjs/fix-claimed-epochs.js.map +1 -0
- package/lib/cjs/unrug-hotspots.js +167 -0
- package/lib/cjs/unrug-hotspots.js.map +1 -0
- package/lib/cjs/update-proxy-config.js +128 -0
- package/lib/cjs/update-proxy-config.js.map +1 -0
- package/lib/esm/src/fix-claimed-epochs.js +50 -0
- package/lib/esm/src/fix-claimed-epochs.js.map +1 -0
- package/lib/esm/src/unrug-hotspots.js +126 -0
- package/lib/esm/src/unrug-hotspots.js.map +1 -0
- package/lib/esm/src/update-proxy-config.js +87 -0
- package/lib/esm/src/update-proxy-config.js.map +1 -0
- package/lib/esm/tsconfig.esm.tsbuildinfo +1 -1
- package/lib/types/src/fix-claimed-epochs.d.ts +2 -0
- package/lib/types/src/fix-claimed-epochs.d.ts.map +1 -0
- package/lib/types/src/unrug-hotspots.d.ts +2 -0
- package/lib/types/src/unrug-hotspots.d.ts.map +1 -0
- package/lib/types/src/update-proxy-config.d.ts +2 -0
- package/lib/types/src/update-proxy-config.d.ts.map +1 -0
- package/package.json +13 -13
|
@@ -0,0 +1,91 @@
|
|
|
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 helium_sub_daos_sdk_1 = require("@helium/helium-sub-daos-sdk");
|
|
41
|
+
const spl_utils_1 = require("@helium/spl-utils");
|
|
42
|
+
const web3_js_1 = require("@solana/web3.js");
|
|
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
|
+
delegatedPositions: {
|
|
61
|
+
type: "string",
|
|
62
|
+
describe: "Path to the delegated positions file",
|
|
63
|
+
default: __dirname + "/delegatedPositions.txt",
|
|
64
|
+
},
|
|
65
|
+
});
|
|
66
|
+
const argv = yield yarg.argv;
|
|
67
|
+
process.env.ANCHOR_WALLET = argv.wallet;
|
|
68
|
+
process.env.ANCHOR_PROVIDER_URL = argv.url;
|
|
69
|
+
anchor.setProvider(anchor.AnchorProvider.local(argv.url));
|
|
70
|
+
const provider = anchor.getProvider();
|
|
71
|
+
const wallet = new anchor.Wallet((0, utils_1.loadKeypair)(argv.wallet));
|
|
72
|
+
const hsdProgram = yield (0, helium_sub_daos_sdk_1.init)(provider);
|
|
73
|
+
const delegatedPositions = fs_1.default.readFileSync(argv.delegatedPositions, "utf-8")
|
|
74
|
+
.split("\n")
|
|
75
|
+
.filter(line => line.trim() !== ""); // Remove empty lines
|
|
76
|
+
const instructions = [];
|
|
77
|
+
for (const delegatedPosition of delegatedPositions) {
|
|
78
|
+
console.log(delegatedPosition, new web3_js_1.PublicKey(delegatedPosition).toBase58());
|
|
79
|
+
instructions.push(yield hsdProgram.methods
|
|
80
|
+
.tempFixClaimedEpoch()
|
|
81
|
+
.accounts({
|
|
82
|
+
authority: wallet.publicKey,
|
|
83
|
+
delegatedPosition: new web3_js_1.PublicKey(delegatedPosition),
|
|
84
|
+
})
|
|
85
|
+
.instruction());
|
|
86
|
+
}
|
|
87
|
+
yield (0, spl_utils_1.batchParallelInstructionsWithPriorityFee)(provider, instructions, { maxSignatureBatch: 100 });
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
exports.run = run;
|
|
91
|
+
//# sourceMappingURL=fix-claimed-epochs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fix-claimed-epochs.js","sourceRoot":"","sources":["../../src/fix-claimed-epochs.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,0DAA4C;AAI5C,qEAA8D;AAG9D,iDAE2B;AAE3B,6CAAoE;AAEpE,4CAAoB;AACpB,4CAAoB;AACpB,wDAAgC;AAChC,mCAIiB;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,kBAAkB,EAAE;gBAClB,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,sCAAsC;gBAChD,OAAO,EAAE,SAAS,GAAG,yBAAyB;aAC/C;SACF,CAAC,CAAC;QACH,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC;QAC7B,OAAO,CAAC,GAAG,CAAC,aAAa,GAAG,IAAI,CAAC,MAAM,CAAC;QACxC,OAAO,CAAC,GAAG,CAAC,mBAAmB,GAAG,IAAI,CAAC,GAAG,CAAC;QAC3C,MAAM,CAAC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
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 helium_entity_manager_sdk_1 = require("@helium/helium-entity-manager-sdk");
|
|
41
|
+
const helium_sub_daos_sdk_1 = require("@helium/helium-sub-daos-sdk");
|
|
42
|
+
const spl_utils_1 = require("@helium/spl-utils");
|
|
43
|
+
const mpl_bubblegum_1 = require("@metaplex-foundation/mpl-bubblegum");
|
|
44
|
+
const spl_account_compression_1 = require("@solana/spl-account-compression");
|
|
45
|
+
const web3_js_1 = require("@solana/web3.js");
|
|
46
|
+
const bs58_1 = __importDefault(require("bs58"));
|
|
47
|
+
const os_1 = __importDefault(require("os"));
|
|
48
|
+
const yargs_1 = __importDefault(require("yargs/yargs"));
|
|
49
|
+
const utils_1 = require("./utils");
|
|
50
|
+
function run(args = process.argv) {
|
|
51
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
52
|
+
const yarg = (0, yargs_1.default)(args).options({
|
|
53
|
+
ruggedWallet: {
|
|
54
|
+
describe: "Anchor wallet keypair",
|
|
55
|
+
required: true,
|
|
56
|
+
type: "string",
|
|
57
|
+
},
|
|
58
|
+
recipient: {
|
|
59
|
+
describe: "Recipient of the hotspots",
|
|
60
|
+
type: "string",
|
|
61
|
+
required: true,
|
|
62
|
+
},
|
|
63
|
+
wallet: {
|
|
64
|
+
alias: "k",
|
|
65
|
+
describe: "Anchor wallet keypair",
|
|
66
|
+
default: `${os_1.default.homedir()}/.config/solana/id.json`,
|
|
67
|
+
},
|
|
68
|
+
url: {
|
|
69
|
+
alias: "u",
|
|
70
|
+
default: "http://127.0.0.1:8899",
|
|
71
|
+
describe: "The solana url",
|
|
72
|
+
},
|
|
73
|
+
hntMint: {
|
|
74
|
+
type: "string",
|
|
75
|
+
describe: "HNT mint of the dao to be updated",
|
|
76
|
+
default: spl_utils_1.HNT_MINT.toBase58(),
|
|
77
|
+
},
|
|
78
|
+
});
|
|
79
|
+
const argv = yield yarg.argv;
|
|
80
|
+
process.env.ANCHOR_WALLET = argv.wallet;
|
|
81
|
+
process.env.ANCHOR_PROVIDER_URL = argv.url;
|
|
82
|
+
anchor.setProvider(anchor.AnchorProvider.local(argv.url));
|
|
83
|
+
const provider = anchor.getProvider();
|
|
84
|
+
const ruggedWallet = new anchor.Wallet((0, utils_1.loadKeypair)(argv.ruggedWallet));
|
|
85
|
+
const ruggedWalletKeypair = (0, utils_1.loadKeypair)(argv.ruggedWallet);
|
|
86
|
+
const myKeypair = (0, utils_1.loadKeypair)(argv.wallet);
|
|
87
|
+
const cNFTs = yield (0, spl_utils_1.searchAssets)(provider.connection.rpcEndpoint, {
|
|
88
|
+
ownerAddress: ruggedWallet.publicKey.toBase58(),
|
|
89
|
+
limit: 1000,
|
|
90
|
+
creatorVerified: true,
|
|
91
|
+
burnt: false,
|
|
92
|
+
creatorAddress: (0, helium_entity_manager_sdk_1.entityCreatorKey)((0, helium_sub_daos_sdk_1.daoKey)(spl_utils_1.HNT_MINT)[0])[0].toBase58(),
|
|
93
|
+
});
|
|
94
|
+
const drafts = [];
|
|
95
|
+
for (const cNFT of cNFTs) {
|
|
96
|
+
const draft = yield transferCompressedCollectable(provider.connection, provider.wallet.publicKey, cNFT, new web3_js_1.PublicKey(argv.recipient));
|
|
97
|
+
drafts.push(draft);
|
|
98
|
+
}
|
|
99
|
+
for (const draft of drafts) {
|
|
100
|
+
const tx = yield (0, spl_utils_1.toVersionedTx)(yield (0, spl_utils_1.populateMissingDraftInfo)(provider.connection, draft));
|
|
101
|
+
yield tx.sign([ruggedWalletKeypair, myKeypair]);
|
|
102
|
+
yield (0, spl_utils_1.bulkSendRawTransactions)(provider.connection, [Buffer.from(tx.serialize())], console.log);
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
exports.run = run;
|
|
107
|
+
function getBubblegumAuthorityPDA(merkleRollPubKey) {
|
|
108
|
+
const [bubblegumAuthorityPDAKey] = web3_js_1.PublicKey.findProgramAddressSync([merkleRollPubKey.toBuffer()], new web3_js_1.PublicKey("BGUMAp9Gq7iTEuizy4pqaxsTyUCBK68MDfK752saRPUY"));
|
|
109
|
+
return bubblegumAuthorityPDAKey;
|
|
110
|
+
}
|
|
111
|
+
function bufferToArray(buffer) {
|
|
112
|
+
const nums = [];
|
|
113
|
+
for (let i = 0; i < buffer.length; i += 1) {
|
|
114
|
+
nums.push(buffer[i]);
|
|
115
|
+
}
|
|
116
|
+
return nums;
|
|
117
|
+
}
|
|
118
|
+
const mapProof = (assetProof) => {
|
|
119
|
+
if (!assetProof.proof || assetProof.proof.length === 0) {
|
|
120
|
+
throw new Error("Proof is empty");
|
|
121
|
+
}
|
|
122
|
+
return assetProof.proof.map((node) => ({
|
|
123
|
+
pubkey: new web3_js_1.PublicKey(node),
|
|
124
|
+
isSigner: false,
|
|
125
|
+
isWritable: false,
|
|
126
|
+
}));
|
|
127
|
+
};
|
|
128
|
+
const transferCompressedCollectable = (conn, payer, collectable, recipientPubKey) => __awaiter(void 0, void 0, void 0, function* () {
|
|
129
|
+
const instructions = [];
|
|
130
|
+
const assetProof = (yield (0, spl_utils_1.getAssetProof)(conn.rpcEndpoint, collectable.id));
|
|
131
|
+
const treeAuthority = getBubblegumAuthorityPDA(new web3_js_1.PublicKey(assetProof.treeId));
|
|
132
|
+
const leafDelegate = collectable.ownership.delegate
|
|
133
|
+
? new web3_js_1.PublicKey(collectable.ownership.delegate)
|
|
134
|
+
: new web3_js_1.PublicKey(collectable.ownership.owner);
|
|
135
|
+
const merkleTree = new web3_js_1.PublicKey(assetProof.treeId);
|
|
136
|
+
const tree = yield spl_account_compression_1.ConcurrentMerkleTreeAccount.fromAccountAddress(conn, merkleTree, "confirmed");
|
|
137
|
+
const canopyHeight = tree.getCanopyDepth();
|
|
138
|
+
const proofPath = mapProof(assetProof);
|
|
139
|
+
const anchorRemainingAccounts = proofPath.slice(0, proofPath.length - (canopyHeight || 0));
|
|
140
|
+
const ix = (0, mpl_bubblegum_1.createTransferInstruction)({
|
|
141
|
+
treeAuthority,
|
|
142
|
+
leafOwner: new web3_js_1.PublicKey(collectable.ownership.owner),
|
|
143
|
+
leafDelegate,
|
|
144
|
+
newLeafOwner: recipientPubKey,
|
|
145
|
+
merkleTree,
|
|
146
|
+
logWrapper: spl_account_compression_1.SPL_NOOP_PROGRAM_ID,
|
|
147
|
+
compressionProgram: spl_account_compression_1.SPL_ACCOUNT_COMPRESSION_PROGRAM_ID,
|
|
148
|
+
anchorRemainingAccounts,
|
|
149
|
+
}, {
|
|
150
|
+
root: bufferToArray(assetProof.root.toBuffer()),
|
|
151
|
+
dataHash: bufferToArray(Buffer.from(bs58_1.default.decode(collectable.compression.data_hash.trim()))),
|
|
152
|
+
creatorHash: bufferToArray(Buffer.from(bs58_1.default.decode(collectable.compression.creator_hash.trim()))),
|
|
153
|
+
nonce: collectable.compression.leaf_id,
|
|
154
|
+
index: collectable.compression.leaf_id,
|
|
155
|
+
});
|
|
156
|
+
ix.keys[1].isSigner = true;
|
|
157
|
+
instructions.push(ix);
|
|
158
|
+
return {
|
|
159
|
+
instructions: yield (0, spl_utils_1.withPriorityFees)({
|
|
160
|
+
connection: conn,
|
|
161
|
+
instructions,
|
|
162
|
+
feePayer: payer,
|
|
163
|
+
}),
|
|
164
|
+
feePayer: payer,
|
|
165
|
+
};
|
|
166
|
+
});
|
|
167
|
+
//# sourceMappingURL=unrug-hotspots.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unrug-hotspots.js","sourceRoot":"","sources":["../../src/unrug-hotspots.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,0DAA4C;AAC5C,iFAAqE;AACrE,qEAAqD;AACrD,iDAW2B;AAC3B,sEAA+E;AAC/E,6EAIyC;AACzC,6CAKyB;AACzB,gDAAwB;AACxB,4CAAoB;AACpB,wDAAgC;AAChC,mCAAsC;A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I,EAAE,CAAC,CAAC,CACtE;QACD,KAAK,EAAE,WAAW,CAAC,WAAW,CAAC,OAAO;QACtC,KAAK,EAAE,WAAW,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,IAAA,4BAAgB,EAAC;YACnC,UAAU,EAAE,IAAI;YAChB,YAAY;YACZ,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,QAAQ,EAAE,KAAK;KAChB,CAAC;AACJ,CAAC,CAAA,CAAC"}
|
|
@@ -0,0 +1,128 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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;Y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AC,OAAO,CAAC,GAAG,CAAC,mBAAmB,EAAE,MAAM,EAAE;YACtE,kBAAkB,EAAE,WAAW;SAChC,CAAC,CAAC;QACH,MAAM,IAAA,gCAAwB,EAAC;YAC7B,QAAQ;YACR,YAAY;YACZ,kBAAkB,EAAE,IAAI,CAAC,kBAAkB;YAC3C,MAAM;YACN,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC,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"}
|
|
@@ -0,0 +1,50 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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,WAA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,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"}
|
|
@@ -0,0 +1,126 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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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