Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions command/analyze.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
const { Command, Argument } = require("commander");
const { getBlsRegisterClient, getPath, readKeypair } = require("./utils");
const anchor = require("@coral-xyz/anchor");
const { getBlsRegisterClient } = require("./utils");
const chalk = require("chalk");
const { Keypair } = require("@solana/web3.js");
const fs = require("node:fs");
Expand Down Expand Up @@ -58,7 +57,7 @@ analyzeCommand.addArgument(file).action(async (file, options) => {
} while (rs != null && rs.length > 0);
process.exit(0);
} catch (e) {
console.log(chalk.red("analyze execute fail: " + e));
console.log(chalk.red("analyze execute failed: " + e));
process.exit(1);
}
});
Expand Down
2 changes: 1 addition & 1 deletion command/bless_token.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ blesstokenCommand
console.log(chalk.green("bless token initial success."));
process.exit(0);
} catch (e) {
console.log(chalk.red("bless token initial fail: " + e));
console.log(chalk.red("bless token initial failed: " + e));
process.exit(1);
}
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
const { Command, Argument } = require("commander");
const chalk = require("chalk");
const { WALLET_PATH } = require("../lib/constants");
const { WALLET_PATH } = require("../../lib/constants");
const {
getBlsContractClient,
getPath,
readKeypair,
bs58Message,
} = require("./utils");
} = require("../utils");
const { PublicKey } = require("@solana/web3.js");

const blessMetaAcceptAdminCommand = new Command("accept-admin")
Expand All @@ -25,7 +25,7 @@ const blessMetaAcceptAdminCommand = new Command("accept-admin")
)
.option(
"--squads <true/false>",
"squads: if squads true, use squads to signature, default is false.",
"squads: if true, use Squads to sign the transaction; default: false.",
)
.option(
"--admin <admin>",
Expand Down Expand Up @@ -103,7 +103,7 @@ blessMetaAcceptAdminCommand
console.log(chalk.green("bless meta accept admin success."));
process.exit(0);
} catch (e) {
console.log(chalk.red("bless meta accept admin fail: " + e));
console.log(chalk.red("bless meta accept admin failed: " + e));
process.exit(1);
}
});
Expand Down
12 changes: 7 additions & 5 deletions command/bles_meta_create.js → command/meta/bles_meta_create.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
const { Command, Argument } = require("commander");
const chalk = require("chalk");
const anchor = require("@coral-xyz/anchor");
const { WALLET_PATH } = require("../lib/constants");
const { WALLET_PATH } = require("../../lib/constants");
const {
getBlsContractClient,
getPath,
readKeypair,
getMetadata,
bs58Message,
} = require("./utils");
} = require("../utils");
const { PublicKey } = require("@solana/web3.js");

const blessMetaCreateCommand = new Command("create")
Expand All @@ -28,11 +28,11 @@ const blessMetaCreateCommand = new Command("create")
.option("--multisig <multisig>", "multisig: the multisig of the bless meta")
.option(
"--squads <true/false>",
"squads: if squads true, use squads to signature, default is false.",
"squads: if true, use Squads to sign the transaction; default: false.",
)
.option(
"--admin <admin>",
"admin: the admin of the bless meta, the admin will as payer in squads mode ",
"admin: the admin of the bless meta, the admin will as payer in Squads mode ",
)
.description(
"create-meta: create meta account of the bless meta, the value is base58",
Expand Down Expand Up @@ -128,7 +128,9 @@ blessMetaCreateCommand
console.log(chalk.green("bless token metadata create account success."));
process.exit(0);
} catch (e) {
console.log(chalk.red("bless token metadata create account fail: " + e));
console.log(
chalk.red("bless token metadata create account failed: " + e),
);
process.exit(1);
}
});
Expand Down
6 changes: 3 additions & 3 deletions command/bles_meta_init.js → command/meta/bles_meta_init.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
const { Command, Argument } = require("commander");
const chalk = require("chalk");
const { WALLET_PATH } = require("../lib/constants");
const { WALLET_PATH } = require("../../lib/constants");
const { PublicKey } = require("@solana/web3.js");
const { getBlsContractClient, getPath, readKeypair } = require("./utils");
const { getBlsContractClient, getPath, readKeypair } = require("../utils");

