Skip to content

Commit

Permalink
Address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Perronef5 committed Feb 9, 2024
1 parent faa8238 commit e11633e
Show file tree
Hide file tree
Showing 26 changed files with 751 additions and 902 deletions.
50 changes: 25 additions & 25 deletions packages/helium-admin-cli/src/approve-carrier.ts
Original file line number Diff line number Diff line change
@@ -1,47 +1,47 @@
import * as anchor from '@coral-xyz/anchor';
import { carrierKey, init as initMem } from '@helium/mobile-entity-manager-sdk';
import { subDaoKey, init as initHsd } from '@helium/helium-sub-daos-sdk';
import { Keypair, PublicKey, TransactionInstruction } from '@solana/web3.js';
import Squads from '@sqds/sdk';
import os from 'os';
import yargs from 'yargs/yargs';
import { loadKeypair, sendInstructionsOrSquads } from './utils';
import { MOBILE_MINT } from '@helium/spl-utils';
import * as anchor from "@coral-xyz/anchor";
import { carrierKey, init as initMem } from "@helium/mobile-entity-manager-sdk";
import { subDaoKey, init as initHsd } from "@helium/helium-sub-daos-sdk";
import { Keypair, PublicKey, TransactionInstruction } from "@solana/web3.js";
import Squads from "@sqds/sdk";
import os from "os";
import yargs from "yargs/yargs";
import { loadKeypair } from "./utils";
import { MOBILE_MINT, sendInstructionsOrSquads } from "@helium/spl-utils";

