@geeqdev/geeq-sdk 0.1.0 → 0.2.0
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/.idea/geeq_sdk.iml +12 -0
- package/.idea/modules.xml +8 -0
- package/.idea/vcs.xml +6 -0
- package/.nvmrc +1 -0
- package/CONTRIBUTING.md +20 -0
- package/dist/src/address/record-type.d.ts +10 -0
- package/dist/src/address/record-type.js +59 -0
- package/dist/src/address/record-type.js.map +1 -0
- package/dist/src/address/wallet-address.d.ts +34 -0
- package/dist/src/address/wallet-address.js +90 -0
- package/dist/src/address/wallet-address.js.map +1 -0
- package/dist/src/amount.d.ts +43 -0
- package/dist/src/amount.js +105 -0
- package/dist/src/amount.js.map +1 -0
- package/dist/src/assert.d.ts +12 -0
- package/dist/src/assert.js +24 -0
- package/dist/src/assert.js.map +1 -0
- package/dist/src/capnp/adminNetTx.capnp.d.ts +75 -0
- package/dist/src/capnp/adminNetTx.capnp.js +66 -0
- package/dist/src/capnp/adminNetTx.capnp.js.map +1 -0
- package/dist/src/capnp/appLayBlock.capnp.d.ts +26 -0
- package/dist/src/capnp/appLayBlock.capnp.js +24 -0
- package/dist/src/capnp/appLayBlock.capnp.js.map +1 -0
- package/dist/src/capnp/appLayLedger.capnp.d.ts +34 -0
- package/dist/src/capnp/appLayLedger.capnp.js +32 -0
- package/dist/src/capnp/appLayLedger.capnp.js.map +1 -0
- package/dist/src/capnp/appLayRec.capnp.d.ts +129 -0
- package/dist/src/capnp/appLayRec.capnp.js +156 -0
- package/dist/src/capnp/appLayRec.capnp.js.map +1 -0
- package/dist/src/capnp/chainStateView.capnp.d.ts +50 -0
- package/dist/src/capnp/chainStateView.capnp.js +48 -0
- package/dist/src/capnp/chainStateView.capnp.js.map +1 -0
- package/dist/src/capnp/coinAcctRec.capnp.d.ts +178 -0
- package/dist/src/capnp/coinAcctRec.capnp.js +189 -0
- package/dist/src/capnp/coinAcctRec.capnp.js.map +1 -0
- package/dist/src/capnp/genesisBlock.capnp.d.ts +61 -0
- package/dist/src/capnp/genesisBlock.capnp.js +55 -0
- package/dist/src/capnp/genesisBlock.capnp.js.map +1 -0
- package/dist/src/capnp/hubContentStmt.capnp.d.ts +63 -0
- package/dist/src/capnp/hubContentStmt.capnp.js +57 -0
- package/dist/src/capnp/hubContentStmt.capnp.js.map +1 -0
- package/dist/src/capnp/misc.capnp.d.ts +20 -0
- package/dist/src/capnp/misc.capnp.js +18 -0
- package/dist/src/capnp/misc.capnp.js.map +1 -0
- package/dist/src/capnp/netActorRec.capnp.d.ts +65 -0
- package/dist/src/capnp/netActorRec.capnp.js +65 -0
- package/dist/src/capnp/netActorRec.capnp.js.map +1 -0
- package/dist/src/capnp/nodeContentStmt.capnp.d.ts +67 -0
- package/dist/src/capnp/nodeContentStmt.capnp.js +61 -0
- package/dist/src/capnp/nodeContentStmt.capnp.js.map +1 -0
- package/dist/src/capnp/nodePayloadList.capnp.d.ts +28 -0
- package/dist/src/capnp/nodePayloadList.capnp.js +26 -0
- package/dist/src/capnp/nodePayloadList.capnp.js.map +1 -0
- package/dist/src/capnp/nodeTxList.capnp.d.ts +36 -0
- package/dist/src/capnp/nodeTxList.capnp.js +34 -0
- package/dist/src/capnp/nodeTxList.capnp.js.map +1 -0
- package/dist/src/capnp/paramAcctRec.capnp.d.ts +338 -0
- package/dist/src/capnp/paramAcctRec.capnp.js +669 -0
- package/dist/src/capnp/paramAcctRec.capnp.js.map +1 -0
- package/dist/src/capnp/payload.capnp.d.ts +237 -0
- package/dist/src/capnp/payload.capnp.js +260 -0
- package/dist/src/capnp/payload.capnp.js.map +1 -0
- package/dist/src/capnp/proxyAcctRec.capnp.d.ts +223 -0
- package/dist/src/capnp/proxyAcctRec.capnp.js +255 -0
- package/dist/src/capnp/proxyAcctRec.capnp.js.map +1 -0
- package/dist/src/capnp/relayContentStmt.capnp.d.ts +82 -0
- package/dist/src/capnp/relayContentStmt.capnp.js +85 -0
- package/dist/src/capnp/relayContentStmt.capnp.js.map +1 -0
- package/dist/src/capnp/sysAcctRec.capnp.d.ts +48 -0
- package/dist/src/capnp/sysAcctRec.capnp.js +46 -0
- package/dist/src/capnp/sysAcctRec.capnp.js.map +1 -0
- package/dist/src/capnp/userAppTx.capnp.d.ts +230 -0
- package/dist/src/capnp/userAppTx.capnp.js +270 -0
- package/dist/src/capnp/userAppTx.capnp.js.map +1 -0
- package/dist/src/capnp/userValTx.capnp.d.ts +1575 -0
- package/dist/src/capnp/userValTx.capnp.js +2004 -0
- package/dist/src/capnp/userValTx.capnp.js.map +1 -0
- package/dist/src/capnp/valLayBlock.capnp.d.ts +88 -0
- package/dist/src/capnp/valLayBlock.capnp.js +86 -0
- package/dist/src/capnp/valLayBlock.capnp.js.map +1 -0
- package/dist/src/capnp/valLayLedger.capnp.d.ts +85 -0
- package/dist/src/capnp/valLayLedger.capnp.js +75 -0
- package/dist/src/capnp/valLayLedger.capnp.js.map +1 -0
- package/dist/src/chain/geeq-chain.d.ts +474 -0
- package/dist/src/chain/geeq-chain.js +721 -0
- package/dist/src/chain/geeq-chain.js.map +1 -0
- package/dist/src/chain/geeq-node.d.ts +57 -0
- package/dist/src/chain/geeq-node.js +62 -0
- package/dist/src/chain/geeq-node.js.map +1 -0
- package/dist/src/chain/nonce-guard.d.ts +42 -0
- package/dist/src/chain/nonce-guard.js +68 -0
- package/dist/src/chain/nonce-guard.js.map +1 -0
- package/dist/src/chain/select.d.ts +40 -0
- package/dist/src/chain/select.js +114 -0
- package/dist/src/chain/select.js.map +1 -0
- package/dist/src/crypto/account-id.d.ts +35 -0
- package/dist/src/crypto/account-id.js +58 -0
- package/dist/src/crypto/account-id.js.map +1 -0
- package/dist/src/crypto/keypair.d.ts +24 -0
- package/dist/src/crypto/keypair.js +158 -0
- package/dist/src/crypto/keypair.js.map +1 -0
- package/dist/src/crypto/mnemonic.d.ts +34 -0
- package/dist/src/crypto/mnemonic.js +57 -0
- package/dist/src/crypto/mnemonic.js.map +1 -0
- package/dist/src/encoding/base64.d.ts +8 -0
- package/dist/src/encoding/base64.js +53 -0
- package/dist/src/encoding/base64.js.map +1 -0
- package/dist/src/encoding/hex.d.ts +2 -0
- package/dist/src/encoding/hex.js +35 -0
- package/dist/src/encoding/hex.js.map +1 -0
- package/dist/src/errors.d.ts +83 -0
- package/dist/src/errors.js +49 -0
- package/dist/src/errors.js.map +1 -0
- package/dist/src/index.d.ts +59 -0
- package/dist/src/index.js +53 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/ledger/coin-accounts.d.ts +42 -0
- package/dist/src/ledger/coin-accounts.js +37 -0
- package/dist/src/ledger/coin-accounts.js.map +1 -0
- package/dist/src/ledger/decode.d.ts +18 -0
- package/dist/src/ledger/decode.js +113 -0
- package/dist/src/ledger/decode.js.map +1 -0
- package/dist/src/ledger/geeq-ledger.d.ts +99 -0
- package/dist/src/ledger/geeq-ledger.js +125 -0
- package/dist/src/ledger/geeq-ledger.js.map +1 -0
- package/dist/src/ledger/net-actors.d.ts +65 -0
- package/dist/src/ledger/net-actors.js +53 -0
- package/dist/src/ledger/net-actors.js.map +1 -0
- package/dist/src/ledger/nft-records.d.ts +13 -0
- package/dist/src/ledger/nft-records.js +41 -0
- package/dist/src/ledger/nft-records.js.map +1 -0
- package/dist/src/ledger/params.d.ts +34 -0
- package/dist/src/ledger/params.js +71 -0
- package/dist/src/ledger/params.js.map +1 -0
- package/dist/src/ledger/proxy-accounts.d.ts +26 -0
- package/dist/src/ledger/proxy-accounts.js +27 -0
- package/dist/src/ledger/proxy-accounts.js.map +1 -0
- package/dist/src/net/discovery.d.ts +62 -0
- package/dist/src/net/discovery.js +136 -0
- package/dist/src/net/discovery.js.map +1 -0
- package/dist/src/net/explorer.d.ts +57 -0
- package/dist/src/net/explorer.js +64 -0
- package/dist/src/net/explorer.js.map +1 -0
- package/dist/src/net/read-ledger.d.ts +7 -0
- package/dist/src/net/read-ledger.js +39 -0
- package/dist/src/net/read-ledger.js.map +1 -0
- package/dist/src/net/routes.d.ts +49 -0
- package/dist/src/net/routes.js +70 -0
- package/dist/src/net/routes.js.map +1 -0
- package/dist/src/net/transport.d.ts +55 -0
- package/dist/src/net/transport.js +168 -0
- package/dist/src/net/transport.js.map +1 -0
- package/dist/src/net/websocket.d.ts +49 -0
- package/dist/src/net/websocket.js +54 -0
- package/dist/src/net/websocket.js.map +1 -0
- package/dist/src/runtime/bindings.d.ts +9 -0
- package/dist/src/runtime/bindings.js +27 -0
- package/dist/src/runtime/bindings.js.map +1 -0
- package/dist/src/runtime/init.d.ts +13 -0
- package/dist/src/runtime/init.js +40 -0
- package/dist/src/runtime/init.js.map +1 -0
- package/dist/src/runtime/wasm-loader.browser.d.ts +14 -0
- package/dist/src/runtime/wasm-loader.browser.js +20 -0
- package/dist/src/runtime/wasm-loader.browser.js.map +1 -0
- package/dist/src/runtime/wasm-loader.node.d.ts +7 -0
- package/dist/src/runtime/wasm-loader.node.js +14 -0
- package/dist/src/runtime/wasm-loader.node.js.map +1 -0
- package/dist/src/socket/geeq-socket.d.ts +232 -0
- package/dist/src/socket/geeq-socket.js +634 -0
- package/dist/src/socket/geeq-socket.js.map +1 -0
- package/dist/src/socket/tracked-tx.d.ts +148 -0
- package/dist/src/socket/tracked-tx.js +212 -0
- package/dist/src/socket/tracked-tx.js.map +1 -0
- package/dist/src/socket/tx-status.d.ts +69 -0
- package/dist/src/socket/tx-status.js +72 -0
- package/dist/src/socket/tx-status.js.map +1 -0
- package/dist/src/tx/attestation.d.ts +60 -0
- package/dist/src/tx/attestation.js +163 -0
- package/dist/src/tx/attestation.js.map +1 -0
- package/dist/src/tx/content.d.ts +27 -0
- package/dist/src/tx/content.js +62 -0
- package/dist/src/tx/content.js.map +1 -0
- package/dist/src/tx/encode.d.ts +60 -0
- package/dist/src/tx/encode.js +82 -0
- package/dist/src/tx/encode.js.map +1 -0
- package/dist/src/tx/expiry.d.ts +11 -0
- package/dist/src/tx/expiry.js +12 -0
- package/dist/src/tx/expiry.js.map +1 -0
- package/dist/src/tx/fee.d.ts +16 -0
- package/dist/src/tx/fee.js +29 -0
- package/dist/src/tx/fee.js.map +1 -0
- package/dist/src/tx/metadata.d.ts +39 -0
- package/dist/src/tx/metadata.js +66 -0
- package/dist/src/tx/metadata.js.map +1 -0
- package/dist/src/tx/nft.d.ts +16 -0
- package/dist/src/tx/nft.js +98 -0
- package/dist/src/tx/nft.js.map +1 -0
- package/dist/src/tx/proxy.d.ts +37 -0
- package/dist/src/tx/proxy.js +134 -0
- package/dist/src/tx/proxy.js.map +1 -0
- package/dist/src/tx/transfer.d.ts +31 -0
- package/dist/src/tx/transfer.js +123 -0
- package/dist/src/tx/transfer.js.map +1 -0
- package/dist/src/types.d.ts +448 -0
- package/dist/src/types.js +2 -0
- package/dist/src/types.js.map +1 -0
- package/dist/tests/account-id.test.d.ts +1 -0
- package/dist/tests/account-id.test.js +27 -0
- package/dist/tests/account-id.test.js.map +1 -0
- package/dist/tests/amount.test.d.ts +1 -0
- package/dist/tests/amount.test.js +113 -0
- package/dist/tests/amount.test.js.map +1 -0
- package/dist/tests/attestation.test.d.ts +1 -0
- package/dist/tests/attestation.test.js +182 -0
- package/dist/tests/attestation.test.js.map +1 -0
- package/dist/tests/chain.test.d.ts +1 -0
- package/dist/tests/chain.test.js +647 -0
- package/dist/tests/chain.test.js.map +1 -0
- package/dist/tests/content.test.d.ts +1 -0
- package/dist/tests/content.test.js +90 -0
- package/dist/tests/content.test.js.map +1 -0
- package/dist/tests/documented-api.test.d.ts +1 -0
- package/dist/tests/documented-api.test.js +229 -0
- package/dist/tests/documented-api.test.js.map +1 -0
- package/dist/tests/explorer.test.d.ts +1 -0
- package/dist/tests/explorer.test.js +95 -0
- package/dist/tests/explorer.test.js.map +1 -0
- package/dist/tests/fee.test.d.ts +1 -0
- package/dist/tests/fee.test.js +179 -0
- package/dist/tests/fee.test.js.map +1 -0
- package/dist/tests/fixtures/build-vll.d.ts +71 -0
- package/dist/tests/fixtures/build-vll.js +141 -0
- package/dist/tests/fixtures/build-vll.js.map +1 -0
- package/dist/tests/fixtures/fake-socket.d.ts +44 -0
- package/dist/tests/fixtures/fake-socket.js +93 -0
- package/dist/tests/fixtures/fake-socket.js.map +1 -0
- package/dist/tests/fixtures/fake-transport.d.ts +24 -0
- package/dist/tests/fixtures/fake-transport.js +30 -0
- package/dist/tests/fixtures/fake-transport.js.map +1 -0
- package/dist/tests/keypair.test.d.ts +1 -0
- package/dist/tests/keypair.test.js +163 -0
- package/dist/tests/keypair.test.js.map +1 -0
- package/dist/tests/ledger.test.d.ts +1 -0
- package/dist/tests/ledger.test.js +234 -0
- package/dist/tests/ledger.test.js.map +1 -0
- package/dist/tests/mnemonic.test.d.ts +1 -0
- package/dist/tests/mnemonic.test.js +97 -0
- package/dist/tests/mnemonic.test.js.map +1 -0
- package/dist/tests/nft-transfer.test.d.ts +1 -0
- package/dist/tests/nft-transfer.test.js +170 -0
- package/dist/tests/nft-transfer.test.js.map +1 -0
- package/dist/tests/nft.test.d.ts +1 -0
- package/dist/tests/nft.test.js +180 -0
- package/dist/tests/nft.test.js.map +1 -0
- package/dist/tests/offline.test.d.ts +1 -0
- package/dist/tests/offline.test.js +95 -0
- package/dist/tests/offline.test.js.map +1 -0
- package/dist/tests/proxy.test.d.ts +1 -0
- package/dist/tests/proxy.test.js +183 -0
- package/dist/tests/proxy.test.js.map +1 -0
- package/dist/tests/select.test.d.ts +1 -0
- package/dist/tests/select.test.js +200 -0
- package/dist/tests/select.test.js.map +1 -0
- package/dist/tests/socket.test.d.ts +1 -0
- package/dist/tests/socket.test.js +607 -0
- package/dist/tests/socket.test.js.map +1 -0
- package/dist/tests/transfer.test.d.ts +1 -0
- package/dist/tests/transfer.test.js +225 -0
- package/dist/tests/transfer.test.js.map +1 -0
- package/dist/tests/wallet-address.test.d.ts +1 -0
- package/dist/tests/wallet-address.test.js +101 -0
- package/dist/tests/wallet-address.test.js.map +1 -0
- package/dist/tests/wasm-loader.jest.d.ts +13 -0
- package/dist/tests/wasm-loader.jest.js +15 -0
- package/dist/tests/wasm-loader.jest.js.map +1 -0
- package/example/.env.example +4 -0
- package/example/README.md +304 -0
- package/example/USAGE.md +74 -0
- package/example/index.html +12 -0
- package/example/package-lock.json +1557 -0
- package/example/package.json +25 -0
- package/example/scripts/browser-check.mjs +1421 -0
- package/example/scripts/match-derivation.mjs +65 -0
- package/example/src/App.vue +138 -0
- package/example/src/components/AuthorityPanel.vue +277 -0
- package/example/src/components/ChainPanel.vue +267 -0
- package/example/src/components/ChainState.vue +59 -0
- package/example/src/components/CopyButton.vue +25 -0
- package/example/src/components/CreateAssetPanel.vue +313 -0
- package/example/src/components/DigitalAssetsPanel.vue +68 -0
- package/example/src/components/EvidencePanel.vue +396 -0
- package/example/src/components/ExplorerPanel.vue +119 -0
- package/example/src/components/KeypairPanel.vue +182 -0
- package/example/src/components/PhrasePanel.vue +105 -0
- package/example/src/components/SocketWarning.vue +18 -0
- package/example/src/components/StepGate.vue +24 -0
- package/example/src/components/TransferPanel.vue +416 -0
- package/example/src/components/TxDeadline.vue +19 -0
- package/example/src/components/TxFee.vue +31 -0
- package/example/src/components/TxStatus.vue +105 -0
- package/example/src/composables/useSocketConnection.ts +80 -0
- package/example/src/env.d.ts +12 -0
- package/example/src/main.ts +5 -0
- package/example/src/pennies.ts +7 -0
- package/example/src/style.css +149 -0
- package/example/tsconfig.json +19 -0
- package/example/vite.config.ts +26 -0
- package/jest.config.js +18 -0
- package/package.json +2 -6
- package/scripts/copy-wasm.mjs +21 -0
- package/scripts/smoke.mjs +382 -0
- package/src/address/record-type.ts +77 -0
- package/src/address/wallet-address.ts +105 -0
- package/src/amount.ts +143 -0
- package/src/assert.ts +30 -0
- package/src/capnp/README.md +15 -0
- package/src/capnp/adminNetTx.capnp.ts +66 -0
- package/src/capnp/appLayBlock.capnp.ts +26 -0
- package/src/capnp/appLayLedger.capnp.ts +35 -0
- package/src/capnp/appLayRec.capnp.ts +159 -0
- package/src/capnp/chainStateView.capnp.ts +49 -0
- package/src/capnp/coinAcctRec.capnp.ts +193 -0
- package/src/capnp/genesisBlock.capnp.ts +56 -0
- package/src/capnp/hubContentStmt.capnp.ts +59 -0
- package/src/capnp/misc.capnp.ts +19 -0
- package/src/capnp/netActorRec.capnp.ts +64 -0
- package/src/capnp/nodeContentStmt.capnp.ts +62 -0
- package/src/capnp/nodePayloadList.capnp.ts +28 -0
- package/src/capnp/nodeTxList.capnp.ts +37 -0
- package/src/capnp/paramAcctRec.capnp.ts +669 -0
- package/src/capnp/payload.capnp.ts +261 -0
- package/src/capnp/proxyAcctRec.capnp.ts +259 -0
- package/src/capnp/relayContentStmt.capnp.ts +85 -0
- package/src/capnp/sysAcctRec.capnp.ts +47 -0
- package/src/capnp/userAppTx.capnp.ts +269 -0
- package/src/capnp/userValTx.capnp.ts +1999 -0
- package/src/capnp/valLayBlock.capnp.ts +93 -0
- package/src/capnp/valLayLedger.capnp.ts +80 -0
- package/src/chain/geeq-chain.ts +1094 -0
- package/src/chain/geeq-node.ts +105 -0
- package/src/chain/nonce-guard.ts +73 -0
- package/src/chain/select.ts +149 -0
- package/src/crypto/account-id.ts +83 -0
- package/src/crypto/keypair.ts +221 -0
- package/src/crypto/mnemonic.ts +69 -0
- package/src/encoding/base64.ts +58 -0
- package/src/encoding/hex.ts +42 -0
- package/src/errors.ts +122 -0
- package/src/index.ts +195 -0
- package/src/ledger/coin-accounts.ts +73 -0
- package/src/ledger/decode.ts +147 -0
- package/src/ledger/geeq-ledger.ts +184 -0
- package/src/ledger/net-actors.ts +129 -0
- package/src/ledger/nft-records.ts +49 -0
- package/src/ledger/params.ts +82 -0
- package/src/ledger/proxy-accounts.ts +51 -0
- package/src/net/discovery.ts +231 -0
- package/src/net/explorer.ts +123 -0
- package/src/net/read-ledger.ts +58 -0
- package/src/net/routes.ts +79 -0
- package/src/net/transport.ts +221 -0
- package/src/net/websocket.ts +94 -0
- package/src/runtime/bindings.ts +38 -0
- package/src/runtime/init.ts +49 -0
- package/src/runtime/wasm-loader.browser.ts +22 -0
- package/src/runtime/wasm-loader.node.ts +16 -0
- package/src/socket/geeq-socket.ts +827 -0
- package/src/socket/tracked-tx.ts +319 -0
- package/src/socket/tx-status.ts +131 -0
- package/src/tx/attestation.ts +222 -0
- package/src/tx/content.ts +82 -0
- package/src/tx/encode.ts +107 -0
- package/src/tx/expiry.ts +11 -0
- package/src/tx/fee.ts +31 -0
- package/src/tx/metadata.ts +100 -0
- package/src/tx/nft.ts +108 -0
- package/src/tx/proxy.ts +156 -0
- package/src/tx/transfer.ts +162 -0
- package/src/types.ts +503 -0
- package/src/wasm/README.md +22 -0
- package/src/wasm/browser/geeq_core.d.ts +1224 -0
- package/src/wasm/browser/geeq_core.js +6014 -0
- package/src/wasm/browser/geeq_core_bg.wasm +0 -0
- package/src/wasm/browser/geeq_core_bg.wasm.d.ts +447 -0
- package/src/wasm/nodejs/geeq_core.d.ts +753 -0
- package/src/wasm/nodejs/geeq_core.js +6016 -0
- package/src/wasm/nodejs/geeq_core_bg.wasm +0 -0
- package/src/wasm/nodejs/geeq_core_bg.wasm.d.ts +447 -0
- package/src/wasm/nodejs/package.json +3 -0
- package/tsconfig.build.json +8 -0
- package/tsconfig.json +21 -0
- package/tsup.config.ts +60 -0
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Find which derivation path produced a given address.
|
|
3
|
+
*
|
|
4
|
+
* `chainNumber` is *not* part of the derivation path — it is stamped into the
|
|
5
|
+
* address envelope alongside the account id. So two apps on the same chain
|
|
6
|
+
* still disagree whenever their coin type, record type, account, address index
|
|
7
|
+
* or passphrase differ. This walks the plausible combinations and tells you
|
|
8
|
+
* which one your app used.
|
|
9
|
+
*
|
|
10
|
+
* MNEMONIC="word word …" TARGET=fvCvcdu… CHAIN=1000000008 \
|
|
11
|
+
* node scripts/match-derivation.mjs
|
|
12
|
+
*
|
|
13
|
+
* TARGET is optional — leave it off to print the whole matrix. The phrase is
|
|
14
|
+
* read from the environment and never written anywhere.
|
|
15
|
+
*/
|
|
16
|
+
import { keypairFromMnemonic } from '@geeqdev/geeq-sdk'
|
|
17
|
+
|
|
18
|
+
const mnemonic = process.env.MNEMONIC
|
|
19
|
+
const target = process.env.TARGET
|
|
20
|
+
const chainNumber = Number(process.env.CHAIN ?? 1)
|
|
21
|
+
|
|
22
|
+
if (!mnemonic) {
|
|
23
|
+
console.error('Set MNEMONIC, e.g. MNEMONIC="legal winner thank …" node scripts/match-derivation.mjs')
|
|
24
|
+
process.exit(1)
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const COIN_TYPES = ['testnet', 'mainnet']
|
|
28
|
+
const RECORD_TYPES = ['coin-asset', 'coin-hl', 'coin-micro']
|
|
29
|
+
const INDICES = [0, 1, 2]
|
|
30
|
+
// '' is the SDK default. To try others as well, PASSPHRASES=",one,two".
|
|
31
|
+
const PASSPHRASES = (process.env.PASSPHRASES ?? '').split(',')
|
|
32
|
+
|
|
33
|
+
let found = null
|
|
34
|
+
for (const passphrase of PASSPHRASES) {
|
|
35
|
+
for (const coinType of COIN_TYPES) {
|
|
36
|
+
for (const recordType of RECORD_TYPES) {
|
|
37
|
+
for (const account of INDICES) {
|
|
38
|
+
for (const addressIndex of INDICES) {
|
|
39
|
+
const options = { coinType, recordType, account, addressIndex, passphrase }
|
|
40
|
+
const keypair = await keypairFromMnemonic(mnemonic, options)
|
|
41
|
+
// The envelope record type is independent of the derivation one, but an
|
|
42
|
+
// app that derives with X almost always encodes with X too.
|
|
43
|
+
const address = keypair.getAddress({ chainNumber, recordType })
|
|
44
|
+
keypair.dispose()
|
|
45
|
+
|
|
46
|
+
const match = address === target
|
|
47
|
+
if (match) found = options
|
|
48
|
+
if (!target || match) {
|
|
49
|
+
console.log(
|
|
50
|
+
`${coinType.padEnd(8)} ${recordType.padEnd(11)} account=${account} addressIndex=${addressIndex} passphrase=${passphrase === '' ? '(none)' : passphrase} ${address}${match ? ' <<< MATCH' : ''}`,
|
|
51
|
+
)
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
if (target) {
|
|
60
|
+
console.log(
|
|
61
|
+
found
|
|
62
|
+
? `\nMatched with ${JSON.stringify(found)} at chain ${chainNumber}.`
|
|
63
|
+
: `\nNo match at chain ${chainNumber}. Try another BIP-39 passphrase via PASSPHRASES=..., a record type outside ${RECORD_TYPES.join('/')}, or an index above ${Math.max(...INDICES)}.`,
|
|
64
|
+
)
|
|
65
|
+
}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { markRaw, onMounted, ref, shallowRef, watch } from 'vue'
|
|
3
|
+
import { GeeqError, initGeeq } from '@geeqdev/geeq-sdk'
|
|
4
|
+
import type { GeeqChain, GeeqKeypair } from '@geeqdev/geeq-sdk'
|
|
5
|
+
import { useSocketConnection } from './composables/useSocketConnection'
|
|
6
|
+
import EvidencePanel from './components/EvidencePanel.vue'
|
|
7
|
+
import ChainPanel from './components/ChainPanel.vue'
|
|
8
|
+
import ExplorerPanel from './components/ExplorerPanel.vue'
|
|
9
|
+
import CreateAssetPanel from './components/CreateAssetPanel.vue'
|
|
10
|
+
import DigitalAssetsPanel from './components/DigitalAssetsPanel.vue'
|
|
11
|
+
import TransferPanel from './components/TransferPanel.vue'
|
|
12
|
+
import AuthorityPanel from './components/AuthorityPanel.vue'
|
|
13
|
+
import PhrasePanel from './components/PhrasePanel.vue'
|
|
14
|
+
import StepGate from './components/StepGate.vue'
|
|
15
|
+
import KeypairPanel from './components/KeypairPanel.vue'
|
|
16
|
+
|
|
17
|
+
type EngineState = 'loading' | 'ready' | 'error'
|
|
18
|
+
|
|
19
|
+
const engine = ref<EngineState>('loading')
|
|
20
|
+
const engineError = ref('')
|
|
21
|
+
const mnemonic = ref('')
|
|
22
|
+
// Owned here because two panels need to agree on it: the address encodes the
|
|
23
|
+
// chain, and the node found for it in step 3 serves that same chain. Step 2 sets it;
|
|
24
|
+
// step 3 only reads it.
|
|
25
|
+
const chainNumber = ref(1)
|
|
26
|
+
// Published by KeypairPanel, which still owns the engine handle and disposes it —
|
|
27
|
+
// this is a borrowed reference, set back to null the moment that happens.
|
|
28
|
+
const keypair = shallowRef<GeeqKeypair | null>(null)
|
|
29
|
+
// The chain is connected once, in step 3, and shared by everything that builds a
|
|
30
|
+
// transaction. Same shallowRef + markRaw reasoning as the keypair.
|
|
31
|
+
const chain = shallowRef<GeeqChain | null>(null)
|
|
32
|
+
// The node's socket, opened with the chain and closed with it. Every transaction panel
|
|
33
|
+
// tracks its transactions through it.
|
|
34
|
+
const socketUrl = ref('')
|
|
35
|
+
const connection = useSocketConnection(chain, socketUrl)
|
|
36
|
+
|
|
37
|
+
// The steps everything else builds on, in the order they are done. Each later step waits
|
|
38
|
+
// for the first of these before it that is not done yet.
|
|
39
|
+
const foundations = [
|
|
40
|
+
{ step: 1, done: () => mnemonic.value !== '', todo: 'create or restore a recovery phrase' },
|
|
41
|
+
{ step: 2, done: () => keypair.value !== null, todo: 'derive a keypair' },
|
|
42
|
+
{ step: 3, done: () => chain.value !== null, todo: 'find a node' },
|
|
43
|
+
]
|
|
44
|
+
|
|
45
|
+
/** What `step` is waiting for, as a sentence, or null when it can be used. */
|
|
46
|
+
function waitingFor(step: number): string | null {
|
|
47
|
+
const missing = foundations.find((f) => f.step < step && !f.done())
|
|
48
|
+
return missing === undefined ? null : `Waiting for step ${missing.step}: ${missing.todo}.`
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function onKeypair(next: GeeqKeypair | null) {
|
|
52
|
+
keypair.value = next === null ? null : markRaw(next)
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// Subscribe the account whenever there is an account and a socket, so the node
|
|
56
|
+
// also pushes its updates — not only the statuses of what this page sends.
|
|
57
|
+
watch([keypair, () => connection.socket], ([account, socket]) => {
|
|
58
|
+
if (account === null || socket === null) return
|
|
59
|
+
// If this fails, track() subscribes again before a submission and reports it then.
|
|
60
|
+
socket.subscribe(account).catch(() => {})
|
|
61
|
+
})
|
|
62
|
+
|
|
63
|
+
onMounted(async () => {
|
|
64
|
+
// Loads the ~2 MB WebAssembly engine once. Every async SDK call awaits this
|
|
65
|
+
// internally, so this is only here to drive the status indicator.
|
|
66
|
+
try {
|
|
67
|
+
await initGeeq()
|
|
68
|
+
engine.value = 'ready'
|
|
69
|
+
} catch (e) {
|
|
70
|
+
engine.value = 'error'
|
|
71
|
+
engineError.value = e instanceof GeeqError ? `${e.code}: ${e.message}` : String(e)
|
|
72
|
+
}
|
|
73
|
+
})
|
|
74
|
+
</script>
|
|
75
|
+
|
|
76
|
+
<template>
|
|
77
|
+
<div class="wrap">
|
|
78
|
+
<header>
|
|
79
|
+
<h1>Geeq sdk usage demo</h1>
|
|
80
|
+
<p>
|
|
81
|
+
Generate a recovery phrase and derive a Geeq keypair, entirely in the browser
|
|
82
|
+
with <code>@geeqdev/geeq-sdk</code>.
|
|
83
|
+
</p>
|
|
84
|
+
<div class="engine">
|
|
85
|
+
<span class="dot" :class="engine" />
|
|
86
|
+
<span v-if="engine === 'loading'">Loading engine…</span>
|
|
87
|
+
<span v-else-if="engine === 'ready'">Engine ready</span>
|
|
88
|
+
<span v-else>Engine failed to load</span>
|
|
89
|
+
</div>
|
|
90
|
+
<div v-if="engine === 'error'" class="warn">{{ engineError }}</div>
|
|
91
|
+
</header>
|
|
92
|
+
|
|
93
|
+
<StepGate :done="mnemonic !== ''">
|
|
94
|
+
<PhrasePanel @change="(value: string) => (mnemonic = value)" />
|
|
95
|
+
</StepGate>
|
|
96
|
+
<StepGate :waiting-for="waitingFor(2)" :done="keypair !== null">
|
|
97
|
+
<KeypairPanel
|
|
98
|
+
v-model:chain-number="chainNumber"
|
|
99
|
+
:mnemonic="mnemonic"
|
|
100
|
+
:engine-ready="engine === 'ready'"
|
|
101
|
+
@keypair="onKeypair"
|
|
102
|
+
/>
|
|
103
|
+
</StepGate>
|
|
104
|
+
<StepGate :waiting-for="waitingFor(3)" :done="chain !== null">
|
|
105
|
+
<ChainPanel
|
|
106
|
+
v-model:socket-url="socketUrl"
|
|
107
|
+
:chain-number="chainNumber"
|
|
108
|
+
:connection="connection"
|
|
109
|
+
@chain="(next: GeeqChain | null) => (chain = next === null ? null : markRaw(next))"
|
|
110
|
+
/>
|
|
111
|
+
</StepGate>
|
|
112
|
+
<StepGate :waiting-for="waitingFor(4)">
|
|
113
|
+
<EvidencePanel :keypair="keypair" :chain="chain" :connection="connection" />
|
|
114
|
+
</StepGate>
|
|
115
|
+
<StepGate :waiting-for="waitingFor(5)">
|
|
116
|
+
<TransferPanel :keypair="keypair" :chain="chain" :connection="connection" />
|
|
117
|
+
</StepGate>
|
|
118
|
+
<StepGate :waiting-for="waitingFor(6)">
|
|
119
|
+
<AuthorityPanel :keypair="keypair" :chain="chain" :connection="connection" />
|
|
120
|
+
</StepGate>
|
|
121
|
+
<StepGate :waiting-for="waitingFor(7)">
|
|
122
|
+
<CreateAssetPanel :keypair="keypair" :chain="chain" :connection="connection" />
|
|
123
|
+
</StepGate>
|
|
124
|
+
<StepGate :waiting-for="waitingFor(8)">
|
|
125
|
+
<DigitalAssetsPanel :keypair="keypair" :chain="chain" />
|
|
126
|
+
</StepGate>
|
|
127
|
+
<!-- Needs nothing from the steps above: any refHash can be looked up. -->
|
|
128
|
+
<ExplorerPanel />
|
|
129
|
+
|
|
130
|
+
<footer>
|
|
131
|
+
Keys and phrases exist only in this tab's memory and are gone on refresh — nothing
|
|
132
|
+
is stored. The only network traffic is to the simulator and the node it picks in
|
|
133
|
+
step 3: reading its ledger, submitting what you build, and its socket, which reports
|
|
134
|
+
back what the chain decided. If the socket cannot open, submitting still works —
|
|
135
|
+
nothing will report back. Step 9 also asks the block explorer you name.
|
|
136
|
+
</footer>
|
|
137
|
+
</div>
|
|
138
|
+
</template>
|
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { markRaw, ref, shallowRef, watch } from 'vue'
|
|
3
|
+
import { coinTransferSubmitBody, submitRoute, toBase64 } from '@geeqdev/geeq-sdk'
|
|
4
|
+
import type {
|
|
5
|
+
GeeqChain,
|
|
6
|
+
GeeqKeypair,
|
|
7
|
+
GeeqNftMintProxies,
|
|
8
|
+
GeeqTrackedTx,
|
|
9
|
+
NftMintProxyTx,
|
|
10
|
+
} from '@geeqdev/geeq-sdk'
|
|
11
|
+
import type { SocketConnection } from '../composables/useSocketConnection'
|
|
12
|
+
import { penniesLabel } from '../pennies'
|
|
13
|
+
import ChainState from './ChainState.vue'
|
|
14
|
+
import CopyButton from './CopyButton.vue'
|
|
15
|
+
import SocketWarning from './SocketWarning.vue'
|
|
16
|
+
import TxDeadline from './TxDeadline.vue'
|
|
17
|
+
import TxFee from './TxFee.vue'
|
|
18
|
+
import TxStatus from './TxStatus.vue'
|
|
19
|
+
|
|
20
|
+
const props = defineProps<{
|
|
21
|
+
keypair: GeeqKeypair | null
|
|
22
|
+
chain: GeeqChain | null
|
|
23
|
+
connection: SocketConnection
|
|
24
|
+
}>()
|
|
25
|
+
|
|
26
|
+
const amount = ref('5')
|
|
27
|
+
|
|
28
|
+
const tx = ref<NftMintProxyTx | null>(null)
|
|
29
|
+
const building = ref(false)
|
|
30
|
+
const buildError = ref('')
|
|
31
|
+
const submitting = ref(false)
|
|
32
|
+
const submitError = ref('')
|
|
33
|
+
const submitted = ref(false)
|
|
34
|
+
/** Set when the check before submitting found the built transaction too old. */
|
|
35
|
+
const expired = ref(false)
|
|
36
|
+
/** The last submission, followed to its verdict. */
|
|
37
|
+
const tracked = shallowRef<GeeqTrackedTx | null>(null)
|
|
38
|
+
/** Why the last submission is not being followed, when it is not. */
|
|
39
|
+
const notTracked = ref('')
|
|
40
|
+
|
|
41
|
+
/** This account's authority accounts as the ledger last listed them, or null before the first look. */
|
|
42
|
+
const found = shallowRef<GeeqNftMintProxies | null>(null)
|
|
43
|
+
const finding = ref(false)
|
|
44
|
+
const findError = ref('')
|
|
45
|
+
|
|
46
|
+
// A built transaction is pinned to a block and a nonce, so any change invalidates it.
|
|
47
|
+
watch([amount, () => props.keypair, () => props.chain], () => {
|
|
48
|
+
tx.value = null
|
|
49
|
+
submitted.value = false
|
|
50
|
+
submitError.value = ''
|
|
51
|
+
expired.value = false
|
|
52
|
+
})
|
|
53
|
+
watch([() => props.keypair, () => props.chain], () => (found.value = null))
|
|
54
|
+
|
|
55
|
+
async function build() {
|
|
56
|
+
if (props.keypair === null || props.chain === null) return
|
|
57
|
+
|
|
58
|
+
building.value = true
|
|
59
|
+
buildError.value = ''
|
|
60
|
+
tx.value = null
|
|
61
|
+
submitted.value = false
|
|
62
|
+
expired.value = false
|
|
63
|
+
try {
|
|
64
|
+
// Reads the ledger, checks the funding against the balance and the chain's minimum,
|
|
65
|
+
// finds this account's authority accounts to take the next index, then signs.
|
|
66
|
+
tx.value = await props.chain.createNftMintProxy({
|
|
67
|
+
admin: props.keypair,
|
|
68
|
+
amount: { geeq: amount.value.trim() },
|
|
69
|
+
})
|
|
70
|
+
} catch (error) {
|
|
71
|
+
buildError.value = (error as Error).message
|
|
72
|
+
} finally {
|
|
73
|
+
building.value = false
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
async function submit() {
|
|
78
|
+
const built = tx.value
|
|
79
|
+
const target = built?.nodeUrl ?? props.chain?.endpoint
|
|
80
|
+
if (built === null || target === undefined || props.chain === null) return
|
|
81
|
+
|
|
82
|
+
submitting.value = true
|
|
83
|
+
submitError.value = ''
|
|
84
|
+
submitted.value = false
|
|
85
|
+
tracked.value = null
|
|
86
|
+
notTracked.value = ''
|
|
87
|
+
try {
|
|
88
|
+
// It may have waited, and a node refuses one the chain has moved too far past.
|
|
89
|
+
if (await props.chain.isExpired(built)) {
|
|
90
|
+
expired.value = true
|
|
91
|
+
return
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
// Listen before sending, as for a transfer.
|
|
95
|
+
const socket = props.connection.socket
|
|
96
|
+
if (socket === null) {
|
|
97
|
+
notTracked.value = 'The node socket is not open.'
|
|
98
|
+
} else {
|
|
99
|
+
try {
|
|
100
|
+
tracked.value = markRaw(await socket.track(built))
|
|
101
|
+
} catch (e) {
|
|
102
|
+
notTracked.value = `Could not subscribe for its verdict: ${(e as Error).message}`
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
// Delegating authority is a validation-layer transaction, so it posts exactly like a
|
|
107
|
+
// transfer: one blob, as `uvt`.
|
|
108
|
+
const response = await fetch(submitRoute(target), {
|
|
109
|
+
method: 'POST',
|
|
110
|
+
headers: { 'content-type': 'application/json' },
|
|
111
|
+
body: coinTransferSubmitBody(built.transaction),
|
|
112
|
+
})
|
|
113
|
+
if (!response.ok) {
|
|
114
|
+
const body = (await response.text()).slice(0, 400)
|
|
115
|
+
tracked.value?.refused({ status: response.status, message: body })
|
|
116
|
+
submitError.value = `Node replied ${response.status} ${response.statusText}: ${body}`
|
|
117
|
+
return
|
|
118
|
+
}
|
|
119
|
+
submitted.value = true
|
|
120
|
+
} catch (e) {
|
|
121
|
+
submitError.value = `Could not reach the node — ${(e as Error).message}.`
|
|
122
|
+
} finally {
|
|
123
|
+
submitting.value = false
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
async function findAuthorities() {
|
|
128
|
+
if (props.keypair === null || props.chain === null) return
|
|
129
|
+
|
|
130
|
+
finding.value = true
|
|
131
|
+
findError.value = ''
|
|
132
|
+
try {
|
|
133
|
+
// A fresh read: an authority account is in the ledger only once a block has confirmed it.
|
|
134
|
+
found.value = await props.chain.findNftMintProxies({ admin: props.keypair, maxAgeMs: 0 })
|
|
135
|
+
} catch (error) {
|
|
136
|
+
findError.value = (error as Error).message
|
|
137
|
+
} finally {
|
|
138
|
+
finding.value = false
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
</script>
|
|
142
|
+
|
|
143
|
+
<template>
|
|
144
|
+
<section class="card">
|
|
145
|
+
<h2><span class="step">6</span>Delegate authority</h2>
|
|
146
|
+
|
|
147
|
+
<p class="hint" style="margin-top: 0">
|
|
148
|
+
A digital asset is created through an <strong>authority account</strong>: a record of
|
|
149
|
+
its own on the chain that holds coin to pay for creating digital assets, and that only
|
|
150
|
+
its admin — this account — can sign for. Delegate authority here to create one, then
|
|
151
|
+
create digital assets through it in step 7.
|
|
152
|
+
</p>
|
|
153
|
+
<p class="hint">
|
|
154
|
+
Each authority account has an <strong>index</strong> — an account's first is 1 — and its
|
|
155
|
+
id is derived from the admin's key and that index. The SDK finds this account's
|
|
156
|
+
authority accounts in the ledger and takes the next index, so nothing has to be
|
|
157
|
+
remembered.
|
|
158
|
+
</p>
|
|
159
|
+
|
|
160
|
+
<div class="row">
|
|
161
|
+
<span class="ctl">
|
|
162
|
+
<label for="authority-amount">Fund with</label>
|
|
163
|
+
<input
|
|
164
|
+
id="authority-amount"
|
|
165
|
+
v-model="amount"
|
|
166
|
+
type="text"
|
|
167
|
+
inputmode="decimal"
|
|
168
|
+
placeholder="5"
|
|
169
|
+
data-testid="authority-amount"
|
|
170
|
+
/>
|
|
171
|
+
geeq
|
|
172
|
+
</span>
|
|
173
|
+
<button
|
|
174
|
+
class="primary"
|
|
175
|
+
:disabled="!keypair || !chain || amount.trim() === '' || building"
|
|
176
|
+
data-testid="build-authority"
|
|
177
|
+
@click="build"
|
|
178
|
+
>
|
|
179
|
+
{{ building ? 'Reading ledger & signing…' : 'Build & sign' }}
|
|
180
|
+
</button>
|
|
181
|
+
</div>
|
|
182
|
+
<p class="hint">
|
|
183
|
+
The funding moves onto the authority account and pays for the digital assets created
|
|
184
|
+
through it. It must clear the chain's minimum transfer, and the fee is charged on top.
|
|
185
|
+
</p>
|
|
186
|
+
<div v-if="buildError" class="warn" data-testid="authority-error">{{ buildError }}</div>
|
|
187
|
+
|
|
188
|
+
<template v-if="tx && chain">
|
|
189
|
+
<div class="field">
|
|
190
|
+
<div class="k">
|
|
191
|
+
Authority account <span data-testid="authority-index">{{ tx.index }}</span> of this account · address
|
|
192
|
+
</div>
|
|
193
|
+
<div class="row">
|
|
194
|
+
<code class="v" style="flex: 1 1 auto" data-testid="authority-address">{{ tx.proxyAddress }}</code>
|
|
195
|
+
<CopyButton :value="tx.proxyAddress" />
|
|
196
|
+
</div>
|
|
197
|
+
</div>
|
|
198
|
+
|
|
199
|
+
<div class="field">
|
|
200
|
+
<div class="k">Authority account id · base64 · derived from your key and the index</div>
|
|
201
|
+
<div class="v" data-testid="authority-id">{{ toBase64(tx.proxyAccountId) }}</div>
|
|
202
|
+
</div>
|
|
203
|
+
|
|
204
|
+
<ChainState :chain-state="tx.chainState" nonce-of="this account" />
|
|
205
|
+
<TxFee :chain="chain" :fee="tx.fee" :amount="tx.amount" payer="this account" />
|
|
206
|
+
|
|
207
|
+
<div class="field">
|
|
208
|
+
<div class="k">Signed transaction · base64 · {{ tx.transaction.length }} chars</div>
|
|
209
|
+
<div class="v wrap" data-testid="authority-base64">{{ tx.transaction }}</div>
|
|
210
|
+
</div>
|
|
211
|
+
|
|
212
|
+
<h3 class="sub">Submit</h3>
|
|
213
|
+
<div class="row">
|
|
214
|
+
<button
|
|
215
|
+
class="primary"
|
|
216
|
+
:disabled="submitting || submitted || expired || connection.state === 'connecting'"
|
|
217
|
+
data-testid="submit-authority"
|
|
218
|
+
@click="submit"
|
|
219
|
+
>
|
|
220
|
+
{{ submitting ? 'Submitting…' : submitted ? 'Submitted' : 'Submit to node' }}
|
|
221
|
+
</button>
|
|
222
|
+
</div>
|
|
223
|
+
<p class="hint">
|
|
224
|
+
Sent like a transfer. It uses this account's nonce
|
|
225
|
+
<strong data-testid="admin-nonce">{{ tx.chainState.nonce }}</strong>, not an
|
|
226
|
+
authority account's, so send it once: a second copy is refused once the first has
|
|
227
|
+
landed. The authority account exists once a block confirms it.
|
|
228
|
+
</p>
|
|
229
|
+
<TxDeadline :valid-until-block="tx.validUntilBlock" :expired="expired" />
|
|
230
|
+
<SocketWarning :connection="connection" />
|
|
231
|
+
|
|
232
|
+
<div v-if="submitError" class="warn">{{ submitError }}</div>
|
|
233
|
+
<p v-if="submitted && notTracked" class="warn" data-testid="tx-untracked">
|
|
234
|
+
<strong>Sent, but no confirmation will follow.</strong> {{ notTracked }}
|
|
235
|
+
</p>
|
|
236
|
+
</template>
|
|
237
|
+
|
|
238
|
+
<TxStatus v-if="tracked" :tracked="tracked" />
|
|
239
|
+
|
|
240
|
+
<h3 class="sub">Your authority accounts</h3>
|
|
241
|
+
<div class="row">
|
|
242
|
+
<button :disabled="!keypair || !chain || finding" data-testid="find-authorities" @click="findAuthorities">
|
|
243
|
+
{{ finding ? 'Reading ledger…' : 'Find in ledger' }}
|
|
244
|
+
</button>
|
|
245
|
+
</div>
|
|
246
|
+
<div v-if="findError" class="warn">{{ findError }}</div>
|
|
247
|
+
<template v-if="found && chain">
|
|
248
|
+
<p v-if="found.proxies.length === 0" class="hint" data-testid="no-authorities">
|
|
249
|
+
None yet. An authority account shows here once a block has confirmed it.
|
|
250
|
+
</p>
|
|
251
|
+
<div v-for="authority in found.proxies" :key="authority.address" class="field" data-testid="authority">
|
|
252
|
+
<div class="k">Authority account {{ authority.index ?? '(no index)' }}</div>
|
|
253
|
+
<div class="v">{{ authority.address }}</div>
|
|
254
|
+
<div class="hint">
|
|
255
|
+
{{ chain.formatGeeq(authority.balance) }} geeq {{ penniesLabel(authority.balance) }} · own
|
|
256
|
+
nonce {{ authority.nonce }}
|
|
257
|
+
</div>
|
|
258
|
+
</div>
|
|
259
|
+
<p class="hint">
|
|
260
|
+
The next authority account takes index
|
|
261
|
+
<strong data-testid="next-index">{{ found.nextIndex }}</strong>. Each authority account
|
|
262
|
+
has its own nonce, which starts at 1 and moves only when a digital asset is created
|
|
263
|
+
through it. Delegating authority spends this account's nonce instead.
|
|
264
|
+
</p>
|
|
265
|
+
</template>
|
|
266
|
+
</section>
|
|
267
|
+
</template>
|
|
268
|
+
|
|
269
|
+
<style scoped>
|
|
270
|
+
.ctl { display: inline-flex; align-items: center; gap: 8px; }
|
|
271
|
+
.ctl input { width: 100px; }
|
|
272
|
+
.sub {
|
|
273
|
+
font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em;
|
|
274
|
+
color: var(--muted); font-weight: 600; margin: 22px 0 8px;
|
|
275
|
+
}
|
|
276
|
+
.v.wrap { word-break: break-all; white-space: normal; }
|
|
277
|
+
</style>
|