@locuschain/lib 0.2.2 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/accounts/account.d.cts +58 -0
- package/dist/accounts/index.d.cts +5 -5
- package/dist/accounts/keys/index.d.cts +2 -0
- package/dist/accounts/keys/localKeySource.d.cts +23 -0
- package/dist/accounts/keys/toKeySource.d.cts +14 -0
- package/dist/accounts/keysToAccount.d.cts +19 -0
- package/dist/accounts/mnemonicToAccount.d.cts +25 -0
- package/dist/accounts/signing/txKeyPolicy.d.cts +21 -0
- package/dist/accounts/types.d.cts +100 -0
- package/dist/actions/wallet/_deriveTxAdditions.d.cts +18 -0
- package/dist/actions/wallet/_prepareTransaction.d.cts +15 -0
- package/dist/actions/wallet/_sendPreparedTransaction.d.cts +9 -0
- package/dist/actions/wallet/_signLocusTransaction.d.cts +14 -0
- package/dist/actions/wallet/index.d.cts +5 -0
- package/dist/actions/wallet/types.d.cts +38 -0
- package/dist/autogen/actions/debug/index.d.cts +2 -0
- package/dist/autogen/actions/debug/public/allHeights.d.cts +3 -0
- package/dist/autogen/actions/debug/public/balanceGrantList.d.cts +2 -0
- package/dist/autogen/actions/debug/public/balanceList.d.cts +2 -0
- package/dist/autogen/actions/debug/public/createAccount.d.cts +3 -0
- package/dist/autogen/actions/debug/public/createNode.d.cts +4 -0
- package/dist/autogen/actions/debug/public/dumpAllAccounts.d.cts +3 -0
- package/dist/autogen/actions/debug/public/echo.d.cts +2 -0
- package/dist/autogen/actions/debug/public/gameChainCmd.d.cts +4 -0
- package/dist/autogen/actions/debug/public/getAccountsBalances.d.cts +4 -0
- package/dist/autogen/actions/debug/public/getAccountsHeights.d.cts +4 -0
- package/dist/autogen/actions/debug/public/getContractLog.d.cts +4 -0
- package/dist/autogen/actions/debug/public/getGuestsInfo.d.cts +3 -0
- package/dist/autogen/actions/debug/public/getHomeShard.d.cts +4 -0
- package/dist/autogen/actions/debug/public/getImportAccount.d.cts +4 -0
- package/dist/autogen/actions/debug/public/getImportAccountLog.d.cts +4 -0
- package/dist/autogen/actions/debug/public/getKeys.d.cts +4 -0
- package/dist/autogen/actions/debug/public/getNodeBlocks.d.cts +3 -0
- package/dist/autogen/actions/debug/public/getPeerPool.d.cts +2 -0
- package/dist/autogen/actions/debug/public/getPeersInfo.d.cts +3 -0
- package/dist/autogen/actions/debug/public/importAccount.d.cts +4 -0
- package/dist/autogen/actions/debug/public/index.d.cts +29 -0
- package/dist/autogen/actions/debug/public/initReliableNodes.d.cts +4 -0
- package/dist/autogen/actions/debug/public/noArgsRets.d.cts +2 -0
- package/dist/autogen/actions/debug/public/nodeCmd.d.cts +3 -0
- package/dist/autogen/actions/debug/public/removeHoldTxs.d.cts +4 -0
- package/dist/autogen/actions/debug/public/requestVme.d.cts +4 -0
- package/dist/autogen/actions/debug/public/sendRawTransaction.d.cts +4 -0
- package/dist/autogen/actions/debug/public/setImportAccountTx.d.cts +4 -0
- package/dist/autogen/actions/debug/public/setReliableNode.d.cts +4 -0
- package/dist/autogen/actions/debug/public/viewContract.d.cts +4 -0
- package/dist/autogen/actions/debug/wallet/callContract.d.cts +4 -0
- package/dist/autogen/actions/debug/wallet/createContract.d.cts +4 -0
- package/dist/autogen/actions/debug/wallet/createSynthAccount.d.cts +4 -0
- package/dist/autogen/actions/debug/wallet/index.d.cts +4 -0
- package/dist/autogen/actions/debug/wallet/postDataToSynthAccount.d.cts +4 -0
- package/dist/autogen/actions/index.d.cts +3 -0
- package/dist/autogen/actions/public/accountHeightsToDownload.d.cts +4 -0
- package/dist/autogen/actions/public/accountHeightsToUpload.d.cts +4 -0
- package/dist/autogen/actions/public/calculateSpentByExpress.d.cts +4 -0
- package/dist/autogen/actions/public/clientMessage.d.cts +3 -0
- package/dist/autogen/actions/public/downloadAccountTxs.d.cts +4 -0
- package/dist/autogen/actions/public/echo.d.cts +2 -0
- package/dist/autogen/actions/public/findDuplicateSubscriber.d.cts +4 -0
- package/dist/autogen/actions/public/generateLatestStoredDataProof.d.cts +4 -0
- package/dist/autogen/actions/public/getAccountAssetList.d.cts +4 -0
- package/dist/autogen/actions/public/getAccountAssetObject.d.cts +4 -0
- package/dist/autogen/actions/public/getAccountDetail.d.cts +4 -0
- package/dist/autogen/actions/public/getAccountHistory.d.cts +4 -0
- package/dist/autogen/actions/public/getAccountTokenList.d.cts +4 -0
- package/dist/autogen/actions/public/getConciseNodeStatus.d.cts +3 -0
- package/dist/autogen/actions/public/getGenesisAccount.d.cts +3 -0
- package/dist/autogen/actions/public/getIdentityProof.d.cts +4 -0
- package/dist/autogen/actions/public/getInactiveTxList.d.cts +4 -0
- package/dist/autogen/actions/public/getMontInfoList.d.cts +4 -0
- package/dist/autogen/actions/public/getNodeStatus.d.cts +3 -0
- package/dist/autogen/actions/public/getOwnerBalance.d.cts +3 -0
- package/dist/autogen/actions/public/getRoundState.d.cts +4 -0
- package/dist/autogen/actions/public/getRoundStatesList.d.cts +4 -0
- package/dist/autogen/actions/public/getShardOfAccount.d.cts +4 -0
- package/dist/autogen/actions/public/getSyncState.d.cts +3 -0
- package/dist/autogen/actions/public/getTx.d.cts +4 -0
- package/dist/autogen/actions/public/getWorldRoundState.d.cts +4 -0
- package/dist/autogen/actions/public/getWorldRoundStatesList.d.cts +4 -0
- package/dist/autogen/actions/public/hasSystemToken.d.cts +4 -0
- package/dist/autogen/actions/public/index.d.cts +38 -0
- package/dist/autogen/actions/public/makeTxProof.d.cts +4 -0
- package/dist/autogen/actions/public/queryAddress.d.cts +4 -0
- package/dist/autogen/actions/public/readTxListWitness.d.cts +4 -0
- package/dist/autogen/actions/public/setHost.d.cts +3 -0
- package/dist/autogen/actions/public/subscribeAddress.d.cts +4 -0
- package/dist/autogen/actions/public/uploadAccountTxs.d.cts +3 -0
- package/dist/autogen/actions/public/verifyAndSignChallenge.d.cts +4 -0
- package/dist/autogen/actions/public/verifyIdentityProof.d.cts +4 -0
- package/dist/autogen/actions/public/verifyLatestStoredDataProof.d.cts +3 -0
- package/dist/autogen/actions/public/verifyTxListWitness.d.cts +3 -0
- package/dist/autogen/actions/wallet/acceptScript.d.cts +4 -0
- package/dist/autogen/actions/wallet/becomeGuest.d.cts +4 -0
- package/dist/autogen/actions/wallet/becomeHost.d.cts +4 -0
- package/dist/autogen/actions/wallet/changeKey.d.cts +4 -0
- package/dist/autogen/actions/wallet/changeVkey.d.cts +4 -0
- package/dist/autogen/actions/wallet/closeAccount.d.cts +4 -0
- package/dist/autogen/actions/wallet/createAssetObject.d.cts +4 -0
- package/dist/autogen/actions/wallet/createToken.d.cts +4 -0
- package/dist/autogen/actions/wallet/createVme.d.cts +4 -0
- package/dist/autogen/actions/wallet/freezeAccount.d.cts +4 -0
- package/dist/autogen/actions/wallet/index.d.cts +20 -0
- package/dist/autogen/actions/wallet/lockStake.d.cts +4 -0
- package/dist/autogen/actions/wallet/openAccount.d.cts +4 -0
- package/dist/autogen/actions/wallet/postData.d.cts +4 -0
- package/dist/autogen/actions/wallet/provideScript.d.cts +4 -0
- package/dist/autogen/actions/wallet/requestDataTrade.d.cts +4 -0
- package/dist/autogen/actions/wallet/transferAssetObject.d.cts +4 -0
- package/dist/autogen/actions/wallet/transferCoin.d.cts +4 -0
- package/dist/autogen/actions/wallet/transferCoinExpress.d.cts +4 -0
- package/dist/autogen/actions/wallet/transferToken.d.cts +4 -0
- package/dist/autogen/actions/wallet/unlockStake.d.cts +4 -0
- package/dist/autogen/debugPublicActions.d.cts +47 -0
- package/dist/autogen/debugWalletActions.d.cts +11 -0
- package/dist/autogen/index.d.cts +8 -8
- package/dist/autogen/locus-tx.d.cts +5 -0
- package/dist/autogen/publicActions.d.cts +66 -0
- package/dist/autogen/rpc-api-spec.d.cts +210 -0
- package/dist/autogen/types/common/addr-tx-proof.d.cts +5 -0
- package/dist/autogen/types/common/asset-object-transfer.d.cts +8 -0
- package/dist/autogen/types/common/asset-object.d.cts +10 -0
- package/dist/autogen/types/common/asset-proof-objects.d.cts +5 -0
- package/dist/autogen/types/common/asset-transfer-info.d.cts +9 -0
- package/dist/autogen/types/common/base-meta.d.cts +1 -0
- package/dist/autogen/types/common/contract-exec-status.d.cts +16 -0
- package/dist/autogen/types/common/contract-transfer-info.d.cts +7 -0
- package/dist/autogen/types/common/get-peers-info.d.cts +9 -0
- package/dist/autogen/types/common/index-value-pair.d.cts +4 -0
- package/dist/autogen/types/common/index.d.cts +54 -0
- package/dist/autogen/types/common/input-params-data-transfer.d.cts +8 -0
- package/dist/autogen/types/common/key-bind-info.d.cts +4 -0
- package/dist/autogen/types/common/mont-info.d.cts +4 -0
- package/dist/autogen/types/common/object-amount-transfer.d.cts +5 -0
- package/dist/autogen/types/common/object-amount.d.cts +4 -0
- package/dist/autogen/types/common/output-download-account-txs.d.cts +4 -0
- package/dist/autogen/types/common/param-str.d.cts +3 -0
- package/dist/autogen/types/common/param-tx-data.d.cts +5 -0
- package/dist/autogen/types/common/params-token-value-pair.d.cts +4 -0
- package/dist/autogen/types/common/public-height-chunk.d.cts +4 -0
- package/dist/autogen/types/common/ref-tx-info.d.cts +5 -0
- package/dist/autogen/types/common/ref-vtx.d.cts +6 -0
- package/dist/autogen/types/common/ret-type-base.d.cts +1 -0
- package/dist/autogen/types/common/round-state-abstract.d.cts +11 -0
- package/dist/autogen/types/common/round-state-detail.d.cts +16 -0
- package/dist/autogen/types/common/rpc-account-height.d.cts +5 -0
- package/dist/autogen/types/common/rpc-accounts-balances-result.d.cts +4 -0
- package/dist/autogen/types/common/rpc-asset-list-values.d.cts +7 -0
- package/dist/autogen/types/common/rpc-data-trade-result.d.cts +5 -0
- package/dist/autogen/types/common/rpc-token-balance-pair.d.cts +4 -0
- package/dist/autogen/types/common/token-value-ab.d.cts +5 -0
- package/dist/autogen/types/common/token-value-pair.d.cts +4 -0
- package/dist/autogen/types/common/transaction-sender-index.d.cts +7 -0
- package/dist/autogen/types/common/transfer-info.d.cts +7 -0
- package/dist/autogen/types/common/tx-base.d.cts +13 -0
- package/dist/autogen/types/common/tx-hash-elements.d.cts +6 -0
- package/dist/autogen/types/common/tx-key-height-hash.d.cts +4 -0
- package/dist/autogen/types/common/tx-key-nround.d.cts +5 -0
- package/dist/autogen/types/common/tx-key.d.cts +4 -0
- package/dist/autogen/types/common/tx-meta.d.cts +2 -0
- package/dist/autogen/types/common/tx-no-signature.d.cts +1 -0
- package/dist/autogen/types/common/tx-recv-set-meta.d.cts +2 -0
- package/dist/autogen/types/common/tx-sign-key.d.cts +1 -0
- package/dist/autogen/types/common/tx-signature.d.cts +3 -0
- package/dist/autogen/types/common/tx-vsignature.d.cts +3 -0
- package/dist/autogen/types/common/vm-engine-block.d.cts +11 -0
- package/dist/autogen/types/common/vm-reward.d.cts +4 -0
- package/dist/autogen/types/common/vm-tx-state.d.cts +27 -0
- package/dist/autogen/types/common/vme-block-meta.d.cts +2 -0
- package/dist/autogen/types/common/vme-info.d.cts +3 -0
- package/dist/autogen/types/common/vme-lock-stake.d.cts +4 -0
- package/dist/autogen/types/common/vote-info-rpc.d.cts +5 -0
- package/dist/autogen/types/common/vtx-meta.d.cts +2 -0
- package/dist/autogen/types/common/wrs-validators-info.d.cts +5 -0
- package/dist/autogen/types/consts/address-class.d.cts +11 -0
- package/dist/autogen/types/consts/consts.d.cts +2 -0
- package/dist/autogen/types/consts/currency-unit.d.cts +15 -0
- package/dist/autogen/types/consts/index.d.cts +3 -0
- package/dist/autogen/types/consts/tx-type.d.cts +61 -0
- package/dist/autogen/types/consts/tx-types.d.cts +415 -0
- package/dist/autogen/types/rpc/heights-result.d.cts +4 -0
- package/dist/autogen/types/rpc/index.d.cts +107 -0
- package/dist/autogen/types/rpc/params-accept-script.d.cts +8 -0
- package/dist/autogen/types/rpc/params-account-and-index.d.cts +4 -0
- package/dist/autogen/types/rpc/params-account-heights.d.cts +5 -0
- package/dist/autogen/types/rpc/params-account-history.d.cts +5 -0
- package/dist/autogen/types/rpc/params-account.d.cts +3 -0
- package/dist/autogen/types/rpc/params-accounts.d.cts +3 -0
- package/dist/autogen/types/rpc/params-become-guest.d.cts +5 -0
- package/dist/autogen/types/rpc/params-become-host.d.cts +5 -0
- package/dist/autogen/types/rpc/params-calculate-spent-by-express.d.cts +5 -0
- package/dist/autogen/types/rpc/params-call-contract.d.cts +13 -0
- package/dist/autogen/types/rpc/params-change-key.d.cts +8 -0
- package/dist/autogen/types/rpc/params-change-vkey.d.cts +5 -0
- package/dist/autogen/types/rpc/params-close-account.d.cts +7 -0
- package/dist/autogen/types/rpc/params-contract-log.d.cts +6 -0
- package/dist/autogen/types/rpc/params-create-asset-object.d.cts +10 -0
- package/dist/autogen/types/rpc/params-create-contract.d.cts +14 -0
- package/dist/autogen/types/rpc/params-create-node.d.cts +4 -0
- package/dist/autogen/types/rpc/params-create-synth-account.d.cts +8 -0
- package/dist/autogen/types/rpc/params-create-token.d.cts +7 -0
- package/dist/autogen/types/rpc/params-create-vme.d.cts +8 -0
- package/dist/autogen/types/rpc/params-download-account-txs.d.cts +6 -0
- package/dist/autogen/types/rpc/params-find-duplicate-subscriber.d.cts +3 -0
- package/dist/autogen/types/rpc/params-freeze-account.d.cts +5 -0
- package/dist/autogen/types/rpc/params-game-chain-cmd.d.cts +5 -0
- package/dist/autogen/types/rpc/params-generate-latest-stored-data-proof.d.cts +4 -0
- package/dist/autogen/types/rpc/params-get-asset-list.d.cts +4 -0
- package/dist/autogen/types/rpc/params-get-asset-objects.d.cts +4 -0
- package/dist/autogen/types/rpc/params-get-home-shard.d.cts +3 -0
- package/dist/autogen/types/rpc/params-get-identity-proof.d.cts +4 -0
- package/dist/autogen/types/rpc/params-get-import-account.d.cts +3 -0
- package/dist/autogen/types/rpc/params-import-account.d.cts +7 -0
- package/dist/autogen/types/rpc/params-init-reliable-nodes.d.cts +5 -0
- package/dist/autogen/types/rpc/params-latest-stored-data-proof.d.cts +4 -0
- package/dist/autogen/types/rpc/params-lock-stake.d.cts +7 -0
- package/dist/autogen/types/rpc/params-open-account.d.cts +11 -0
- package/dist/autogen/types/rpc/params-post-data-to-synth-account.d.cts +11 -0
- package/dist/autogen/types/rpc/params-provide-script.d.cts +14 -0
- package/dist/autogen/types/rpc/params-query-address.d.cts +3 -0
- package/dist/autogen/types/rpc/params-read-tx-list.d.cts +5 -0
- package/dist/autogen/types/rpc/params-remove-hold-txs.d.cts +5 -0
- package/dist/autogen/types/rpc/params-request-data-trade.d.cts +10 -0
- package/dist/autogen/types/rpc/params-request-vme.d.cts +4 -0
- package/dist/autogen/types/rpc/params-round-list.d.cts +4 -0
- package/dist/autogen/types/rpc/params-round.d.cts +3 -0
- package/dist/autogen/types/rpc/params-rs.d.cts +4 -0
- package/dist/autogen/types/rpc/params-send-raw-transaction.d.cts +4 -0
- package/dist/autogen/types/rpc/params-set-host.d.cts +4 -0
- package/dist/autogen/types/rpc/params-set-import-account-tx.d.cts +5 -0
- package/dist/autogen/types/rpc/params-set-reliable-node.d.cts +4 -0
- package/dist/autogen/types/rpc/params-subscribe-address.d.cts +4 -0
- package/dist/autogen/types/rpc/params-transfer-asset-object.d.cts +9 -0
- package/dist/autogen/types/rpc/params-transfer-coin-express.d.cts +7 -0
- package/dist/autogen/types/rpc/params-transfer-coin.d.cts +8 -0
- package/dist/autogen/types/rpc/params-transfer-tokens.d.cts +14 -0
- package/dist/autogen/types/rpc/params-tx-list-witness.d.cts +6 -0
- package/dist/autogen/types/rpc/params-tx-list.d.cts +5 -0
- package/dist/autogen/types/rpc/params-unlock-stake.d.cts +7 -0
- package/dist/autogen/types/rpc/params-upload-account-txs.d.cts +5 -0
- package/dist/autogen/types/rpc/params-verify-and-sign-challenge.d.cts +8 -0
- package/dist/autogen/types/rpc/params-verify-identity-proof.d.cts +6 -0
- package/dist/autogen/types/rpc/result-dump-accounts.d.cts +4 -0
- package/dist/autogen/types/rpc/rpc-bool-result.d.cts +3 -0
- package/dist/autogen/types/rpc/rpc-calculate-spent-by-express-result.d.cts +3 -0
- package/dist/autogen/types/rpc/rpc-create-account-result.d.cts +7 -0
- package/dist/autogen/types/rpc/rpc-create-node-result.d.cts +5 -0
- package/dist/autogen/types/rpc/rpc-create-tx-result.d.cts +7 -0
- package/dist/autogen/types/rpc/rpc-find-duplicate-subscriber-result.d.cts +3 -0
- package/dist/autogen/types/rpc/rpc-game-chain-cmd-result.d.cts +3 -0
- package/dist/autogen/types/rpc/rpc-generate-latest-stored-data-proof-result.d.cts +4 -0
- package/dist/autogen/types/rpc/rpc-get-account-asset-list-result.d.cts +4 -0
- package/dist/autogen/types/rpc/rpc-get-account-asset-object-result.d.cts +5 -0
- package/dist/autogen/types/rpc/rpc-get-account-detail-result.d.cts +11 -0
- package/dist/autogen/types/rpc/rpc-get-account-history-result.d.cts +3 -0
- package/dist/autogen/types/rpc/rpc-get-account-token-list-result.d.cts +6 -0
- package/dist/autogen/types/rpc/rpc-get-accounts-balances-result.d.cts +3 -0
- package/dist/autogen/types/rpc/rpc-get-accounts-heights-result.d.cts +3 -0
- package/dist/autogen/types/rpc/rpc-get-concise-node-status-result.d.cts +18 -0
- package/dist/autogen/types/rpc/rpc-get-contract-log-result.d.cts +3 -0
- package/dist/autogen/types/rpc/rpc-get-genesis-account-result.d.cts +3 -0
- package/dist/autogen/types/rpc/rpc-get-guests-info-result.d.cts +3 -0
- package/dist/autogen/types/rpc/rpc-get-home-shard-result.d.cts +3 -0
- package/dist/autogen/types/rpc/rpc-get-identity-proof-result.d.cts +6 -0
- package/dist/autogen/types/rpc/rpc-get-import-account-result.d.cts +10 -0
- package/dist/autogen/types/rpc/rpc-get-inactive-tx-list-result.d.cts +14 -0
- package/dist/autogen/types/rpc/rpc-get-keys-result.d.cts +7 -0
- package/dist/autogen/types/rpc/rpc-get-mont-info-list-result.d.cts +5 -0
- package/dist/autogen/types/rpc/rpc-get-node-blocks-result.d.cts +3 -0
- package/dist/autogen/types/rpc/rpc-get-node-status-result.d.cts +28 -0
- package/dist/autogen/types/rpc/rpc-get-shard-of-account-result.d.cts +4 -0
- package/dist/autogen/types/rpc/rpc-get-sync-state-result.d.cts +3 -0
- package/dist/autogen/types/rpc/rpc-get-tx-result.d.cts +3 -0
- package/dist/autogen/types/rpc/rpc-get-world-round-state-result.d.cts +13 -0
- package/dist/autogen/types/rpc/rpc-get-world-round-states-list-result.d.cts +3 -0
- package/dist/autogen/types/rpc/rpc-has-system-token-result.d.cts +4 -0
- package/dist/autogen/types/rpc/rpc-import-account-result.d.cts +3 -0
- package/dist/autogen/types/rpc/rpc-node-cmd-result.d.cts +5 -0
- package/dist/autogen/types/rpc/rpc-query-address-result.d.cts +3 -0
- package/dist/autogen/types/rpc/rpc-read-tx-list-witness-result.d.cts +6 -0
- package/dist/autogen/types/rpc/rpc-request-vme-result.d.cts +3 -0
- package/dist/autogen/types/rpc/rpc-send-raw-transaction-result.d.cts +1 -0
- package/dist/autogen/types/rpc/rpc-set-import-account-tx-result.d.cts +5 -0
- package/dist/autogen/types/rpc/rpc-subscribe-address-result.d.cts +1 -0
- package/dist/autogen/types/rpc/rpc-verify-and-sign-challenge-result.d.cts +8 -0
- package/dist/autogen/types/rpc/rpc-verify-identity-proof-result.d.cts +4 -0
- package/dist/autogen/types/rpc/rpc-view-contract-result.d.cts +3 -0
- package/dist/autogen/types/rpc/upload-heights-result.d.cts +6 -0
- package/dist/autogen/types/tx/index.d.cts +50 -0
- package/dist/autogen/types/tx/tx-accept-script-after-time-lock.d.cts +12 -0
- package/dist/autogen/types/tx/tx-accept-script.d.cts +15 -0
- package/dist/autogen/types/tx/tx-activate-all-assets.d.cts +15 -0
- package/dist/autogen/types/tx/tx-activate-asset-object.d.cts +9 -0
- package/dist/autogen/types/tx/tx-activate-call-contract.d.cts +15 -0
- package/dist/autogen/types/tx/tx-activate-coin.d.cts +9 -0
- package/dist/autogen/types/tx/tx-activate-contract-result.d.cts +18 -0
- package/dist/autogen/types/tx/tx-activate-contract-reward.d.cts +8 -0
- package/dist/autogen/types/tx/tx-activate-contract-transfer.d.cts +15 -0
- package/dist/autogen/types/tx/tx-activate-data-synth-account.d.cts +12 -0
- package/dist/autogen/types/tx/tx-activate-foundation-reserve.d.cts +7 -0
- package/dist/autogen/types/tx/tx-activate-incentive.d.cts +11 -0
- package/dist/autogen/types/tx/tx-activate-lock-stake-for-vme.d.cts +9 -0
- package/dist/autogen/types/tx/tx-activate-open-contract.d.cts +15 -0
- package/dist/autogen/types/tx/tx-activate-open-synth-account.d.cts +9 -0
- package/dist/autogen/types/tx/tx-activate-open-vm-engine.d.cts +11 -0
- package/dist/autogen/types/tx/tx-activate-token.d.cts +12 -0
- package/dist/autogen/types/tx/tx-become-guest.d.cts +10 -0
- package/dist/autogen/types/tx/tx-become-host.d.cts +7 -0
- package/dist/autogen/types/tx/tx-burn-asset-object.d.cts +8 -0
- package/dist/autogen/types/tx/tx-burn-token.d.cts +10 -0
- package/dist/autogen/types/tx/tx-call-contract.d.cts +16 -0
- package/dist/autogen/types/tx/tx-change-foundation-account.d.cts +6 -0
- package/dist/autogen/types/tx/tx-change-keypair.d.cts +10 -0
- package/dist/autogen/types/tx/tx-change-vkey.d.cts +6 -0
- package/dist/autogen/types/tx/tx-close-account.d.cts +12 -0
- package/dist/autogen/types/tx/tx-contract-blank-reward.d.cts +5 -0
- package/dist/autogen/types/tx/tx-contract-transfer-reward.d.cts +8 -0
- package/dist/autogen/types/tx/tx-create-asset-object.d.cts +10 -0
- package/dist/autogen/types/tx/tx-create-contract.d.cts +17 -0
- package/dist/autogen/types/tx/tx-create-synth-account.d.cts +7 -0
- package/dist/autogen/types/tx/tx-create-token.d.cts +10 -0
- package/dist/autogen/types/tx/tx-create-vm-engine.d.cts +8 -0
- package/dist/autogen/types/tx/tx-dummy.d.cts +3 -0
- package/dist/autogen/types/tx/tx-finalize.d.cts +6 -0
- package/dist/autogen/types/tx/tx-freeze-account.d.cts +5 -0
- package/dist/autogen/types/tx/tx-genesis-account.d.cts +11 -0
- package/dist/autogen/types/tx/tx-lead-vtx.d.cts +9 -0
- package/dist/autogen/types/tx/tx-lock-stake-for-vme.d.cts +7 -0
- package/dist/autogen/types/tx/tx-open-account.d.cts +18 -0
- package/dist/autogen/types/tx/tx-post-data-synth-account.d.cts +9 -0
- package/dist/autogen/types/tx/tx-post-data.d.cts +11 -0
- package/dist/autogen/types/tx/tx-provide-script.d.cts +16 -0
- package/dist/autogen/types/tx/tx-revoke.d.cts +16 -0
- package/dist/autogen/types/tx/tx-transfer-asset-object.d.cts +8 -0
- package/dist/autogen/types/tx/tx-transfer-coin-express.d.cts +8 -0
- package/dist/autogen/types/tx/tx-transfer-coin.d.cts +7 -0
- package/dist/autogen/types/tx/tx-transfer-token.d.cts +11 -0
- package/dist/autogen/types/tx/tx-unlock-stake.d.cts +7 -0
- package/dist/autogen/types/tx/tx-vm-engine-block.d.cts +6 -0
- package/dist/autogen/types/wasm/grant-consume-result.d.cts +4 -0
- package/dist/autogen/types/wasm/index.d.cts +26 -0
- package/dist/autogen/types/wasm/library-versions.d.cts +6 -0
- package/dist/autogen/types/wasm/param-calculate-tx-link-hash.d.cts +3 -0
- package/dist/autogen/types/wasm/param-code-core-script.d.cts +3 -0
- package/dist/autogen/types/wasm/param-convert-currency.d.cts +5 -0
- package/dist/autogen/types/wasm/param-create-account-and-keystore.d.cts +6 -0
- package/dist/autogen/types/wasm/param-create-master-keystore.d.cts +6 -0
- package/dist/autogen/types/wasm/param-create-normal-key.d.cts +4 -0
- package/dist/autogen/types/wasm/param-create-normal-keystore.d.cts +8 -0
- package/dist/autogen/types/wasm/param-derive-keys-from-mnemonic-and-path.d.cts +4 -0
- package/dist/autogen/types/wasm/param-derive-keys-from-mnemonic.d.cts +6 -0
- package/dist/autogen/types/wasm/param-encode-tx-currency.d.cts +3 -0
- package/dist/autogen/types/wasm/param-encode-tx-number.d.cts +4 -0
- package/dist/autogen/types/wasm/param-generate-mnemonic-by-seed.d.cts +3 -0
- package/dist/autogen/types/wasm/param-generate-mnemonic.d.cts +3 -0
- package/dist/autogen/types/wasm/param-get-home-shard.d.cts +4 -0
- package/dist/autogen/types/wasm/param-hash.d.cts +4 -0
- package/dist/autogen/types/wasm/param-load-keystore.d.cts +4 -0
- package/dist/autogen/types/wasm/param-make-currency.d.cts +4 -0
- package/dist/autogen/types/wasm/param-sign-by-master-key.d.cts +4 -0
- package/dist/autogen/types/wasm/param-sign-key-bind.d.cts +5 -0
- package/dist/autogen/types/wasm/param-sign.d.cts +4 -0
- package/dist/autogen/types/wasm/param-test-core-script.d.cts +7 -0
- package/dist/autogen/types/wasm/param-txs.d.cts +3 -0
- package/dist/autogen/types/wasm/param-verify-merkle-proof.d.cts +5 -0
- package/dist/autogen/types/wasm/param-verify.d.cts +5 -0
- package/dist/autogen/walletActions.d.cts +43 -0
- package/dist/autogen/wasm/crypto_aimer.d.cts +2 -0
- package/dist/autogen/wasm/crypto_haetae.d.cts +2 -0
- package/dist/autogen/wasm/crypto_smaugt.d.cts +2 -0
- package/dist/autogen/wasm/lclib.wasm +0 -0
- package/dist/autogen/wasm.d.cts +72 -0
- package/dist/clients/createClient.d.cts +8 -0
- package/dist/clients/createLocusPublicClient.d.cts +100 -0
- package/dist/clients/createLocusWalletClient.d.cts +57 -0
- package/dist/clients/createPublicClient.d.cts +6 -0
- package/dist/clients/createWalletClient.d.cts +8 -0
- package/dist/clients/index.d.cts +6 -6
- package/dist/clients/types.d.cts +21 -0
- package/dist/clients/types.d.mts +2 -0
- package/dist/constant/index.d.cts +2 -2
- package/dist/contracts/abis/erc20.d.cts +174 -0
- package/dist/contracts/abis/index.d.cts +1 -0
- package/dist/contracts/getContract.d.cts +33 -0
- package/dist/contracts/index.d.cts +2 -2
- package/dist/errors/account.d.cts +45 -0
- package/dist/errors/base.d.cts +13 -0
- package/dist/errors/index.d.cts +4 -4
- package/dist/errors/rpc.d.cts +21 -0
- package/dist/errors/transport.d.cts +21 -0
- package/dist/index.d.cts +8 -0
- package/dist/transports/http.d.cts +9 -0
- package/dist/transports/index.d.cts +2 -2
- package/dist/transports/types.d.cts +38 -0
- package/dist/transports/types.d.mts +2 -0
- package/dist/types/index.d.cts +5 -5
- package/dist/types/primitives.d.cts +5 -0
- package/dist/utils/abi.d.cts +88 -0
- package/dist/utils/index.d.cts +5 -5
- package/dist/utils/keystore.d.cts +87 -0
- package/dist/utils/lclib.d.cts +2 -0
- package/dist/utils/locus-wasm-bridge.d.cts +1 -0
- package/dist/utils/tx-validator.d.cts +28 -0
- package/dist/utils/types.d.cts +15 -0
- package/dist/utils/wasm-fetch.d.cts +6 -0
- package/package.json +2 -2
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { Address } from '../types/primitives.cjs';
|
|
2
|
+
import type { DualKeyAccount, KeySource, PreparedTransaction } from './types.cjs';
|
|
3
|
+
export type DualKeyAccountArgs = {
|
|
4
|
+
address: Address;
|
|
5
|
+
master: KeySource;
|
|
6
|
+
normal: KeySource;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Locus dual-key account 를 만든다. 반환된 `signTransaction` 은 prepare 된
|
|
10
|
+
* TX 에 대해 master/normal 라우팅을 모두 캡슐화하므로, wallet action 들이
|
|
11
|
+
* tx.type 분기를 직접 할 필요가 없다.
|
|
12
|
+
*
|
|
13
|
+
* 2 단계 흐름 노트:
|
|
14
|
+
*
|
|
15
|
+
* - OPEN_ACCOUNT 는 prepare RPC 에서도 master key-bind 서명이 필요하다.
|
|
16
|
+
* `prepareParams` 는 호출자가 `keySign` 을 빈 값으로 둔 경우 자동으로
|
|
17
|
+
* 채운다. FALCON+ED25519 가 non-deterministic 이라 submit 단계에서
|
|
18
|
+
* 서명을 다시 계산하지 *않고*, `prepared.tx.keyBind.sign` 에서 prepare
|
|
19
|
+
* 단계 값을 그대로 읽어 쓴다 (노드가 prepare 파라미터를 그대로 echo).
|
|
20
|
+
*
|
|
21
|
+
* - CHANGE_KEYPAIR 는 *자동으로 채우지 않는다*. 노드가 메인 tx 서명을
|
|
22
|
+
* 이전 키가 아닌 *새* normal pubkey 로 검증 (proof-of-possession)
|
|
23
|
+
* 하므로, 호출자가 새 normal secret 을 보유한 상태로 새 DualKeyAccount
|
|
24
|
+
* 를 만들어 호출해야 한다. account.normal.getPublicKey() 가 새 키로
|
|
25
|
+
* 바뀐 후라면 auto-compute 된 `signByMasterKey` 는 잘못된 `currentNpk`
|
|
26
|
+
* 를 쓰게 되므로 자동 계산을 비활성화한다. 호출자 측 흐름:
|
|
27
|
+
*
|
|
28
|
+
* 1. signByMasterKey = await oldAccount.master.signKeyBind({
|
|
29
|
+
* newNpk: <새 normal pubkey>,
|
|
30
|
+
* currentNpk: <이전 normal pubkey>,
|
|
31
|
+
* });
|
|
32
|
+
* 2. const newAccount = keysToAccount({ address, msk, mpk,
|
|
33
|
+
* nsk: <new>, npk: <new> });
|
|
34
|
+
* 3. await wallet.changeKey({ ..., signByMasterKey });
|
|
35
|
+
*
|
|
36
|
+
* signByMasterKey 가 비어 있으면 prepareParams 가 throw 한다.
|
|
37
|
+
*
|
|
38
|
+
* - 그 외 모든 TX 는 prepareParams 가 pass-through.
|
|
39
|
+
*
|
|
40
|
+
* 정책 (single source of truth — 노드 측 ParamsOpenAccount / ParamsChangeKey
|
|
41
|
+
* / ParamsChangeVKey / ParamsCloseAccount RPC struct 와 동기 유지):
|
|
42
|
+
*
|
|
43
|
+
* TX_CLOSE_ACCOUNT -> sign = master.signMessage(hash)
|
|
44
|
+
* TX_OPEN_ACCOUNT -> sign = normal.signMessage(hash) AND
|
|
45
|
+
* keySign = prepared.tx.keyBind.sign
|
|
46
|
+
* TX_CHANGE_KEYPAIR -> sign = normal.signMessage(hash) // normal 은 *새* 키여야 함
|
|
47
|
+
* signByMasterKey = prepared.tx.keyBind.sign
|
|
48
|
+
* TX_CHANGE_VKEY -> sign = normal.signMessage(hash)
|
|
49
|
+
* 그 외 -> sign = normal.signMessage(hash)
|
|
50
|
+
*
|
|
51
|
+
* public key 필드 (mpk/pk/mpkey/masterPkey/newNormalPkey) 는 여기서
|
|
52
|
+
* 합성하지 않는다 — 호출자가 prepare 파라미터에 직접 포함시켜 넘기고,
|
|
53
|
+
* `_sendPreparedTransaction` 이 submit 단계에서 params[0] 에 추가 필드들
|
|
54
|
+
* 을 병합할 때 원본 값을 보존한다.
|
|
55
|
+
*/
|
|
56
|
+
export declare function dualKeyAccount(args: DualKeyAccountArgs): DualKeyAccount;
|
|
57
|
+
export declare const toAccount: typeof dualKeyAccount;
|
|
58
|
+
export type { PreparedTransaction };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export * from './types.
|
|
2
|
-
export * from './account.
|
|
3
|
-
export * from './keysToAccount.
|
|
4
|
-
export * from './mnemonicToAccount.
|
|
5
|
-
export * from './keys/index.
|
|
1
|
+
export * from './types.cjs';
|
|
2
|
+
export * from './account.cjs';
|
|
3
|
+
export * from './keysToAccount.cjs';
|
|
4
|
+
export * from './mnemonicToAccount.cjs';
|
|
5
|
+
export * from './keys/index.cjs';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { KeySource } from '../types.cjs';
|
|
2
|
+
export type LocalKeySourceArgs = {
|
|
3
|
+
/** 평문 secret key (normal 소스이면 nsk, master 소스이면 msk). */
|
|
4
|
+
key: string;
|
|
5
|
+
/** 짝이 되는 public key (npk 또는 mpk). 호출자가 직접 넘겨야 한다. */
|
|
6
|
+
publicKey: string;
|
|
7
|
+
/**
|
|
8
|
+
* 어느 WASM signer 를 호출할지:
|
|
9
|
+
* - 'normal' 은 `sign(sk, message)` 를 사용하며 signKeyBind 를 노출하지 않는다.
|
|
10
|
+
* - 'master' 는 `signByMasterKey(msk, message)` 를 사용하고
|
|
11
|
+
* signKeyBind(msk, newNpk, currentNpk) 도 함께 노출한다.
|
|
12
|
+
*/
|
|
13
|
+
role: 'master' | 'normal';
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* 인메모리 secret-key 소스. 개발용, CLI 도구, 또는 호출자가 평문 키
|
|
17
|
+
* 자료를 보관해도 무방한 경우에 적합하다.
|
|
18
|
+
*
|
|
19
|
+
* 키를 keystore / 하드웨어 장치 / 다른 프로세스 뒤에 보관하는 지갑은
|
|
20
|
+
* raw `key` 를 라이브러리에 넘기는 대신 toKeySource() 와 자체 콜백을
|
|
21
|
+
* 주입하는 방식을 써야 한다.
|
|
22
|
+
*/
|
|
23
|
+
export declare function localKeySource(args: LocalKeySourceArgs): KeySource;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { KeySource } from '../types.cjs';
|
|
2
|
+
export type ToKeySourceArgs = {
|
|
3
|
+
/** 디버그/UI 라벨. 도구가 사용할 수 있도록 반환되는 소스에 저장된다. */
|
|
4
|
+
type?: string;
|
|
5
|
+
getPublicKey: KeySource['getPublicKey'];
|
|
6
|
+
signMessage: KeySource['signMessage'];
|
|
7
|
+
signKeyBind?: KeySource['signKeyBind'];
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* 호출자가 제공한 콜백으로 KeySource 를 만든다. keystore 기반 지갑,
|
|
11
|
+
* 하드웨어 지갑, 외부 지갑 앱이 통합되는 진입점 — 라이브러리는 secret key
|
|
12
|
+
* 를 보지 않는다.
|
|
13
|
+
*/
|
|
14
|
+
export declare function toKeySource(args: ToKeySourceArgs): KeySource;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Address } from '../types/primitives.cjs';
|
|
2
|
+
import type { DualKeyAccount } from './types.cjs';
|
|
3
|
+
export type KeysToAccountArgs = {
|
|
4
|
+
address: Address;
|
|
5
|
+
/** Master secret key. */
|
|
6
|
+
msk: string;
|
|
7
|
+
/** Master public key. Locus 의 PQ 알고리즘은 msk 로부터 mpk 를 derive 하지 않으므로 함께 받는다. */
|
|
8
|
+
mpk: string;
|
|
9
|
+
/** Normal secret key. */
|
|
10
|
+
nsk: string;
|
|
11
|
+
/** Normal public key. */
|
|
12
|
+
npk: string;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* 평문 master/normal 키페어로부터 DualKeyAccount 를 만든다. 개발용, 테스트,
|
|
16
|
+
* CLI 도구 용도 — 프로덕션 지갑은 secret key 가 라이브러리에 들어가지
|
|
17
|
+
* 않도록 toAccount() 와 toKeySource() 콜백을 사용해야 한다.
|
|
18
|
+
*/
|
|
19
|
+
export declare function keysToAccount(args: KeysToAccountArgs): DualKeyAccount;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { DualKeyAccount } from './types.cjs';
|
|
2
|
+
export type MnemonicToAccountArgs = {
|
|
3
|
+
mnemonic: string;
|
|
4
|
+
/**
|
|
5
|
+
* 완전히 형성된 BIP-44 path. 이 값을 넘기면 deriveKeysFromMnemonicAndPath
|
|
6
|
+
* 가 사용되고 master KeyAlgorithm 은 path 에서 추론된다. normal
|
|
7
|
+
* KeyAlgorithm 은 노드 측 헬퍼가 ed25519 로 고정한다. 이 모드에서는
|
|
8
|
+
* `algoMaster`, `algoNormal`, `index` 가 무시된다.
|
|
9
|
+
*/
|
|
10
|
+
path?: string;
|
|
11
|
+
/** `path` 가 없을 때 필수. */
|
|
12
|
+
algoMaster?: string;
|
|
13
|
+
/** `path` 가 없을 때 필수. */
|
|
14
|
+
algoNormal?: string;
|
|
15
|
+
/** BIP-44 account index. 기본값 0. `path` 가 있으면 무시된다. */
|
|
16
|
+
index?: number;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* BIP-39 mnemonic 으로부터 WASM 을 거쳐 Locus DualKeyAccount 를 derive 한다.
|
|
20
|
+
* 라이브러리는 결과 secret key 를 반환된 localKeySource 클로저 외에는
|
|
21
|
+
* 보관하지 않는다 — 콜백 방식 키 위임이 필요한 호출자는
|
|
22
|
+
* deriveKeysFromMnemonic / deriveKeysFromMnemonicAndPath 를 직접 호출한 뒤
|
|
23
|
+
* 결과를 `toAccount({ master, normal })` 에 넘기는 게 권장.
|
|
24
|
+
*/
|
|
25
|
+
export declare function mnemonicToAccount(args: MnemonicToAccountArgs): DualKeyAccount;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 메인 서명을 master 키로 생성하는 TX 타입 집합 (signByMasterKey WASM 호출).
|
|
3
|
+
* 그 외 모든 TX 는 normal 키로 서명한다 (sign WASM 호출).
|
|
4
|
+
*
|
|
5
|
+
* Source of truth: locuschain 프로토콜 — CLOSE_ACCOUNT 만 메인 tx 를 master
|
|
6
|
+
* 키로 직접 서명한다.
|
|
7
|
+
*/
|
|
8
|
+
export declare const MASTER_SIGN_TX_TYPES: ReadonlySet<string>;
|
|
9
|
+
/**
|
|
10
|
+
* Submit payload 에 SignKeyBind 결과가 포함되는 TX 타입 집합. 메인 tx 는
|
|
11
|
+
* 여전히 normal 키가 서명하고, master 키는 (새 normal pubkey, 현재 normal
|
|
12
|
+
* pubkey) 간의 binding 만 증명한다.
|
|
13
|
+
*
|
|
14
|
+
* 정확한 submit 필드는 RPC 마다 다르다:
|
|
15
|
+
* - TX_OPEN_ACCOUNT -> additions.keySign (ParamsOpenAccount.keySign)
|
|
16
|
+
* - TX_CHANGE_KEYPAIR -> additions.signByMasterKey (ParamsChangeKey.signByMasterKey)
|
|
17
|
+
*
|
|
18
|
+
* Source of truth: locuschain 프로토콜 — run/test_lclib/lclib/lclib.go 의
|
|
19
|
+
* SignKeyBind 와 nodeext/rpclocus/rpc.go 의 ParamsXxx struct 참고.
|
|
20
|
+
*/
|
|
21
|
+
export declare const SIGN_KEY_BIND_TX_TYPES: ReadonlySet<string>;
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import type { RpcCreateTxResult } from '../autogen/types/rpc/rpc-create-tx-result.cjs';
|
|
2
|
+
import type { Address } from '../types/primitives.cjs';
|
|
3
|
+
/**
|
|
4
|
+
* 서버 측 prepare 결과 — 로컬 서명 단계의 입력이 된다. Locus 의 모든
|
|
5
|
+
* TX_CREATION RPC (예: locus_transferCoin) 가 이 값을 반환한다.
|
|
6
|
+
*/
|
|
7
|
+
export type PreparedTransaction = RpcCreateTxResult;
|
|
8
|
+
/**
|
|
9
|
+
* 두 번째 (submit) RPC 호출의 params[0] 에 병합되는 추가 필드들.
|
|
10
|
+
*
|
|
11
|
+
* 필드명은 RPC 스키마와 글자 그대로 (와이어에서 case-sensitive) 일치한다:
|
|
12
|
+
* - `sign` 과 `signedHeight` 는 모든 TX_CREATION submit 에 존재.
|
|
13
|
+
* - `keySign` 은 TX_OPEN_ACCOUNT 의 SignKeyBind 결과.
|
|
14
|
+
* - `signByMasterKey` 는 TX_CHANGE_KEYPAIR 의 SignKeyBind 결과.
|
|
15
|
+
* public key 필드 (mpk/pk/mpkey/masterPkey/newNormalPkey) 는 사용자가
|
|
16
|
+
* prepare 파라미터로 직접 넘기는 값이며 여기서 합성하지 않는다.
|
|
17
|
+
*/
|
|
18
|
+
export type TxSignAdditions = {
|
|
19
|
+
sign: string;
|
|
20
|
+
signedHeight: number;
|
|
21
|
+
/** TX_OPEN_ACCOUNT: 초기 key-bind 메시지에 대한 master 서명. */
|
|
22
|
+
keySign?: string;
|
|
23
|
+
/** TX_CHANGE_KEYPAIR: (newNpk, hash(currentNpk)) 에 대한 master 서명. */
|
|
24
|
+
signByMasterKey?: string;
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* 키 단위의 일반 signer. 구현체는 다음과 같다:
|
|
28
|
+
* - localKeySource — secret key + public key 를 메모리에 보유.
|
|
29
|
+
* - toKeySource — 호출자가 제공한 콜백 (keystore, 하드웨어 지갑,
|
|
30
|
+
* 외부 지갑 앱 등).
|
|
31
|
+
* 라이브러리는 secret key 를 직접 보관하지 않고, 콜백만 호출한다.
|
|
32
|
+
*/
|
|
33
|
+
export type KeySource = {
|
|
34
|
+
/** 디버그/UI 라벨 — 'local' | 'keystore' | 'ledger' | 'trezor' | 'json-rpc' | 'custom' | string. */
|
|
35
|
+
type: string;
|
|
36
|
+
/**
|
|
37
|
+
* public key (normal 소스이면 npk, master 소스이면 mpk). Locus 의 PQ
|
|
38
|
+
* 서명 알고리즘은 secret 으로부터 public 을 결정적으로 derive 할 수
|
|
39
|
+
* 없어, 호출자가 값을 주입해야 한다.
|
|
40
|
+
*/
|
|
41
|
+
getPublicKey: (args?: {
|
|
42
|
+
signal?: AbortSignal;
|
|
43
|
+
}) => Promise<string>;
|
|
44
|
+
/** 임의의 메시지에 서명한다 (보통 tx 해시). */
|
|
45
|
+
signMessage: (args: {
|
|
46
|
+
message: string;
|
|
47
|
+
signal?: AbortSignal;
|
|
48
|
+
}) => Promise<string>;
|
|
49
|
+
/**
|
|
50
|
+
* changeKey 흐름용 서명: master KeySource 가 새 normal public key 를
|
|
51
|
+
* 이전 키에 바인드한다. 이 함수는 master 소스만 제공할 것으로 기대하며,
|
|
52
|
+
* 이를 필요로 하는 wallet action 을 signKeyBind 구현 없는 KeySource 로
|
|
53
|
+
* 호출하면 SignKeyBindUnsupportedError 가 발생한다.
|
|
54
|
+
*
|
|
55
|
+
* 최초 key bind (TX_OPEN_ACCOUNT) 의 경우 currentNpk 는 빈 문자열 — 노드는
|
|
56
|
+
* 이를 BlankShortDigest 로 해석한다.
|
|
57
|
+
*/
|
|
58
|
+
signKeyBind?: (args: {
|
|
59
|
+
newNpk: string;
|
|
60
|
+
currentNpk: string;
|
|
61
|
+
signal?: AbortSignal;
|
|
62
|
+
}) => Promise<string>;
|
|
63
|
+
};
|
|
64
|
+
/**
|
|
65
|
+
* Locus account 모델: 두 개의 key source (master + normal). 라이브러리는
|
|
66
|
+
* TX 마다 어느 소스로 라우팅할지 accounts/signing/txKeyPolicy.mts 의
|
|
67
|
+
* TX 타입별 정책으로 결정한다.
|
|
68
|
+
*/
|
|
69
|
+
export type DualKeyAccount = {
|
|
70
|
+
type: 'locus-dual-key';
|
|
71
|
+
address: Address;
|
|
72
|
+
master: KeySource;
|
|
73
|
+
normal: KeySource;
|
|
74
|
+
/**
|
|
75
|
+
* _prepareTransaction 이 첫 RPC 호출 전에 부르는 선택적 훅.
|
|
76
|
+
* TX_OPEN_ACCOUNT / TX_CHANGE_KEYPAIR 의 경우 prepare RPC 단계에서도
|
|
77
|
+
* 노드가 master 가 증명한 key-bind 서명을 검증하므로 prepare 전에
|
|
78
|
+
* 미리 채워져 있어야 한다. 변환된 `params` 를 반환하면 dualKeyAccount
|
|
79
|
+
* 가 `keySign` / `signByMasterKey` 를 자동으로 채우고, 나머지 RPC 는
|
|
80
|
+
* pass-through 로 둔다.
|
|
81
|
+
*/
|
|
82
|
+
prepareParams?: (args: {
|
|
83
|
+
method: string;
|
|
84
|
+
params: readonly unknown[];
|
|
85
|
+
signal?: AbortSignal;
|
|
86
|
+
}) => Promise<readonly unknown[]>;
|
|
87
|
+
/** _signLocusTransaction 이 호출한다. 사용자 코드가 직접 부르지 않는다. */
|
|
88
|
+
signTransaction: (args: {
|
|
89
|
+
prepared: PreparedTransaction;
|
|
90
|
+
signal?: AbortSignal;
|
|
91
|
+
}) => Promise<TxSignAdditions>;
|
|
92
|
+
/** TX 외 메시지 서명용 escape hatch (예: 인증 challenge). */
|
|
93
|
+
signMessage: (args: {
|
|
94
|
+
message: string;
|
|
95
|
+
role?: 'master' | 'normal';
|
|
96
|
+
signal?: AbortSignal;
|
|
97
|
+
}) => Promise<string>;
|
|
98
|
+
};
|
|
99
|
+
/** 라이브러리의 표준 account 타입으로 re-export. */
|
|
100
|
+
export type LocusAccount = DualKeyAccount;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { PreparedTransaction } from '../../accounts/types.cjs';
|
|
2
|
+
/**
|
|
3
|
+
* prepared.tx 의 type 으로부터 submit RPC 호출 params[0] 에 echo 해야 할 부가
|
|
4
|
+
* 필드들을 추출한다.
|
|
5
|
+
*
|
|
6
|
+
* 노드는 prepare 단계에서 일부 필드를 직접 생성하거나 확정한 뒤 1차 응답의
|
|
7
|
+
* `tx` 안에 담아 돌려준다. 이어지는 submit 호출은 *동일 method* 를 다시
|
|
8
|
+
* 호출하기 때문에, 호출자가 보낸 params 에 이 값들을 다시 채워 넣지 않으면
|
|
9
|
+
* 노드 검증 단계에서 hash 불일치 또는 빈 필드로 실패한다.
|
|
10
|
+
*
|
|
11
|
+
* TX_CREATE_CONTRACT -> contractAccount = tx.target
|
|
12
|
+
* TX_CREATE_SA -> synthAccount = tx.target
|
|
13
|
+
* TX_CREATE_VME -> sysId = tx.sysId
|
|
14
|
+
* TX_CHANGE_VKEY -> newValidationPkey = tx.newKey
|
|
15
|
+
*
|
|
16
|
+
* prefix 매칭이라 `*_FEE` 변종 (TX_CREATE_CONTRACT_FEE 등) 도 같이 잡힌다.
|
|
17
|
+
*/
|
|
18
|
+
export declare function _deriveTxAdditions(prepared: PreparedTransaction): Record<string, unknown>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Client } from '../../clients/types.cjs';
|
|
2
|
+
import type { PrepareTransactionArgs, PreparedTransactionEnvelope } from './types.cjs';
|
|
3
|
+
/**
|
|
4
|
+
* Locus TX 2-step 흐름의 1 단계.
|
|
5
|
+
*
|
|
6
|
+
* TX_CREATION RPC 를 호출자 params 로 호출하고, 응답이 `hash` 와 `tx` 를
|
|
7
|
+
* 모두 포함하는지 (즉 일반 read 응답이 아니라 진짜 prepare 결과인지)
|
|
8
|
+
* 검증한다. _signLocusTransaction 과 _sendPreparedTransaction 이 소비할
|
|
9
|
+
* envelope 를 반환한다.
|
|
10
|
+
*
|
|
11
|
+
* 클라이언트가 `prepareParams` 를 제공하는 DualKeyAccount 에 바인드되어
|
|
12
|
+
* 있으면 params 는 그 훅을 먼저 거친다. OPEN_ACCOUNT / CHANGE_KEYPAIR 가
|
|
13
|
+
* 노드 검증 전에 master 가 증명한 key-bind 서명을 채우는 경로가 이것.
|
|
14
|
+
*/
|
|
15
|
+
export declare function _prepareTransaction(client: Client, args: PrepareTransactionArgs): Promise<PreparedTransactionEnvelope>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Client } from '../../clients/types.cjs';
|
|
2
|
+
import type { SignedTransactionEnvelope } from './types.cjs';
|
|
3
|
+
/**
|
|
4
|
+
* Locus TX 2-step 흐름의 3 단계.
|
|
5
|
+
*
|
|
6
|
+
* sign 단계 결과를 params[0] 에 병합한 뒤 같은 RPC 메서드를 다시 호출한다.
|
|
7
|
+
* 노드는 이제 완성된 payload 를 받아 최종 결과를 반환한다.
|
|
8
|
+
*/
|
|
9
|
+
export declare function _sendPreparedTransaction<T = unknown>(client: Client, signed: SignedTransactionEnvelope): Promise<T>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { DualKeyAccount } from '../../accounts/types.cjs';
|
|
2
|
+
import type { PreparedTransactionEnvelope, SignedTransactionEnvelope } from './types.cjs';
|
|
3
|
+
/**
|
|
4
|
+
* Locus TX 2-step 흐름의 2 단계.
|
|
5
|
+
*
|
|
6
|
+
* prepared envelope 를 account 에 넘기고, account 가 master / normal /
|
|
7
|
+
* signKeyBind 라우팅을 한 곳에서 수행한다 (accounts/account.mts 참고).
|
|
8
|
+
*
|
|
9
|
+
* 동시에 `_deriveTxAdditions` 로 prepared.tx 에서 echo 해야 할 TX-type 별
|
|
10
|
+
* 필드 (contractAccount / synthAccount / sysId / newValidationPkey) 를
|
|
11
|
+
* 추출해 sign 결과와 함께 submit 단계 (`_sendPreparedTransaction`) 의
|
|
12
|
+
* params[0] 머지 대상에 포함시킨다.
|
|
13
|
+
*/
|
|
14
|
+
export declare function _signLocusTransaction(account: DualKeyAccount | undefined, envelope: PreparedTransactionEnvelope): Promise<SignedTransactionEnvelope>;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { PreparedTransaction, TxSignAdditions } from '../../accounts/types.cjs';
|
|
2
|
+
export type PrepareTransactionArgs = {
|
|
3
|
+
/** 호출할 RPC 메서드 (예: 'locus_transferCoin'). */
|
|
4
|
+
method: string;
|
|
5
|
+
/** 원본 RPC params. 첫 원소가 3 단계에서 sign 추가 필드를 받는다. */
|
|
6
|
+
params: readonly unknown[];
|
|
7
|
+
};
|
|
8
|
+
export type PreparedTransactionEnvelope = {
|
|
9
|
+
method: string;
|
|
10
|
+
params: readonly unknown[];
|
|
11
|
+
/** 1 단계에서 노드가 반환한 결과. hash + tx + signedHeight 를 담는다. */
|
|
12
|
+
prepared: PreparedTransaction;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* submit 호출 (`_sendPreparedTransaction`) 이 params[0] 에 병합하는 부가 필드.
|
|
16
|
+
*
|
|
17
|
+
* 두 출처의 합집합:
|
|
18
|
+
* - sign 단계 결과 (`TxSignAdditions`) — sign / signedHeight / keySign /
|
|
19
|
+
* signByMasterKey.
|
|
20
|
+
* - prepared.tx 에서 echo 해야 하는 TX-type 별 필드 (`_deriveTxAdditions`):
|
|
21
|
+
* contractAccount / synthAccount / sysId / newValidationPkey.
|
|
22
|
+
*/
|
|
23
|
+
export type SubmitAdditions = TxSignAdditions & {
|
|
24
|
+
/** TX_CREATE_CONTRACT — 노드가 생성한 컨트랙트 주소를 echo. */
|
|
25
|
+
contractAccount?: string;
|
|
26
|
+
/** TX_CREATE_SA — 노드가 생성한 synth account 주소를 echo. */
|
|
27
|
+
synthAccount?: string;
|
|
28
|
+
/** TX_CREATE_VME — 노드가 확정한 sysId 를 echo. */
|
|
29
|
+
sysId?: string;
|
|
30
|
+
/** TX_CHANGE_VKEY — 노드가 echo 한 새 validation pubkey. */
|
|
31
|
+
newValidationPkey?: string;
|
|
32
|
+
};
|
|
33
|
+
export type SignedTransactionEnvelope = {
|
|
34
|
+
method: string;
|
|
35
|
+
params: readonly unknown[];
|
|
36
|
+
/** 2 단계 결과 — 3 단계에서 params[0] 에 병합된다. */
|
|
37
|
+
additions: SubmitAdditions;
|
|
38
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ParamsCreateNode } from '../../../types/rpc/params-create-node.cjs';
|
|
2
|
+
import { RpcCreateNodeResult } from '../../../types/rpc/rpc-create-node-result.cjs';
|
|
3
|
+
import type { Client } from '../../../../clients/types.cjs';
|
|
4
|
+
export declare function createNode(client: Client, param: ParamsCreateNode): Promise<RpcCreateNodeResult>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ParamsGameChainCmd } from '../../../types/rpc/params-game-chain-cmd.cjs';
|
|
2
|
+
import { RpcGameChainCmdResult } from '../../../types/rpc/rpc-game-chain-cmd-result.cjs';
|
|
3
|
+
import type { Client } from '../../../../clients/types.cjs';
|
|
4
|
+
export declare function gameChainCmd(client: Client, param: ParamsGameChainCmd): Promise<RpcGameChainCmdResult>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ParamsAccounts } from '../../../types/rpc/params-accounts.cjs';
|
|
2
|
+
import { RpcGetAccountsBalancesResult } from '../../../types/rpc/rpc-get-accounts-balances-result.cjs';
|
|
3
|
+
import type { Client } from '../../../../clients/types.cjs';
|
|
4
|
+
export declare function getAccountsBalances(client: Client, param: ParamsAccounts): Promise<RpcGetAccountsBalancesResult>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ParamsAccounts } from '../../../types/rpc/params-accounts.cjs';
|
|
2
|
+
import { RpcGetAccountsHeightsResult } from '../../../types/rpc/rpc-get-accounts-heights-result.cjs';
|
|
3
|
+
import type { Client } from '../../../../clients/types.cjs';
|
|
4
|
+
export declare function getAccountsHeights(client: Client, param: ParamsAccounts): Promise<RpcGetAccountsHeightsResult>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ParamsContractLog } from '../../../types/rpc/params-contract-log.cjs';
|
|
2
|
+
import { RpcGetContractLogResult } from '../../../types/rpc/rpc-get-contract-log-result.cjs';
|
|
3
|
+
import type { Client } from '../../../../clients/types.cjs';
|
|
4
|
+
export declare function getContractLog(client: Client, param: ParamsContractLog): Promise<RpcGetContractLogResult>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ParamsGetHomeShard } from '../../../types/rpc/params-get-home-shard.cjs';
|
|
2
|
+
import { RpcGetHomeShardResult } from '../../../types/rpc/rpc-get-home-shard-result.cjs';
|
|
3
|
+
import type { Client } from '../../../../clients/types.cjs';
|
|
4
|
+
export declare function getHomeShard(client: Client, param: ParamsGetHomeShard): Promise<RpcGetHomeShardResult>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ParamsGetImportAccount } from '../../../types/rpc/params-get-import-account.cjs';
|
|
2
|
+
import { RpcGetImportAccountResult } from '../../../types/rpc/rpc-get-import-account-result.cjs';
|
|
3
|
+
import type { Client } from '../../../../clients/types.cjs';
|
|
4
|
+
export declare function getImportAccount(client: Client, params: ParamsGetImportAccount): Promise<RpcGetImportAccountResult>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ParamsGetImportAccount } from '../../../types/rpc/params-get-import-account.cjs';
|
|
2
|
+
import { RpcImportAccountResult } from '../../../types/rpc/rpc-import-account-result.cjs';
|
|
3
|
+
import type { Client } from '../../../../clients/types.cjs';
|
|
4
|
+
export declare function getImportAccountLog(client: Client, params: ParamsGetImportAccount): Promise<RpcImportAccountResult>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ParamsAccount } from '../../../types/rpc/params-account.cjs';
|
|
2
|
+
import { RpcGetKeysResult } from '../../../types/rpc/rpc-get-keys-result.cjs';
|
|
3
|
+
import type { Client } from '../../../../clients/types.cjs';
|
|
4
|
+
export declare function getKeys(client: Client, params: ParamsAccount): Promise<RpcGetKeysResult>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ParamsImportAccount } from '../../../types/rpc/params-import-account.cjs';
|
|
2
|
+
import { RpcImportAccountResult } from '../../../types/rpc/rpc-import-account-result.cjs';
|
|
3
|
+
import type { Client } from '../../../../clients/types.cjs';
|
|
4
|
+
export declare function importAccount(client: Client, params: ParamsImportAccount): Promise<RpcImportAccountResult>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export * from './allHeights.cjs';
|
|
2
|
+
export * from './balanceGrantList.cjs';
|
|
3
|
+
export * from './balanceList.cjs';
|
|
4
|
+
export * from './createAccount.cjs';
|
|
5
|
+
export * from './createNode.cjs';
|
|
6
|
+
export * from './dumpAllAccounts.cjs';
|
|
7
|
+
export * from './echo.cjs';
|
|
8
|
+
export * from './gameChainCmd.cjs';
|
|
9
|
+
export * from './getAccountsBalances.cjs';
|
|
10
|
+
export * from './getAccountsHeights.cjs';
|
|
11
|
+
export * from './getContractLog.cjs';
|
|
12
|
+
export * from './getGuestsInfo.cjs';
|
|
13
|
+
export * from './getHomeShard.cjs';
|
|
14
|
+
export * from './getImportAccount.cjs';
|
|
15
|
+
export * from './getImportAccountLog.cjs';
|
|
16
|
+
export * from './getKeys.cjs';
|
|
17
|
+
export * from './getNodeBlocks.cjs';
|
|
18
|
+
export * from './getPeerPool.cjs';
|
|
19
|
+
export * from './getPeersInfo.cjs';
|
|
20
|
+
export * from './importAccount.cjs';
|
|
21
|
+
export * from './initReliableNodes.cjs';
|
|
22
|
+
export * from './noArgsRets.cjs';
|
|
23
|
+
export * from './nodeCmd.cjs';
|
|
24
|
+
export * from './removeHoldTxs.cjs';
|
|
25
|
+
export * from './requestVme.cjs';
|
|
26
|
+
export * from './sendRawTransaction.cjs';
|
|
27
|
+
export * from './setImportAccountTx.cjs';
|
|
28
|
+
export * from './setReliableNode.cjs';
|
|
29
|
+
export * from './viewContract.cjs';
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ParamsInitReliableNodes } from '../../../types/rpc/params-init-reliable-nodes.cjs';
|
|
2
|
+
import { RpcBoolResult } from '../../../types/rpc/rpc-bool-result.cjs';
|
|
3
|
+
import type { Client } from '../../../../clients/types.cjs';
|
|
4
|
+
export declare function initReliableNodes(client: Client, param: ParamsInitReliableNodes): Promise<RpcBoolResult>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ParamsRemoveHoldTxs } from '../../../types/rpc/params-remove-hold-txs.cjs';
|
|
2
|
+
import { RetTypeBase } from '../../../types/common/ret-type-base.cjs';
|
|
3
|
+
import type { Client } from '../../../../clients/types.cjs';
|
|
4
|
+
export declare function removeHoldTxs(client: Client, param: ParamsRemoveHoldTxs): Promise<RetTypeBase>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ParamsRequestVme } from '../../../types/rpc/params-request-vme.cjs';
|
|
2
|
+
import { RpcRequestVmeResult } from '../../../types/rpc/rpc-request-vme-result.cjs';
|
|
3
|
+
import type { Client } from '../../../../clients/types.cjs';
|
|
4
|
+
export declare function requestVme(client: Client, params: ParamsRequestVme): Promise<RpcRequestVmeResult>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ParamsSendRawTransaction } from '../../../types/rpc/params-send-raw-transaction.cjs';
|
|
2
|
+
import { RpcSendRawTransactionResult } from '../../../types/rpc/rpc-send-raw-transaction-result.cjs';
|
|
3
|
+
import type { Client } from '../../../../clients/types.cjs';
|
|
4
|
+
export declare function sendRawTransaction(client: Client, params: ParamsSendRawTransaction): Promise<RpcSendRawTransactionResult>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ParamsSetImportAccountTx } from '../../../types/rpc/params-set-import-account-tx.cjs';
|
|
2
|
+
import { RpcSetImportAccountTxResult } from '../../../types/rpc/rpc-set-import-account-tx-result.cjs';
|
|
3
|
+
import type { Client } from '../../../../clients/types.cjs';
|
|
4
|
+
export declare function setImportAccountTx(client: Client, params: ParamsSetImportAccountTx): Promise<RpcSetImportAccountTxResult>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ParamsSetReliableNode } from '../../../types/rpc/params-set-reliable-node.cjs';
|
|
2
|
+
import { RpcBoolResult } from '../../../types/rpc/rpc-bool-result.cjs';
|
|
3
|
+
import type { Client } from '../../../../clients/types.cjs';
|
|
4
|
+
export declare function setReliableNode(client: Client, param: ParamsSetReliableNode): Promise<RpcBoolResult>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ParamsCallContract } from '../../../types/rpc/params-call-contract.cjs';
|
|
2
|
+
import { RpcViewContractResult } from '../../../types/rpc/rpc-view-contract-result.cjs';
|
|
3
|
+
import type { Client } from '../../../../clients/types.cjs';
|
|
4
|
+
export declare function viewContract(client: Client, param: ParamsCallContract): Promise<RpcViewContractResult>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ParamsCallContract } from '../../../types/rpc/params-call-contract.cjs';
|
|
2
|
+
import { RpcCreateTxResult } from '../../../types/rpc/rpc-create-tx-result.cjs';
|
|
3
|
+
import type { WalletClient } from '../../../../clients/types.cjs';
|
|
4
|
+
export declare function callContract(client: WalletClient, param: ParamsCallContract): Promise<RpcCreateTxResult>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ParamsCreateContract } from '../../../types/rpc/params-create-contract.cjs';
|
|
2
|
+
import { RpcCreateTxResult } from '../../../types/rpc/rpc-create-tx-result.cjs';
|
|
3
|
+
import type { WalletClient } from '../../../../clients/types.cjs';
|
|
4
|
+
export declare function createContract(client: WalletClient, param: ParamsCreateContract): Promise<RpcCreateTxResult>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ParamsCreateSynthAccount } from '../../../types/rpc/params-create-synth-account.cjs';
|
|
2
|
+
import { RpcCreateTxResult } from '../../../types/rpc/rpc-create-tx-result.cjs';
|
|
3
|
+
import type { WalletClient } from '../../../../clients/types.cjs';
|
|
4
|
+
export declare function createSynthAccount(client: WalletClient, param: ParamsCreateSynthAccount): Promise<RpcCreateTxResult>;
|