clients/js: add aptos network info
This commit is contained in:
parent
7d53c68aad
commit
8a4a49983e
|
@ -67,7 +67,11 @@ export async function execute_aptos(
|
||||||
// transaction that deploys a module cannot use that module
|
// transaction that deploys a module cannot use that module
|
||||||
//
|
//
|
||||||
// Tx 1.
|
// Tx 1.
|
||||||
|
try {
|
||||||
await callEntryFunc(network, rpc, `${contract}::wrapped`, "create_wrapped_coin_type", [], [bcsVAA]);
|
await callEntryFunc(network, rpc, `${contract}::wrapped`, "create_wrapped_coin_type", [], [bcsVAA]);
|
||||||
|
} catch (e) {
|
||||||
|
console.log("this one already happened (probably)")
|
||||||
|
}
|
||||||
|
|
||||||
// We just deployed the module (notice the "wait" argument which makes
|
// We just deployed the module (notice the "wait" argument which makes
|
||||||
// the previous step block until finality).
|
// the previous step block until finality).
|
||||||
|
@ -175,7 +179,7 @@ export async function callEntryFunc(
|
||||||
TxnBuilderTypes.AccountAddress.fromHex(accountFrom.address()),
|
TxnBuilderTypes.AccountAddress.fromHex(accountFrom.address()),
|
||||||
BigInt(sequenceNumber),
|
BigInt(sequenceNumber),
|
||||||
txPayload,
|
txPayload,
|
||||||
BigInt(30000), //max gas to be used. TODO(csongor): we could compute this from the simulation below...
|
BigInt(100000), //max gas to be used. TODO(csongor): we could compute this from the simulation below...
|
||||||
BigInt(100), //price per unit gas TODO(csongor): we should get this dynamically
|
BigInt(100), //price per unit gas TODO(csongor): we should get this dynamically
|
||||||
BigInt(Math.floor(Date.now() / 1000) + 10),
|
BigInt(Math.floor(Date.now() / 1000) + 10),
|
||||||
new TxnBuilderTypes.ChainId(chainId),
|
new TxnBuilderTypes.ChainId(chainId),
|
||||||
|
|
|
@ -173,7 +173,7 @@ exports.builder = function(y: typeof yargs) {
|
||||||
|
|
||||||
// TODO(csongor): use deployer address from sdk (when it's there)
|
// TODO(csongor): use deployer address from sdk (when it's there)
|
||||||
let module_name = "0x277fa055b6a73c42c0662d5236c65c864ccbf2d4abd21f174a30c8b786eab84b::deployer";
|
let module_name = "0x277fa055b6a73c42c0662d5236c65c864ccbf2d4abd21f174a30c8b786eab84b::deployer";
|
||||||
if (network == "TESTNET") {
|
if (network == "TESTNET" || network == "MAINNET") {
|
||||||
module_name = "0x0108bc32f7de18a5f6e1e7d6ee7aff9f5fc858d0d87ac0da94dd8d2a5d267d6b::deployer";
|
module_name = "0x0108bc32f7de18a5f6e1e7d6ee7aff9f5fc858d0d87ac0da94dd8d2a5d267d6b::deployer";
|
||||||
}
|
}
|
||||||
const rpc = argv.rpc ?? NETWORKS[network]["aptos"].rpc;
|
const rpc = argv.rpc ?? NETWORKS[network]["aptos"].rpc;
|
||||||
|
@ -202,7 +202,7 @@ exports.builder = function(y: typeof yargs) {
|
||||||
const rpc = NETWORKS[network]["aptos"].rpc;
|
const rpc = NETWORKS[network]["aptos"].rpc;
|
||||||
// TODO(csongor): use sdk address
|
// TODO(csongor): use sdk address
|
||||||
let module_name = "0x277fa055b6a73c42c0662d5236c65c864ccbf2d4abd21f174a30c8b786eab84b::sender";
|
let module_name = "0x277fa055b6a73c42c0662d5236c65c864ccbf2d4abd21f174a30c8b786eab84b::sender";
|
||||||
if (network == "TESTNET") {
|
if (network == "TESTNET" || network == "MAINNET") {
|
||||||
module_name = "0x0108bc32f7de18a5f6e1e7d6ee7aff9f5fc858d0d87ac0da94dd8d2a5d267d6b::sender";
|
module_name = "0x0108bc32f7de18a5f6e1e7d6ee7aff9f5fc858d0d87ac0da94dd8d2a5d267d6b::sender";
|
||||||
}
|
}
|
||||||
await callEntryFunc(network, rpc, module_name, "send_message", [], [BCS.bcsSerializeBytes(Buffer.from(argv["message"], "ascii"))])
|
await callEntryFunc(network, rpc, module_name, "send_message", [], [BCS.bcsSerializeBytes(Buffer.from(argv["message"], "ascii"))])
|
||||||
|
|
|
@ -94,8 +94,8 @@ const MAINNET = {
|
||||||
key: undefined,
|
key: undefined,
|
||||||
},
|
},
|
||||||
aptos: {
|
aptos: {
|
||||||
rpc: undefined,
|
rpc: "https://fullnode.mainnet.aptoslabs.com/v1",
|
||||||
key: undefined,
|
key: get_env_var("APTOS_KEY"),
|
||||||
},
|
},
|
||||||
sui: {
|
sui: {
|
||||||
rpc: undefined,
|
rpc: undefined,
|
||||||
|
|
Loading…
Reference in New Issue