@thruputchain/client 0.0.0-stage → 0.26.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/LICENSE +201 -0
- package/README.md +953 -2
- package/dist/actions-CXx6qzsv.cjs +513 -0
- package/dist/actions-CXx6qzsv.cjs.map +1 -0
- package/dist/actions-QHgiCqT6.js +430 -0
- package/dist/actions-QHgiCqT6.js.map +1 -0
- package/dist/actions.cjs +23 -0
- package/dist/actions.d.cts +4 -0
- package/dist/actions.d.ts +4 -0
- package/dist/actions.js +3 -0
- package/dist/artifact-BM_MVzhL.d.cts +35 -0
- package/dist/artifact-BM_MVzhL.d.cts.map +1 -0
- package/dist/artifact-BM_MVzhL.d.ts +35 -0
- package/dist/artifact-BM_MVzhL.d.ts.map +1 -0
- package/dist/client-JixxskeH.d.cts +746 -0
- package/dist/client-JixxskeH.d.cts.map +1 -0
- package/dist/client-JixxskeH.d.ts +746 -0
- package/dist/client-JixxskeH.d.ts.map +1 -0
- package/dist/codec-BHKoSaOP.js +9506 -0
- package/dist/codec-BHKoSaOP.js.map +1 -0
- package/dist/codec-C3OlYm98.cjs +9566 -0
- package/dist/codec-C3OlYm98.cjs.map +1 -0
- package/dist/contract-C7T2H2Oi.cjs +1628 -0
- package/dist/contract-C7T2H2Oi.cjs.map +1 -0
- package/dist/contract-DzvyyFCI.js +1472 -0
- package/dist/contract-DzvyyFCI.js.map +1 -0
- package/dist/contract.cjs +63 -0
- package/dist/contract.d.cts +4 -0
- package/dist/contract.d.ts +4 -0
- package/dist/contract.js +2 -0
- package/dist/contracts.cjs +1050 -0
- package/dist/contracts.cjs.map +1 -0
- package/dist/contracts.d.cts +397 -0
- package/dist/contracts.d.cts.map +1 -0
- package/dist/contracts.d.ts +397 -0
- package/dist/contracts.d.ts.map +1 -0
- package/dist/contracts.js +1030 -0
- package/dist/contracts.js.map +1 -0
- package/dist/dev_wallet-CSMA1PCt.js +497 -0
- package/dist/dev_wallet-CSMA1PCt.js.map +1 -0
- package/dist/dev_wallet-GX-NCAFk.cjs +530 -0
- package/dist/dev_wallet-GX-NCAFk.cjs.map +1 -0
- package/dist/domainSeparator-B_vU_zUD.cjs +102 -0
- package/dist/domainSeparator-B_vU_zUD.cjs.map +1 -0
- package/dist/domainSeparator-CBCvxIj-.js +79 -0
- package/dist/domainSeparator-CBCvxIj-.js.map +1 -0
- package/dist/execution-DYqPDn4O.d.cts +227 -0
- package/dist/execution-DYqPDn4O.d.cts.map +1 -0
- package/dist/execution-Dj6E4B_b.d.ts +227 -0
- package/dist/execution-Dj6E4B_b.d.ts.map +1 -0
- package/dist/hex-DIcaALXL.js +112 -0
- package/dist/hex-DIcaALXL.js.map +1 -0
- package/dist/hex-DkGpiZ5e.cjs +189 -0
- package/dist/hex-DkGpiZ5e.cjs.map +1 -0
- package/dist/index--5LsCotr.d.ts +192 -0
- package/dist/index--5LsCotr.d.ts.map +1 -0
- package/dist/index-1-rFirYe.d.cts +90 -0
- package/dist/index-1-rFirYe.d.cts.map +1 -0
- package/dist/index-B5KqSHeL.d.cts +192 -0
- package/dist/index-B5KqSHeL.d.cts.map +1 -0
- package/dist/index-BraLWObY.d.cts +164 -0
- package/dist/index-BraLWObY.d.cts.map +1 -0
- package/dist/index-ByNNqY7S.d.cts +83 -0
- package/dist/index-ByNNqY7S.d.cts.map +1 -0
- package/dist/index-ByvV2UF6.d.ts +164 -0
- package/dist/index-ByvV2UF6.d.ts.map +1 -0
- package/dist/index-CG2WRtGa.d.cts +164 -0
- package/dist/index-CG2WRtGa.d.cts.map +1 -0
- package/dist/index-CIHK7Ew9.d.cts +303 -0
- package/dist/index-CIHK7Ew9.d.cts.map +1 -0
- package/dist/index-CIHK7Ew9.d.ts +303 -0
- package/dist/index-CIHK7Ew9.d.ts.map +1 -0
- package/dist/index-CVrhB9Dr.d.cts +263 -0
- package/dist/index-CVrhB9Dr.d.cts.map +1 -0
- package/dist/index-D89ur7mO.d.ts +164 -0
- package/dist/index-D89ur7mO.d.ts.map +1 -0
- package/dist/index-DzrLv3EA.d.cts +82 -0
- package/dist/index-DzrLv3EA.d.cts.map +1 -0
- package/dist/index-DzrLv3EA.d.ts +82 -0
- package/dist/index-DzrLv3EA.d.ts.map +1 -0
- package/dist/index-SV-inhhO.d.ts +90 -0
- package/dist/index-SV-inhhO.d.ts.map +1 -0
- package/dist/index-dJ65V8se.d.ts +263 -0
- package/dist/index-dJ65V8se.d.ts.map +1 -0
- package/dist/index-fdTURpBk.d.ts +83 -0
- package/dist/index-fdTURpBk.d.ts.map +1 -0
- package/dist/index.cjs +445 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +174 -0
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.ts +174 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +189 -0
- package/dist/index.js.map +1 -0
- package/dist/provider.cjs +101 -0
- package/dist/provider.cjs.map +1 -0
- package/dist/provider.d.cts +2 -0
- package/dist/provider.d.ts +2 -0
- package/dist/provider.js +76 -0
- package/dist/provider.js.map +1 -0
- package/dist/readError-AoNjzW75.cjs +604 -0
- package/dist/readError-AoNjzW75.cjs.map +1 -0
- package/dist/readError-CZPYcW__.js +551 -0
- package/dist/readError-CZPYcW__.js.map +1 -0
- package/dist/readViews-DJyqc7im.d.cts +604 -0
- package/dist/readViews-DJyqc7im.d.cts.map +1 -0
- package/dist/readViews-DQoaUORa.d.ts +604 -0
- package/dist/readViews-DQoaUORa.d.ts.map +1 -0
- package/dist/rolldown-runtime-D6vf50IK.cjs +28 -0
- package/dist/sendInvocation-BwabRa2N.js +505 -0
- package/dist/sendInvocation-BwabRa2N.js.map +1 -0
- package/dist/sendInvocation-qO8AZcmU.cjs +661 -0
- package/dist/sendInvocation-qO8AZcmU.cjs.map +1 -0
- package/dist/sign-BewmV_EL.cjs +139 -0
- package/dist/sign-BewmV_EL.cjs.map +1 -0
- package/dist/sign-DVIRyW8Y.js +122 -0
- package/dist/sign-DVIRyW8Y.js.map +1 -0
- package/dist/sign-Ve0eetRO.d.ts +48 -0
- package/dist/sign-Ve0eetRO.d.ts.map +1 -0
- package/dist/sign-eUT0iGQG.d.cts +48 -0
- package/dist/sign-eUT0iGQG.d.cts.map +1 -0
- package/dist/signed-op.cjs +9 -0
- package/dist/signed-op.d.cts +3 -0
- package/dist/signed-op.d.ts +3 -0
- package/dist/signed-op.js +3 -0
- package/dist/signedOp-C52gOgpR.js +166 -0
- package/dist/signedOp-C52gOgpR.js.map +1 -0
- package/dist/signedOp-oqAXEqmE.cjs +183 -0
- package/dist/signedOp-oqAXEqmE.cjs.map +1 -0
- package/dist/signed_op-BokEDWr-.js +154 -0
- package/dist/signed_op-BokEDWr-.js.map +1 -0
- package/dist/signed_op-C4lY_TCc.d.ts +58 -0
- package/dist/signed_op-C4lY_TCc.d.ts.map +1 -0
- package/dist/signed_op-DX5WuyEh.d.cts +58 -0
- package/dist/signed_op-DX5WuyEh.d.cts.map +1 -0
- package/dist/signed_op-q8KKSm5e.cjs +175 -0
- package/dist/signed_op-q8KKSm5e.cjs.map +1 -0
- package/dist/signers-BFP84wJP.cjs +137 -0
- package/dist/signers-BFP84wJP.cjs.map +1 -0
- package/dist/signers-CzOSedwJ.js +120 -0
- package/dist/signers-CzOSedwJ.js.map +1 -0
- package/dist/signers.cjs +5 -0
- package/dist/signers.d.cts +3 -0
- package/dist/signers.d.ts +3 -0
- package/dist/signers.js +2 -0
- package/dist/size-506oTE28.js +91 -0
- package/dist/size-506oTE28.js.map +1 -0
- package/dist/size-OAFfOthl.cjs +108 -0
- package/dist/size-OAFfOthl.cjs.map +1 -0
- package/dist/transaction-CwkQxQOx.js +24 -0
- package/dist/transaction-CwkQxQOx.js.map +1 -0
- package/dist/transaction-DrSrCJ5y.cjs +47 -0
- package/dist/transaction-DrSrCJ5y.cjs.map +1 -0
- package/dist/transaction.cjs +13 -0
- package/dist/transaction.d.cts +3 -0
- package/dist/transaction.d.ts +3 -0
- package/dist/transaction.js +4 -0
- package/dist/transactionHash-CO9ajbvU.js +24 -0
- package/dist/transactionHash-CO9ajbvU.js.map +1 -0
- package/dist/transactionHash-D5yf4KoL.cjs +29 -0
- package/dist/transactionHash-D5yf4KoL.cjs.map +1 -0
- package/dist/transport-CBFwAIIv.js +261 -0
- package/dist/transport-CBFwAIIv.js.map +1 -0
- package/dist/transport-tWxKhXUt.cjs +279 -0
- package/dist/transport-tWxKhXUt.cjs.map +1 -0
- package/dist/transport.cjs +19 -0
- package/dist/transport.d.cts +3 -0
- package/dist/transport.d.ts +3 -0
- package/dist/transport.js +4 -0
- package/dist/types-BE40oD_Q.d.cts +18 -0
- package/dist/types-BE40oD_Q.d.cts.map +1 -0
- package/dist/types-BE40oD_Q.d.ts +18 -0
- package/dist/types-BE40oD_Q.d.ts.map +1 -0
- package/dist/validation-4w-vDGAi.cjs +543 -0
- package/dist/validation-4w-vDGAi.cjs.map +1 -0
- package/dist/validation-eXATmgO0.js +411 -0
- package/dist/validation-eXATmgO0.js.map +1 -0
- package/dist/wallet-7RELuTkf.js +667 -0
- package/dist/wallet-7RELuTkf.js.map +1 -0
- package/dist/wallet-T_JazXRc.cjs +709 -0
- package/dist/wallet-T_JazXRc.cjs.map +1 -0
- package/dist/wallet.cjs +27 -0
- package/dist/wallet.d.cts +3 -0
- package/dist/wallet.d.ts +3 -0
- package/dist/wallet.js +3 -0
- package/package.json +122 -4
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
const require_codec = require("./codec-C3OlYm98.cjs");
|
|
2
|
+
const require_hex = require("./hex-DkGpiZ5e.cjs");
|
|
3
|
+
const require_transactionHash = require("./transactionHash-D5yf4KoL.cjs");
|
|
4
|
+
const require_readError = require("./readError-AoNjzW75.cjs");
|
|
5
|
+
let _thruputchain_protocol = require("@thruputchain/protocol");
|
|
6
|
+
let _thruputchain_protocol_utils = require("@thruputchain/protocol/utils");
|
|
7
|
+
//#region src/transport/mock.ts
|
|
8
|
+
const methods = [
|
|
9
|
+
"getVersionInfo",
|
|
10
|
+
"getNetworkInfo",
|
|
11
|
+
"getChainTip",
|
|
12
|
+
"getChainConfig",
|
|
13
|
+
"getServerLimits",
|
|
14
|
+
"getBalance",
|
|
15
|
+
"getRegisteredAuth",
|
|
16
|
+
"getContractDeployment",
|
|
17
|
+
"getEffectiveContract",
|
|
18
|
+
"getContractArtifact",
|
|
19
|
+
"getBlockByHeight",
|
|
20
|
+
"dev_getPendingTransactionCount",
|
|
21
|
+
"simulateInvocation",
|
|
22
|
+
"simulateInvocations",
|
|
23
|
+
"sendTransaction",
|
|
24
|
+
"getTransactionReceipt",
|
|
25
|
+
"getTransactionInput",
|
|
26
|
+
"getTransactionStatus",
|
|
27
|
+
"getTransactionsByRootAddress",
|
|
28
|
+
"getTransactionsByBlock",
|
|
29
|
+
"getEvents",
|
|
30
|
+
"getStorage",
|
|
31
|
+
"faucet_requestAirdrop"
|
|
32
|
+
];
|
|
33
|
+
/** Deterministic native RPC transport for examples; it does not execute contract code. */
|
|
34
|
+
var MockTransport = class {
|
|
35
|
+
#height = 0n;
|
|
36
|
+
#transactions = /* @__PURE__ */ new Map();
|
|
37
|
+
async request(method, params = {}, options) {
|
|
38
|
+
options?.signal?.throwIfAborted();
|
|
39
|
+
if (Array.isArray(params)) throw new TypeError("Native RPC params must be a named object");
|
|
40
|
+
const stateBlockHeight = this.#height.toString();
|
|
41
|
+
const bounds = {
|
|
42
|
+
oldestIndexedBlockHeight: "0",
|
|
43
|
+
latestIndexedBlockHeight: stateBlockHeight,
|
|
44
|
+
nextCursor: null
|
|
45
|
+
};
|
|
46
|
+
const simulation = {
|
|
47
|
+
output: {
|
|
48
|
+
result: "return",
|
|
49
|
+
returnData: "0x"
|
|
50
|
+
},
|
|
51
|
+
events: [],
|
|
52
|
+
gasUsed: "0"
|
|
53
|
+
};
|
|
54
|
+
let result;
|
|
55
|
+
switch (method) {
|
|
56
|
+
case "getTransactionInput":
|
|
57
|
+
result = { status: "unavailable" };
|
|
58
|
+
break;
|
|
59
|
+
case "getVersionInfo":
|
|
60
|
+
result = {
|
|
61
|
+
wireFormat: "14.4.0",
|
|
62
|
+
implementation: "mock",
|
|
63
|
+
supportedMethods: [...methods]
|
|
64
|
+
};
|
|
65
|
+
break;
|
|
66
|
+
case "getNetworkInfo":
|
|
67
|
+
result = { networkHash: "1".repeat(32) };
|
|
68
|
+
break;
|
|
69
|
+
case "getChainTip":
|
|
70
|
+
result = {
|
|
71
|
+
blockHeight: stateBlockHeight,
|
|
72
|
+
blockHash: this.#blockHash(this.#height)
|
|
73
|
+
};
|
|
74
|
+
break;
|
|
75
|
+
case "getChainConfig":
|
|
76
|
+
result = { stated: { maxNewContractsPerTx: 4 } };
|
|
77
|
+
break;
|
|
78
|
+
case "getServerLimits":
|
|
79
|
+
result = {
|
|
80
|
+
maxSimulationGas: "100000000",
|
|
81
|
+
maxSimulationCalldataBytes: "65536",
|
|
82
|
+
maxEventsPerPage: 200,
|
|
83
|
+
maxTransactionsPerPage: 200,
|
|
84
|
+
maxCursorBytes: "1024",
|
|
85
|
+
simulationBatch: {
|
|
86
|
+
maxInvocations: 16,
|
|
87
|
+
maxCalldataBytes: 65536,
|
|
88
|
+
maxGas: "1600000000",
|
|
89
|
+
maxBackendResponseBytes: 1e6,
|
|
90
|
+
timeoutMs: "3000"
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
break;
|
|
94
|
+
case "getBalance":
|
|
95
|
+
result = {
|
|
96
|
+
address: params.address,
|
|
97
|
+
rawBalance: "0",
|
|
98
|
+
stateBlockHeight
|
|
99
|
+
};
|
|
100
|
+
break;
|
|
101
|
+
case "getRegisteredAuth":
|
|
102
|
+
result = {
|
|
103
|
+
address: params.address,
|
|
104
|
+
configuration: null,
|
|
105
|
+
stateBlockHeight
|
|
106
|
+
};
|
|
107
|
+
break;
|
|
108
|
+
case "getStorage":
|
|
109
|
+
result = {
|
|
110
|
+
item: null,
|
|
111
|
+
stateBlockHeight
|
|
112
|
+
};
|
|
113
|
+
break;
|
|
114
|
+
case "getContractDeployment":
|
|
115
|
+
result = {
|
|
116
|
+
address: params.address,
|
|
117
|
+
stateBlockHeight,
|
|
118
|
+
deployment: null
|
|
119
|
+
};
|
|
120
|
+
break;
|
|
121
|
+
case "getEffectiveContract":
|
|
122
|
+
result = {
|
|
123
|
+
address: params.address,
|
|
124
|
+
context: params.context,
|
|
125
|
+
stateBlockHeight,
|
|
126
|
+
selection: null
|
|
127
|
+
};
|
|
128
|
+
break;
|
|
129
|
+
case "getContractArtifact": throw new require_readError.JsonRpcError(-32014, "Contract artifact unavailable", {
|
|
130
|
+
kind: "contractArtifactUnavailable",
|
|
131
|
+
hash: params.hash
|
|
132
|
+
}, method);
|
|
133
|
+
case "dev_getPendingTransactionCount":
|
|
134
|
+
result = { count: "0" };
|
|
135
|
+
break;
|
|
136
|
+
case "simulateInvocation":
|
|
137
|
+
result = {
|
|
138
|
+
...simulation,
|
|
139
|
+
stateBlockHeight
|
|
140
|
+
};
|
|
141
|
+
break;
|
|
142
|
+
case "simulateInvocations":
|
|
143
|
+
result = {
|
|
144
|
+
stateBlockHeight,
|
|
145
|
+
results: params.invocations.map(() => structuredClone(simulation))
|
|
146
|
+
};
|
|
147
|
+
break;
|
|
148
|
+
case "faucet_requestAirdrop":
|
|
149
|
+
result = {
|
|
150
|
+
attemptStatus: "succeeded",
|
|
151
|
+
recipient: params.recipient,
|
|
152
|
+
rawAmount: "100000000",
|
|
153
|
+
transactionHash: this.#blockHash(this.#height),
|
|
154
|
+
blockHeight: stateBlockHeight,
|
|
155
|
+
execution: {
|
|
156
|
+
result: "return",
|
|
157
|
+
returnData: "0x"
|
|
158
|
+
}
|
|
159
|
+
};
|
|
160
|
+
break;
|
|
161
|
+
case "sendTransaction": {
|
|
162
|
+
const hash = (0, _thruputchain_protocol_utils.toBase58)(require_transactionHash.hashSignedTransaction((0, _thruputchain_protocol.deserialize)(require_hex.fromHex0x(String(params.signedTransaction)), _thruputchain_protocol.codec.SignedTransaction)));
|
|
163
|
+
if (!this.#transactions.has(hash)) this.#transactions.set(hash, ++this.#height);
|
|
164
|
+
result = {
|
|
165
|
+
transactionHash: hash,
|
|
166
|
+
admission: "accepted"
|
|
167
|
+
};
|
|
168
|
+
break;
|
|
169
|
+
}
|
|
170
|
+
case "getTransactionReceipt": {
|
|
171
|
+
const height = this.#transactions.get(String(params.transactionHash));
|
|
172
|
+
result = height === void 0 ? null : {
|
|
173
|
+
transactionHash: params.transactionHash,
|
|
174
|
+
blockHeight: height.toString(),
|
|
175
|
+
execution: {
|
|
176
|
+
result: "return",
|
|
177
|
+
returnData: "0x"
|
|
178
|
+
},
|
|
179
|
+
events: [],
|
|
180
|
+
gasUsed: "0"
|
|
181
|
+
};
|
|
182
|
+
break;
|
|
183
|
+
}
|
|
184
|
+
case "getTransactionStatus": {
|
|
185
|
+
const height = this.#transactions.get(String(params.transactionHash));
|
|
186
|
+
result = height === void 0 ? { status: "unknown" } : {
|
|
187
|
+
status: "committed",
|
|
188
|
+
blockHeight: height.toString()
|
|
189
|
+
};
|
|
190
|
+
break;
|
|
191
|
+
}
|
|
192
|
+
case "getEvents":
|
|
193
|
+
result = {
|
|
194
|
+
...bounds,
|
|
195
|
+
events: []
|
|
196
|
+
};
|
|
197
|
+
break;
|
|
198
|
+
case "getTransactionsByRootAddress":
|
|
199
|
+
case "getTransactionsByBlock":
|
|
200
|
+
result = {
|
|
201
|
+
...bounds,
|
|
202
|
+
transactions: []
|
|
203
|
+
};
|
|
204
|
+
break;
|
|
205
|
+
case "getBlockByHeight": {
|
|
206
|
+
const height = BigInt(String(params.blockHeight));
|
|
207
|
+
result = height <= 0n || height > this.#height ? null : {
|
|
208
|
+
blockHash: this.#blockHash(height),
|
|
209
|
+
protocol: 0,
|
|
210
|
+
networkHash: "1".repeat(32),
|
|
211
|
+
proposer: "1".repeat(32),
|
|
212
|
+
blockTimepoint: "0",
|
|
213
|
+
blockHeight: height.toString(),
|
|
214
|
+
txsHash: this.#blockHash(height),
|
|
215
|
+
storageHash: this.#blockHash(height),
|
|
216
|
+
eventsHash: this.#blockHash(height),
|
|
217
|
+
configHash: this.#blockHash(height),
|
|
218
|
+
prevBlockHash: this.#blockHash(height - 1n),
|
|
219
|
+
proposalTxsHash: this.#blockHash(height),
|
|
220
|
+
upgrades: []
|
|
221
|
+
};
|
|
222
|
+
break;
|
|
223
|
+
}
|
|
224
|
+
default: throw new Error(`MockTransport: method not implemented: ${method}`);
|
|
225
|
+
}
|
|
226
|
+
return result;
|
|
227
|
+
}
|
|
228
|
+
#blockHash(height) {
|
|
229
|
+
const bytes = new Uint8Array(32);
|
|
230
|
+
new DataView(bytes.buffer).setBigUint64(24, height);
|
|
231
|
+
return (0, _thruputchain_protocol_utils.toBase58)(bytes);
|
|
232
|
+
}
|
|
233
|
+
};
|
|
234
|
+
//#endregion
|
|
235
|
+
//#region src/transport/txInvalidDetail.ts
|
|
236
|
+
/** Read known transaction-bound evidence without inferring retry permission. */
|
|
237
|
+
function txInvalidDetail(error) {
|
|
238
|
+
if (!(error instanceof require_readError.NativeRpcError) || error.decoded.classification !== "known" || error.decoded.data.kind !== "transactionInvalid") return null;
|
|
239
|
+
const detail = error.decoded.data.detail;
|
|
240
|
+
return !detail || detail instanceof require_codec.UnsupportedRpcValue ? null : detail;
|
|
241
|
+
}
|
|
242
|
+
//#endregion
|
|
243
|
+
//#region src/rpc/errors.ts
|
|
244
|
+
/** Native causes. Codes alone never grant write retry permission. */
|
|
245
|
+
const NativeRpcErrorCode = {
|
|
246
|
+
BackendDataInvalid: -32054,
|
|
247
|
+
BackendTimeout: -32051,
|
|
248
|
+
BackendUnavailable: -32050,
|
|
249
|
+
ContractArtifactUnavailable: -32014,
|
|
250
|
+
FundingAttemptStopped: -32030,
|
|
251
|
+
HistoryUnavailable: -32013,
|
|
252
|
+
InvalidParams: -32602,
|
|
253
|
+
LocalFundingUnresolved: -32031,
|
|
254
|
+
Overloaded: -32053,
|
|
255
|
+
StateHeightUnavailable: -32012,
|
|
256
|
+
TransactionInvalid: -32e3,
|
|
257
|
+
TransactionRejected: -32001
|
|
258
|
+
};
|
|
259
|
+
//#endregion
|
|
260
|
+
Object.defineProperty(exports, "MockTransport", {
|
|
261
|
+
enumerable: true,
|
|
262
|
+
get: function() {
|
|
263
|
+
return MockTransport;
|
|
264
|
+
}
|
|
265
|
+
});
|
|
266
|
+
Object.defineProperty(exports, "NativeRpcErrorCode", {
|
|
267
|
+
enumerable: true,
|
|
268
|
+
get: function() {
|
|
269
|
+
return NativeRpcErrorCode;
|
|
270
|
+
}
|
|
271
|
+
});
|
|
272
|
+
Object.defineProperty(exports, "txInvalidDetail", {
|
|
273
|
+
enumerable: true,
|
|
274
|
+
get: function() {
|
|
275
|
+
return txInvalidDetail;
|
|
276
|
+
}
|
|
277
|
+
});
|
|
278
|
+
|
|
279
|
+
//# sourceMappingURL=transport-tWxKhXUt.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transport-tWxKhXUt.cjs","names":["#height","#blockHash","JsonRpcError","hashSignedTransaction","fromHex0x","codec","#transactions","NativeRpcError","UnsupportedRpcValue"],"sources":["../src/transport/mock.ts","../src/transport/txInvalidDetail.ts","../src/rpc/errors.ts"],"sourcesContent":["import type { Transport, RpcParams, TransportRequestOptions } from \"./types.js\";\nimport { codec, deserialize } from \"@thruputchain/protocol\";\nimport { toBase58 } from \"../encoding.js\";\nimport { fromHex0x } from \"../actions/hex.js\";\nimport { hashSignedTransaction } from \"../derivation/transactionHash.js\";\nimport { JsonRpcError } from \"./http.js\";\n\nconst methods = [\n \"getVersionInfo\",\n \"getNetworkInfo\",\n \"getChainTip\",\n \"getChainConfig\",\n \"getServerLimits\",\n \"getBalance\",\n \"getRegisteredAuth\",\n \"getContractDeployment\",\n \"getEffectiveContract\",\n \"getContractArtifact\",\n \"getBlockByHeight\",\n \"dev_getPendingTransactionCount\",\n \"simulateInvocation\",\n \"simulateInvocations\",\n \"sendTransaction\",\n \"getTransactionReceipt\",\n \"getTransactionInput\",\n \"getTransactionStatus\",\n \"getTransactionsByRootAddress\",\n \"getTransactionsByBlock\",\n \"getEvents\",\n \"getStorage\",\n \"faucet_requestAirdrop\",\n];\n/** Deterministic native RPC transport for examples; it does not execute contract code. */\nexport class MockTransport implements Transport {\n #height = 0n;\n #transactions = new Map<string, bigint>();\n async request<T = unknown>(\n method: string,\n params: RpcParams = {},\n options?: TransportRequestOptions,\n ): Promise<T> {\n options?.signal?.throwIfAborted();\n if (Array.isArray(params))\n throw new TypeError(\"Native RPC params must be a named object\");\n const stateBlockHeight = this.#height.toString();\n const bounds = {\n oldestIndexedBlockHeight: \"0\",\n latestIndexedBlockHeight: stateBlockHeight,\n nextCursor: null,\n };\n const simulation = {\n output: { result: \"return\", returnData: \"0x\" },\n events: [],\n gasUsed: \"0\",\n };\n let result: unknown;\n switch (method) {\n case \"getTransactionInput\":\n result = { status: \"unavailable\" };\n break;\n case \"getVersionInfo\":\n result = {\n wireFormat: \"14.4.0\",\n implementation: \"mock\",\n supportedMethods: [...methods],\n };\n break;\n case \"getNetworkInfo\":\n result = { networkHash: \"1\".repeat(32) };\n break;\n case \"getChainTip\":\n result = {\n blockHeight: stateBlockHeight,\n blockHash: this.#blockHash(this.#height),\n };\n break;\n case \"getChainConfig\":\n result = { stated: { maxNewContractsPerTx: 4 } };\n break;\n case \"getServerLimits\":\n result = {\n maxSimulationGas: \"100000000\",\n maxSimulationCalldataBytes: \"65536\",\n maxEventsPerPage: 200,\n maxTransactionsPerPage: 200,\n maxCursorBytes: \"1024\",\n simulationBatch: {\n maxInvocations: 16,\n maxCalldataBytes: 65536,\n maxGas: \"1600000000\",\n maxBackendResponseBytes: 1000000,\n timeoutMs: \"3000\",\n },\n };\n break;\n case \"getBalance\":\n result = { address: params.address, rawBalance: \"0\", stateBlockHeight };\n break;\n case \"getRegisteredAuth\":\n result = {\n address: params.address,\n configuration: null,\n stateBlockHeight,\n };\n break;\n case \"getStorage\":\n result = { item: null, stateBlockHeight };\n break;\n case \"getContractDeployment\":\n result = {\n address: params.address,\n stateBlockHeight,\n deployment: null,\n };\n break;\n case \"getEffectiveContract\":\n result = {\n address: params.address,\n context: params.context,\n stateBlockHeight,\n selection: null,\n };\n break;\n case \"getContractArtifact\":\n throw new JsonRpcError(\n -32014,\n \"Contract artifact unavailable\",\n {\n kind: \"contractArtifactUnavailable\",\n hash: params.hash,\n },\n method,\n );\n case \"dev_getPendingTransactionCount\":\n result = { count: \"0\" };\n break;\n case \"simulateInvocation\":\n result = { ...simulation, stateBlockHeight };\n break;\n case \"simulateInvocations\":\n result = {\n stateBlockHeight,\n results: (params.invocations as unknown[]).map(() =>\n structuredClone(simulation),\n ),\n };\n break;\n case \"faucet_requestAirdrop\":\n result = {\n attemptStatus: \"succeeded\",\n recipient: params.recipient,\n rawAmount: \"100000000\",\n transactionHash: this.#blockHash(this.#height),\n blockHeight: stateBlockHeight,\n execution: { result: \"return\", returnData: \"0x\" },\n };\n break;\n case \"sendTransaction\": {\n const signed = deserialize(\n fromHex0x(String(params.signedTransaction)),\n codec.SignedTransaction,\n );\n const hash = toBase58(hashSignedTransaction(signed));\n if (!this.#transactions.has(hash))\n this.#transactions.set(hash, ++this.#height);\n result = { transactionHash: hash, admission: \"accepted\" };\n break;\n }\n case \"getTransactionReceipt\": {\n const height = this.#transactions.get(String(params.transactionHash));\n result =\n height === undefined\n ? null\n : {\n transactionHash: params.transactionHash,\n blockHeight: height.toString(),\n execution: { result: \"return\", returnData: \"0x\" },\n events: [],\n gasUsed: \"0\",\n };\n break;\n }\n case \"getTransactionStatus\": {\n const height = this.#transactions.get(String(params.transactionHash));\n result =\n height === undefined\n ? { status: \"unknown\" }\n : { status: \"committed\", blockHeight: height.toString() };\n break;\n }\n case \"getEvents\":\n result = { ...bounds, events: [] };\n break;\n case \"getTransactionsByRootAddress\":\n case \"getTransactionsByBlock\":\n result = { ...bounds, transactions: [] };\n break;\n case \"getBlockByHeight\": {\n const height = BigInt(String(params.blockHeight));\n result =\n height <= 0n || height > this.#height\n ? null\n : {\n blockHash: this.#blockHash(height),\n protocol: 0,\n networkHash: \"1\".repeat(32),\n proposer: \"1\".repeat(32),\n blockTimepoint: \"0\",\n blockHeight: height.toString(),\n txsHash: this.#blockHash(height),\n storageHash: this.#blockHash(height),\n eventsHash: this.#blockHash(height),\n configHash: this.#blockHash(height),\n prevBlockHash: this.#blockHash(height - 1n),\n proposalTxsHash: this.#blockHash(height),\n upgrades: [],\n };\n break;\n }\n default:\n throw new Error(`MockTransport: method not implemented: ${method}`);\n }\n return result as T;\n }\n #blockHash(height: bigint): string {\n const bytes = new Uint8Array(32);\n new DataView(bytes.buffer).setBigUint64(24, height);\n return toBase58(bytes);\n }\n}\n","import { NativeRpcError } from \"../rpc/errorReader.js\";\nimport { UnsupportedRpcValue } from \"../rpc/codec.js\";\nimport type { RpcErrorData } from \"../rpc/generated.js\";\n/** A validated native admission bound violation. Unknown details remain on the raw error. */\nexport type TxInvalidDetail = Exclude<\n NonNullable<Extract<RpcErrorData, { kind: \"transactionInvalid\" }>[\"detail\"]>,\n UnsupportedRpcValue\n>;\n/** Read known transaction-bound evidence without inferring retry permission. */\nexport function txInvalidDetail(error: unknown): TxInvalidDetail | null {\n if (\n !(error instanceof NativeRpcError) ||\n error.decoded.classification !== \"known\" ||\n error.decoded.data.kind !== \"transactionInvalid\"\n )\n return null;\n const detail = error.decoded.data.detail;\n return !detail || detail instanceof UnsupportedRpcValue ? null : detail;\n}\n","// Generated from the Rust-owned native OpenRPC fixture. Do not edit.\n/** Native causes. Codes alone never grant write retry permission. */\nexport const NativeRpcErrorCode = {\n BackendDataInvalid: -32054,\n BackendTimeout: -32051,\n BackendUnavailable: -32050,\n ContractArtifactUnavailable: -32014,\n FundingAttemptStopped: -32030,\n HistoryUnavailable: -32013,\n InvalidParams: -32602,\n LocalFundingUnresolved: -32031,\n Overloaded: -32053,\n StateHeightUnavailable: -32012,\n TransactionInvalid: -32000,\n TransactionRejected: -32001,\n} as const;\n"],"mappings":";;;;;;;AAOA,MAAM,UAAU;CACd;CACA;CACA;CACA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CAClC,OAAO,CAAC,UAAU,kBAAkBC,cAAAA,sBAAsB,OAAO;AACnE;;;;AChBA,MAAa,qBAAqB;CAChC,oBAAoB;CACpB,gBAAgB;CAChB,oBAAoB;CACpB,6BAA6B;CAC7B,uBAAuB;CACvB,oBAAoB;CACpB,eAAe;CACf,wBAAwB;CACxB,YAAY;CACZ,wBAAwB;CACxB,oBAAoB;CACpB,qBAAqB;AACvB"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_codec = require("./codec-C3OlYm98.cjs");
|
|
3
|
+
const require_readError = require("./readError-AoNjzW75.cjs");
|
|
4
|
+
const require_transport = require("./transport-tWxKhXUt.cjs");
|
|
5
|
+
exports.HttpRequestError = require_readError.HttpRequestError;
|
|
6
|
+
exports.HttpResponseError = require_readError.HttpResponseError;
|
|
7
|
+
exports.HttpTransport = require_readError.HttpTransport;
|
|
8
|
+
exports.JsonRpcError = require_readError.JsonRpcError;
|
|
9
|
+
exports.MockTransport = require_transport.MockTransport;
|
|
10
|
+
exports.NativeRpcError = require_readError.NativeRpcError;
|
|
11
|
+
exports.NativeRpcErrorCode = require_transport.NativeRpcErrorCode;
|
|
12
|
+
exports.RpcCompatibilityError = require_readError.RpcCompatibilityError;
|
|
13
|
+
exports.RpcDecodingError = require_codec.RpcDecodingError;
|
|
14
|
+
exports.RpcRequestValidationError = require_codec.RpcRequestValidationError;
|
|
15
|
+
exports.RpcResponseError = require_readError.RpcResponseError;
|
|
16
|
+
exports.UnsupportedRpcValue = require_codec.UnsupportedRpcValue;
|
|
17
|
+
exports.classifyReadError = require_readError.classifyReadError;
|
|
18
|
+
exports.createRpcClient = require_readError.createRpcClient;
|
|
19
|
+
exports.txInvalidDetail = require_transport.txInvalidDetail;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { $ as RpcPublicKey, A as RpcContractDeploymentResult, B as RpcEventPage, C as RpcChainConfig, Ct as RpcDecodingError, D as RpcConflictDiagnostic, Dt as Transport, E as RpcConflictCode, Et as RpcParams, F as RpcEffectiveContract, G as RpcIdentifiedEvent, H as RpcFailureCause, I as RpcEffectiveContractResult, J as RpcInvocationOutput, K as RpcInvocation, L as RpcEmittedEvent, M as RpcDecimalTimePoint, N as RpcDecimalU64, O as RpcContractArtifactResult, Ot as TransportRequestOptions, P as RpcDescendingAnchor, Q as RpcPendingTransactionCount, R as RpcErrorData, S as RpcBlockStart, St as RpcVersionInfo, T as RpcConfigLimits, Tt as UnsupportedRpcValue, U as RpcFundingSubmission, V as RpcExecutionConfig, W as RpcHistoryStart, X as RpcIterationOrder, Y as RpcInvocationResult, Z as RpcNetworkInfo, _ as RpcBase58_Ed25519PublicKey, _t as RpcTransactionReceipt, a as RpcMethod, at as RpcSchedulerError, b as RpcBase58_ValidatorID, bt as RpcTransactionStatus, c as RpcAdmission, ct as RpcServerLimits, d as RpcAscendingAnchor, dt as RpcSimulationResults, et as RpcReceiptExecution, f as RpcAssumedAuth, ft as RpcStorageCosts, g as RpcBase58_ContractAddress, gt as RpcTransactionInputResult, h as RpcBalanceResult, ht as RpcTopicFilter, i as RpcDiscovery, it as RpcResults, j as RpcContractRejectCode, k as RpcContractDeployment, l as RpcAirdropAttempt, lt as RpcSimulationBatchLimits, m as RpcAuthSigner, mt as RpcStorageResult, n as RpcClientOptions, nt as RpcRegisteredAuthResult, o as RpcMethods, ot as RpcSchedulerErrorSource, p as RpcAuthConfiguration, pt as RpcStorageItem, q as RpcInvocationContext, r as RpcCompatibilityError, rt as RpcRequests, s as createRpcClient, st as RpcSendTransactionResult, t as RpcClient, tt as RpcRecentAttemptFailure, u as RpcAirdropExecution, ut as RpcSimulationResult, v as RpcBase58_PublicKeyHash, vt as RpcTransactionRef, w as RpcChainTip, wt as RpcRequestValidationError, x as RpcBlockInfo, xt as RpcTxHash, y as RpcBase58_SHA256Hash, yt as RpcTransactionRefPage, z as RpcEventFilter } from "./client-JixxskeH.cjs";
|
|
2
|
+
import { a as TxInvalidDetail, c as classifyReadError, d as HttpRequestError, f as HttpResponseError, h as JsonRpcError, i as NativeRpcErrorCode, l as MockTransport, m as HttpTransportOptions, n as DecodedRpcError, o as txInvalidDetail, p as HttpTransport, r as NativeRpcError, s as ReadErrorKind, t as RpcResponseError, u as HttpBatchOptions } from "./index-BraLWObY.cjs";
|
|
3
|
+
export { type DecodedRpcError, type HttpBatchOptions, HttpRequestError, HttpResponseError, HttpTransport, type HttpTransportOptions, JsonRpcError, MockTransport, NativeRpcError, NativeRpcErrorCode, type ReadErrorKind, type RpcAdmission, type RpcAirdropAttempt, type RpcAirdropExecution, type RpcAscendingAnchor, type RpcAssumedAuth, type RpcAuthConfiguration, type RpcAuthSigner, type RpcBalanceResult, type RpcBase58_ContractAddress, type RpcBase58_Ed25519PublicKey, type RpcBase58_PublicKeyHash, type RpcBase58_SHA256Hash, type RpcBase58_ValidatorID, type RpcBlockInfo, type RpcBlockStart, type RpcChainConfig, type RpcChainTip, type RpcClient, type RpcClientOptions, RpcCompatibilityError, type RpcConfigLimits, type RpcConflictCode, type RpcConflictDiagnostic, type RpcContractArtifactResult, type RpcContractDeployment, type RpcContractDeploymentResult, type RpcContractRejectCode, type RpcDecimalTimePoint, type RpcDecimalU64, RpcDecodingError, type RpcDescendingAnchor, type RpcDiscovery, type RpcEffectiveContract, type RpcEffectiveContractResult, type RpcEmittedEvent, type RpcErrorData, type RpcEventFilter, type RpcEventPage, type RpcExecutionConfig, type RpcFailureCause, type RpcFundingSubmission, type RpcHistoryStart, type RpcIdentifiedEvent, type RpcInvocation, type RpcInvocationContext, type RpcInvocationOutput, type RpcInvocationResult, type RpcIterationOrder, type RpcMethod, type RpcMethods, type RpcNetworkInfo, type RpcParams, type RpcPendingTransactionCount, type RpcPublicKey, type RpcReceiptExecution, type RpcRecentAttemptFailure, type RpcRegisteredAuthResult, RpcRequestValidationError, type RpcRequests, RpcResponseError, type RpcResults, type RpcSchedulerError, type RpcSchedulerErrorSource, type RpcSendTransactionResult, type RpcServerLimits, type RpcSimulationBatchLimits, type RpcSimulationResult, type RpcSimulationResults, type RpcStorageCosts, type RpcStorageItem, type RpcStorageResult, type RpcTopicFilter, type RpcTransactionInputResult, type RpcTransactionReceipt, type RpcTransactionRef, type RpcTransactionRefPage, type RpcTransactionStatus, type RpcTxHash, type RpcVersionInfo, type Transport, type TransportRequestOptions, type TxInvalidDetail, UnsupportedRpcValue, classifyReadError, createRpcClient, txInvalidDetail };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { $ as RpcPublicKey, A as RpcContractDeploymentResult, B as RpcEventPage, C as RpcChainConfig, Ct as RpcDecodingError, D as RpcConflictDiagnostic, Dt as Transport, E as RpcConflictCode, Et as RpcParams, F as RpcEffectiveContract, G as RpcIdentifiedEvent, H as RpcFailureCause, I as RpcEffectiveContractResult, J as RpcInvocationOutput, K as RpcInvocation, L as RpcEmittedEvent, M as RpcDecimalTimePoint, N as RpcDecimalU64, O as RpcContractArtifactResult, Ot as TransportRequestOptions, P as RpcDescendingAnchor, Q as RpcPendingTransactionCount, R as RpcErrorData, S as RpcBlockStart, St as RpcVersionInfo, T as RpcConfigLimits, Tt as UnsupportedRpcValue, U as RpcFundingSubmission, V as RpcExecutionConfig, W as RpcHistoryStart, X as RpcIterationOrder, Y as RpcInvocationResult, Z as RpcNetworkInfo, _ as RpcBase58_Ed25519PublicKey, _t as RpcTransactionReceipt, a as RpcMethod, at as RpcSchedulerError, b as RpcBase58_ValidatorID, bt as RpcTransactionStatus, c as RpcAdmission, ct as RpcServerLimits, d as RpcAscendingAnchor, dt as RpcSimulationResults, et as RpcReceiptExecution, f as RpcAssumedAuth, ft as RpcStorageCosts, g as RpcBase58_ContractAddress, gt as RpcTransactionInputResult, h as RpcBalanceResult, ht as RpcTopicFilter, i as RpcDiscovery, it as RpcResults, j as RpcContractRejectCode, k as RpcContractDeployment, l as RpcAirdropAttempt, lt as RpcSimulationBatchLimits, m as RpcAuthSigner, mt as RpcStorageResult, n as RpcClientOptions, nt as RpcRegisteredAuthResult, o as RpcMethods, ot as RpcSchedulerErrorSource, p as RpcAuthConfiguration, pt as RpcStorageItem, q as RpcInvocationContext, r as RpcCompatibilityError, rt as RpcRequests, s as createRpcClient, st as RpcSendTransactionResult, t as RpcClient, tt as RpcRecentAttemptFailure, u as RpcAirdropExecution, ut as RpcSimulationResult, v as RpcBase58_PublicKeyHash, vt as RpcTransactionRef, w as RpcChainTip, wt as RpcRequestValidationError, x as RpcBlockInfo, xt as RpcTxHash, y as RpcBase58_SHA256Hash, yt as RpcTransactionRefPage, z as RpcEventFilter } from "./client-JixxskeH.js";
|
|
2
|
+
import { a as TxInvalidDetail, c as classifyReadError, d as HttpRequestError, f as HttpResponseError, h as JsonRpcError, i as NativeRpcErrorCode, l as MockTransport, m as HttpTransportOptions, n as DecodedRpcError, o as txInvalidDetail, p as HttpTransport, r as NativeRpcError, s as ReadErrorKind, t as RpcResponseError, u as HttpBatchOptions } from "./index-ByvV2UF6.js";
|
|
3
|
+
export { type DecodedRpcError, type HttpBatchOptions, HttpRequestError, HttpResponseError, HttpTransport, type HttpTransportOptions, JsonRpcError, MockTransport, NativeRpcError, NativeRpcErrorCode, type ReadErrorKind, type RpcAdmission, type RpcAirdropAttempt, type RpcAirdropExecution, type RpcAscendingAnchor, type RpcAssumedAuth, type RpcAuthConfiguration, type RpcAuthSigner, type RpcBalanceResult, type RpcBase58_ContractAddress, type RpcBase58_Ed25519PublicKey, type RpcBase58_PublicKeyHash, type RpcBase58_SHA256Hash, type RpcBase58_ValidatorID, type RpcBlockInfo, type RpcBlockStart, type RpcChainConfig, type RpcChainTip, type RpcClient, type RpcClientOptions, RpcCompatibilityError, type RpcConfigLimits, type RpcConflictCode, type RpcConflictDiagnostic, type RpcContractArtifactResult, type RpcContractDeployment, type RpcContractDeploymentResult, type RpcContractRejectCode, type RpcDecimalTimePoint, type RpcDecimalU64, RpcDecodingError, type RpcDescendingAnchor, type RpcDiscovery, type RpcEffectiveContract, type RpcEffectiveContractResult, type RpcEmittedEvent, type RpcErrorData, type RpcEventFilter, type RpcEventPage, type RpcExecutionConfig, type RpcFailureCause, type RpcFundingSubmission, type RpcHistoryStart, type RpcIdentifiedEvent, type RpcInvocation, type RpcInvocationContext, type RpcInvocationOutput, type RpcInvocationResult, type RpcIterationOrder, type RpcMethod, type RpcMethods, type RpcNetworkInfo, type RpcParams, type RpcPendingTransactionCount, type RpcPublicKey, type RpcReceiptExecution, type RpcRecentAttemptFailure, type RpcRegisteredAuthResult, RpcRequestValidationError, type RpcRequests, RpcResponseError, type RpcResults, type RpcSchedulerError, type RpcSchedulerErrorSource, type RpcSendTransactionResult, type RpcServerLimits, type RpcSimulationBatchLimits, type RpcSimulationResult, type RpcSimulationResults, type RpcStorageCosts, type RpcStorageItem, type RpcStorageResult, type RpcTopicFilter, type RpcTransactionInputResult, type RpcTransactionReceipt, type RpcTransactionRef, type RpcTransactionRefPage, type RpcTransactionStatus, type RpcTxHash, type RpcVersionInfo, type Transport, type TransportRequestOptions, type TxInvalidDetail, UnsupportedRpcValue, classifyReadError, createRpcClient, txInvalidDetail };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { n as RpcRequestValidationError, r as UnsupportedRpcValue, t as RpcDecodingError } from "./codec-BHKoSaOP.js";
|
|
2
|
+
import { a as HttpRequestError, c as JsonRpcError, i as NativeRpcError, l as RpcResponseError, n as RpcCompatibilityError, o as HttpResponseError, r as createRpcClient, s as HttpTransport, t as classifyReadError } from "./readError-CZPYcW__.js";
|
|
3
|
+
import { n as txInvalidDetail, r as MockTransport, t as NativeRpcErrorCode } from "./transport-CBFwAIIv.js";
|
|
4
|
+
export { HttpRequestError, HttpResponseError, HttpTransport, JsonRpcError, MockTransport, NativeRpcError, NativeRpcErrorCode, RpcCompatibilityError, RpcDecodingError, RpcRequestValidationError, RpcResponseError, UnsupportedRpcValue, classifyReadError, createRpcClient, txInvalidDetail };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { PublicKey, Signature } from "@thruputchain/protocol";
|
|
2
|
+
|
|
3
|
+
//#region src/signers/types.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Interface for signing canonical transaction bytes.
|
|
6
|
+
*
|
|
7
|
+
* Implement this interface to connect the SDK to a wallet, hardware signer,
|
|
8
|
+
* remote signer, or custom key-management system.
|
|
9
|
+
*/
|
|
10
|
+
interface Signer {
|
|
11
|
+
/** Sign an arbitrary byte message and return a protocol signature. */
|
|
12
|
+
sign(message: Uint8Array): Promise<Signature>;
|
|
13
|
+
/** Public key corresponding to signatures produced by this signer. */
|
|
14
|
+
publicKey: PublicKey;
|
|
15
|
+
}
|
|
16
|
+
//#endregion
|
|
17
|
+
export { Signer as t };
|
|
18
|
+
//# sourceMappingURL=types-BE40oD_Q.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types-BE40oD_Q.d.cts","names":[],"sources":["../src/signers/types.ts"],"mappings":";;;;;AAQA;;;;UAAiB,MAAA;EAEY;EAA3B,IAAA,CAAK,OAAA,EAAS,UAAA,GAAa,OAAA,CAAQ,SAAA;EAGf;EAApB,SAAA,EAAW,SAAA;AAAA"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { PublicKey, Signature } from "@thruputchain/protocol";
|
|
2
|
+
|
|
3
|
+
//#region src/signers/types.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Interface for signing canonical transaction bytes.
|
|
6
|
+
*
|
|
7
|
+
* Implement this interface to connect the SDK to a wallet, hardware signer,
|
|
8
|
+
* remote signer, or custom key-management system.
|
|
9
|
+
*/
|
|
10
|
+
interface Signer {
|
|
11
|
+
/** Sign an arbitrary byte message and return a protocol signature. */
|
|
12
|
+
sign(message: Uint8Array): Promise<Signature>;
|
|
13
|
+
/** Public key corresponding to signatures produced by this signer. */
|
|
14
|
+
publicKey: PublicKey;
|
|
15
|
+
}
|
|
16
|
+
//#endregion
|
|
17
|
+
export { Signer as t };
|
|
18
|
+
//# sourceMappingURL=types-BE40oD_Q.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types-BE40oD_Q.d.ts","names":[],"sources":["../src/signers/types.ts"],"mappings":";;;;;AAQA;;;;UAAiB,MAAA;EAEY;EAA3B,IAAA,CAAK,OAAA,EAAS,UAAA,GAAa,OAAA,CAAQ,SAAA;EAGf;EAApB,SAAA,EAAW,SAAA;AAAA"}
|