export async function run(args: any = process.argv) {
const yarg = yargs(args).options({
wallet: {
alias: 'k',
describe: 'Anchor wallet keypair',
alias: "k",
describe: "Anchor wallet keypair",
default: `${os.homedir()}/.config/solana/id.json`,
},
url: {
alias: 'u',
default: 'http://127.0.0.1:8899',
describe: 'The solana url',
alias: "u",
default: "http://127.0.0.1:8899",
describe: "The solana url",
},
dntMint: {
type: 'string',
describe: 'DNT mint of the subdao to approve on',
type: "string",
describe: "DNT mint of the subdao to approve on",
default: MOBILE_MINT.toBase58(),
},
name: {
alias: 'n',
type: 'string',
alias: "n",
type: "string",
required: true,
describe: 'Name of the carrier to approve, case sensitive',
describe: "Name of the carrier to approve, case sensitive",
},
executeTransaction: {
type: 'boolean',
type: "boolean",
},
multisig: {
type: 'string',
type: "string",
describe:
'Address of the squads multisig to be authority. If not provided, your wallet will be the authority',
"Address of the squads multisig to be authority. If not provided, your wallet will be the authority",
},
authorityIndex: {
type: 'number',
describe: 'Authority index for squads. Defaults to 1',
type: "number",
describe: "Authority index for squads. Defaults to 1",
default: 1,
},
});
Expand Down Expand Up @@ -72,7 +72,7 @@ export async function run(args: any = process.argv) {
);

const squads = Squads.endpoint(process.env.ANCHOR_PROVIDER_URL, wallet, {
commitmentOrConfig: 'finalized',
commitmentOrConfig: "finalized",
});

await sendInstructionsOrSquads({
Expand Down
48 changes: 24 additions & 24 deletions packages/helium-admin-cli/src/approve-program.ts
Original file line number Diff line number Diff line change
@@ -1,46 +1,46 @@
import * as anchor from '@coral-xyz/anchor';
import { init as initHem } from '@helium/helium-entity-manager-sdk';
import { daoKey, init as initHsd } from '@helium/helium-sub-daos-sdk';
import { PublicKey, TransactionInstruction } from '@solana/web3.js';
import Squads from '@sqds/sdk';
import os from 'os';
import yargs from 'yargs/yargs';
import { loadKeypair, sendInstructionsOrSquads } from './utils';
import { HNT_MINT } from '@helium/spl-utils';
import * as anchor from "@coral-xyz/anchor";
import { init as initHem } from "@helium/helium-entity-manager-sdk";
import { daoKey, init as initHsd } from "@helium/helium-sub-daos-sdk";
import { PublicKey, TransactionInstruction } from "@solana/web3.js";
import Squads from "@sqds/sdk";
import os from "os";
import yargs from "yargs/yargs";
import { loadKeypair } from "./utils";
import { HNT_MINT, sendInstructionsOrSquads } from "@helium/spl-utils";

export async function run(args: any = process.argv) {
const yarg = yargs(args).options({
wallet: {
alias: 'k',
describe: 'Anchor wallet keypair',
alias: "k",
describe: "Anchor wallet keypair",
default: `${os.homedir()}/.config/solana/id.json`,
},
url: {
alias: 'u',
default: 'http://127.0.0.1:8899',
describe: 'The solana url',
alias: "u",
default: "http://127.0.0.1:8899",
describe: "The solana url",
},
hntMint: {
type: 'string',
describe: 'HNT mint of the dao to be updated',
type: "string",
describe: "HNT mint of the dao to be updated",
default: HNT_MINT.toBase58(),
},
programId: {
type: 'string',
describe: 'Program ID to allow',
type: "string",
describe: "Program ID to allow",
required: true,
},
executeTransaction: {
type: 'boolean',
type: "boolean",
},
multisig: {
type: 'string',
type: "string",
describe:
'Address of the squads multisig to be authority. If not provided, your wallet will be the authority',
"Address of the squads multisig to be authority. If not provided, your wallet will be the authority",
},
authorityIndex: {
type: 'number',
describe: 'Authority index for squads. Defaults to 1',
type: "number",
describe: "Authority index for squads. Defaults to 1",
default: 1,
},
});
Expand Down Expand Up @@ -74,7 +74,7 @@ export async function run(args: any = process.argv) {
);

const squads = Squads.endpoint(process.env.ANCHOR_PROVIDER_URL, wallet, {
commitmentOrConfig: 'finalized',
commitmentOrConfig: "finalized",
});

await sendInstructionsOrSquads({
Expand Down
45 changes: 21 additions & 24 deletions packages/helium-admin-cli/src/close-buffers.ts
Original file line number Diff line number Diff line change
@@ -1,43 +1,40 @@
import * as anchor from '@coral-xyz/anchor';
import { PublicKey } from '@solana/web3.js';
import Squads from '@sqds/sdk';
import os from 'os';
import yargs from 'yargs/yargs';
import {
createCloseBufferInstruction,
loadKeypair,
sendInstructionsOrSquads,
} from './utils';
import { BPF_UPGRADE_LOADER_ID } from '@solana/spl-governance';
import bs58 from 'bs58';
import * as anchor from "@coral-xyz/anchor";
import { PublicKey } from "@solana/web3.js";
import Squads from "@sqds/sdk";
import os from "os";
import yargs from "yargs/yargs";
import { createCloseBufferInstruction, loadKeypair } from "./utils";
import { BPF_UPGRADE_LOADER_ID } from "@solana/spl-governance";
import bs58 from "bs58";
import { sendInstructionsOrSquads } from "@helium/spl-utils";

export async function run(args: any = process.argv) {
const yarg = yargs(args).options({
wallet: {
alias: 'k',
describe: 'Anchor wallet keypair',
alias: "k",
describe: "Anchor wallet keypair",
default: `${os.homedir()}/.config/solana/id.json`,
},
url: {
alias: 'u',
default: 'http://127.0.0.1:8899',
describe: 'The solana url',
alias: "u",
default: "http://127.0.0.1:8899",
describe: "The solana url",
},
executeTransaction: {
type: 'boolean',
type: "boolean",
},
multisig: {
type: 'string',
type: "string",
describe:
'Address of the squads multisig to be authority. If not provided, your wallet will be the authority',
"Address of the squads multisig to be authority. If not provided, your wallet will be the authority",
},
authorityIndex: {
type: 'number',
describe: 'Authority index for squads. Defaults to 1',
type: "number",
describe: "Authority index for squads. Defaults to 1",
default: 1,
},
programId: {
type: 'string',
type: "string",
required: true,
},
});
Expand All @@ -49,7 +46,7 @@ export async function run(args: any = process.argv) {
const wallet = new anchor.Wallet(loadKeypair(argv.wallet));
const connection = provider.connection;
const squads = Squads.endpoint(process.env.ANCHOR_PROVIDER_URL, wallet, {
commitmentOrConfig: 'finalized',
commitmentOrConfig: "finalized",
});
let authority = provider.wallet.publicKey;
let multisig = argv.multisig ? new PublicKey(argv.multisig) : null;
Expand Down
47 changes: 22 additions & 25 deletions packages/helium-admin-cli/src/close-canopy.ts
Original file line number Diff line number Diff line change
@@ -1,44 +1,41 @@
import * as anchor from '@coral-xyz/anchor';
import { daoKey, init as initHsd } from '@helium/helium-sub-daos-sdk';
import { PublicKey, TransactionInstruction } from '@solana/web3.js';
import Squads from '@sqds/sdk';
import os from 'os';
import yargs from 'yargs/yargs';
import {
loadKeypair,
parseEmissionsSchedule,
sendInstructionsOrSquads,
} from './utils';
import { init, lazyTransactionsKey } from '@helium/lazy-transactions-sdk';
import * as anchor from "@coral-xyz/anchor";
import { daoKey, init as initHsd } from "@helium/helium-sub-daos-sdk";
import { PublicKey, TransactionInstruction } from "@solana/web3.js";
import Squads from "@sqds/sdk";
import os from "os";
import yargs from "yargs/yargs";
import { loadKeypair, parseEmissionsSchedule } from "./utils";
import { init, lazyTransactionsKey } from "@helium/lazy-transactions-sdk";
import { sendInstructionsOrSquads } from "@helium/spl-utils";

export async function run(args: any = process.argv) {
const yarg = yargs(args).options({
wallet: {
alias: 'k',
describe: 'Anchor wallet keypair',
alias: "k",
describe: "Anchor wallet keypair",
default: `${os.homedir()}/.config/solana/id.json`,
},
url: {
alias: 'u',
default: 'http://127.0.0.1:8899',
describe: 'The solana url',
alias: "u",
default: "http://127.0.0.1:8899",
describe: "The solana url",
},
name: {
required: true,
type: 'string',
describe: 'Lazy dist name',
type: "string",
describe: "Lazy dist name",
},
executeTransaction: {
type: 'boolean',
type: "boolean",
},
multisig: {
type: 'string',
type: "string",
describe:
'Address of the squads multisig to be authority. If not provided, your wallet will be the authority',
"Address of the squads multisig to be authority. If not provided, your wallet will be the authority",
},
authorityIndex: {
type: 'number',
describe: 'Authority index for squads. Defaults to 1',
type: "number",
describe: "Authority index for squads. Defaults to 1",
default: 1,
},
});
Expand All @@ -64,7 +61,7 @@ export async function run(args: any = process.argv) {
);

const squads = Squads.endpoint(process.env.ANCHOR_PROVIDER_URL, wallet, {
commitmentOrConfig: 'finalized',
commitmentOrConfig: "finalized",
});
await sendInstructionsOrSquads({
provider,
Expand Down
8 changes: 5 additions & 3 deletions packages/helium-admin-cli/src/create-boost-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ import { HNT_MINT, MOBILE_MINT, toBN } from "@helium/spl-utils";
import { PublicKey } from "@solana/web3.js";
import os from "os";
import yargs from "yargs/yargs";
import { loadKeypair, sendInstructionsOrSquads } from "./utils";
import { loadKeypair } from "./utils";
import { init as initHsd } from "@helium/helium-sub-daos-sdk";
import { getMint } from "@solana/spl-token";
import Squads from "@sqds/sdk";
import { sendInstructionsOrSquads } from "@helium/spl-utils";

export async function run(args: any = process.argv) {
const yarg = yargs(args).options({
Expand Down Expand Up @@ -90,7 +91,8 @@ export async function run(args: any = process.argv) {
const mint = await getMint(program.provider.connection, dntMint);
const subDao = (await subDaoKey(dntMint))[0];

const subDaoAuth = (await hsdProgram.account.subDaoV0.fetch(subDao)).authority
const subDaoAuth = (await hsdProgram.account.subDaoV0.fetch(subDao))
.authority;
const instructions = [
await program.methods
.initializeBoostConfigV0({
Expand All @@ -104,7 +106,7 @@ export async function run(args: any = process.argv) {
rentReclaimAuthority: new PublicKey(argv.rentReclaimAuthority),
authority: subDaoAuth,
subDao,
startAuthority: new PublicKey(argv.startAuthority)
startAuthority: new PublicKey(argv.startAuthority),
})
.instruction(),
];
Expand Down
Loading

0 comments on commit e11633e

Please sign in to comment.