const blessMetaInitCommand = new Command("init")
.option(
Expand Down Expand Up @@ -39,7 +39,7 @@ blessMetaInitCommand.addArgument(mint).action(async (mint, options) => {
console.log(chalk.green("bless token metadata account initial success."));
process.exit(0);
} catch (e) {
console.log(chalk.red("bless token metadata account initial fail: " + e));
console.log(chalk.red("bless token metadata account initial failed: " + e));
process.exit(1);
}
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
const { Command, Argument } = require("commander");
const chalk = require("chalk");
const { WALLET_PATH } = require("../lib/constants");
const { WALLET_PATH } = require("../../lib/constants");
const {
getBlsContractClient,
getPath,
readKeypair,
bs58Message,
} = require("./utils");
} = require("../utils");
const { PublicKey } = require("@solana/web3.js");

const blessMetaSetPendingAdminCommand = new Command("pending-admin")
Expand All @@ -29,7 +29,7 @@ const blessMetaSetPendingAdminCommand = new Command("pending-admin")
)
.option(
"--squads <true/false>",
"squads: if squads true, use squads to signature, default is false.",
"squads: if true, use Squads to sign the transaction; default: false.",
)
.description(
"pending-admin: set the pending admin of the bless meta, the value is base58",
Expand Down Expand Up @@ -115,7 +115,7 @@ blessMetaSetPendingAdminCommand
console.log(chalk.green("bless meta set pending admin success."));
process.exit(0);
} catch (e) {
console.log(chalk.red("bless meta set the pending admin fail: " + e));
console.log(chalk.red("bless meta set the pending admin failed: " + e));
process.exit(1);
}
});
Expand Down
12 changes: 7 additions & 5 deletions command/bles_meta_update.js → command/meta/bles_meta_update.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
const { Command, Argument } = require("commander");
const chalk = require("chalk");
const { WALLET_PATH } = require("../lib/constants");
const { WALLET_PATH } = require("../../lib/constants");
const {
getBlsContractClient,
getPath,
readKeypair,
getMetadata,
bs58Message,
} = require("./utils");
} = require("../utils");
const { PublicKey } = require("@solana/web3.js");

const blessMetaUpdateCommand = new Command("update")
Expand All @@ -27,11 +27,11 @@ const blessMetaUpdateCommand = new Command("update")
.option("--multisig <multisig>", "multisig: the multisig of the bless meta")
.option(
"--squads <true/false>",
"squads: if squads true, use squads to signature, default is false.",
"squads: if true, use Squads to sign the transaction; default: false.",
)
.option(
"--admin <admin>",
"admin: the admin of the bless meta, the admin will as payer in squads mode ",
"admin: the admin of the bless meta, the admin will as payer in Squads mode ",
)
.description(
"create-meta: create meta account of the bless meta, the value is base58",
Expand Down Expand Up @@ -116,7 +116,9 @@ blessMetaUpdateCommand
console.log(chalk.green("bless token metadata account update success."));
process.exit(0);
} catch (e) {
console.log(chalk.red("bless token metadata account update fail: " + e));
console.log(
chalk.red("bless token metadata account update failed: " + e),
);
process.exit(1);
}
});
Expand Down
16 changes: 16 additions & 0 deletions command/meta/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
const blessMetaInitCommand = require("./bles_meta_init.js")
const tokenMetaSetAdminCommand = require("./bles_meta_set_pending_admin.js")
const blessMetaUpdateCommand = require("./bles_meta_update.js")
const blessMetaCreateCommand = require("./bles_meta_create.js")
const tokenMetaAcceptAdminCommand = require("./bles_meta_accept_admin.js")

const commands = {
blessMetaInitCommand,
blessMetaCreateCommand,
blessMetaUpdateCommand,
tokenMetaSetAdminCommand,
tokenMetaAcceptAdminCommand,
};

module.exports = commands;
module.exports.default = commands;
3 changes: 3 additions & 0 deletions command/program/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
const programCommand = require("./program.js");

module.exports = programCommand;
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const { Command, Argument } = require("commander");
const { getPath, readKeypair, getConnection } = require("./utils");
const { WALLET_PATH } = require("../lib/constants");
const { getPath, readKeypair, getConnection } = require("../utils");
const { WALLET_PATH } = require("../../lib/constants");
const Loader = require("./loader");
const chalk = require("chalk");
const nacl = require("tweetnacl");
Expand Down Expand Up @@ -79,7 +79,7 @@ deployBufferCommand
const tx = await connection.sendRawTransaction(deployTx.serialize());
console.log(chalk.green("program deploy success: " + tx));
} catch (e) {
console.log(chalk.red("program deploy fail: " + e));
console.log(chalk.red("program deploy failed: " + e));
}
});

Expand Down
6 changes: 3 additions & 3 deletions command/prg_upgrade.js → command/program/prg_upgrade.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const { Command, Argument } = require("commander");
const { getPath, readKeypair, getConnection } = require("./utils");
const { WALLET_PATH } = require("../lib/constants");
const { getPath, readKeypair, getConnection } = require("../utils");
const { WALLET_PATH } = require("../../lib/constants");
const Loader = require("./loader");
const chalk = require("chalk");
const nacl = require("tweetnacl");
Expand Down Expand Up @@ -64,7 +64,7 @@ upgradeCommand
const tx = await connection.sendRawTransaction(transaction.serialize());
console.log(chalk.green("program upgrade success: " + tx));
} catch (e) {
console.log(chalk.red("program upgrade fail: " + e));
console.log(chalk.red("program upgrade failed: " + e));
}
});

Expand Down
File renamed without changes.
3 changes: 3 additions & 0 deletions command/register/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
const registerCommand = require("./register.js")

