@layerzerolabs/lz-initia-sdk-v2 3.0.80 → 3.0.82

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.
Files changed (36) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/deployments/initia-sandbox-local/blocked_msglib.json +1 -1
  3. package/deployments/initia-sandbox-local/counter.json +1 -1
  4. package/deployments/initia-sandbox-local/deployer.json +1 -1
  5. package/deployments/initia-sandbox-local/dvn.json +1 -1
  6. package/deployments/initia-sandbox-local/dvn_fee_lib_0.json +1 -1
  7. package/deployments/initia-sandbox-local/dvn_fee_lib_router_0.json +1 -1
  8. package/deployments/initia-sandbox-local/dvn_fee_lib_router_1.json +1 -1
  9. package/deployments/initia-sandbox-local/endpoint_v2.json +1 -1
  10. package/deployments/initia-sandbox-local/endpoint_v2_common.json +1 -1
  11. package/deployments/initia-sandbox-local/executor.json +1 -1
  12. package/deployments/initia-sandbox-local/executor_fee_lib_0.json +1 -1
  13. package/deployments/initia-sandbox-local/executor_fee_lib_router_0.json +1 -1
  14. package/deployments/initia-sandbox-local/executor_fee_lib_router_1.json +1 -1
  15. package/deployments/initia-sandbox-local/layerzero_views.json +1 -1
  16. package/deployments/initia-sandbox-local/msglib_types.json +1 -1
  17. package/deployments/initia-sandbox-local/oft-TokenOne.json +1 -1
  18. package/deployments/initia-sandbox-local/oft-TokenThree.json +1 -1
  19. package/deployments/initia-sandbox-local/oft-TokenTwo.json +1 -1
  20. package/deployments/initia-sandbox-local/oft_common.json +1 -1
  21. package/deployments/initia-sandbox-local/price_feed_module_0.json +1 -1
  22. package/deployments/initia-sandbox-local/price_feed_router_0.json +1 -1
  23. package/deployments/initia-sandbox-local/price_feed_router_1.json +1 -1
  24. package/deployments/initia-sandbox-local/router_node_0.json +1 -1
  25. package/deployments/initia-sandbox-local/router_node_1.json +1 -1
  26. package/deployments/initia-sandbox-local/simple_msglib.json +1 -1
  27. package/deployments/initia-sandbox-local/treasury.json +1 -1
  28. package/deployments/initia-sandbox-local/uln_302.json +1 -1
  29. package/deployments/initia-sandbox-local/worker_common.json +1 -1
  30. package/dist/index.cjs +43 -38
  31. package/dist/index.cjs.map +1 -1
  32. package/dist/index.d.mts +30 -30
  33. package/dist/index.d.ts +30 -30
  34. package/dist/index.mjs +39 -38
  35. package/dist/index.mjs.map +1 -1
  36. package/package.json +11 -11
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/generated/addresses.ts","../src/utils.ts","../src/index.ts"],"names":["Stage","Wallet","TransactionRequest","MsgExecute","MsgExecuteJSON","MsgScript","bcs","LayerZeroModulesSdk","MnemonicKey","isMnemonicAndPath","isPrivateKey","AccAddress","MoveAbortError","MoveResourceNotFoundError","UnclassifiedError","InitiaSigner","MoveTableItemNotFoundError"],"mappings":";;;;;;;;;;AAGO,IAAM,mBAAqD,GAAA;AAAA,EAC9D,CAACA,mBAAM,CAAA,OAAO,GAAG,oEAAA;AAAA,EACjB,CAACA,mBAAM,CAAA,OAAO,GAAG,oEAAA;AAAA,EACjB,CAACA,mBAAM,CAAA,OAAO,GAAG;AACrB;AAEO,IAAM,0BAA4D,GAAA;AAAA,EACrE,CAACA,mBAAM,CAAA,OAAO,GAAG,oEAAA;AAAA,EACjB,CAACA,mBAAM,CAAA,OAAO,GAAG,oEAAA;AAAA,EACjB,CAACA,mBAAM,CAAA,OAAO,GAAG;AACrB;AAEO,IAAM,uBAAyD,GAAA;AAAA,EAClE,CAACA,mBAAM,CAAA,OAAO,GAAG,oEAAA;AAAA,EACjB,CAACA,mBAAM,CAAA,OAAO,GAAG,oEAAA;AAAA,EACjB,CAACA,mBAAM,CAAA,OAAO,GAAG;AACrB;AAEO,IAAM,kBAAoD,GAAA;AAAA,EAC7D,CAACA,mBAAM,CAAA,OAAO,GAAG,oEAAA;AAAA,EACjB,CAACA,mBAAM,CAAA,OAAO,GAAG,mEAAA;AAAA,EACjB,CAACA,mBAAM,CAAA,OAAO,GAAG;AACrB;AAEO,IAAM,WAA6C,G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AAA,CAAS,OAAO,IAAK,CAAA,UAAA;AAAA,QACxC,IAAK,CAAA,MAAA;AAAA,QACL,WAAW,IAAK,CAAA,IAAA,CAAK,QAAoB,EAAA,IAAA,CAAK,KAAK,GAAiC;AAAA,OACxF;AACA,MAAM,MAAA,EAAE,OAAU,GAAA,GAAA;AAClB,MAAM,MAAA,WAAA,GAAc,IAAK,CAAA,KAAA,CAAM,KAAK,CAAA;AACpC,MAAA,OAAO,MAAO,CAAA,MAAA,CAAO,WAAW,CAAA,CAAE,CAAC,CAAA;AAAA,aAC9B,CAAG,EAAA;AACR,MAAI,IAAA,YAAA,CAAa,CAAC,CAAK,IAAA,CAAA,CAAE,SAAS,IAAK,CAAA,OAAA,CAAQ,UAAW,CAAA,wBAAwB,CAAG,EAAA;AACjF,QAAA,MAAM,IAAIG,0CAAA,CAA2B,CAAE,CAAA,QAAA,CAAS,KAAK,OAAO,CAAA;AAAA;AAEhE,MAAM,MAAA,CAAA;AAAA;AACV;AACJ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASA,iBAAiB,OAAyB,EAAA;AACtC,IAAO,OAAA,OAAA;AAAA;AACX;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,YAAwB,GAAA;AACpB,IAAO,OAAA,KAAA;AAAA;AACX;AAAA;AAAA;AAAA;AAAA,EAMA,MAAM,gBAAgB,OAAmC,EAAA;AACrD,IAAI,IAAA;AACA,MAAA,MAAM,KAAK,kBAAmB,CAAA;AAAA,QAC1B,cAAgB,EAAA,OAAA;AAAA,QAChB,YAAc,EAAA;AAAA,OACjB,CAAA;AACD,MAAO,OAAA,IAAA;AAAA,aACF,CAAG,EAAA;AACR,MAAO,OAAA,KAAA;AAAA;AACX;AAER","file":"index.cjs","sourcesContent":["// WARNING: Do not change this code. It is auto generated.\n// If you want some new feature, please update generate-addresses.ts.\nimport {Stage} from '@layerzerolabs/lz-definitions'\nexport const ENDPOINT_V2_ADDRESS: { [stage in Stage]?: string } = {\n [Stage.MAINNET]: '0x81d2b534893db8745ab2b0c092ec5f88d554d54825f98fd9e8c83f9b113ee77e',\n [Stage.TESTNET]: '0xcc4e9fda80712972deb0338d85b84822a42d5155b645ef1b2eeae42cedd41b04',\n [Stage.SANDBOX]: '0x4cfd96a8b3d7bff492fd490568c66a9117fe25f7154f7bdecae9649dd99bf551',\n}\n\nexport const SIMPLE_MESSAGE_LIB_ADDRESS: { [stage in Stage]?: string } = {\n [Stage.MAINNET]: '0x32cff077e36f28969f01b92e29e643e74289ed86b51d420f1202c1bc736a2a5f',\n [Stage.TESTNET]: '0xd6fb80799f09bcd7784e1c5cd065a84cac826ce4c49f9c6893cbd9c753fada6a',\n [Stage.SANDBOX]: '0x2fc80c0b184ad67e85a30dc4b5e4de5b519c07f2fedb46ab4ca60783c6a095e6',\n}\n\nexport const ULN_MESSAGE_LIB_ADDRESS: { [stage in Stage]?: string } = {\n [Stage.MAINNET]: '0x5aab6aa28749dd073c26c4703e14eb7e89dd6a25abc2e1f0e98de59f8203a012',\n [Stage.TESTNET]: '0x3e1b182c40965a986133798e1da76302ef327de2c32c58110361587560285e88',\n [Stage.SANDBOX]: '0x59c8706450b668ea055c95eedfd0a9b29ee43d6b6035649ccaac58300d603d02',\n}\n\nexport const COUNTER_V2_ADDRESS: { [stage in Stage]?: string } = {\n [Stage.MAINNET]: '0x27b7ea8a7a98e48029f0170caf52d8d631ce7433a043a87e5bfc29d8d0a4c240',\n [Stage.TESTNET]: '0xf57ffea0a6dfd7e98a0e5f7e36515f2e8622931c6fb5b690528271707213540',\n [Stage.SANDBOX]: '0xe45e57fa31ac68e748511462beb185ea1fbc544a4833a92f4bd7553e3defcaa0',\n}\n\nexport const OFT_ADDRESS: { [stage in Stage]?: string } = {\n [Stage.MAINNET]: '0x6a54eb11fa99dfe3b0cf219e4b125f72f607f9948d7fe36c32f84af736f96cc9',\n [Stage.TESTNET]: '0x18fcbd1705146f06d901cf65da36bf82367801445e265f3d042ac2d187c9c2f3',\n [Stage.SANDBOX]: '0xffae52435cdf714b1966594b38025bc12de1a18531ce3731ae28179b44498d5c',\n}\n\nexport const LAYERZERO_VIEWS_ADDRESS: { [stage in Stage]?: string } = {\n [Stage.MAINNET]: '0x79cc082b54f649d8ac00d372715b951a8a604ee31814c6019110c9b4aebb2c23',\n [Stage.TESTNET]: '0x122ddbfee4da1a173ac45f5672bb1e51626142e68f4adf3ecf03a96546058fdc',\n [Stage.SANDBOX]: '0x39439bfb5a35a2df9fe800572c8f37c4748e6721bf775fa9022d0a14df087eeb',\n}\n\nexport const EXECUTOR_ADDRESS: { [stage in Stage]?: string } = {\n [Stage.MAINNET]: '0xaa3f42a2955bec10bb58b7d95aa2e7471499e26b220c92aced179041f152c8b7',\n [Stage.TESTNET]: '0x798c194c8740dde76a0e3f46f444f7ee974765abb2a9db98be03a0ee89ce050c',\n [Stage.SANDBOX]: '0x453fbcf26de58a231366b55431bcaec34bde7803399c486d0591ab2241b2e5ee',\n}\n\nexport const DVN_ADDRESS: { [stage in Stage]?: string } = {\n [Stage.MAINNET]: '0xd8717e05c622a366394bedb326ca10e6a34b25df20ec9b572382b65c8a68461f',\n [Stage.TESTNET]: '0x3f12330ba9e26a604e2149b4b67c0710d32fcbc3de0bea76dd43dbb6b747bc8c',\n [Stage.SANDBOX]: '0x7f890e79ba7c2011afa5dbf63849b7dc7f56c7c2bf82318a0142ac238dab4950',\n}\n\nexport const WORKER_COMMON: { [stage in Stage]?: string } = {\n [Stage.MAINNET]: '0x64418278adf0c593b9a241e0258590d58966430ca9fc203b03f4cf37209cf6c7',\n [Stage.TESTNET]: '0xb293d24e62db7ceeca5ba2d3f359ce5eb3733975e66707dcd51bc56bc99cce3e',\n [Stage.SANDBOX]: '0x65653b11aa3392f1d33743f43c4498c1ce37996a655ffa8e29797f343dcbc2ab',\n}\n\nexport const PRICE_FEED: { [stage in Stage]?: string } = {\n [Stage.MAINNET]: '0x89ea5ebd792f61423b5739449f7c6f394085735560152118019895876dfedc22',\n [Stage.TESTNET]: '0xea6575eb7042529451de4be4d113e4d11b623db2221e613781199e10ff6b041d',\n [Stage.SANDBOX]: '0x6f1e8a995402af6e7806176202927c84fee1a6e07ae6143be9143811cc87d2f',\n}\n\nexport const TREASURY_ADDRESS: { [stage in Stage]?: string } = {\n [Stage.MAINNET]: '0x47ed8d8ccd2eb258950bbebeca06f18828832422785100fcd458ec14b6ccb73e',\n [Stage.TESTNET]: '0x7081e9d11f24283f18c8cc0cd5add340c36329bd577e1390fdda0426640ebde0',\n [Stage.SANDBOX]: '0xbc2e6b95b83dc18dae9ed54630c6c3075239c3e574bc4520b3f71332b7282013',\n}\n\nexport const ENDPOINT_V2_COMMON: { [stage in Stage]?: string } = {\n [Stage.MAINNET]: '0x7aa83ccf30a1dfa4637f745ecfe4bfef2a5266cf4423a03e52e2983d4f0dd82a',\n [Stage.TESTNET]: '0x8451402fdd9c7c959246667e1bd3a96109e175ca322242f4ed75eed9e0d35723',\n [Stage.SANDBOX]: '0x3c6d605576f2cbc3a627c5cfce28a30e8c2747e8e1a7f2d6816fdd0dfba8d6c2',\n}\n\nexport const DVN_FEE_LIB: { [stage in Stage]?: string } = {\n [Stage.MAINNET]: '0x753ce30d577abb046f7b1691dbc520281c8a45aed20fe1aacc21f683b7dc0d5c',\n [Stage.TESTNET]: '0x8382276eb833cb4526cfccbbc86348366100ca26d3761086ab868e188b9e08a3',\n [Stage.SANDBOX]: '0x10c41a5ac21901b97211469f46afddcb74b6c26cd925229dd73088aba470fcc5',\n}\n\nexport const EXECUTOR_FEE_LIB: { [stage in Stage]?: string } = {\n [Stage.MAINNET]: '0xb8d9c6a52154738957055420ef16a662cc062811a4b6753854eae95cf9e6f82f',\n [Stage.TESTNET]: '0x50b7a15f8ffa96784769a73e651fa3b1d9e00c372898d260fb4cdb0505cc12cb',\n [Stage.SANDBOX]: '0x165d3bdaa57a3d3622f23514709b11ec6c43c8c2bcab364624bcbc8bf1770fa',\n}\n\nexport const DEPLOY_TO_OBJECT: { [stage in Stage]?: string } = {\n [Stage.MAINNET]: '0x838c8daa1ba8b2e01617d4d50620cb5ea98c61a6',\n [Stage.TESTNET]: '0xd74239090db4dc740c3e5a9bdd7918fb39f4f250',\n [Stage.SANDBOX]: '0xd01d8dfbfb8bf0a5f27621895a6c26c8d2b13203',\n}\n","import { AccAddress, CreateTxOptions, Msg, MsgExecute, MsgExecuteJSON, MsgScript, Wallet, bcs } from '@initia/initia.js'\n\nimport { TransactionRequest } from '@layerzerolabs/lz-core'\nimport { EntryFunctionArgumentTypes, InputEntryFunctionData } from '@layerzerolabs/move-definitions'\n\nimport { InitiaBuildTxRequest } from './types'\n\n/**\n * Builds a transaction.\n *\n * @param {Wallet} nativeSigner - The nativeSigner or the address of the sender.\n * @param {InitiaBuildTxRequest} buildTxRequest - The transaction request to build.\n * @returns {Promise<TransactionRequest>} A promise that resolves to the built transaction request.\n * @throws {Error} If the gas price is invalid.\n */\nexport async function buildTransaction(\n nativeSigner: Wallet | AccAddress,\n buildTxRequest: InitiaBuildTxRequest\n): Promise<TransactionRequest> {\n const sender = nativeSigner instanceof Wallet ? nativeSigner.key.accAddress.toString() : nativeSigner.toString()\n let msg: Msg\n if (buildTxRequest.payload.function.split('::').length === 3) {\n // entry function transaction\n msg = convertPayloadToMsgExecute(sender, buildTxRequest.payload)\n } else {\n msg = convertPayloadToMsgScript(sender, buildTxRequest.payload)\n }\n const createOptions: CreateTxOptions & {\n sequence?: number\n } = {\n msgs: [msg],\n }\n if (buildTxRequest.options?.gas !== undefined) {\n createOptions.gas = buildTxRequest.options.gas\n }\n if (buildTxRequest.options?.gasPrice !== undefined) {\n if (isNaN(Number(buildTxRequest.options.gasPrice)) && buildTxRequest.options.gasPrice.endsWith('uinit')) {\n createOptions.gasPrices = buildTxRequest.options.gasPrice\n } else if (!isNaN(Number(buildTxRequest.options.gasPrice))) {\n createOptions.gasPrices = `${buildTxRequest.options.gasPrice}uinit`\n } else {\n throw Error(`Invalid gas price for initia :${buildTxRequest.options.gasPrice}`)\n }\n }\n if (buildTxRequest.options?.sequence !== undefined) {\n createOptions.sequence = buildTxRequest.options.sequence\n }\n return Promise.resolve(TransactionRequest.from(createOptions))\n}\n\n/**\n * Builds a transaction.\n *\n * @param {Wallet} nativeSigner - The nativeSigner or the address of the sender.\n * @param {InitiaBuildTxRequest} buildTxRequest - The transaction request to build.\n * @returns {Promise<TransactionRequest>} A promise that resolves to the built transaction request.\n * @throws {Error} If the gas price is invalid.\n */\nexport async function buildInitiaMultisigTransaction(\n nativeSigner: Wallet | AccAddress,\n multisigAddress: string,\n buildTxRequest: InitiaBuildTxRequest\n): Promise<TransactionRequest> {\n const sender = nativeSigner instanceof Wallet ? nativeSigner.key.accAddress.toString() : nativeSigner.toString()\n let msg: Msg\n if (buildTxRequest.payload.function.split('::').length === 3) {\n // entry function transaction\n msg = convertPayloadToMultisigMsgExecute(sender, multisigAddress, buildTxRequest.payload)\n } else {\n throw new Error('No support multisig for script payload')\n }\n const createOptions: CreateTxOptions & {\n sequence?: number\n } = {\n msgs: [msg],\n }\n if (buildTxRequest.options?.gas !== undefined) {\n createOptions.gas = buildTxRequest.options.gas\n }\n if (buildTxRequest.options?.gasPrice !== undefined) {\n if (isNaN(Number(buildTxRequest.options.gasPrice)) && buildTxRequest.options.gasPrice.endsWith('uinit')) {\n createOptions.gasPrices = buildTxRequest.options.gasPrice\n } else if (!isNaN(Number(buildTxRequest.options.gasPrice))) {\n createOptions.gasPrices = `${buildTxRequest.options.gasPrice}uinit`\n } else {\n throw Error(`Invalid gas price for initia :${buildTxRequest.options.gasPrice}`)\n }\n }\n if (buildTxRequest.options?.sequence !== undefined) {\n createOptions.sequence = buildTxRequest.options.sequence\n }\n return Promise.resolve(TransactionRequest.from(createOptions))\n}\n\n/**\n * Converts a payload to a MsgExecute object for the Initia blockchain.\n *\n * @param {string} sender - The address of the sender.\n * @param {InputEntryFunctionData} payload - The payload of the transaction.\n * @returns {Msg} The MsgExecute object.\n */\nexport function convertPayloadToMsgExecute(sender: string, payload: InputEntryFunctionData): Msg {\n const functionStructs = payload.function.split('::')\n const moduleAddress = functionStructs[0]\n const moduleName = functionStructs[1]\n const functionName = functionStructs[2]\n const args = covertPayloadArgs(payload.functionArgumentTypes ?? [], payload.functionArguments)\n const msg = new MsgExecute(\n sender, // sender address\n moduleAddress, // module owner address\n moduleName, // module name\n functionName, // function name\n payload.typeArguments ?? [], // type args\n args\n )\n return msg\n}\n\nexport function convertPayloadToMultisigMsgExecute(\n sender: string,\n multisigAddress: string,\n payload: InputEntryFunctionData\n): Msg {\n const functionStructs = payload.function.split('::')\n const moduleAddress = functionStructs[0]\n const moduleName = functionStructs[1]\n const functionName = functionStructs[2]\n\n function PrettierBigNumber(_key: unknown, value: unknown): any {\n if (typeof value === 'bigint') {\n return value.toString()\n }\n return value\n }\n\n const msgCreateProposal = new MsgExecuteJSON(\n sender,\n '0x1',\n 'multisig_v2',\n 'create_proposal_with_json',\n [],\n [\n multisigAddress, // multisig address\n [moduleAddress], // module addresses\n [moduleName], // module names\n [functionName], // function names\n [[]], // function type args\n [payload.functionArguments.map((v) => JSON.stringify(v, PrettierBigNumber))], // function args\n null, // expiry duration //TODO how many time need to expire\n ].map((v) => JSON.stringify(v, PrettierBigNumber))\n )\n\n return msgCreateProposal\n}\n\n/**\n * Converts a payload to a MsgScript object for the Initia blockchain.\n *\n * @param {string} sender - The address of the sender.\n * @param {InputEntryFunctionData} payload - The payload of the transaction.\n * @returns {Msg} The MsgScript object.\n */\nexport function convertPayloadToMsgScript(sender: string, payload: InputEntryFunctionData): Msg {\n const args = covertPayloadArgs(payload.functionArgumentTypes ?? [], payload.functionArguments)\n const msg = new MsgScript(\n sender, // sender address\n Buffer.from(payload.function, 'hex').toString('base64'), // function\n payload.typeArguments,\n args\n )\n return msg\n}\n\n/**\n * Converts payload arguments to a list of strings.\n *\n * @param {string[]} functionArgumentTypes - The types of the function arguments.\n * @param {EntryFunctionArgumentTypes[]} functionArguments - The function arguments.\n * @returns {string[]} The list of converted arguments.\n */\nexport function covertPayloadArgs(\n functionArgumentTypes: string[],\n functionArguments: EntryFunctionArgumentTypes[]\n): string[] {\n const args: string[] = []\n for (let i = 0; i < functionArguments.length; i++) {\n args.push(convertArg(functionArgumentTypes[i], functionArguments[i]))\n }\n return args\n}\n\n/**\n * Converts a single argument to a string based on its type.\n *\n * @param {string} argsType - The type of the argument.\n * @param {EntryFunctionArgumentTypes} arg - The argument to convert.\n * @returns {string} The converted argument as a string.\n * @throws {Error} If the argument type is invalid.\n */\nexport function convertArg(argsType: string, arg: EntryFunctionArgumentTypes): string {\n switch (argsType) {\n case 'bool':\n return bcs\n .bool()\n .serialize(arg as boolean)\n .toBase64()\n case 'u256':\n return bcs\n .u256()\n .serialize(arg as bigint)\n .toBase64()\n case 'u128':\n return bcs\n .u128()\n .serialize(arg as bigint)\n .toBase64()\n case 'u64':\n return bcs\n .u64()\n .serialize(arg as bigint)\n .toBase64()\n case 'u32':\n return bcs\n .u32()\n .serialize(arg as number)\n .toBase64()\n case 'u16':\n return bcs\n .u16()\n .serialize(arg as number)\n .toBase64()\n case 'u8':\n return bcs\n .u8()\n .serialize(arg as number)\n .toBase64()\n case 'address':\n return bcs\n .address()\n .serialize(arg as string)\n .toBase64()\n case 'vector<u8>':\n return bcs\n .vector(bcs.u8())\n .serialize(arg as unknown as Uint8Array)\n .toBase64()\n case 'vector<address>':\n return bcs\n .vector(bcs.address())\n .serialize(arg as unknown as string[])\n .toBase64()\n case 'vector<vector<u8>>':\n return bcs\n .vector(bcs.vector(bcs.u8()))\n .serialize(arg as unknown as Uint8Array[])\n .toBase64()\n default:\n // eslint-disable-next-line @typescript-eslint/restrict-template-expressions\n throw new Error(`Invalid type argsType: ${argsType.toString()}`)\n }\n}\n","import { AccAddress, LCDClient, MnemonicKey, TxError, WaitTxBroadcastResult, Wallet } from '@initia/initia.js'\n\nimport { Provider } from '@layerzerolabs/lz-core'\nimport { InitiaProvider, InitiaSigner } from '@layerzerolabs/lz-corekit-initia'\nimport { Stage } from '@layerzerolabs/lz-definitions'\nimport { AccountsOption, LayerZeroModulesSdk, MoveSdkImpl } from '@layerzerolabs/lz-movevm-sdk-v2'\nimport {\n EntryFunctionArgumentTypes,\n GasOptions,\n MnemonicAndPath,\n MoveAbortError,\n MoveFunction,\n MoveResourceNotFoundError,\n MoveStructId,\n MoveTableItemNotFoundError,\n MoveValue,\n PrivateKey,\n TableItemRequest,\n TransactionResponse,\n UnclassifiedError,\n isMnemonicAndPath,\n isPrivateKey,\n} from '@layerzerolabs/move-definitions'\n\nimport {\n COUNTER_V2_ADDRESS,\n DEPLOY_TO_OBJECT,\n DVN_ADDRESS,\n ENDPOINT_V2_ADDRESS,\n ENDPOINT_V2_COMMON,\n EXECUTOR_ADDRESS,\n LAYERZERO_VIEWS_ADDRESS,\n OFT_ADDRESS,\n PRICE_FEED,\n SIMPLE_MESSAGE_LIB_ADDRESS,\n TREASURY_ADDRESS,\n ULN_MESSAGE_LIB_ADDRESS,\n WORKER_COMMON,\n} from './generated/addresses'\nimport { InitiaBuildTxRequestOptions } from './types'\nimport { buildTransaction, convertArg, covertPayloadArgs } from './utils'\n\nexport * from './generated/addresses'\n\n/**\n * Options for initializing the SDK.\n */\nexport interface SdkOptions {\n /**\n * The provider for the SDK.\n */\n provider: InitiaProvider\n\n /**\n * The stage of the SDK (optional).\n * default value is Stage.SANDBOX\n */\n stage?: Stage\n\n /**\n * The accounts option (optional).\n * default value is read from generated/addresses.ts\n */\n accounts?: AccountsOption\n}\n\n/**\n * Creates an instance of the SDK from the given provider.\n *\n * @param {Provider} provider - The provider of the current chain. {@link InitiaProvider}.\n * @param {Stage} [stage] - The stage of the SDK. {@link Stage}\n * @returns {SDK} The initialized SDK instance.\n */\nexport function getSDKFromProvider(provider: Provider, stage?: Stage): SDK {\n return new SDK({ provider: provider as InitiaProvider, stage })\n}\n\n/**\n * Interface representing an Axios error, which returned by the chain node.\n */\ninterface AxiosError {\n response: {\n data: {\n code: number\n message: string\n }\n }\n}\n\n/**\n * Checks if the given error is an AxiosError.\n *\n * @param {any} error - The error to check.\n * @returns {error is AxiosError} True if the error is an AxiosError, false otherwise.\n */\nfunction isAxiosError(error: any): error is AxiosError {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n return error?.response?.data?.message !== undefined\n}\n\n/**\n * Checks if the given transaction result is a TxError.\n *\n * @param {unknown} tx - The transaction result to check, for initia the result type is {@link WaitTxBroadcastResult}.\n * @returns {tx is TxError} True if the transaction result is a TxError, false otherwise.\n */\nfunction isTxError(tx: unknown): tx is TxError {\n return tx instanceof Object && 'code' in tx && Number(tx.code) !== 0\n}\n\n/**\n * The SDK class provides methods to interact with the Initia.\n * For usage, please check [README.md](../README.md).\n *\n * @implements {MoveSdkImpl<MnemonicKey>}\n */\nexport class SDK implements MoveSdkImpl<MnemonicKey> {\n stage: Stage\n provider: InitiaProvider\n LayerzeroModule: LayerZeroModulesSdk<MnemonicKey>\n accounts: AccountsOption\n\n /**\n * Creates an instance of the SDK.\n *\n * @param {SdkOptions} options - The SDK options.\n */\n constructor(options: SdkOptions) {\n this.stage = options.stage ?? Stage.SANDBOX\n this.accounts = options.accounts ?? {\n endpoint_v2: this.toHexAddress(ENDPOINT_V2_ADDRESS[this.stage] ?? '0x0'),\n counter_v2: this.toHexAddress(COUNTER_V2_ADDRESS[this.stage] ?? '0x0'),\n oft: this.toHexAddress(OFT_ADDRESS[this.stage] ?? '0x0'),\n layerzero_views: this.toHexAddress(LAYERZERO_VIEWS_ADDRESS[this.stage] ?? '0x0'),\n simple_message_lib: this.toHexAddress(SIMPLE_MESSAGE_LIB_ADDRESS[this.stage] ?? '0x0'),\n uln_message_lib: this.toHexAddress(ULN_MESSAGE_LIB_ADDRESS[this.stage] ?? '0x0'),\n executor: this.toHexAddress(EXECUTOR_ADDRESS[this.stage] ?? '0x0'),\n dvn: this.toHexAddress(DVN_ADDRESS[this.stage] ?? '0x0'),\n worker_common: this.toHexAddress(WORKER_COMMON[this.stage] ?? '0x0'),\n price_feed: this.toHexAddress(PRICE_FEED[this.stage] ?? '0x0'),\n treasury: this.toHexAddress(TREASURY_ADDRESS[this.stage] ?? '0x0'),\n endpoint_v2_common: this.toHexAddress(ENDPOINT_V2_COMMON[this.stage] ?? '0x0'),\n deploy_to_object: this.toHexAddress(DEPLOY_TO_OBJECT[this.stage] ?? '0x0'),\n }\n this.provider = options.provider\n this.LayerzeroModule = new LayerZeroModulesSdk(this)\n }\n\n /**\n * Gets the Initia native client.\n *\n * @returns {LCDClient} The Initia native client.\n */\n getLCDClient(): LCDClient {\n return this.provider.native\n }\n\n /**\n * Executes a view function.\n * @implements {MoveSdkImpl<MnemonicKey>}\n *\n * @param {Object} args - The arguments for the view function.\n * @param {MoveFunction} args.functionName - The name of the function.\n * @param {EntryFunctionArgumentTypes[]} args.functionArgs - The arguments for the function.\n * @param {string[]} [args.functionArgTypes] - The types of the arguments.\n * @param {string[]} [args.typeArgs] - The type arguments.\n * @returns {Promise<MoveValue[]>} The result of the view function.\n */\n async viewFunction(args: {\n functionName: MoveFunction\n functionArgs: EntryFunctionArgumentTypes[]\n functionArgTypes?: string[]\n typeArgs?: string[]\n }): Promise<MoveValue[]> {\n const argsStrings = covertPayloadArgs(args.functionArgTypes ?? [], args.functionArgs)\n const [moduleAddress, moduleName, functionName] = args.functionName.split('::')\n try {\n const viewFunctionData = await this.provider.native.move.viewFunction<MoveValue>(\n moduleAddress,\n moduleName,\n functionName,\n args.typeArgs ?? [],\n argsStrings\n )\n return [viewFunctionData]\n } catch (e) {\n throw this.handleError(e)\n }\n }\n\n /**\n * Normalizes the given signer.\n * @implements {MoveSdkImpl<MnemonicKey>}\n *\n * @param {MnemonicKey | PrivateKey | MnemonicAndPath} signer - The signer to normalize.\n * @returns {MnemonicKey} The normalized signer.\n */\n normalizeSigner(signer: MnemonicKey | PrivateKey | MnemonicAndPath): MnemonicKey {\n if (signer instanceof MnemonicKey) {\n return signer\n } else if (isMnemonicAndPath(signer)) {\n const { mnemonic, path } = signer\n const [_, coinType, account, __, index] = path.match(/\\d+/g)?.map(Number) ?? []\n return new MnemonicKey({\n mnemonic,\n coinType,\n account,\n index,\n })\n } else if (isPrivateKey(signer)) {\n return MnemonicKey.fromHex(signer) as MnemonicKey\n }\n throw new Error(`Invalid signer`)\n }\n\n /**\n * Converts the given account to an address.\n * @implements {MoveSdkImpl<MnemonicKey>}\n *\n * @param {MnemonicKey} account - The account to convert.\n * @returns {string} The address of the account.\n */\n accountToAddress(account: MnemonicKey): string {\n return this.toHexAddress(account.accAddress)\n }\n\n /**\n * Converts an address to a Bech32 address.\n * For more details about Bech32 addresses, see https://thebitcoinmanual.com/articles/btc-bech32-address/.\n *\n * @param {string | Uint8Array} anyAddress - The address to convert. It can be a string or a Uint8Array.\n * @returns {string} The Bech32 address.\n */\n toBech32Address(anyAddress: string | Uint8Array): string {\n if (anyAddress instanceof Uint8Array) {\n anyAddress = Buffer.from(anyAddress).toString('hex')\n }\n if (AccAddress.validate(anyAddress)) {\n return anyAddress\n }\n return AccAddress.fromHex(anyAddress)\n }\n\n /**\n * Converts an address to a hexadecimal string.\n *\n * @param {string | Uint8Array} anyAddress - The address to convert.\n * @returns {string} The hexadecimal string representation of the address.\n */\n toHexAddress(anyAddress: string | Uint8Array): string {\n if (anyAddress instanceof Uint8Array) {\n anyAddress = Buffer.from(anyAddress).toString('hex')\n }\n if (AccAddress.validate(anyAddress)) {\n return AccAddress.toHex(anyAddress)\n }\n return anyAddress\n }\n\n /**\n * Handles errors and returns appropriate error instances based on the error type.\n *\n * @param {unknown} e - The error to handle.\n * @returns {unknown} The handled error, which could be an instance of MoveAbortError, MoveResourceNotFoundError, UnclassifiedError, or the original error.\n */\n handleError(e: unknown): unknown {\n if (isAxiosError(e)) {\n const errorString = e.response.data.message\n const codeMatch = errorString.match(/code=(\\d+)/)\n if (errorString.includes('VM aborted') && codeMatch !== null) {\n const code = parseInt(codeMatch[1])\n return new MoveAbortError(code, e.response.data.message)\n } else if (errorString.startsWith('collections: not found')) {\n return new MoveResourceNotFoundError(e.response.data.message)\n } else if (errorString.includes('MISSING_DATA')) {\n return new MoveResourceNotFoundError(e.response.data.message)\n } else {\n return new UnclassifiedError(e.response.data.message)\n }\n }\n return e\n }\n\n /**\n * Sends a transaction and waits for confirmation.\n * @implements {MoveSdkImpl<MnemonicKey>}\n *\n * @param {MnemonicKey | PrivateKey | MnemonicAndPath} sender - The sender of the transaction.\n * @param {MoveFunction} func - The function to call.\n * @param {EntryFunctionArgumentTypes[]} args - The arguments for the function.\n * @param {string[]} [argTypes] - The types of the arguments for the function.\n * @param {GasOptions} [gasOptions] - The gas options.\n * @param {string[]} [typeArguments] - The type arguments.\n * @returns {Promise<TransactionResponse>} The transaction response.\n */\n async sendAndConfirmTransaction(\n sender: MnemonicKey | PrivateKey | MnemonicAndPath,\n func: MoveFunction,\n args: EntryFunctionArgumentTypes[],\n argTypes?: string[],\n gasOptions?: GasOptions,\n typeArguments?: string[]\n ): Promise<TransactionResponse> {\n try {\n sender = this.normalizeSigner(sender)\n const coreSigner = InitiaSigner.from(sender).connect(this.provider)\n\n const buildTxRequestOption: InitiaBuildTxRequestOptions = {\n gas: gasOptions?.gasLimit,\n gasPrice: gasOptions?.gasPrice !== undefined ? `${gasOptions.gasPrice}uinit` : undefined,\n }\n\n const txRequest = await buildTransaction(coreSigner.native as Wallet, {\n payload: {\n function: func,\n functionArguments: args,\n functionArgumentTypes: argTypes,\n typeArguments: typeArguments,\n },\n options: buildTxRequestOption,\n })\n const signedTx = await coreSigner.signTransaction(txRequest)\n\n const txReceipt = await coreSigner.sendAndConfirm(signedTx)\n const result = txReceipt.receipt as WaitTxBroadcastResult\n\n if (isTxError(result)) {\n throw Error(result.raw_log)\n }\n return {\n hash: result.txhash,\n sender: sender.accAddress,\n raw: result,\n }\n } catch (e) {\n throw this.handleError(e)\n }\n }\n\n /**\n * Gets an account resource.\n * @implements {MoveSdkImpl<MnemonicKey>}\n *\n * @param {Object} args - The arguments for getting the account resource.\n * @param {string | Uint8Array} args.accountAddress - The account address.\n * @param {MoveStructId} args.resourceType - The type of the resource.\n * @param {Object} [args.options] - The options for getting the resource.\n * @returns {Promise<T>} The account resource.\n * @template T - The type of the resource.\n */\n async getAccountResource<T extends NonNullable<unknown> = any>(args: {\n accountAddress: string | Uint8Array\n resourceType: MoveStructId\n options?: unknown\n }): Promise<T> {\n try {\n const address = this.toHexAddress(args.accountAddress)\n const { data } = await this.provider.native.move.resource(address, args.resourceType)\n return data as T\n } catch (e) {\n if (isAxiosError(e) && e.response.data.message.startsWith('collections: not found')) {\n throw new MoveResourceNotFoundError(e.response.data.message)\n }\n throw e\n }\n }\n\n /**\n * Gets a table item.\n * @implements {MoveSdkImpl<MnemonicKey>}\n *\n * @param {Object} args - The arguments for getting the table item.\n * @param {string} args.handle - The table handle.\n * @param {TableItemRequest} args.data - The key of the item.\n * @param {Object} [args.options] - The options for getting the item.\n * @returns {Promise<T>} The table item.\n * @template T - The type of the item.\n */\n async getTableItem<T>(args: { handle: string; data: TableItemRequest; options?: unknown }): Promise<T> {\n try {\n const res = await this.provider.native.move.tableEntry(\n args.handle,\n convertArg(args.data.key_type as string, args.data.key as EntryFunctionArgumentTypes)\n )\n const { value } = res\n const valueObject = JSON.parse(value) as { [key: string]: T }\n return Object.values(valueObject)[0]\n } catch (e) {\n if (isAxiosError(e) && e.response.data.message.startsWith('collections: not found')) {\n throw new MoveTableItemNotFoundError(e.response.data.message)\n }\n throw e\n }\n }\n\n /**\n * Normalizes the given address.\n * @implements {MoveSdkImpl<MnemonicKey>}\n *\n * @param {string} address - The address to normalize.\n * @returns {string} The normalized address.\n */\n normalizeAddress(address: string): string {\n return address\n }\n\n /**\n * Checks if the SDK supports coins.\n * @implements {MoveSdkImpl<MnemonicKey>}\n *\n * @returns {boolean} True if the SDK supports coins, false otherwise.\n */\n supportsCoin(): boolean {\n return false\n }\n\n /**\n * Checks if the given address is a valid object address.\n * @param address\n */\n async isObjectAddress(address: string): Promise<boolean> {\n try {\n await this.getAccountResource({\n accountAddress: address,\n resourceType: '0x1::object::ObjectCore',\n })\n return true\n } catch (e) {\n return false\n }\n }\n}\n\nexport * from './types'\nexport * from './utils'\n"]}
1
+ {"version":3,"sources":["../src/generated/addresses.ts","../src/utils.ts","../src/index.ts"],"names":["Stage","initia","TransactionRequest","LayerZeroModulesSdk","isMnemonicAndPath","isPrivateKey","MoveAbortError","MoveResourceNotFoundError","UnclassifiedError","InitiaSigner","MoveTableItemNotFoundError"],"mappings":";;;;;;;;;;;;;;AAGO,IAAM,mBAAqD,GAAA;AAAA,EAC9D,CAACA,mBAAM,CAAA,OAAO,GAAG,oEAAA;AAAA,EACjB,CAACA,mBAAM,CAAA,OAAO,GAAG,oEAAA;AAAA,EACjB,CAACA,mBAAM,CAAA,OAAO,GAAG;AACrB;AAEO,IAAM,0BAA4D,GAAA;AAAA,EACrE,CAACA,mBAAM,CAAA,OAAO,GAAG,oEAAA;AAAA,EACjB,CAACA,mBAAM,CAAA,OAAO,GAAG,oEAAA;AAAA,EACjB,CAACA,mBAAM,CAAA,OAAO,GAAG;AACrB;AAEO,IAAM,uBAAyD,GAAA;AAAA,EAClE,CAACA,mBAAM,CAAA,OAAO,GAAG,oEAAA;AAAA,EACjB,CAACA,mBAAM,CAAA,OAAO,GAAG,oEAAA;AAAA,EACjB,CAACA,mBAAM,CAAA,OAAO,GAAG;AACrB;AAEO,IAAM,kBAAoD,GAAA;AAAA,EAC7D,CAACA,mBAAM,CAAA,OAAO,GAAG,oEAAA;AAAA,EACjB,CAACA,mBAAM,CAAA,OAAO,GAAG,mEAAA;AAAA,EACjB,CAACA,mBAAM,CAAA,OAAO,GAAG;AACrB;AAEO,IAAM,WAA6C,GAAA;AAAA,EACtD,CAACA,mBAAM,CAAA,OAAO,GAAG,oEAAA;AAAA,EACjB,CAACA,mBAAM,CAAA,OAAO,GAAG,oEAAA;AAAA,EACjB,CAACA,mBAAM,CAAA,OAAO,GAAG;AACrB;AAEO,IAAM,uBAAyD,GAAA;AAAA,EAClE,CAACA,mBAAM,CAAA,O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AACX;AAER","file":"index.cjs","sourcesContent":["// WARNING: Do not change this code. It is auto generated.\n// If you want some new feature, please update generate-addresses.ts.\nimport {Stage} from '@layerzerolabs/lz-definitions'\nexport const ENDPOINT_V2_ADDRESS: { [stage in Stage]?: string } = {\n [Stage.MAINNET]: '0x81d2b534893db8745ab2b0c092ec5f88d554d54825f98fd9e8c83f9b113ee77e',\n [Stage.TESTNET]: '0xcc4e9fda80712972deb0338d85b84822a42d5155b645ef1b2eeae42cedd41b04',\n [Stage.SANDBOX]: '0x4cfd96a8b3d7bff492fd490568c66a9117fe25f7154f7bdecae9649dd99bf551',\n}\n\nexport const SIMPLE_MESSAGE_LIB_ADDRESS: { [stage in Stage]?: string } = {\n [Stage.MAINNET]: '0x32cff077e36f28969f01b92e29e643e74289ed86b51d420f1202c1bc736a2a5f',\n [Stage.TESTNET]: '0xd6fb80799f09bcd7784e1c5cd065a84cac826ce4c49f9c6893cbd9c753fada6a',\n [Stage.SANDBOX]: '0x2fc80c0b184ad67e85a30dc4b5e4de5b519c07f2fedb46ab4ca60783c6a095e6',\n}\n\nexport const ULN_MESSAGE_LIB_ADDRESS: { [stage in Stage]?: string } = {\n [Stage.MAINNET]: '0x5aab6aa28749dd073c26c4703e14eb7e89dd6a25abc2e1f0e98de59f8203a012',\n [Stage.TESTNET]: '0x3e1b182c40965a986133798e1da76302ef327de2c32c58110361587560285e88',\n [Stage.SANDBOX]: '0x59c8706450b668ea055c95eedfd0a9b29ee43d6b6035649ccaac58300d603d02',\n}\n\nexport const COUNTER_V2_ADDRESS: { [stage in Stage]?: string } = {\n [Stage.MAINNET]: '0x27b7ea8a7a98e48029f0170caf52d8d631ce7433a043a87e5bfc29d8d0a4c240',\n [Stage.TESTNET]: '0xf57ffea0a6dfd7e98a0e5f7e36515f2e8622931c6fb5b690528271707213540',\n [Stage.SANDBOX]: '0xe45e57fa31ac68e748511462beb185ea1fbc544a4833a92f4bd7553e3defcaa0',\n}\n\nexport const OFT_ADDRESS: { [stage in Stage]?: string } = {\n [Stage.MAINNET]: '0x6a54eb11fa99dfe3b0cf219e4b125f72f607f9948d7fe36c32f84af736f96cc9',\n [Stage.TESTNET]: '0x18fcbd1705146f06d901cf65da36bf82367801445e265f3d042ac2d187c9c2f3',\n [Stage.SANDBOX]: '0xffae52435cdf714b1966594b38025bc12de1a18531ce3731ae28179b44498d5c',\n}\n\nexport const LAYERZERO_VIEWS_ADDRESS: { [stage in Stage]?: string } = {\n [Stage.MAINNET]: '0x79cc082b54f649d8ac00d372715b951a8a604ee31814c6019110c9b4aebb2c23',\n [Stage.TESTNET]: '0x122ddbfee4da1a173ac45f5672bb1e51626142e68f4adf3ecf03a96546058fdc',\n [Stage.SANDBOX]: '0x39439bfb5a35a2df9fe800572c8f37c4748e6721bf775fa9022d0a14df087eeb',\n}\n\nexport const EXECUTOR_ADDRESS: { [stage in Stage]?: string } = {\n [Stage.MAINNET]: '0xaa3f42a2955bec10bb58b7d95aa2e7471499e26b220c92aced179041f152c8b7',\n [Stage.TESTNET]: '0x798c194c8740dde76a0e3f46f444f7ee974765abb2a9db98be03a0ee89ce050c',\n [Stage.SANDBOX]: '0x453fbcf26de58a231366b55431bcaec34bde7803399c486d0591ab2241b2e5ee',\n}\n\nexport const DVN_ADDRESS: { [stage in Stage]?: string } = {\n [Stage.MAINNET]: '0xd8717e05c622a366394bedb326ca10e6a34b25df20ec9b572382b65c8a68461f',\n [Stage.TESTNET]: '0x3f12330ba9e26a604e2149b4b67c0710d32fcbc3de0bea76dd43dbb6b747bc8c',\n [Stage.SANDBOX]: '0x7f890e79ba7c2011afa5dbf63849b7dc7f56c7c2bf82318a0142ac238dab4950',\n}\n\nexport const WORKER_COMMON: { [stage in Stage]?: string } = {\n [Stage.MAINNET]: '0x64418278adf0c593b9a241e0258590d58966430ca9fc203b03f4cf37209cf6c7',\n [Stage.TESTNET]: '0xb293d24e62db7ceeca5ba2d3f359ce5eb3733975e66707dcd51bc56bc99cce3e',\n [Stage.SANDBOX]: '0x65653b11aa3392f1d33743f43c4498c1ce37996a655ffa8e29797f343dcbc2ab',\n}\n\nexport const PRICE_FEED: { [stage in Stage]?: string } = {\n [Stage.MAINNET]: '0x89ea5ebd792f61423b5739449f7c6f394085735560152118019895876dfedc22',\n [Stage.TESTNET]: '0xea6575eb7042529451de4be4d113e4d11b623db2221e613781199e10ff6b041d',\n [Stage.SANDBOX]: '0x6f1e8a995402af6e7806176202927c84fee1a6e07ae6143be9143811cc87d2f',\n}\n\nexport const TREASURY_ADDRESS: { [stage in Stage]?: string } = {\n [Stage.MAINNET]: '0x47ed8d8ccd2eb258950bbebeca06f18828832422785100fcd458ec14b6ccb73e',\n [Stage.TESTNET]: '0x7081e9d11f24283f18c8cc0cd5add340c36329bd577e1390fdda0426640ebde0',\n [Stage.SANDBOX]: '0xbc2e6b95b83dc18dae9ed54630c6c3075239c3e574bc4520b3f71332b7282013',\n}\n\nexport const ENDPOINT_V2_COMMON: { [stage in Stage]?: string } = {\n [Stage.MAINNET]: '0x7aa83ccf30a1dfa4637f745ecfe4bfef2a5266cf4423a03e52e2983d4f0dd82a',\n [Stage.TESTNET]: '0x8451402fdd9c7c959246667e1bd3a96109e175ca322242f4ed75eed9e0d35723',\n [Stage.SANDBOX]: '0x3c6d605576f2cbc3a627c5cfce28a30e8c2747e8e1a7f2d6816fdd0dfba8d6c2',\n}\n\nexport const DVN_FEE_LIB: { [stage in Stage]?: string } = {\n [Stage.MAINNET]: '0x753ce30d577abb046f7b1691dbc520281c8a45aed20fe1aacc21f683b7dc0d5c',\n [Stage.TESTNET]: '0x8382276eb833cb4526cfccbbc86348366100ca26d3761086ab868e188b9e08a3',\n [Stage.SANDBOX]: '0x10c41a5ac21901b97211469f46afddcb74b6c26cd925229dd73088aba470fcc5',\n}\n\nexport const EXECUTOR_FEE_LIB: { [stage in Stage]?: string } = {\n [Stage.MAINNET]: '0xb8d9c6a52154738957055420ef16a662cc062811a4b6753854eae95cf9e6f82f',\n [Stage.TESTNET]: '0x50b7a15f8ffa96784769a73e651fa3b1d9e00c372898d260fb4cdb0505cc12cb',\n [Stage.SANDBOX]: '0x165d3bdaa57a3d3622f23514709b11ec6c43c8c2bcab364624bcbc8bf1770fa',\n}\n\nexport const DEPLOY_TO_OBJECT: { [stage in Stage]?: string } = {\n [Stage.MAINNET]: '0x838c8daa1ba8b2e01617d4d50620cb5ea98c61a6',\n [Stage.TESTNET]: '0xd74239090db4dc740c3e5a9bdd7918fb39f4f250',\n [Stage.SANDBOX]: '0xd01d8dfbfb8bf0a5f27621895a6c26c8d2b13203',\n}\n","// eslint-disable-next-line import/default\nimport initia from '@initia/initia.js'\n\nimport { TransactionRequest } from '@layerzerolabs/lz-core'\nimport { EntryFunctionArgumentTypes, InputEntryFunctionData } from '@layerzerolabs/move-definitions'\n\nimport { InitiaBuildTxRequest } from './types'\n\n/**\n * Builds a transaction.\n *\n * @param {initia.Wallet} nativeSigner - The nativeSigner or the address of the sender.\n * @param {InitiaBuildTxRequest} buildTxRequest - The transaction request to build.\n * @returns {Promise<TransactionRequest>} A promise that resolves to the built transaction request.\n * @throws {Error} If the gas price is invalid.\n */\nexport async function buildTransaction(\n nativeSigner: initia.Wallet | initia.AccAddress,\n buildTxRequest: InitiaBuildTxRequest\n): Promise<TransactionRequest> {\n const sender =\n nativeSigner instanceof initia.Wallet ? nativeSigner.key.accAddress.toString() : nativeSigner.toString()\n let msg: initia.Msg\n if (buildTxRequest.payload.function.split('::').length === 3) {\n // entry function transaction\n msg = convertPayloadToMsgExecute(sender, buildTxRequest.payload)\n } else {\n msg = convertPayloadToMsgScript(sender, buildTxRequest.payload)\n }\n const createOptions: initia.CreateTxOptions & {\n sequence?: number\n } = {\n msgs: [msg],\n }\n if (buildTxRequest.options?.gas !== undefined) {\n createOptions.gas = buildTxRequest.options.gas\n }\n if (buildTxRequest.options?.gasPrice !== undefined) {\n if (isNaN(Number(buildTxRequest.options.gasPrice)) && buildTxRequest.options.gasPrice.endsWith('uinit')) {\n createOptions.gasPrices = buildTxRequest.options.gasPrice\n } else if (!isNaN(Number(buildTxRequest.options.gasPrice))) {\n createOptions.gasPrices = `${buildTxRequest.options.gasPrice}uinit`\n } else {\n throw Error(`Invalid gas price for initia :${buildTxRequest.options.gasPrice}`)\n }\n }\n if (buildTxRequest.options?.sequence !== undefined) {\n createOptions.sequence = buildTxRequest.options.sequence\n }\n return Promise.resolve(TransactionRequest.from(createOptions))\n}\n\n/**\n * Builds a transaction.\n *\n * @param {initia.Wallet} nativeSigner - The nativeSigner or the address of the sender.\n * @param {InitiaBuildTxRequest} buildTxRequest - The transaction request to build.\n * @returns {Promise<TransactionRequest>} A promise that resolves to the built transaction request.\n * @throws {Error} If the gas price is invalid.\n */\nexport async function buildInitiaMultisigTransaction(\n nativeSigner: initia.Wallet | initia.AccAddress,\n multisigAddress: string,\n buildTxRequest: InitiaBuildTxRequest\n): Promise<TransactionRequest> {\n const sender =\n nativeSigner instanceof initia.Wallet ? nativeSigner.key.accAddress.toString() : nativeSigner.toString()\n let msg: initia.Msg\n if (buildTxRequest.payload.function.split('::').length === 3) {\n // entry function transaction\n msg = convertPayloadToMultisigMsgExecute(sender, multisigAddress, buildTxRequest.payload)\n } else {\n throw new Error('No support multisig for script payload')\n }\n const createOptions: initia.CreateTxOptions & {\n sequence?: number\n } = {\n msgs: [msg],\n }\n if (buildTxRequest.options?.gas !== undefined) {\n createOptions.gas = buildTxRequest.options.gas\n }\n if (buildTxRequest.options?.gasPrice !== undefined) {\n if (isNaN(Number(buildTxRequest.options.gasPrice)) && buildTxRequest.options.gasPrice.endsWith('uinit')) {\n createOptions.gasPrices = buildTxRequest.options.gasPrice\n } else if (!isNaN(Number(buildTxRequest.options.gasPrice))) {\n createOptions.gasPrices = `${buildTxRequest.options.gasPrice}uinit`\n } else {\n throw Error(`Invalid gas price for initia :${buildTxRequest.options.gasPrice}`)\n }\n }\n if (buildTxRequest.options?.sequence !== undefined) {\n createOptions.sequence = buildTxRequest.options.sequence\n }\n return Promise.resolve(TransactionRequest.from(createOptions))\n}\n\n/**\n * Converts a payload to a MsgExecute object for the Initia blockchain.\n *\n * @param {string} sender - The address of the sender.\n * @param {InputEntryFunctionData} payload - The payload of the transaction.\n * @returns {initia.Msg} The MsgExecute object.\n */\nexport function convertPayloadToMsgExecute(sender: string, payload: InputEntryFunctionData): initia.Msg {\n const functionStructs = payload.function.split('::')\n const moduleAddress = functionStructs[0]\n const moduleName = functionStructs[1]\n const functionName = functionStructs[2]\n const args = covertPayloadArgs(payload.functionArgumentTypes ?? [], payload.functionArguments)\n const msg = new initia.MsgExecute(\n sender, // sender address\n moduleAddress, // module owner address\n moduleName, // module name\n functionName, // function name\n payload.typeArguments ?? [], // type args\n args\n )\n return msg\n}\n\nexport function convertPayloadToMultisigMsgExecute(\n sender: string,\n multisigAddress: string,\n payload: InputEntryFunctionData\n): initia.Msg {\n const functionStructs = payload.function.split('::')\n const moduleAddress = functionStructs[0]\n const moduleName = functionStructs[1]\n const functionName = functionStructs[2]\n\n function PrettierBigNumber(_key: unknown, value: unknown): any {\n if (typeof value === 'bigint') {\n return value.toString()\n }\n return value\n }\n\n const msgCreateProposal = new initia.MsgExecuteJSON(\n sender,\n '0x1',\n 'multisig_v2',\n 'create_proposal_with_json',\n [],\n [\n multisigAddress, // multisig address\n [moduleAddress], // module addresses\n [moduleName], // module names\n [functionName], // function names\n [[]], // function type args\n [payload.functionArguments.map((v) => JSON.stringify(v, PrettierBigNumber))], // function args\n null, // expiry duration //TODO how many time need to expire\n ].map((v) => JSON.stringify(v, PrettierBigNumber))\n )\n\n return msgCreateProposal\n}\n\n/**\n * Converts a payload to a MsgScript object for the Initia blockchain.\n *\n * @param {string} sender - The address of the sender.\n * @param {InputEntryFunctionData} payload - The payload of the transaction.\n * @returns {initia.Msg} The MsgScript object.\n */\nexport function convertPayloadToMsgScript(sender: string, payload: InputEntryFunctionData): initia.Msg {\n const args = covertPayloadArgs(payload.functionArgumentTypes ?? [], payload.functionArguments)\n const msg = new initia.MsgScript(\n sender, // sender address\n Buffer.from(payload.function, 'hex').toString('base64'), // function\n payload.typeArguments,\n args\n )\n return msg\n}\n\n/**\n * Converts payload arguments to a list of strings.\n *\n * @param {string[]} functionArgumentTypes - The types of the function arguments.\n * @param {EntryFunctionArgumentTypes[]} functionArguments - The function arguments.\n * @returns {string[]} The list of converted arguments.\n */\nexport function covertPayloadArgs(\n functionArgumentTypes: string[],\n functionArguments: EntryFunctionArgumentTypes[]\n): string[] {\n const args: string[] = []\n for (let i = 0; i < functionArguments.length; i++) {\n args.push(convertArg(functionArgumentTypes[i], functionArguments[i]))\n }\n return args\n}\n\n/**\n * Converts a single argument to a string based on its type.\n *\n * @param {string} argsType - The type of the argument.\n * @param {EntryFunctionArgumentTypes} arg - The argument to convert.\n * @returns {string} The converted argument as a string.\n * @throws {Error} If the argument type is invalid.\n */\nexport function convertArg(argsType: string, arg: EntryFunctionArgumentTypes): string {\n switch (argsType) {\n case 'bool':\n return initia.bcs\n .bool()\n .serialize(arg as boolean)\n .toBase64()\n case 'u256':\n return initia.bcs\n .u256()\n .serialize(arg as bigint)\n .toBase64()\n case 'u128':\n return initia.bcs\n .u128()\n .serialize(arg as bigint)\n .toBase64()\n case 'u64':\n return initia.bcs\n .u64()\n .serialize(arg as bigint)\n .toBase64()\n case 'u32':\n return initia.bcs\n .u32()\n .serialize(arg as number)\n .toBase64()\n case 'u16':\n return initia.bcs\n .u16()\n .serialize(arg as number)\n .toBase64()\n case 'u8':\n return initia.bcs\n .u8()\n .serialize(arg as number)\n .toBase64()\n case 'address':\n return initia.bcs\n .address()\n .serialize(arg as string)\n .toBase64()\n case 'vector<u8>':\n return initia.bcs\n .vector(initia.bcs.u8())\n .serialize(arg as unknown as Uint8Array)\n .toBase64()\n case 'vector<address>':\n return initia.bcs\n .vector(initia.bcs.address())\n .serialize(arg as unknown as string[])\n .toBase64()\n case 'vector<vector<u8>>':\n return initia.bcs\n .vector(initia.bcs.vector(initia.bcs.u8()))\n .serialize(arg as unknown as Uint8Array[])\n .toBase64()\n default:\n // eslint-disable-next-line @typescript-eslint/restrict-template-expressions\n throw new Error(`Invalid type argsType: ${argsType.toString()}`)\n }\n}\n","// eslint-disable-next-line import/default\nimport initia from '@initia/initia.js'\n\nimport { Provider } from '@layerzerolabs/lz-core'\nimport { InitiaProvider, InitiaSigner } from '@layerzerolabs/lz-corekit-initia'\nimport { Stage } from '@layerzerolabs/lz-definitions'\nimport { AccountsOption, LayerZeroModulesSdk, MoveSdkImpl } from '@layerzerolabs/lz-movevm-sdk-v2'\nimport {\n EntryFunctionArgumentTypes,\n GasOptions,\n MnemonicAndPath,\n MoveAbortError,\n MoveFunction,\n MoveResourceNotFoundError,\n MoveStructId,\n MoveTableItemNotFoundError,\n MoveValue,\n PrivateKey,\n TableItemRequest,\n TransactionResponse,\n UnclassifiedError,\n isMnemonicAndPath,\n isPrivateKey,\n} from '@layerzerolabs/move-definitions'\n\nimport {\n COUNTER_V2_ADDRESS,\n DEPLOY_TO_OBJECT,\n DVN_ADDRESS,\n ENDPOINT_V2_ADDRESS,\n ENDPOINT_V2_COMMON,\n EXECUTOR_ADDRESS,\n LAYERZERO_VIEWS_ADDRESS,\n OFT_ADDRESS,\n PRICE_FEED,\n SIMPLE_MESSAGE_LIB_ADDRESS,\n TREASURY_ADDRESS,\n ULN_MESSAGE_LIB_ADDRESS,\n WORKER_COMMON,\n} from './generated/addresses'\nimport { InitiaBuildTxRequestOptions } from './types'\nimport { buildTransaction, convertArg, covertPayloadArgs } from './utils'\n\nexport * from './generated/addresses'\n\n/**\n * Options for initializing the SDK.\n */\nexport interface SdkOptions {\n /**\n * The provider for the SDK.\n */\n provider: InitiaProvider\n\n /**\n * The stage of the SDK (optional).\n * default value is Stage.SANDBOX\n */\n stage?: Stage\n\n /**\n * The accounts option (optional).\n * default value is read from generated/addresses.ts\n */\n accounts?: AccountsOption\n}\n\n/**\n * Creates an instance of the SDK from the given provider.\n *\n * @param {Provider} provider - The provider of the current chain. {@link InitiaProvider}.\n * @param {Stage} [stage] - The stage of the SDK. {@link Stage}\n * @returns {SDK} The initialized SDK instance.\n */\nexport function getSDKFromProvider(provider: Provider, stage?: Stage): SDK {\n return new SDK({ provider: provider as InitiaProvider, stage })\n}\n\n/**\n * Interface representing an Axios error, which returned by the chain node.\n */\ninterface AxiosError {\n response: {\n data: {\n code: number\n message: string\n }\n }\n}\n\n/**\n * Checks if the given error is an AxiosError.\n *\n * @param {any} error - The error to check.\n * @returns {error is AxiosError} True if the error is an AxiosError, false otherwise.\n */\nfunction isAxiosError(error: any): error is AxiosError {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n return error?.response?.data?.message !== undefined\n}\n\n/**\n * Checks if the given transaction result is a TxError.\n *\n * @param {unknown} tx - The transaction result to check, for initia the result type is {@link WaitTxBroadcastResult}.\n * @returns {tx is TxError} True if the transaction result is a TxError, false otherwise.\n */\nfunction isTxError(tx: unknown): tx is initia.TxError {\n return tx instanceof Object && 'code' in tx && Number(tx.code) !== 0\n}\n\n/**\n * The SDK class provides methods to interact with the Initia.\n * For usage, please check [README.md](../README.md).\n *\n * @implements {MoveSdkImpl<initia.MnemonicKey>}\n */\nexport class SDK implements MoveSdkImpl<initia.MnemonicKey> {\n stage: Stage\n provider: InitiaProvider\n LayerzeroModule: LayerZeroModulesSdk<initia.MnemonicKey>\n accounts: AccountsOption\n\n /**\n * Creates an instance of the SDK.\n *\n * @param {SdkOptions} options - The SDK options.\n */\n constructor(options: SdkOptions) {\n this.stage = options.stage ?? Stage.SANDBOX\n this.accounts = options.accounts ?? {\n endpoint_v2: this.toHexAddress(ENDPOINT_V2_ADDRESS[this.stage] ?? '0x0'),\n counter_v2: this.toHexAddress(COUNTER_V2_ADDRESS[this.stage] ?? '0x0'),\n oft: this.toHexAddress(OFT_ADDRESS[this.stage] ?? '0x0'),\n layerzero_views: this.toHexAddress(LAYERZERO_VIEWS_ADDRESS[this.stage] ?? '0x0'),\n simple_message_lib: this.toHexAddress(SIMPLE_MESSAGE_LIB_ADDRESS[this.stage] ?? '0x0'),\n uln_message_lib: this.toHexAddress(ULN_MESSAGE_LIB_ADDRESS[this.stage] ?? '0x0'),\n executor: this.toHexAddress(EXECUTOR_ADDRESS[this.stage] ?? '0x0'),\n dvn: this.toHexAddress(DVN_ADDRESS[this.stage] ?? '0x0'),\n worker_common: this.toHexAddress(WORKER_COMMON[this.stage] ?? '0x0'),\n price_feed: this.toHexAddress(PRICE_FEED[this.stage] ?? '0x0'),\n treasury: this.toHexAddress(TREASURY_ADDRESS[this.stage] ?? '0x0'),\n endpoint_v2_common: this.toHexAddress(ENDPOINT_V2_COMMON[this.stage] ?? '0x0'),\n deploy_to_object: this.toHexAddress(DEPLOY_TO_OBJECT[this.stage] ?? '0x0'),\n }\n this.provider = options.provider\n this.LayerzeroModule = new LayerZeroModulesSdk(this)\n }\n\n /**\n * Gets the Initia native client.\n *\n * @returns {initia.LCDClient} The Initia native client.\n */\n getLCDClient(): initia.LCDClient {\n return this.provider.native\n }\n\n /**\n * Executes a view function.\n * @implements {MoveSdkImpl<initia.MnemonicKey>}\n *\n * @param {Object} args - The arguments for the view function.\n * @param {MoveFunction} args.functionName - The name of the function.\n * @param {EntryFunctionArgumentTypes[]} args.functionArgs - The arguments for the function.\n * @param {string[]} [args.functionArgTypes] - The types of the arguments.\n * @param {string[]} [args.typeArgs] - The type arguments.\n * @returns {Promise<MoveValue[]>} The result of the view function.\n */\n async viewFunction(args: {\n functionName: MoveFunction\n functionArgs: EntryFunctionArgumentTypes[]\n functionArgTypes?: string[]\n typeArgs?: string[]\n }): Promise<MoveValue[]> {\n const argsStrings = covertPayloadArgs(args.functionArgTypes ?? [], args.functionArgs)\n const [moduleAddress, moduleName, functionName] = args.functionName.split('::')\n try {\n const viewFunctionData = await this.provider.native.move.viewFunction<MoveValue>(\n moduleAddress,\n moduleName,\n functionName,\n args.typeArgs ?? [],\n argsStrings\n )\n return [viewFunctionData]\n } catch (e) {\n throw this.handleError(e)\n }\n }\n\n /**\n * Normalizes the given signer.\n * @implements {MoveSdkImpl<initia.MnemonicKey>}\n *\n * @param {initia.MnemonicKey | PrivateKey | MnemonicAndPath} signer - The signer to normalize.\n * @returns {initia.MnemonicKey} The normalized signer.\n */\n normalizeSigner(signer: initia.MnemonicKey | PrivateKey | MnemonicAndPath): initia.MnemonicKey {\n if (signer instanceof initia.MnemonicKey) {\n return signer\n } else if (isMnemonicAndPath(signer)) {\n const { mnemonic, path } = signer\n const [_, coinType, account, __, index] = path.match(/\\d+/g)?.map(Number) ?? []\n return new initia.MnemonicKey({\n mnemonic,\n coinType,\n account,\n index,\n eth: coinType === initia.INIT_COIN_TYPE,\n })\n } else if (isPrivateKey(signer)) {\n return initia.MnemonicKey.fromHex(signer) as initia.MnemonicKey\n }\n throw new Error(`Invalid signer`)\n }\n\n /**\n * Converts the given account to an address.\n * @implements {MoveSdkImpl<initia.MnemonicKey>}\n *\n * @param {initia.MnemonicKey} account - The account to convert.\n * @returns {string} The address of the account.\n */\n accountToAddress(account: initia.MnemonicKey): string {\n return this.toHexAddress(account.accAddress)\n }\n\n /**\n * Converts an address to a Bech32 address.\n * For more details about Bech32 addresses, see https://thebitcoinmanual.com/articles/btc-bech32-address/.\n *\n * @param {string | Uint8Array} anyAddress - The address to convert. It can be a string or a Uint8Array.\n * @returns {string} The Bech32 address.\n */\n toBech32Address(anyAddress: string | Uint8Array): string {\n if (anyAddress instanceof Uint8Array) {\n anyAddress = Buffer.from(anyAddress).toString('hex')\n }\n if (initia.AccAddress.validate(anyAddress)) {\n return anyAddress\n }\n return initia.AccAddress.fromHex(anyAddress)\n }\n\n /**\n * Converts an address to a hexadecimal string.\n *\n * @param {string | Uint8Array} anyAddress - The address to convert.\n * @returns {string} The hexadecimal string representation of the address.\n */\n toHexAddress(anyAddress: string | Uint8Array): string {\n if (anyAddress instanceof Uint8Array) {\n anyAddress = Buffer.from(anyAddress).toString('hex')\n }\n if (initia.AccAddress.validate(anyAddress)) {\n return initia.AccAddress.toHex(anyAddress)\n }\n return anyAddress\n }\n\n /**\n * Handles errors and returns appropriate error instances based on the error type.\n *\n * @param {unknown} e - The error to handle.\n * @returns {unknown} The handled error, which could be an instance of MoveAbortError, MoveResourceNotFoundError, UnclassifiedError, or the original error.\n */\n handleError(e: unknown): unknown {\n if (isAxiosError(e)) {\n const errorString = e.response.data.message\n const codeMatch = errorString.match(/code=(\\d+)/)\n if (errorString.includes('VM aborted') && codeMatch !== null) {\n const code = parseInt(codeMatch[1])\n return new MoveAbortError(code, e.response.data.message)\n } else if (errorString.startsWith('collections: not found')) {\n return new MoveResourceNotFoundError(e.response.data.message)\n } else if (errorString.includes('MISSING_DATA')) {\n return new MoveResourceNotFoundError(e.response.data.message)\n } else {\n return new UnclassifiedError(e.response.data.message)\n }\n }\n return e\n }\n\n /**\n * Sends a transaction and waits for confirmation.\n * @implements {MoveSdkImpl<initia.MnemonicKey>}\n *\n * @param {initia.MnemonicKey | PrivateKey | MnemonicAndPath} sender - The sender of the transaction.\n * @param {MoveFunction} func - The function to call.\n * @param {EntryFunctionArgumentTypes[]} args - The arguments for the function.\n * @param {string[]} [argTypes] - The types of the arguments for the function.\n * @param {GasOptions} [gasOptions] - The gas options.\n * @param {string[]} [typeArguments] - The type arguments.\n * @returns {Promise<TransactionResponse>} The transaction response.\n */\n async sendAndConfirmTransaction(\n sender: initia.MnemonicKey | PrivateKey | MnemonicAndPath,\n func: MoveFunction,\n args: EntryFunctionArgumentTypes[],\n argTypes?: string[],\n gasOptions?: GasOptions,\n typeArguments?: string[]\n ): Promise<TransactionResponse> {\n try {\n sender = this.normalizeSigner(sender)\n const coreSigner = InitiaSigner.from(sender).connect(this.provider)\n\n const buildTxRequestOption: InitiaBuildTxRequestOptions = {\n gas: gasOptions?.gasLimit,\n gasPrice: gasOptions?.gasPrice !== undefined ? `${gasOptions.gasPrice}uinit` : undefined,\n }\n\n const txRequest = await buildTransaction(coreSigner.native as initia.Wallet, {\n payload: {\n function: func,\n functionArguments: args,\n functionArgumentTypes: argTypes,\n typeArguments: typeArguments,\n },\n options: buildTxRequestOption,\n })\n const signedTx = await coreSigner.signTransaction(txRequest)\n\n const txReceipt = await coreSigner.sendAndConfirm(signedTx)\n const result = txReceipt.receipt as initia.WaitTxBroadcastResult\n\n if (isTxError(result)) {\n throw Error(result.raw_log)\n }\n return {\n hash: result.txhash,\n sender: sender.accAddress,\n raw: result,\n }\n } catch (e) {\n throw this.handleError(e)\n }\n }\n\n /**\n * Gets an account resource.\n * @implements {MoveSdkImpl<initia.MnemonicKey>}\n *\n * @param {Object} args - The arguments for getting the account resource.\n * @param {string | Uint8Array} args.accountAddress - The account address.\n * @param {MoveStructId} args.resourceType - The type of the resource.\n * @param {Object} [args.options] - The options for getting the resource.\n * @returns {Promise<T>} The account resource.\n * @template T - The type of the resource.\n */\n async getAccountResource<T extends NonNullable<unknown> = any>(args: {\n accountAddress: string | Uint8Array\n resourceType: MoveStructId\n options?: unknown\n }): Promise<T> {\n try {\n const address = this.toHexAddress(args.accountAddress)\n const { data } = await this.provider.native.move.resource(address, args.resourceType)\n return data as T\n } catch (e) {\n if (isAxiosError(e) && e.response.data.message.startsWith('collections: not found')) {\n throw new MoveResourceNotFoundError(e.response.data.message)\n }\n throw e\n }\n }\n\n /**\n * Gets a table item.\n * @implements {MoveSdkImpl<initia.MnemonicKey>}\n *\n * @param {Object} args - The arguments for getting the table item.\n * @param {string} args.handle - The table handle.\n * @param {TableItemRequest} args.data - The key of the item.\n * @param {Object} [args.options] - The options for getting the item.\n * @returns {Promise<T>} The table item.\n * @template T - The type of the item.\n */\n async getTableItem<T>(args: { handle: string; data: TableItemRequest; options?: unknown }): Promise<T> {\n try {\n const res = await this.provider.native.move.tableEntry(\n args.handle,\n convertArg(args.data.key_type as string, args.data.key as EntryFunctionArgumentTypes)\n )\n const { value } = res\n const valueObject = JSON.parse(value) as { [key: string]: T }\n return Object.values(valueObject)[0]\n } catch (e) {\n if (isAxiosError(e) && e.response.data.message.startsWith('collections: not found')) {\n throw new MoveTableItemNotFoundError(e.response.data.message)\n }\n throw e\n }\n }\n\n /**\n * Normalizes the given address.\n * @implements {MoveSdkImpl<initia.MnemonicKey>}\n *\n * @param {string} address - The address to normalize.\n * @returns {string} The normalized address.\n */\n normalizeAddress(address: string): string {\n return address\n }\n\n /**\n * Checks if the SDK supports coins.\n * @implements {MoveSdkImpl<initia.MnemonicKey>}\n *\n * @returns {boolean} True if the SDK supports coins, false otherwise.\n */\n supportsCoin(): boolean {\n return false\n }\n\n /**\n * Checks if the given address is a valid object address.\n * @param address\n */\n async isObjectAddress(address: string): Promise<boolean> {\n try {\n await this.getAccountResource({\n accountAddress: address,\n resourceType: '0x1::object::ObjectCore',\n })\n return true\n } catch (e) {\n return false\n }\n }\n}\n\nexport * from './types'\nexport * from './utils'\n"]}
package/dist/index.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { Wallet, AccAddress, Msg, MnemonicKey, LCDClient } from '@initia/initia.js';
1
+ import initia from '@initia/initia.js';
2
2
  import { TransactionRequest, Provider } from '@layerzerolabs/lz-core';
