@geeqdev/geeq-sdk 0.1.1 → 0.2.1
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/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/package.json +2 -2
- package/tsconfig.json +2 -1
- package/.idea/geeq_sdk.iml +0 -12
- package/.idea/modules.xml +0 -8
- package/.idea/vcs.xml +0 -6
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/**
|
|
3
|
+
* This file has been automatically generated by the [capnpc-ts utility](https://github.com/jdiaz5513/capnp-ts).
|
|
4
|
+
*/
|
|
5
|
+
import * as capnp from "capnp-ts";
|
|
6
|
+
import { ObjectSize as __O, Struct as __S } from 'capnp-ts';
|
|
7
|
+
import { TokenAssetSubgroup, NftAssetSubgroup, CoinAssetRec, CoinHlRec, CoinMicroRec, CoinAcctRec } from "./coinAcctRec.capnp";
|
|
8
|
+
import { NetActorRec } from "./netActorRec.capnp";
|
|
9
|
+
import { ParamBoolean, ParamCountTwo, ParamCountEight, ParamAcctRec } from "./paramAcctRec.capnp";
|
|
10
|
+
import { MultiUserSubgroup, ProxyDceRec, ProxyFundingRec, ProxyMultisigRec, ProxyNftMintRec, ProxyTokenMintRec, ProxyAcctRec } from "./proxyAcctRec.capnp";
|
|
11
|
+
import { SysAcctRec } from "./sysAcctRec.capnp";
|
|
12
|
+
export const _capnpFileId = "fc9fd9e8367eae85";
|
|
13
|
+
export class NetActorList extends __S {
|
|
14
|
+
static { this._capnp = { displayName: "NetActorList", id: "cb69154de78302bf", size: new __O(0, 1) }; }
|
|
15
|
+
adoptNetActorRecs(value) { __S.adopt(value, __S.getPointer(0, this)); }
|
|
16
|
+
disownNetActorRecs() { return __S.disown(this.getNetActorRecs()); }
|
|
17
|
+
getNetActorRecs() { return __S.getList(0, NetActorList._NetActorRecs, this); }
|
|
18
|
+
hasNetActorRecs() { return !__S.isNull(__S.getPointer(0, this)); }
|
|
19
|
+
initNetActorRecs(length) { return __S.initList(0, NetActorList._NetActorRecs, length, this); }
|
|
20
|
+
setNetActorRecs(value) { __S.copyFrom(value, __S.getPointer(0, this)); }
|
|
21
|
+
toString() { return "NetActorList_" + super.toString(); }
|
|
22
|
+
}
|
|
23
|
+
export class ParamAcctList extends __S {
|
|
24
|
+
static { this._capnp = { displayName: "ParamAcctList", id: "9f10966c1823b346", size: new __O(0, 1) }; }
|
|
25
|
+
adoptParamAcctRecs(value) { __S.adopt(value, __S.getPointer(0, this)); }
|
|
26
|
+
disownParamAcctRecs() { return __S.disown(this.getParamAcctRecs()); }
|
|
27
|
+
getParamAcctRecs() { return __S.getList(0, ParamAcctList._ParamAcctRecs, this); }
|
|
28
|
+
hasParamAcctRecs() { return !__S.isNull(__S.getPointer(0, this)); }
|
|
29
|
+
initParamAcctRecs(length) { return __S.initList(0, ParamAcctList._ParamAcctRecs, length, this); }
|
|
30
|
+
setParamAcctRecs(value) { __S.copyFrom(value, __S.getPointer(0, this)); }
|
|
31
|
+
toString() { return "ParamAcctList_" + super.toString(); }
|
|
32
|
+
}
|
|
33
|
+
export class ValLayLedger extends __S {
|
|
34
|
+
static { this._capnp = { displayName: "ValLayLedger", id: "ce5af3ba903430bd", size: new __O(8, 5) }; }
|
|
35
|
+
getBlockNum() { return __S.getUint32(0, this); }
|
|
36
|
+
setBlockNum(value) { __S.setUint32(0, value, this); }
|
|
37
|
+
getChainNum() { return __S.getUint32(4, this); }
|
|
38
|
+
setChainNum(value) { __S.setUint32(4, value, this); }
|
|
39
|
+
adoptSysAcctRec(value) { __S.adopt(value, __S.getPointer(0, this)); }
|
|
40
|
+
disownSysAcctRec() { return __S.disown(this.getSysAcctRec()); }
|
|
41
|
+
getSysAcctRec() { return __S.getStruct(0, SysAcctRec, this); }
|
|
42
|
+
hasSysAcctRec() { return !__S.isNull(__S.getPointer(0, this)); }
|
|
43
|
+
initSysAcctRec() { return __S.initStructAt(0, SysAcctRec, this); }
|
|
44
|
+
setSysAcctRec(value) { __S.copyFrom(value, __S.getPointer(0, this)); }
|
|
45
|
+
adoptNetActorList(value) { __S.adopt(value, __S.getPointer(1, this)); }
|
|
46
|
+
disownNetActorList() { return __S.disown(this.getNetActorList()); }
|
|
47
|
+
getNetActorList() { return __S.getStruct(1, NetActorList, this); }
|
|
48
|
+
hasNetActorList() { return !__S.isNull(__S.getPointer(1, this)); }
|
|
49
|
+
initNetActorList() { return __S.initStructAt(1, NetActorList, this); }
|
|
50
|
+
setNetActorList(value) { __S.copyFrom(value, __S.getPointer(1, this)); }
|
|
51
|
+
adoptParamAcctList(value) { __S.adopt(value, __S.getPointer(2, this)); }
|
|
52
|
+
disownParamAcctList() { return __S.disown(this.getParamAcctList()); }
|
|
53
|
+
getParamAcctList() { return __S.getStruct(2, ParamAcctList, this); }
|
|
54
|
+
hasParamAcctList() { return !__S.isNull(__S.getPointer(2, this)); }
|
|
55
|
+
initParamAcctList() { return __S.initStructAt(2, ParamAcctList, this); }
|
|
56
|
+
setParamAcctList(value) { __S.copyFrom(value, __S.getPointer(2, this)); }
|
|
57
|
+
adoptCoinAcctRecs(value) { __S.adopt(value, __S.getPointer(3, this)); }
|
|
58
|
+
disownCoinAcctRecs() { return __S.disown(this.getCoinAcctRecs()); }
|
|
59
|
+
getCoinAcctRecs() { return __S.getList(3, ValLayLedger._CoinAcctRecs, this); }
|
|
60
|
+
hasCoinAcctRecs() { return !__S.isNull(__S.getPointer(3, this)); }
|
|
61
|
+
initCoinAcctRecs(length) { return __S.initList(3, ValLayLedger._CoinAcctRecs, length, this); }
|
|
62
|
+
setCoinAcctRecs(value) { __S.copyFrom(value, __S.getPointer(3, this)); }
|
|
63
|
+
adoptProxyAcctRecs(value) { __S.adopt(value, __S.getPointer(4, this)); }
|
|
64
|
+
disownProxyAcctRecs() { return __S.disown(this.getProxyAcctRecs()); }
|
|
65
|
+
getProxyAcctRecs() { return __S.getList(4, ValLayLedger._ProxyAcctRecs, this); }
|
|
66
|
+
hasProxyAcctRecs() { return !__S.isNull(__S.getPointer(4, this)); }
|
|
67
|
+
initProxyAcctRecs(length) { return __S.initList(4, ValLayLedger._ProxyAcctRecs, length, this); }
|
|
68
|
+
setProxyAcctRecs(value) { __S.copyFrom(value, __S.getPointer(4, this)); }
|
|
69
|
+
toString() { return "ValLayLedger_" + super.toString(); }
|
|
70
|
+
}
|
|
71
|
+
NetActorList._NetActorRecs = capnp.CompositeList(NetActorRec);
|
|
72
|
+
ParamAcctList._ParamAcctRecs = capnp.CompositeList(ParamAcctRec);
|
|
73
|
+
ValLayLedger._CoinAcctRecs = capnp.CompositeList(CoinAcctRec);
|
|
74
|
+
ValLayLedger._ProxyAcctRecs = capnp.CompositeList(ProxyAcctRec);
|
|
75
|
+
//# sourceMappingURL=valLayLedger.capnp.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"valLayLedger.capnp.js","sourceRoot":"","sources":["../../../src/capnp/valLayLedger.capnp.ts"],"names":[],"mappings":"AAAA,oBAAoB;AAEpB;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,UAAU,IAAI,GAAG,EAAE,MAAM,IAAI,GAAG,EAAE,MAAM,UAAU,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,YAAY,EAAE,SAAS,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAC/H,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAClG,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,eAAe,EAAE,gBAAgB,EAAE,eAAe,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAC3J,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,MAAM,CAAC,MAAM,YAAY,GAAG,kBAAkB,CAAC;AAC/C,MAAM,OAAO,YAAa,SAAQ,GAAG;aACjB,WAAM,GAAG,EAAE,WAAW,EAAE,cAAc,EAAE,EAAE,EAAE,kBAAkB,EAAE,IAAI,EAAE,IAAI,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC;IAEtG,iBAAiB,CAAC,KAA4C,IAAU,GAA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ACzG,QAAQ,KAAa,OAAO,eAAe,GAAG,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;;AAErE,YAAY,CAAC,aAAa,GAAG,KAAK,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC;AAC9D,aAAa,CAAC,cAAc,GAAG,KAAK,CAAC,aAAa,CAAC,YAAY,CAAC,CAAC;AACjE,YAAY,CAAC,aAAa,GAAG,KAAK,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC;AAC9D,YAAY,CAAC,cAAc,GAAG,KAAK,CAAC,aAAa,CAAC,YAAY,CAAC,CAAC"}
|
|
@@ -0,0 +1,474 @@
|
|
|
1
|
+
import type { AccountRef } from '../crypto/account-id';
|
|
2
|
+
import type { GeeqAmount } from '../amount';
|
|
3
|
+
import type { AttestationTx, CoinTransferTx, GeeqChainState, GeeqKeypair, GeeqNft, GeeqNftMintProxies, NftMintProxyTx, NftMintTx } from '../types';
|
|
4
|
+
import type { GeeqDiscoveredNode } from '../net/discovery';
|
|
5
|
+
import type { GeeqLedger } from '../ledger/geeq-ledger';
|
|
6
|
+
import type { GeeqLedgerNode } from '../ledger/net-actors';
|
|
7
|
+
import type { GeeqTransport } from '../net/transport';
|
|
8
|
+
import type { GeeqContent } from '../tx/content';
|
|
9
|
+
import { GeeqNode } from './geeq-node';
|
|
10
|
+
import type { NodeRequestConfig } from './geeq-node';
|
|
11
|
+
export interface GeeqChainOptions {
|
|
12
|
+
/**
|
|
13
|
+
* How many pennies make one Geeq: a power of ten, as a bigint.
|
|
14
|
+
*
|
|
15
|
+
* The chain counts only pennies and does not publish this, so the app says — use the
|
|
16
|
+
* divisor its wallet and explorer show amounts with. {@link GeeqChain.toPennies} reads
|
|
17
|
+
* `{ geeq }` figures with it, and {@link GeeqChain.formatGeeq} and the chain's own
|
|
18
|
+
* messages show amounts with it.
|
|
19
|
+
*/
|
|
20
|
+
readonly penniesPerGeeq: bigint;
|
|
21
|
+
/**
|
|
22
|
+
* The chain's node directory — the simulator URL for your environment — which the SDK
|
|
23
|
+
* asks for an active node. Works for every chain and environment.
|
|
24
|
+
*
|
|
25
|
+
* Supply this or {@link endpoint}, not both. The directory is the only thing that
|
|
26
|
+
* knows which nodes exist and which are running; the ledger then says which actor the
|
|
27
|
+
* chosen one is. Note the directory is a deployment control plane with no
|
|
28
|
+
* authentication — the SDK reads two of its routes and never touches the rest.
|
|
29
|
+
*/
|
|
30
|
+
readonly discovery?: string | URL;
|
|
31
|
+
/**
|
|
32
|
+
* A specific node, when you already know one.
|
|
33
|
+
*
|
|
34
|
+
* Supply this or {@link discovery}, not both.
|
|
35
|
+
*/
|
|
36
|
+
readonly endpoint?: string | URL;
|
|
37
|
+
/**
|
|
38
|
+
* Which chain to use, by the name its directory gives it.
|
|
39
|
+
*
|
|
40
|
+
* Only meaningful with {@link discovery} — a name exists nowhere but the directory.
|
|
41
|
+
* Matched case-insensitively.
|
|
42
|
+
*/
|
|
43
|
+
readonly chainName?: string;
|
|
44
|
+
/**
|
|
45
|
+
* Which chain to use, by protocol number.
|
|
46
|
+
*
|
|
47
|
+
* With {@link discovery} this selects the chain when no {@link chainName} is given,
|
|
48
|
+
* and asserts it when one is. With {@link endpoint} it asserts the node serves the
|
|
49
|
+
* chain you expect, and a mismatch throws `chain-mismatch` on the first ledger read.
|
|
50
|
+
*/
|
|
51
|
+
readonly chainNumber?: number;
|
|
52
|
+
/** Defaults to a call through `globalThis.fetch`. */
|
|
53
|
+
readonly transport?: GeeqTransport;
|
|
54
|
+
/** Per request. Defaults to 10000. */
|
|
55
|
+
readonly timeoutMs?: number;
|
|
56
|
+
/** Extra headers on every request — a proxy token, a trace id. */
|
|
57
|
+
readonly headers?: Readonly<Record<string, string>>;
|
|
58
|
+
/** How long a read ledger may be reused. Defaults to 5000. 0 disables the cache. */
|
|
59
|
+
readonly ledgerMaxAgeMs?: number;
|
|
60
|
+
/** Skip host matching. Required behind a gateway or when using a DNS name. */
|
|
61
|
+
readonly nodeNumber?: number;
|
|
62
|
+
/**
|
|
63
|
+
* The port discovered nodes are reached on. Defaults to 2082.
|
|
64
|
+
*
|
|
65
|
+
* Deployment configuration, not node selection — override it only when running
|
|
66
|
+
* against nodes that are not behind the standard TLS front door, such as a local
|
|
67
|
+
* test harness.
|
|
68
|
+
*/
|
|
69
|
+
readonly nodePort?: number;
|
|
70
|
+
/** Retries on transport failure only, never on a response. Defaults to 1. */
|
|
71
|
+
readonly retries?: number;
|
|
72
|
+
readonly signal?: AbortSignal;
|
|
73
|
+
}
|
|
74
|
+
export interface AttestationRequest {
|
|
75
|
+
/** The account that signs. Must be a coin-asset account on this chain. */
|
|
76
|
+
readonly keypair: GeeqKeypair;
|
|
77
|
+
/**
|
|
78
|
+
* What to attest. Hashed here with BLAKE3-32; the content never leaves the device.
|
|
79
|
+
*
|
|
80
|
+
* A `File` straight from a file input works, as does a string or raw bytes.
|
|
81
|
+
*/
|
|
82
|
+
readonly content?: GeeqContent;
|
|
83
|
+
/** Or supply the digest yourself. Exactly one of `content` and `attestHash`. */
|
|
84
|
+
readonly attestHash?: Uint8Array;
|
|
85
|
+
/** Public labels, checked against this chain's limits before anything is signed. */
|
|
86
|
+
readonly metadata?: readonly (string | Uint8Array)[];
|
|
87
|
+
/** Override the derived nonce. See {@link NonceGuard} for when that is needed. */
|
|
88
|
+
readonly nonce?: number;
|
|
89
|
+
readonly signal?: AbortSignal;
|
|
90
|
+
}
|
|
91
|
+
export interface CoinTransferRequest {
|
|
92
|
+
/** The account paying. Must be a coin-asset account on this chain. */
|
|
93
|
+
readonly from: GeeqKeypair;
|
|
94
|
+
/**
|
|
95
|
+
* Who receives it.
|
|
96
|
+
*
|
|
97
|
+
* A base58 wallet address is the usual thing — it is what a person pastes — and the
|
|
98
|
+
* chain it encodes is checked against this one. A raw account id or public key works
|
|
99
|
+
* too, but carries no chain to check.
|
|
100
|
+
*/
|
|
101
|
+
readonly to: string | AccountRef;
|
|
102
|
+
/**
|
|
103
|
+
* How much. State the unit: `{ geeq: "1.5" }`, read at {@link GeeqChainOptions.penniesPerGeeq},
|
|
104
|
+
* or `{ pennies }` as the chain counts them. May be left out
|
|
105
|
+
* when sending NFTs, which then go with the chain's minimum transfer.
|
|
106
|
+
*/
|
|
107
|
+
readonly amount?: GeeqAmount;
|
|
108
|
+
/** NFTs to send, by id — see {@link GeeqChain.findNfts}. The sender must hold each one. */
|
|
109
|
+
readonly nfts?: readonly Uint8Array[];
|
|
110
|
+
/** Override the derived nonce. See {@link NonceGuard}. */
|
|
111
|
+
readonly nonce?: number;
|
|
112
|
+
readonly signal?: AbortSignal;
|
|
113
|
+
}
|
|
114
|
+
export interface ChainStateRequest {
|
|
115
|
+
readonly account: AccountRef;
|
|
116
|
+
readonly maxAgeMs?: number;
|
|
117
|
+
readonly signal?: AbortSignal;
|
|
118
|
+
}
|
|
119
|
+
export interface NftMintProxyRequest {
|
|
120
|
+
/**
|
|
121
|
+
* The account paying for the proxy, which also becomes its admin: the only key that
|
|
122
|
+
* can later mint NFTs through it. Must be a coin-asset account on this chain.
|
|
123
|
+
*/
|
|
124
|
+
readonly admin: GeeqKeypair;
|
|
125
|
+
/**
|
|
126
|
+
* Coin moved onto the proxy, `{ geeq }` or `{ pennies }` like any amount. It pays for the
|
|
127
|
+
* mints made through it, so fund it for more than one.
|
|
128
|
+
*/
|
|
129
|
+
readonly amount: GeeqAmount;
|
|
130
|
+
/**
|
|
131
|
+
* Which of the admin's proxies this is, from 1. Leave it out to take the next one —
|
|
132
|
+
* one past the highest the ledger holds for this admin, see
|
|
133
|
+
* {@link GeeqChain.findNftMintProxies}. An index already in use is refused.
|
|
134
|
+
*/
|
|
135
|
+
readonly index?: number;
|
|
136
|
+
/** Override the derived nonce. See {@link NonceGuard}. */
|
|
137
|
+
readonly nonce?: number;
|
|
138
|
+
readonly signal?: AbortSignal;
|
|
139
|
+
}
|
|
140
|
+
export interface NftMintProxiesRequest {
|
|
141
|
+
/**
|
|
142
|
+
* The admin whose proxies to find. A keypair will do; so will a bare public key, since
|
|
143
|
+
* listing needs no signature. Not an account id: an index is derived from the key.
|
|
144
|
+
*/
|
|
145
|
+
readonly admin: {
|
|
146
|
+
readonly publicKey: Uint8Array;
|
|
147
|
+
};
|
|
148
|
+
/** How old a cached ledger may be. 0 reads afresh — a new proxy shows only once confirmed. */
|
|
149
|
+
readonly maxAgeMs?: number;
|
|
150
|
+
readonly signal?: AbortSignal;
|
|
151
|
+
}
|
|
152
|
+
export interface NftsRequest {
|
|
153
|
+
/** Whose NFTs. A keypair will do, as will an account id or a public key. */
|
|
154
|
+
readonly owner: AccountRef;
|
|
155
|
+
/** How old a cached ledger may be. 0 reads afresh — a new NFT shows only once confirmed. */
|
|
156
|
+
readonly maxAgeMs?: number;
|
|
157
|
+
readonly signal?: AbortSignal;
|
|
158
|
+
}
|
|
159
|
+
export interface NftMintRequest {
|
|
160
|
+
/** The proxy's admin: the only key that can mint through it. It signs the mint. */
|
|
161
|
+
readonly admin: GeeqKeypair;
|
|
162
|
+
/**
|
|
163
|
+
* Which of the admin's proxies mints it, by index — see
|
|
164
|
+
* {@link GeeqChain.findNftMintProxies}. The proxy pays the fee and {@link amount}, and
|
|
165
|
+
* spends its own nonce, not the admin's.
|
|
166
|
+
*/
|
|
167
|
+
readonly index: number;
|
|
168
|
+
/**
|
|
169
|
+
* What the NFT stands for. Hashed here with BLAKE3-32; the content never leaves the
|
|
170
|
+
* device. A `File` straight from a file input works, as does a string or raw bytes.
|
|
171
|
+
*/
|
|
172
|
+
readonly content?: GeeqContent;
|
|
173
|
+
/** Or supply the digest yourself. Exactly one of `content` and `attestHash`. */
|
|
174
|
+
readonly attestHash?: Uint8Array;
|
|
175
|
+
/** Public labels stored with the NFT, checked against this chain's limits before signing. */
|
|
176
|
+
readonly metadata?: readonly (string | Uint8Array)[];
|
|
177
|
+
/** Who receives the NFT. Defaults to the admin. An address is checked against this chain. */
|
|
178
|
+
readonly to?: string | AccountRef;
|
|
179
|
+
/** Coin the proxy sends to the receiver with it. Defaults to the chain's minimum transfer. */
|
|
180
|
+
readonly amount?: GeeqAmount;
|
|
181
|
+
/** Override the proxy's derived nonce. See {@link NonceGuard}. */
|
|
182
|
+
readonly nonce?: number;
|
|
183
|
+
readonly signal?: AbortSignal;
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* A chain, reached through one node.
|
|
187
|
+
*
|
|
188
|
+
* Holds the node directory, the metadata limits and a short-lived ledger cache, so an
|
|
189
|
+
* attestation needs only a keypair and something to attest. Everything a transaction is
|
|
190
|
+
* pinned to — chain number, target block, node number, nonce — is read from the ledger
|
|
191
|
+
* rather than asked of the caller, because none of it can be known offline and a wrong
|
|
192
|
+
* value is rejected by the chain.
|
|
193
|
+
*
|
|
194
|
+
* A chain is bound to the endpoint it was connected to. To use a different node, connect
|
|
195
|
+
* another one: a different node means a different address, certificate and CORS origin,
|
|
196
|
+
* which is not something to switch silently.
|
|
197
|
+
*
|
|
198
|
+
* In a reactive framework, mark an instance raw (Vue's `markRaw`) rather than letting it
|
|
199
|
+
* be proxied.
|
|
200
|
+
*/
|
|
201
|
+
export declare class GeeqChain {
|
|
202
|
+
/** The node this chain reads from and builds transactions for. */
|
|
203
|
+
readonly endpoint: string;
|
|
204
|
+
/** What the directory said about the nodes on this chain, when one was used. */
|
|
205
|
+
readonly candidates: readonly GeeqDiscoveredNode[];
|
|
206
|
+
/** The chain's name, when a directory supplied one. Display only — chains are numbered. */
|
|
207
|
+
readonly chainName: string | undefined;
|
|
208
|
+
/** How many pennies make one Geeq, as given to {@link GeeqChain.connect}. */
|
|
209
|
+
readonly penniesPerGeeq: bigint;
|
|
210
|
+
private readonly request;
|
|
211
|
+
private readonly ledgerMaxAgeMs;
|
|
212
|
+
private readonly nonces;
|
|
213
|
+
private readonly declaredChainNumber;
|
|
214
|
+
private readonly nodeNumberOverride;
|
|
215
|
+
private cached;
|
|
216
|
+
private resolved;
|
|
217
|
+
private inflight;
|
|
218
|
+
/** @internal */
|
|
219
|
+
constructor(init: {
|
|
220
|
+
endpoint: string;
|
|
221
|
+
candidates: readonly GeeqDiscoveredNode[];
|
|
222
|
+
chainName: string | undefined;
|
|
223
|
+
chainNumber: number | undefined;
|
|
224
|
+
nodeNumber: number | undefined;
|
|
225
|
+
penniesPerGeeq: bigint;
|
|
226
|
+
request: NodeRequestConfig;
|
|
227
|
+
ledgerMaxAgeMs: number;
|
|
228
|
+
});
|
|
229
|
+
/**
|
|
230
|
+
* Choose a chain and a node, without reading anything from the chain itself.
|
|
231
|
+
*
|
|
232
|
+
* With `discovery`, the directory is asked which nodes exist and one of the active
|
|
233
|
+
* ones is taken. With `endpoint`, that node is used as given. Either way **no ledger
|
|
234
|
+
* is fetched here** — a ledger read is only valid for a few blocks, so it happens when
|
|
235
|
+
* a transaction is actually being built rather than when the app starts.
|
|
236
|
+
*/
|
|
237
|
+
static connect(options: GeeqChainOptions): Promise<GeeqChain>;
|
|
238
|
+
/** {@link GeeqChain.connect}, and install the result as the process-wide default. */
|
|
239
|
+
static init(options: GeeqChainOptions): Promise<GeeqChain>;
|
|
240
|
+
/** The default chain. Throws `not-initialized` when there is none. */
|
|
241
|
+
static current(): GeeqChain;
|
|
242
|
+
/** Whether a default chain has been installed. */
|
|
243
|
+
static get initialized(): boolean;
|
|
244
|
+
/** Clear the default. Call this from `afterEach` so tests do not leak into each other. */
|
|
245
|
+
static reset(): void;
|
|
246
|
+
/** Resolve an amount to pennies, reading a `{ geeq }` figure at {@link penniesPerGeeq}. */
|
|
247
|
+
toPennies(amount: GeeqAmount): bigint;
|
|
248
|
+
/** Show pennies as a Geeq figure at {@link penniesPerGeeq}, as the Geeq wallet does. */
|
|
249
|
+
formatGeeq(pennies: bigint): string;
|
|
250
|
+
/**
|
|
251
|
+
* This chain's number.
|
|
252
|
+
*
|
|
253
|
+
* Known immediately when a directory named the chain, or once a ledger has been read.
|
|
254
|
+
* `undefined` in between — with a bare endpoint and no declared number, only the node
|
|
255
|
+
* can say.
|
|
256
|
+
*/
|
|
257
|
+
get chainNumber(): number | undefined;
|
|
258
|
+
/**
|
|
259
|
+
* The node, once a ledger read has identified it in the net actor list.
|
|
260
|
+
*
|
|
261
|
+
* `undefined` until then: a node's number is the one thing the directory cannot say,
|
|
262
|
+
* so it is not known before the first read.
|
|
263
|
+
*/
|
|
264
|
+
get node(): GeeqNode | undefined;
|
|
265
|
+
/** The net actor directory from the last ledger read, if there has been one. */
|
|
266
|
+
get nodes(): readonly GeeqLedgerNode[];
|
|
267
|
+
/** Those of them that accept transactions. */
|
|
268
|
+
get processingNodes(): readonly GeeqLedgerNode[];
|
|
269
|
+
/** The ledger from the last read, if it is still cached. */
|
|
270
|
+
get ledger(): GeeqLedger | undefined;
|
|
271
|
+
/**
|
|
272
|
+
* A URL for another node in this chain.
|
|
273
|
+
*
|
|
274
|
+
* Every node answers client traffic on {@link GEEQ_NODE_PORT}, so only the scheme is
|
|
275
|
+
* carried over from the endpoint in use. The port recorded against a node in the
|
|
276
|
+
* ledger is its own internal listener and is never what you connect to.
|
|
277
|
+
*/
|
|
278
|
+
endpointFor(host: string): string;
|
|
279
|
+
/**
|
|
280
|
+
* The current ledger, from cache when it is fresh enough.
|
|
281
|
+
*
|
|
282
|
+
* Staleness is safe in exactly one direction. The node accepts a target block within
|
|
283
|
+
* `[N-8, N+1]` of its own head, and a cached ledger can only be *behind*, so the
|
|
284
|
+
* target it yields is never in the future — the only rejected direction. The default
|
|
285
|
+
* five seconds is set by the node list and metadata limits, which have no such
|
|
286
|
+
* tolerance, not by the block window.
|
|
287
|
+
*/
|
|
288
|
+
getLedger(options?: {
|
|
289
|
+
readonly maxAgeMs?: number;
|
|
290
|
+
readonly signal?: AbortSignal;
|
|
291
|
+
}): Promise<GeeqLedger>;
|
|
292
|
+
/** Discard the cached ledger and read again. */
|
|
293
|
+
refresh(options?: {
|
|
294
|
+
readonly signal?: AbortSignal;
|
|
295
|
+
}): Promise<GeeqLedger>;
|
|
296
|
+
/**
|
|
297
|
+
* One read at a time.
|
|
298
|
+
*
|
|
299
|
+
* Same single-flight shape as `initGeeq`, including clearing the promise on failure so
|
|
300
|
+
* a later call can retry rather than being stuck with the first error. Without it, a
|
|
301
|
+
* page that builds several transactions at once pulls the whole ledger several times
|
|
302
|
+
* from an endpoint with no rate limiting of any kind.
|
|
303
|
+
*
|
|
304
|
+
* The read is shared, so it carries no caller's signal: one caller aborting must not
|
|
305
|
+
* fail the others waiting on it. Each caller stops waiting on its own signal instead,
|
|
306
|
+
* and the read runs on, bounded by `timeoutMs`, to fill the cache for whoever is next.
|
|
307
|
+
*/
|
|
308
|
+
private read;
|
|
309
|
+
/**
|
|
310
|
+
* Everything a transaction must be pinned to, read from this chain.
|
|
311
|
+
*
|
|
312
|
+
* Throws rather than guessing when the account cannot sign: absent from the ledger
|
|
313
|
+
* (the ordinary state of an unfunded keypair), or present as a record type the
|
|
314
|
+
* protocol will not accept.
|
|
315
|
+
*/
|
|
316
|
+
getChainState(request: ChainStateRequest): Promise<GeeqChainState>;
|
|
317
|
+
/**
|
|
318
|
+
* What every transaction built from `ledger` is pinned to, bar the signer's nonce: the
|
|
319
|
+
* same for a signer's own transaction and for a proxy's.
|
|
320
|
+
*/
|
|
321
|
+
private pinnedTo;
|
|
322
|
+
/** {@link getChainState} against a ledger already in hand, so a build reads only one. */
|
|
323
|
+
private stateIn;
|
|
324
|
+
/**
|
|
325
|
+
* The ledger a build is made from, and the state of `signer` in it.
|
|
326
|
+
*
|
|
327
|
+
* A cached ledger is up to a few seconds old, so "this account already built against
|
|
328
|
+
* this block" may only mean "we are looking at an old block". Look again once before
|
|
329
|
+
* letting the nonce guard refuse — otherwise a caller who waited out the block interval
|
|
330
|
+
* is told to wait for a block that has already passed. An explicit nonce is the caller
|
|
331
|
+
* taking responsibility, so it skips the check.
|
|
332
|
+
*
|
|
333
|
+
* Everything the build then needs — what the sender holds, which proxies exist — comes
|
|
334
|
+
* from this same ledger, so it all describes one block.
|
|
335
|
+
*/
|
|
336
|
+
private readForBuild;
|
|
337
|
+
/** Read afresh if `guardKey` already built against `ledger`'s block. See {@link readForBuild}. */
|
|
338
|
+
private recheckIfClaimed;
|
|
339
|
+
/**
|
|
340
|
+
* Build and sign an attestation, deriving everything the chain decides.
|
|
341
|
+
*
|
|
342
|
+
* This is where the ledger is read, because this is the first moment the values it
|
|
343
|
+
* carries are actually needed — and they go stale within a handful of blocks, so
|
|
344
|
+
* reading them any earlier would only mean reading them twice.
|
|
345
|
+
*
|
|
346
|
+
* The result is **not submitted**. Hand it to {@link GeeqSocket.track} first, so its
|
|
347
|
+
* verdict has somewhere to arrive, then POST `transaction` and `payload` to
|
|
348
|
+
* {@link AttestationTx.nodeUrl}; any other node rejects it, because the node number is
|
|
349
|
+
* checked with strict equality.
|
|
350
|
+
*/
|
|
351
|
+
createAttestation(input: AttestationRequest): Promise<AttestationTx>;
|
|
352
|
+
/**
|
|
353
|
+
* Record the nonce a finished build took, so a second build against the same block is
|
|
354
|
+
* refused rather than sent to share it.
|
|
355
|
+
*
|
|
356
|
+
* Claimed only once a transaction really exists, so a build that failed validation does
|
|
357
|
+
* not consume the account's one nonce for this block. An explicit nonce is the caller
|
|
358
|
+
* taking responsibility, so it bypasses the guard entirely.
|
|
359
|
+
*/
|
|
360
|
+
private claimNonce;
|
|
361
|
+
/**
|
|
362
|
+
* Resolve a recipient, checking the chain it belongs to when one is stated.
|
|
363
|
+
*
|
|
364
|
+
* An address carries a chain number, and an address from another chain is almost
|
|
365
|
+
* always a paste from the wrong place. The account id inside it would still be
|
|
366
|
+
* technically usable here, which is exactly why this is worth refusing rather than
|
|
367
|
+
* quietly sending.
|
|
368
|
+
*/
|
|
369
|
+
private resolveRecipient;
|
|
370
|
+
/**
|
|
371
|
+
* Send coin to another account, and NFTs with it if you name them.
|
|
372
|
+
*
|
|
373
|
+
* Reads the ledger, so it also knows what the sender holds and what the chain's minimum
|
|
374
|
+
* transfer is. The amount is checked against the minimum, and the sender's NFTs against
|
|
375
|
+
* the ones named, before anything is signed; the balance against the amount plus the
|
|
376
|
+
* fee once the signed transaction gives the fee. NFTs always travel with coin: leave
|
|
377
|
+
* `amount` out and they go with the chain's minimum transfer.
|
|
378
|
+
*
|
|
379
|
+
* The result is **not submitted**. Hand it to {@link GeeqSocket.track} first, then POST
|
|
380
|
+
* `transaction` to {@link CoinTransferTx.nodeUrl} using `coinTransferSubmitBody`, which
|
|
381
|
+
* sends it as type `uvt` — a different shape from an attestation, and with no separate
|
|
382
|
+
* payload.
|
|
383
|
+
*/
|
|
384
|
+
createTransfer(input: CoinTransferRequest): Promise<CoinTransferTx>;
|
|
385
|
+
/**
|
|
386
|
+
* The NFTs an account holds on this chain, in the order its record lists them, each with
|
|
387
|
+
* the hash and labels it was minted with.
|
|
388
|
+
*
|
|
389
|
+
* Which NFTs it holds comes from the validation layer ledger; what each stands for, from
|
|
390
|
+
* the application layer ledger, which is read afresh every time. An account the chain
|
|
391
|
+
* does not know holds none. A new NFT shows once a block has confirmed it, so pass
|
|
392
|
+
* `maxAgeMs: 0` to look straight after one was minted or sent.
|
|
393
|
+
*/
|
|
394
|
+
findNfts(request: NftsRequest): Promise<readonly GeeqNft[]>;
|
|
395
|
+
/**
|
|
396
|
+
* The NFT mint proxies an admin has on this chain, each with its index, and the index
|
|
397
|
+
* its next proxy takes: one past the highest in use, or 1 for an admin with none.
|
|
398
|
+
*
|
|
399
|
+
* A proxy appears once a block has confirmed it, so pass `maxAgeMs: 0` to look
|
|
400
|
+
* straight after one was submitted.
|
|
401
|
+
*/
|
|
402
|
+
findNftMintProxies(request: NftMintProxiesRequest): Promise<GeeqNftMintProxies>;
|
|
403
|
+
/**
|
|
404
|
+
* Create a proxy to mint NFTs through.
|
|
405
|
+
*
|
|
406
|
+
* A proxy is a record of its own: it holds coin, carries its own nonce, and names one
|
|
407
|
+
* admin — `admin` here — who signs every mint made through it. Its id is derived from
|
|
408
|
+
* the admin's key and an index, as the Geeq wallet derives it: by default the next
|
|
409
|
+
* index {@link findNftMintProxies} reports, so it is found again from the key alone.
|
|
410
|
+
*
|
|
411
|
+
* Checks the funding against the chain's minimum, and the admin's balance against the
|
|
412
|
+
* funding plus the fee. The result is **not submitted** — track it, then post it with
|
|
413
|
+
* `coinTransferSubmitBody`, exactly as a transfer. The proxy exists once a block
|
|
414
|
+
* confirms it.
|
|
415
|
+
*/
|
|
416
|
+
createNftMintProxy(input: NftMintProxyRequest): Promise<NftMintProxyTx>;
|
|
417
|
+
/**
|
|
418
|
+
* Mint an NFT through one of the admin's proxies.
|
|
419
|
+
*
|
|
420
|
+
* The proxy is the sender: it pays the fee and the coin sent with the NFT, and spends
|
|
421
|
+
* its own nonce, not the admin's. The admin signs. The NFT itself is the content's hash
|
|
422
|
+
* and labels, as an attestation is, and its id is derived from them — so the same
|
|
423
|
+
* content with the same labels through the same proxy cannot be minted twice.
|
|
424
|
+
*
|
|
425
|
+
* Reads the ledger to find the proxy and check what it holds. The result is **not
|
|
426
|
+
* submitted** — track it, then post it with `attestationSubmitBody`, exactly as an
|
|
427
|
+
* attestation: two fields, as `uat`.
|
|
428
|
+
*/
|
|
429
|
+
mintNft(input: NftMintRequest): Promise<NftMintTx>;
|
|
430
|
+
/**
|
|
431
|
+
* Whether a built transaction is now too old to send: the chain is past its
|
|
432
|
+
* `validUntilBlock`, and a node would refuse it with an HTTP 400.
|
|
433
|
+
*
|
|
434
|
+
* Reads the ledger afresh, because a cached one can only be behind the chain and would
|
|
435
|
+
* say "not yet" when it already is. Call it before submitting a transaction that may
|
|
436
|
+
* have waited.
|
|
437
|
+
*/
|
|
438
|
+
isExpired(tx: {
|
|
439
|
+
readonly validUntilBlock: number;
|
|
440
|
+
}): Promise<boolean>;
|
|
441
|
+
/**
|
|
442
|
+
* Give back the nonce a built transaction took, because it will never be sent — the
|
|
443
|
+
* user changed something and is building again. The next build may then take the same
|
|
444
|
+
* nonce in the same block instead of being refused with `nonce-collision`.
|
|
445
|
+
*
|
|
446
|
+
* Only for a transaction that was not submitted: if it reaches the node as well as its
|
|
447
|
+
* rebuild, the two share a nonce and the node rejects both.
|
|
448
|
+
*/
|
|
449
|
+
discard(tx: {
|
|
450
|
+
readonly transactionHash: Uint8Array;
|
|
451
|
+
}): void;
|
|
452
|
+
/** Forget which accounts have built a transaction against the current block. */
|
|
453
|
+
forgetNonces(): void;
|
|
454
|
+
/** Drop cached state, and step down as the default if this chain holds that slot. */
|
|
455
|
+
dispose(): void;
|
|
456
|
+
toJSON(): Record<string, unknown>;
|
|
457
|
+
toString(): string;
|
|
458
|
+
}
|
|
459
|
+
/**
|
|
460
|
+
* Connect to a chain and make it the default.
|
|
461
|
+
*
|
|
462
|
+
* Thin alias for {@link GeeqChain.init} — the name most applications reach for, and one
|
|
463
|
+
* line so there is no second implementation to keep in step.
|
|
464
|
+
*
|
|
465
|
+
* ```ts
|
|
466
|
+
* await initChain({ endpoint: 'https://1.2.3.4:2082' })
|
|
467
|
+
* const tx = await attest({ keypair, content: fileBytes })
|
|
468
|
+
* ```
|
|
469
|
+
*/
|
|
470
|
+
export declare function initChain(options: GeeqChainOptions): Promise<GeeqChain>;
|
|
471
|
+
/** Build an attestation on the default chain. See {@link GeeqChain.createAttestation}. */
|
|
472
|
+
export declare function attest(input: AttestationRequest): Promise<AttestationTx>;
|
|
473
|
+
/** Send coin on the default chain. See {@link GeeqChain.createTransfer}. */
|
|
474
|
+
export declare function transfer(input: CoinTransferRequest): Promise<CoinTransferTx>;
|