module.exports = registerCommand;
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
const { Command, Argument } = require("commander");
const anchor = require("@coral-xyz/anchor");
const chalk = require("chalk");
const { WALLET_PATH } = require("../lib/constants");
const { getBlsRegisterClient, getPath, readKeypair } = require("./utils");
const { PublicKey } = require("@solana/web3.js");
const { WALLET_PATH } = require("../../lib/constants");
const { getBlsRegisterClient, getPath, readKeypair } = require("../utils");

const registerAcceptAdminCommand = new Command("accept-admin")
.option(
Expand All @@ -26,7 +25,7 @@ registerAcceptAdminCommand.action(async (options) => {
console.log(chalk.green("registration accept admin success."));
process.exit(0);
} catch (e) {
console.log(chalk.red("accept admin of registration fail: " + e));
console.log(chalk.red("accept admin of registration failed: " + e));
process.exit(1);
}
});
Expand Down
6 changes: 3 additions & 3 deletions command/reg_init.js → command/register/reg_init.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const { Command, Argument } = require("commander");
const { getBlsRegisterClient, getPath, readKeypair } = require("./utils");
const { WALLET_PATH } = require("../lib/constants");
const { getBlsRegisterClient, getPath, readKeypair } = require("../utils");
const { WALLET_PATH } = require("../../lib/constants");
const anchor = require("@coral-xyz/anchor");
const chalk = require("chalk");
const regInitCommand = new Command("init")
Expand Down Expand Up @@ -35,7 +35,7 @@ regInitCommand.addArgument(deadline).action(async (deadline, options) => {
console.log(chalk.green("registration initial success."));
process.exit(0);
} catch (e) {
console.log(chalk.red("registration initial fail: " + e));
console.log(chalk.red("registration initial failed: " + e));
process.exit(1);
}
});
Expand Down
7 changes: 3 additions & 4 deletions command/reg_pause.js → command/register/reg_pause.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
const { Command, Argument } = require("commander");
const anchor = require("@coral-xyz/anchor");
const chalk = require("chalk");
const { WALLET_PATH } = require("../lib/constants");
const { getBlsRegisterClient, getPath, readKeypair } = require("./utils");
const { WALLET_PATH } = require("../../lib/constants");
const { getBlsRegisterClient, getPath, readKeypair } = require("../utils");

const registerSetPauseCommand = new Command("pause")
.option(
Expand Down Expand Up @@ -36,7 +35,7 @@ registerSetPauseCommand.addArgument(pause).action(async (pause, options) => {
}
process.exit(0);
} catch (e) {
console.log(chalk.red("set the pause status of registration fail: " + e));
console.log(chalk.red("set the pause status of registration failed: " + e));
process.exit(1);
}
});
Expand Down
6 changes: 3 additions & 3 deletions command/reg_register.js → command/register/reg_register.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ const { Command, Argument } = require("commander");
const anchor = require("@coral-xyz/anchor");
const chalk = require("chalk");
const ed = require("@noble/ed25519");
const { getBlsRegisterClient, getPath, readKeypair } = require("./utils");
const { WALLET_PATH } = require("../lib/constants");
const { getBlsRegisterClient, getPath, readKeypair } = require("../utils");
const { WALLET_PATH } = require("../../lib/constants");
const { PublicKey } = require("@solana/web3.js");

const registerDoCommand = new Command("register")
Expand Down Expand Up @@ -71,7 +71,7 @@ registerDoCommand.addArgument(nodeid).action(async (nodeid, options) => {
console.log(chalk.green("register success "));
process.exit(0);
} catch (e) {
console.log(chalk.red("register bless node id fail: " + e));
console.log(chalk.red("register bless node id failed: " + e));
process.exit(1);
}
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
const { Command, Argument } = require("commander");
const anchor = require("@coral-xyz/anchor");
const chalk = require("chalk");
const { getBlsRegisterClient, getPath, readKeypair } = require("./utils");
const { WALLET_PATH } = require("../lib/constants");
const { getBlsRegisterClient, getPath, readKeypair } = require("../utils");
const { WALLET_PATH } = require("../../lib/constants");

const registerBackendSignerCommand = new Command("bsigner")
.option(
Expand Down Expand Up @@ -39,7 +38,7 @@ registerBackendSignerCommand
process.exit(0);
} catch (e) {
console.log(
chalk.red("set the backend signer of registration fail: " + e),
chalk.red("set the backend signer of registration failed: " + e),
);
process.exit(1);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
const { Command, Argument } = require("commander");
const anchor = require("@coral-xyz/anchor");
const chalk = require("chalk");
const { getBlsRegisterClient, getPath, readKeypair } = require("./utils");
const { WALLET_PATH } = require("../lib/constants");
const { getBlsRegisterClient, getPath, readKeypair } = require("../utils");
const { WALLET_PATH } = require("../../lib/constants");

const registerSetDeadlineCommand = new Command("deadline")
.option(
Expand Down Expand Up @@ -52,7 +52,7 @@ registerSetDeadlineCommand
}
process.exit(0);
} catch (e) {
console.log(chalk.red("set the deadline of registration fail: " + e));
console.log(chalk.red("set the deadline of registration failed: " + e));
process.exit(1);
}
});
Expand Down
Loading