3
3
  import { InitiaProvider } from '@layerzerolabs/lz-corekit-initia';
4
4
  import { Stage } from '@layerzerolabs/lz-definitions';
@@ -85,38 +85,38 @@ interface InitiaBuildTxRequestOptions {
85
85
  /**
86
86
  * Builds a transaction.
87
87
  *
88
- * @param {Wallet} nativeSigner - The nativeSigner or the address of the sender.
88
+ * @param {initia.Wallet} nativeSigner - The nativeSigner or the address of the sender.
89
89
  * @param {InitiaBuildTxRequest} buildTxRequest - The transaction request to build.
90
90
  * @returns {Promise<TransactionRequest>} A promise that resolves to the built transaction request.
91
91
  * @throws {Error} If the gas price is invalid.
92
92
  */
93
- declare function buildTransaction(nativeSigner: Wallet | AccAddress, buildTxRequest: InitiaBuildTxRequest): Promise<TransactionRequest>;
93
+ declare function buildTransaction(nativeSigner: initia.Wallet | initia.AccAddress, buildTxRequest: InitiaBuildTxRequest): Promise<TransactionRequest>;
94
94
  /**
95
95
  * Builds a transaction.
96
96
  *
97
- * @param {Wallet} nativeSigner - The nativeSigner or the address of the sender.
97
+ * @param {initia.Wallet} nativeSigner - The nativeSigner or the address of the sender.
98
98
  * @param {InitiaBuildTxRequest} buildTxRequest - The transaction request to build.
99
99
  * @returns {Promise<TransactionRequest>} A promise that resolves to the built transaction request.
100
100
  * @throws {Error} If the gas price is invalid.
101
101
  */
102
- declare function buildInitiaMultisigTransaction(nativeSigner: Wallet | AccAddress, multisigAddress: string, buildTxRequest: InitiaBuildTxRequest): Promise<TransactionRequest>;
102
+ declare function buildInitiaMultisigTransaction(nativeSigner: initia.Wallet | initia.AccAddress, multisigAddress: string, buildTxRequest: InitiaBuildTxRequest): Promise<TransactionRequest>;
103
103
  /**
104
104
  * Converts a payload to a MsgExecute object for the Initia blockchain.
105
105
  *
106
106
  * @param {string} sender - The address of the sender.
107
107
  * @param {InputEntryFunctionData} payload - The payload of the transaction.
108
- * @returns {Msg} The MsgExecute object.
108
+ * @returns {initia.Msg} The MsgExecute object.
109
109
  */
110
- declare function convertPayloadToMsgExecute(sender: string, payload: InputEntryFunctionData): Msg;
111
- declare function convertPayloadToMultisigMsgExecute(sender: string, multisigAddress: string, payload: InputEntryFunctionData): Msg;
110
+ declare function convertPayloadToMsgExecute(sender: string, payload: InputEntryFunctionData): initia.Msg;
111
+ declare function convertPayloadToMultisigMsgExecute(sender: string, multisigAddress: string, payload: InputEntryFunctionData): initia.Msg;
112
112
  /**
113
113
  * Converts a payload to a MsgScript object for the Initia blockchain.
114
114
  *
115
115
  * @param {string} sender - The address of the sender.
116
116
  * @param {InputEntryFunctionData} payload - The payload of the transaction.
117
- * @returns {Msg} The MsgScript object.
117
+ * @returns {initia.Msg} The MsgScript object.
118
118
  */
119
- declare function convertPayloadToMsgScript(sender: string, payload: InputEntryFunctionData): Msg;
119
+ declare function convertPayloadToMsgScript(sender: string, payload: InputEntryFunctionData): initia.Msg;
120
120
  /**
121
121
  * Converts payload arguments to a list of strings.
122
122
  *
@@ -166,12 +166,12 @@ declare function getSDKFromProvider(provider: Provider, stage?: Stage): SDK;
166
166
  * The SDK class provides methods to interact with the Initia.
167
167
  * For usage, please check [README.md](../README.md).
168
168
  *
169
- * @implements {MoveSdkImpl<MnemonicKey>}
169
+ * @implements {MoveSdkImpl<initia.MnemonicKey>}
170
170
  */
171
- declare class SDK implements MoveSdkImpl<MnemonicKey> {
171
+ declare class SDK implements MoveSdkImpl<initia.MnemonicKey> {
172
172
  stage: Stage;
173
173
  provider: InitiaProvider;
174
- LayerzeroModule: LayerZeroModulesSdk<MnemonicKey>;
174
+ LayerzeroModule: LayerZeroModulesSdk<initia.MnemonicKey>;
175
175
  accounts: AccountsOption;
176
176
  /**
177
177
  * Creates an instance of the SDK.
@@ -182,12 +182,12 @@ declare class SDK implements MoveSdkImpl<MnemonicKey> {
182
182
  /**
183
183
  * Gets the Initia native client.
184
184
  *
185
- * @returns {LCDClient} The Initia native client.
185
+ * @returns {initia.LCDClient} The Initia native client.
186
186
  */
187
- getLCDClient(): LCDClient;
187
+ getLCDClient(): initia.LCDClient;
188
188
  /**
189
189
  * Executes a view function.
190
- * @implements {MoveSdkImpl<MnemonicKey>}
190
+ * @implements {MoveSdkImpl<initia.MnemonicKey>}
191
191
  *
192
192
  * @param {Object} args - The arguments for the view function.
193
193
  * @param {MoveFunction} args.functionName - The name of the function.
@@ -204,20 +204,20 @@ declare class SDK implements MoveSdkImpl<MnemonicKey> {
204
204
  }): Promise<MoveValue[]>;
205
205
  /**
206
206
  * Normalizes the given signer.
207
- * @implements {MoveSdkImpl<MnemonicKey>}
207
+ * @implements {MoveSdkImpl<initia.MnemonicKey>}
208
208
  *
209
- * @param {MnemonicKey | PrivateKey | MnemonicAndPath} signer - The signer to normalize.
210
- * @returns {MnemonicKey} The normalized signer.
209
+ * @param {initia.MnemonicKey | PrivateKey | MnemonicAndPath} signer - The signer to normalize.
210
+ * @returns {initia.MnemonicKey} The normalized signer.
211
211
  */
212
- normalizeSigner(signer: MnemonicKey | PrivateKey | MnemonicAndPath): MnemonicKey;
212
+ normalizeSigner(signer: initia.MnemonicKey | PrivateKey | MnemonicAndPath): initia.MnemonicKey;
213
213
  /**
214
214
  * Converts the given account to an address.
215
- * @implements {MoveSdkImpl<MnemonicKey>}
215
+ * @implements {MoveSdkImpl<initia.MnemonicKey>}
216
216
  *
217
- * @param {MnemonicKey} account - The account to convert.
217
+ * @param {initia.MnemonicKey} account - The account to convert.
218
218
  * @returns {string} The address of the account.
219
219
  */
220
- accountToAddress(account: MnemonicKey): string;
220
+ accountToAddress(account: initia.MnemonicKey): string;
221
221
  /**
222
222
  * Converts an address to a Bech32 address.
223
223
  * For more details about Bech32 addresses, see https://thebitcoinmanual.com/articles/btc-bech32-address/.
@@ -242,9 +242,9 @@ declare class SDK implements MoveSdkImpl<MnemonicKey> {
242
242
  handleError(e: unknown): unknown;
243
243
  /**
244
244
  * Sends a transaction and waits for confirmation.
245
- * @implements {MoveSdkImpl<MnemonicKey>}
245
+ * @implements {MoveSdkImpl<initia.MnemonicKey>}
246
246
  *
247
- * @param {MnemonicKey | PrivateKey | MnemonicAndPath} sender - The sender of the transaction.
247
+ * @param {initia.MnemonicKey | PrivateKey | MnemonicAndPath} sender - The sender of the transaction.
248
248
  * @param {MoveFunction} func - The function to call.
249
249
  * @param {EntryFunctionArgumentTypes[]} args - The arguments for the function.
250
250
  * @param {string[]} [argTypes] - The types of the arguments for the function.
@@ -252,10 +252,10 @@ declare class SDK implements MoveSdkImpl<MnemonicKey> {
252
252
  * @param {string[]} [typeArguments] - The type arguments.
253
253
  * @returns {Promise<TransactionResponse>} The transaction response.
254
254
  */
255
- sendAndConfirmTransaction(sender: MnemonicKey | PrivateKey | MnemonicAndPath, func: MoveFunction, args: EntryFunctionArgumentTypes[], argTypes?: string[], gasOptions?: GasOptions, typeArguments?: string[]): Promise<TransactionResponse>;
255
+ sendAndConfirmTransaction(sender: initia.MnemonicKey | PrivateKey | MnemonicAndPath, func: MoveFunction, args: EntryFunctionArgumentTypes[], argTypes?: string[], gasOptions?: GasOptions, typeArguments?: string[]): Promise<TransactionResponse>;
256
256
  /**
257
257
  * Gets an account resource.
258
- * @implements {MoveSdkImpl<MnemonicKey>}
258
+ * @implements {MoveSdkImpl<initia.MnemonicKey>}
259
259
  *
260
260
  * @param {Object} args - The arguments for getting the account resource.
261
261
  * @param {string | Uint8Array} args.accountAddress - The account address.
@@ -271,7 +271,7 @@ declare class SDK implements MoveSdkImpl<MnemonicKey> {
271
271
  }): Promise<T>;
272
272
  /**
273
273
  * Gets a table item.
274
- * @implements {MoveSdkImpl<MnemonicKey>}
274
+ * @implements {MoveSdkImpl<initia.MnemonicKey>}
275
275
  *
276
276
  * @param {Object} args - The arguments for getting the table item.
277
277
  * @param {string} args.handle - The table handle.
@@ -287,7 +287,7 @@ declare class SDK implements MoveSdkImpl<MnemonicKey> {
287
287
  }): Promise<T>;
288
288
  /**
289
289
  * Normalizes the given address.
290
- * @implements {MoveSdkImpl<MnemonicKey>}
290
+ * @implements {MoveSdkImpl<initia.MnemonicKey>}
291
291
  *
292
292
  * @param {string} address - The address to normalize.
293
293
  * @returns {string} The normalized address.
@@ -295,7 +295,7 @@ declare class SDK implements MoveSdkImpl<MnemonicKey> {
295
295
  normalizeAddress(address: string): string;
296
296
  /**
297
297
  * Checks if the SDK supports coins.
298
- * @implements {MoveSdkImpl<MnemonicKey>}
298
+ * @implements {MoveSdkImpl<initia.MnemonicKey>}
299
299
  *
300
300
  * @returns {boolean} True if the SDK supports coins, false otherwise.
301
301
  */
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Wallet, AccAddress, Msg, MnemonicKey, LCDClient } from '@initia/initia.js';
1
+ import initia from '@initia/initia.js';
2
2
  import { TransactionRequest, Provider } from '@layerzerolabs/lz-core';
3
3
  import { InitiaProvider } from '@layerzerolabs/lz-corekit-initia';
4
4
  import { Stage } from '@layerzerolabs/lz-definitions';
@@ -85,38 +85,38 @@ interface InitiaBuildTxRequestOptions {
85
85
  /**
86
86
  * Builds a transaction.
87
87
  *
88
- * @param {Wallet} nativeSigner - The nativeSigner or the address of the sender.
88
+ * @param {initia.Wallet} nativeSigner - The nativeSigner or the address of the sender.
89
89
  * @param {InitiaBuildTxRequest} buildTxRequest - The transaction request to build.
90
90
  * @returns {Promise<TransactionRequest>} A promise that resolves to the built transaction request.
91
91
  * @throws {Error} If the gas price is invalid.
92
92
  */
93
- declare function buildTransaction(nativeSigner: Wallet | AccAddress, buildTxRequest: InitiaBuildTxRequest): Promise<TransactionRequest>;
93
+ declare function buildTransaction(nativeSigner: initia.Wallet | initia.AccAddress, buildTxRequest: InitiaBuildTxRequest): Promise<TransactionRequest>;
94
94
  /**
95
95
  * Builds a transaction.
96
96
  *
97
- * @param {Wallet} nativeSigner - The nativeSigner or the address of the sender.
97
+ * @param {initia.Wallet} nativeSigner - The nativeSigner or the address of the sender.
98
98
  * @param {InitiaBuildTxRequest} buildTxRequest - The transaction request to build.
99
99
  * @returns {Promise<TransactionRequest>} A promise that resolves to the built transaction request.
100
100
  * @throws {Error} If the gas price is invalid.
101
101
  */
102
- declare function buildInitiaMultisigTransaction(nativeSigner: Wallet | AccAddress, multisigAddress: string, buildTxRequest: InitiaBuildTxRequest): Promise<TransactionRequest>;
102
+ declare function buildInitiaMultisigTransaction(nativeSigner: initia.Wallet | initia.AccAddress, multisigAddress: string, buildTxRequest: InitiaBuildTxRequest): Promise<TransactionRequest>;
103
103
  /**
104
104
  * Converts a payload to a MsgExecute object for the Initia blockchain.
105
105
  *
106
106
  * @param {string} sender - The address of the sender.
107
107
  * @param {InputEntryFunctionData} payload - The payload of the transaction.
108
- * @returns {Msg} The MsgExecute object.
108
+ * @returns {initia.Msg} The MsgExecute object.
109
109
  */
110
- declare function convertPayloadToMsgExecute(sender: string, payload: InputEntryFunctionData): Msg;
111
- declare function convertPayloadToMultisigMsgExecute(sender: string, multisigAddress: string, payload: InputEntryFunctionData): Msg;
110
+ declare function convertPayloadToMsgExecute(sender: string, payload: InputEntryFunctionData): initia.Msg;
111
+ declare function convertPayloadToMultisigMsgExecute(sender: string, multisigAddress: string, payload: InputEntryFunctionData): initia.Msg;
112
112
  /**
113
113
  * Converts a payload to a MsgScript object for the Initia blockchain.
114
114
  *
115
115
  * @param {string} sender - The address of the sender.
116
116
  * @param {InputEntryFunctionData} payload - The payload of the transaction.
117
- * @returns {Msg} The MsgScript object.
117
+ * @returns {initia.Msg} The MsgScript object.
118
118
  */
119
- declare function convertPayloadToMsgScript(sender: string, payload: InputEntryFunctionData): Msg;
119
+ declare function convertPayloadToMsgScript(sender: string, payload: InputEntryFunctionData): initia.Msg;
120
120
  /**
121
121
  * Converts payload arguments to a list of strings.
122
122
  *
@@ -166,12 +166,12 @@ declare function getSDKFromProvider(provider: Provider, stage?: Stage): SDK;
166
166
  * The SDK class provides methods to interact with the Initia.
167
167
  * For usage, please check [README.md](../README.md).
168
168
  *
169
- * @implements {MoveSdkImpl<MnemonicKey>}
169
+ * @implements {MoveSdkImpl<initia.MnemonicKey>}
170
170
  */
171
- declare class SDK implements MoveSdkImpl<MnemonicKey> {
171
+ declare class SDK implements MoveSdkImpl<initia.MnemonicKey> {
172
172
  stage: Stage;
173
173
  provider: InitiaProvider;
174
- LayerzeroModule: LayerZeroModulesSdk<MnemonicKey>;
174
+ LayerzeroModule: LayerZeroModulesSdk<initia.MnemonicKey>;
175
175
  accounts: AccountsOption;
176
176
  /**
177
177
  * Creates an instance of the SDK.
@@ -182,12 +182,12 @@ declare class SDK implements MoveSdkImpl<MnemonicKey> {
182
182
  /**
183
183
  * Gets the Initia native client.
184
184
  *
185
- * @returns {LCDClient} The Initia native client.
185
+ * @returns {initia.LCDClient} The Initia native client.
186
186
  */
187
- getLCDClient(): LCDClient;
187
+ getLCDClient(): initia.LCDClient;
188
188
  /**
189
189
  * Executes a view function.
190
- * @implements {MoveSdkImpl<MnemonicKey>}
190
+ * @implements {MoveSdkImpl<initia.MnemonicKey>}
191
191
  *
192
192
  * @param {Object} args - The arguments for the view function.
193
193
  * @param {MoveFunction} args.functionName - The name of the function.
@@ -204,20 +204,20 @@ declare class SDK implements MoveSdkImpl<MnemonicKey> {
204
204
  }): Promise<MoveValue[]>;
205
205
  /**
206
206
  * Normalizes the given signer.
207
- * @implements {MoveSdkImpl<MnemonicKey>}
207
+ * @implements {MoveSdkImpl<initia.MnemonicKey>}
208
208
  *
209
- * @param {MnemonicKey | PrivateKey | MnemonicAndPath} signer - The signer to normalize.
210
- * @returns {MnemonicKey} The normalized signer.
209
+ * @param {initia.MnemonicKey | PrivateKey | MnemonicAndPath} signer - The signer to normalize.
210
+ * @returns {initia.MnemonicKey} The normalized signer.
211
211
  */
212
- normalizeSigner(signer: MnemonicKey | PrivateKey | MnemonicAndPath): MnemonicKey;
212
+ normalizeSigner(signer: initia.MnemonicKey | PrivateKey | MnemonicAndPath): initia.MnemonicKey;
213
213
  /**
214
214
  * Converts the given account to an address.
215
- * @implements {MoveSdkImpl<MnemonicKey>}
215
+ * @implements {MoveSdkImpl<initia.MnemonicKey>}
216
216
  *
217
- * @param {MnemonicKey} account - The account to convert.
217
+ * @param {initia.MnemonicKey} account - The account to convert.
218
218
  * @returns {string} The address of the account.
219
219
  */
220
- accountToAddress(account: MnemonicKey): string;
220
+ accountToAddress(account: initia.MnemonicKey): string;
221
221
  /**
222
222
  * Converts an address to a Bech32 address.
223
223
  * For more details about Bech32 addresses, see https://thebitcoinmanual.com/articles/btc-bech32-address/.
@@ -242,9 +242,9 @@ declare class SDK implements MoveSdkImpl<MnemonicKey> {
242
242
  handleError(e: unknown): unknown;
243
243
  /**
244
244
  * Sends a transaction and waits for confirmation.
245
- * @implements {MoveSdkImpl<MnemonicKey>}
245
+ * @implements {MoveSdkImpl<initia.MnemonicKey>}
246
246
  *
247
- * @param {MnemonicKey | PrivateKey | MnemonicAndPath} sender - The sender of the transaction.
247
+ * @param {initia.MnemonicKey | PrivateKey | MnemonicAndPath} sender - The sender of the transaction.
248
248
  * @param {MoveFunction} func - The function to call.
249
249
  * @param {EntryFunctionArgumentTypes[]} args - The arguments for the function.
250
250
  * @param {string[]} [argTypes] - The types of the arguments for the function.
@@ -252,10 +252,10 @@ declare class SDK implements MoveSdkImpl<MnemonicKey> {
252
252
  * @param {string[]} [typeArguments] - The type arguments.
253
253
  * @returns {Promise<TransactionResponse>} The transaction response.
254
254
  */
255
- sendAndConfirmTransaction(sender: MnemonicKey | PrivateKey | MnemonicAndPath, func: MoveFunction, args: EntryFunctionArgumentTypes[], argTypes?: string[], gasOptions?: GasOptions, typeArguments?: string[]): Promise<TransactionResponse>;
255
+ sendAndConfirmTransaction(sender: initia.MnemonicKey | PrivateKey | MnemonicAndPath, func: MoveFunction, args: EntryFunctionArgumentTypes[], argTypes?: string[], gasOptions?: GasOptions, typeArguments?: string[]): Promise<TransactionResponse>;
256
256
  /**
257
257
  * Gets an account resource.
258
- * @implements {MoveSdkImpl<MnemonicKey>}
258
+ * @implements {MoveSdkImpl<initia.MnemonicKey>}
259
259
  *
260
260
  * @param {Object} args - The arguments for getting the account resource.
261
261
  * @param {string | Uint8Array} args.accountAddress - The account address.
@@ -271,7 +271,7 @@ declare class SDK implements MoveSdkImpl<MnemonicKey> {
271
271
  }): Promise<T>;
272
272
  /**
273
273
  * Gets a table item.
274
- * @implements {MoveSdkImpl<MnemonicKey>}
274
+ * @implements {MoveSdkImpl<initia.MnemonicKey>}
275
275
  *
276
276
  * @param {Object} args - The arguments for getting the table item.
277
277
  * @param {string} args.handle - The table handle.
@@ -287,7 +287,7 @@ declare class SDK implements MoveSdkImpl<MnemonicKey> {
287
287
  }): Promise<T>;
288
288
  /**
289
289
  * Normalizes the given address.
290
- * @implements {MoveSdkImpl<MnemonicKey>}
290
+ * @implements {MoveSdkImpl<initia.MnemonicKey>}
291
291
  *
292
292
  * @param {string} address - The address to normalize.
293
293
  * @returns {string} The normalized address.
@@ -295,7 +295,7 @@ declare class SDK implements MoveSdkImpl<MnemonicKey> {
295
295
  normalizeAddress(address: string): string;
296
296
  /**
297
297
  * Checks if the SDK supports coins.
298
- * @implements {MoveSdkImpl<MnemonicKey>}
298
+ * @implements {MoveSdkImpl<initia.MnemonicKey>}
299
299
  *
300
300
  * @returns {boolean} True if the SDK supports coins, false otherwise.
301
301
  */