@helium/helium-admin-cli 0.2.7 → 0.2.9
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/repair-iot-operations-fund.js +113 -0
- package/lib/cjs/repair-iot-operations-fund.js.map +1 -0
- package/lib/esm/src/repair-iot-operations-fund.js +72 -0
- package/lib/esm/src/repair-iot-operations-fund.js.map +1 -0
- package/lib/esm/tsconfig.esm.tsbuildinfo +1 -1
- package/lib/types/src/repair-iot-operations-fund.d.ts +2 -0
- package/lib/types/src/repair-iot-operations-fund.d.ts.map +1 -0
- package/package.json +5 -5
|
@@ -0,0 +1,113 @@
|
|
|
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_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 web3_js_1 = require("@solana/web3.js");
|
|
43
|
+
const sdk_1 = __importDefault(require("@sqds/sdk"));
|
|
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
|
+
hntMint: {
|
|
61
|
+
required: true,
|
|
62
|
+
type: "string",
|
|
63
|
+
describe: "HNT mint of the dao to be updated",
|
|
64
|
+
},
|
|
65
|
+
executeTransaction: {
|
|
66
|
+
type: "boolean",
|
|
67
|
+
},
|
|
68
|
+
multisig: {
|
|
69
|
+
type: "string",
|
|
70
|
+
describe: "Address of the squads multisig to be authority. If not provided, your wallet will be the authority",
|
|
71
|
+
},
|
|
72
|
+
authorityIndex: {
|
|
73
|
+
type: "number",
|
|
74
|
+
describe: "Authority index for squads. Defaults to 1",
|
|
75
|
+
default: 1,
|
|
76
|
+
},
|
|
77
|
+
});
|
|
78
|
+
const argv = yield yarg.argv;
|
|
79
|
+
process.env.ANCHOR_WALLET = argv.wallet;
|
|
80
|
+
process.env.ANCHOR_PROVIDER_URL = argv.url;
|
|
81
|
+
anchor.setProvider(anchor.AnchorProvider.local(argv.url));
|
|
82
|
+
const provider = anchor.getProvider();
|
|
83
|
+
const program = yield (0, helium_entity_manager_sdk_1.init)(provider);
|
|
84
|
+
const daosProgram = yield (0, helium_sub_daos_sdk_1.init)(provider);
|
|
85
|
+
const instructions = [];
|
|
86
|
+
const hntMint = new web3_js_1.PublicKey(argv.hntMint);
|
|
87
|
+
const dao = (0, helium_sub_daos_sdk_1.daoKey)(hntMint)[0];
|
|
88
|
+
const daoAcc = yield daosProgram.account.daoV0.fetch(dao);
|
|
89
|
+
instructions.push(yield program.methods
|
|
90
|
+
.tempRepairIotOperationsFund()
|
|
91
|
+
.accounts({
|
|
92
|
+
dao,
|
|
93
|
+
authority: daoAcc.authority,
|
|
94
|
+
payer: daoAcc.authority,
|
|
95
|
+
keyToAsset: (0, helium_entity_manager_sdk_1.keyToAssetKey)(dao, "iot_operations_fund", "utf8")[0]
|
|
96
|
+
})
|
|
97
|
+
.instruction());
|
|
98
|
+
const squads = sdk_1.default.endpoint(process.env.ANCHOR_PROVIDER_URL, provider.wallet, {
|
|
99
|
+
commitmentOrConfig: "finalized",
|
|
100
|
+
});
|
|
101
|
+
yield (0, utils_1.sendInstructionsOrSquads)({
|
|
102
|
+
provider,
|
|
103
|
+
instructions,
|
|
104
|
+
executeTransaction: argv.executeTransaction,
|
|
105
|
+
squads,
|
|
106
|
+
multisig: argv.multisig ? new web3_js_1.PublicKey(argv.multisig) : undefined,
|
|
107
|
+
authorityIndex: argv.authorityIndex,
|
|
108
|
+
signers: [],
|
|
109
|
+
});
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
exports.run = run;
|
|
113
|
+
//# sourceMappingURL=repair-iot-operations-fund.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"repair-iot-operations-fund.js","sourceRoot":"","sources":["../../src/repair-iot-operations-fund.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,0DAA4C;AAC5C,iFAE2C;AAC3C,qEAAsE;AACtE,6CAA4C;AAC5C,oDAA+B;AAC/B,4CAAoB;AACpB,wDAAgC;AAChC,mCAAmD;AAEnD,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,OAAO,EAAE;gBACP,QAAQ,EAAE,IAAI;gBACd,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,mCAAmC;aAC9C;YACD,kBAAkB,EAAE;gBAClB,IAAI,EAAE,SAAS;aAChB;YACD,QAAQ,EAAE;gBACR,IAAI,EAAE,QAA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ACjB,CAAC;QAEF,MAAM,MAAM,GAAG,aAAM,CAAC,QAAQ,CAC5B,OAAO,CAAC,GAAG,CAAC,mBAAmB,EAC/B,QAAQ,CAAC,MAAM,EACf;YACE,kBAAkB,EAAE,WAAW;SAChC,CACF,CAAC;QACF,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;AAxED,kBAwEC"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import * as anchor from "@coral-xyz/anchor";
|
|
2
|
+
import { init as initHem, keyToAssetKey, } from "@helium/helium-entity-manager-sdk";
|
|
3
|
+
import { daoKey, init as initHsd } from "@helium/helium-sub-daos-sdk";
|
|
4
|
+
import { PublicKey } from "@solana/web3.js";
|
|
5
|
+
import Squads from "@sqds/sdk";
|
|
6
|
+
import os from "os";
|
|
7
|
+
import yargs from "yargs/yargs";
|
|
8
|
+
import { 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
|
+
hntMint: {
|
|
22
|
+
required: true,
|
|
23
|
+
type: "string",
|
|
24
|
+
describe: "HNT mint of the dao to be updated",
|
|
25
|
+
},
|
|
26
|
+
executeTransaction: {
|
|
27
|
+
type: "boolean",
|
|
28
|
+
},
|
|
29
|
+
multisig: {
|
|
30
|
+
type: "string",
|
|
31
|
+
describe: "Address of the squads multisig to be authority. If not provided, your wallet will be the authority",
|
|
32
|
+
},
|
|
33
|
+
authorityIndex: {
|
|
34
|
+
type: "number",
|
|
35
|
+
describe: "Authority index for squads. Defaults to 1",
|
|
36
|
+
default: 1,
|
|
37
|
+
},
|
|
38
|
+
});
|
|
39
|
+
const argv = await yarg.argv;
|
|
40
|
+
process.env.ANCHOR_WALLET = argv.wallet;
|
|
41
|
+
process.env.ANCHOR_PROVIDER_URL = argv.url;
|
|
42
|
+
anchor.setProvider(anchor.AnchorProvider.local(argv.url));
|
|
43
|
+
const provider = anchor.getProvider();
|
|
44
|
+
const program = await initHem(provider);
|
|
45
|
+
const daosProgram = await initHsd(provider);
|
|
46
|
+
const instructions = [];
|
|
47
|
+
const hntMint = new PublicKey(argv.hntMint);
|
|
48
|
+
const dao = daoKey(hntMint)[0];
|
|
49
|
+
const daoAcc = await daosProgram.account.daoV0.fetch(dao);
|
|
50
|
+
instructions.push(await program.methods
|
|
51
|
+
.tempRepairIotOperationsFund()
|
|
52
|
+
.accounts({
|
|
53
|
+
dao,
|
|
54
|
+
authority: daoAcc.authority,
|
|
55
|
+
payer: daoAcc.authority,
|
|
56
|
+
keyToAsset: keyToAssetKey(dao, "iot_operations_fund", "utf8")[0]
|
|
57
|
+
})
|
|
58
|
+
.instruction());
|
|
59
|
+
const squads = Squads.endpoint(process.env.ANCHOR_PROVIDER_URL, provider.wallet, {
|
|
60
|
+
commitmentOrConfig: "finalized",
|
|
61
|
+
});
|
|
62
|
+
await sendInstructionsOrSquads({
|
|
63
|
+
provider,
|
|
64
|
+
instructions,
|
|
65
|
+
executeTransaction: argv.executeTransaction,
|
|
66
|
+
squads,
|
|
67
|
+
multisig: argv.multisig ? new PublicKey(argv.multisig) : undefined,
|
|
68
|
+
authorityIndex: argv.authorityIndex,
|
|
69
|
+
signers: [],
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=repair-iot-operations-fund.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"repair-iot-operations-fund.js","sourceRoot":"","sources":["../../../src/repair-iot-operations-fund.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EACL,IAAI,IAAI,OAAO,EAAE,aAAa,GAC/B,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,IAAI,IAAI,OAAO,EAAE,MAAM,6BAA6B,CAAC;AACtE,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,MAAM,MAAM,WAAW,CAAC;AAC/B,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,KAAK,MAAM,aAAa,CAAC;AAChC,OAAO,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAC;AAEnD,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,OAAO,EAAE;YACP,QAAQ,EAAE,IAAI;YACd,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,mCAAmC;SAC9C;QACD,kBAAkB,EAAE;YAClB,IAAI,EAAE,SAAS;SAChB;QACD,QAAQ,EAAE;YACR,IAAI,EAAE,QAAQ;YACd,QAAQ,EACN,oGAAoG;SACvG;QACD,cAAc,EAAE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