@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.
Files changed (186) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +953 -2
  3. package/dist/actions-CXx6qzsv.cjs +513 -0
  4. package/dist/actions-CXx6qzsv.cjs.map +1 -0
  5. package/dist/actions-QHgiCqT6.js +430 -0
  6. package/dist/actions-QHgiCqT6.js.map +1 -0
  7. package/dist/actions.cjs +23 -0
  8. package/dist/actions.d.cts +4 -0
  9. package/dist/actions.d.ts +4 -0
  10. package/dist/actions.js +3 -0
  11. package/dist/artifact-BM_MVzhL.d.cts +35 -0
  12. package/dist/artifact-BM_MVzhL.d.cts.map +1 -0
  13. package/dist/artifact-BM_MVzhL.d.ts +35 -0
  14. package/dist/artifact-BM_MVzhL.d.ts.map +1 -0
  15. package/dist/client-JixxskeH.d.cts +746 -0
  16. package/dist/client-JixxskeH.d.cts.map +1 -0
  17. package/dist/client-JixxskeH.d.ts +746 -0
  18. package/dist/client-JixxskeH.d.ts.map +1 -0
  19. package/dist/codec-BHKoSaOP.js +9506 -0
  20. package/dist/codec-BHKoSaOP.js.map +1 -0
  21. package/dist/codec-C3OlYm98.cjs +9566 -0
  22. package/dist/codec-C3OlYm98.cjs.map +1 -0
  23. package/dist/contract-C7T2H2Oi.cjs +1628 -0
  24. package/dist/contract-C7T2H2Oi.cjs.map +1 -0
  25. package/dist/contract-DzvyyFCI.js +1472 -0
  26. package/dist/contract-DzvyyFCI.js.map +1 -0
  27. package/dist/contract.cjs +63 -0
  28. package/dist/contract.d.cts +4 -0
  29. package/dist/contract.d.ts +4 -0
  30. package/dist/contract.js +2 -0
  31. package/dist/contracts.cjs +1050 -0
  32. package/dist/contracts.cjs.map +1 -0
  33. package/dist/contracts.d.cts +397 -0
  34. package/dist/contracts.d.cts.map +1 -0
  35. package/dist/contracts.d.ts +397 -0
  36. package/dist/contracts.d.ts.map +1 -0
  37. package/dist/contracts.js +1030 -0
  38. package/dist/contracts.js.map +1 -0
  39. package/dist/dev_wallet-CSMA1PCt.js +497 -0
  40. package/dist/dev_wallet-CSMA1PCt.js.map +1 -0
  41. package/dist/dev_wallet-GX-NCAFk.cjs +530 -0
  42. package/dist/dev_wallet-GX-NCAFk.cjs.map +1 -0
  43. package/dist/domainSeparator-B_vU_zUD.cjs +102 -0
  44. package/dist/domainSeparator-B_vU_zUD.cjs.map +1 -0
  45. package/dist/domainSeparator-CBCvxIj-.js +79 -0
  46. package/dist/domainSeparator-CBCvxIj-.js.map +1 -0
  47. package/dist/execution-DYqPDn4O.d.cts +227 -0
  48. package/dist/execution-DYqPDn4O.d.cts.map +1 -0
  49. package/dist/execution-Dj6E4B_b.d.ts +227 -0
  50. package/dist/execution-Dj6E4B_b.d.ts.map +1 -0
  51. package/dist/hex-DIcaALXL.js +112 -0
  52. package/dist/hex-DIcaALXL.js.map +1 -0
  53. package/dist/hex-DkGpiZ5e.cjs +189 -0
  54. package/dist/hex-DkGpiZ5e.cjs.map +1 -0
  55. package/dist/index--5LsCotr.d.ts +192 -0
  56. package/dist/index--5LsCotr.d.ts.map +1 -0
  57. package/dist/index-1-rFirYe.d.cts +90 -0
  58. package/dist/index-1-rFirYe.d.cts.map +1 -0
  59. package/dist/index-B5KqSHeL.d.cts +192 -0
  60. package/dist/index-B5KqSHeL.d.cts.map +1 -0
  61. package/dist/index-BraLWObY.d.cts +164 -0
  62. package/dist/index-BraLWObY.d.cts.map +1 -0
  63. package/dist/index-ByNNqY7S.d.cts +83 -0
  64. package/dist/index-ByNNqY7S.d.cts.map +1 -0
  65. package/dist/index-ByvV2UF6.d.ts +164 -0
  66. package/dist/index-ByvV2UF6.d.ts.map +1 -0
  67. package/dist/index-CG2WRtGa.d.cts +164 -0
  68. package/dist/index-CG2WRtGa.d.cts.map +1 -0
  69. package/dist/index-CIHK7Ew9.d.cts +303 -0
  70. package/dist/index-CIHK7Ew9.d.cts.map +1 -0
  71. package/dist/index-CIHK7Ew9.d.ts +303 -0
  72. package/dist/index-CIHK7Ew9.d.ts.map +1 -0
  73. package/dist/index-CVrhB9Dr.d.cts +263 -0
  74. package/dist/index-CVrhB9Dr.d.cts.map +1 -0
  75. package/dist/index-D89ur7mO.d.ts +164 -0
  76. package/dist/index-D89ur7mO.d.ts.map +1 -0
  77. package/dist/index-DzrLv3EA.d.cts +82 -0
  78. package/dist/index-DzrLv3EA.d.cts.map +1 -0
  79. package/dist/index-DzrLv3EA.d.ts +82 -0
  80. package/dist/index-DzrLv3EA.d.ts.map +1 -0
  81. package/dist/index-SV-inhhO.d.ts +90 -0
  82. package/dist/index-SV-inhhO.d.ts.map +1 -0
  83. package/dist/index-dJ65V8se.d.ts +263 -0
  84. package/dist/index-dJ65V8se.d.ts.map +1 -0
  85. package/dist/index-fdTURpBk.d.ts +83 -0
  86. package/dist/index-fdTURpBk.d.ts.map +1 -0
  87. package/dist/index.cjs +445 -0
  88. package/dist/index.cjs.map +1 -0
  89. package/dist/index.d.cts +174 -0
  90. package/dist/index.d.cts.map +1 -0
  91. package/dist/index.d.ts +174 -0
  92. package/dist/index.d.ts.map +1 -0
  93. package/dist/index.js +189 -0
  94. package/dist/index.js.map +1 -0
  95. package/dist/provider.cjs +101 -0
  96. package/dist/provider.cjs.map +1 -0
  97. package/dist/provider.d.cts +2 -0
  98. package/dist/provider.d.ts +2 -0
  99. package/dist/provider.js +76 -0
  100. package/dist/provider.js.map +1 -0
  101. package/dist/readError-AoNjzW75.cjs +604 -0
  102. package/dist/readError-AoNjzW75.cjs.map +1 -0
  103. package/dist/readError-CZPYcW__.js +551 -0
  104. package/dist/readError-CZPYcW__.js.map +1 -0
  105. package/dist/readViews-DJyqc7im.d.cts +604 -0
  106. package/dist/readViews-DJyqc7im.d.cts.map +1 -0
  107. package/dist/readViews-DQoaUORa.d.ts +604 -0
  108. package/dist/readViews-DQoaUORa.d.ts.map +1 -0
  109. package/dist/rolldown-runtime-D6vf50IK.cjs +28 -0
  110. package/dist/sendInvocation-BwabRa2N.js +505 -0
  111. package/dist/sendInvocation-BwabRa2N.js.map +1 -0
  112. package/dist/sendInvocation-qO8AZcmU.cjs +661 -0
  113. package/dist/sendInvocation-qO8AZcmU.cjs.map +1 -0
  114. package/dist/sign-BewmV_EL.cjs +139 -0
  115. package/dist/sign-BewmV_EL.cjs.map +1 -0
  116. package/dist/sign-DVIRyW8Y.js +122 -0
  117. package/dist/sign-DVIRyW8Y.js.map +1 -0
  118. package/dist/sign-Ve0eetRO.d.ts +48 -0
  119. package/dist/sign-Ve0eetRO.d.ts.map +1 -0
  120. package/dist/sign-eUT0iGQG.d.cts +48 -0
  121. package/dist/sign-eUT0iGQG.d.cts.map +1 -0
  122. package/dist/signed-op.cjs +9 -0
  123. package/dist/signed-op.d.cts +3 -0
  124. package/dist/signed-op.d.ts +3 -0
  125. package/dist/signed-op.js +3 -0
  126. package/dist/signedOp-C52gOgpR.js +166 -0
  127. package/dist/signedOp-C52gOgpR.js.map +1 -0
  128. package/dist/signedOp-oqAXEqmE.cjs +183 -0
  129. package/dist/signedOp-oqAXEqmE.cjs.map +1 -0
  130. package/dist/signed_op-BokEDWr-.js +154 -0
  131. package/dist/signed_op-BokEDWr-.js.map +1 -0
  132. package/dist/signed_op-C4lY_TCc.d.ts +58 -0
  133. package/dist/signed_op-C4lY_TCc.d.ts.map +1 -0
  134. package/dist/signed_op-DX5WuyEh.d.cts +58 -0
  135. package/dist/signed_op-DX5WuyEh.d.cts.map +1 -0
  136. package/dist/signed_op-q8KKSm5e.cjs +175 -0
  137. package/dist/signed_op-q8KKSm5e.cjs.map +1 -0
  138. package/dist/signers-BFP84wJP.cjs +137 -0
  139. package/dist/signers-BFP84wJP.cjs.map +1 -0
  140. package/dist/signers-CzOSedwJ.js +120 -0
  141. package/dist/signers-CzOSedwJ.js.map +1 -0
  142. package/dist/signers.cjs +5 -0
  143. package/dist/signers.d.cts +3 -0
  144. package/dist/signers.d.ts +3 -0
  145. package/dist/signers.js +2 -0
  146. package/dist/size-506oTE28.js +91 -0
  147. package/dist/size-506oTE28.js.map +1 -0
  148. package/dist/size-OAFfOthl.cjs +108 -0
  149. package/dist/size-OAFfOthl.cjs.map +1 -0
  150. package/dist/transaction-CwkQxQOx.js +24 -0
  151. package/dist/transaction-CwkQxQOx.js.map +1 -0
  152. package/dist/transaction-DrSrCJ5y.cjs +47 -0
  153. package/dist/transaction-DrSrCJ5y.cjs.map +1 -0
  154. package/dist/transaction.cjs +13 -0
  155. package/dist/transaction.d.cts +3 -0
  156. package/dist/transaction.d.ts +3 -0
  157. package/dist/transaction.js +4 -0
  158. package/dist/transactionHash-CO9ajbvU.js +24 -0
  159. package/dist/transactionHash-CO9ajbvU.js.map +1 -0
  160. package/dist/transactionHash-D5yf4KoL.cjs +29 -0
  161. package/dist/transactionHash-D5yf4KoL.cjs.map +1 -0
  162. package/dist/transport-CBFwAIIv.js +261 -0
  163. package/dist/transport-CBFwAIIv.js.map +1 -0
  164. package/dist/transport-tWxKhXUt.cjs +279 -0
  165. package/dist/transport-tWxKhXUt.cjs.map +1 -0
  166. package/dist/transport.cjs +19 -0
  167. package/dist/transport.d.cts +3 -0
  168. package/dist/transport.d.ts +3 -0
  169. package/dist/transport.js +4 -0
  170. package/dist/types-BE40oD_Q.d.cts +18 -0
  171. package/dist/types-BE40oD_Q.d.cts.map +1 -0
  172. package/dist/types-BE40oD_Q.d.ts +18 -0
  173. package/dist/types-BE40oD_Q.d.ts.map +1 -0
  174. package/dist/validation-4w-vDGAi.cjs +543 -0
  175. package/dist/validation-4w-vDGAi.cjs.map +1 -0
  176. package/dist/validation-eXATmgO0.js +411 -0
  177. package/dist/validation-eXATmgO0.js.map +1 -0
  178. package/dist/wallet-7RELuTkf.js +667 -0
  179. package/dist/wallet-7RELuTkf.js.map +1 -0
  180. package/dist/wallet-T_JazXRc.cjs +709 -0
  181. package/dist/wallet-T_JazXRc.cjs.map +1 -0
  182. package/dist/wallet.cjs +27 -0
  183. package/dist/wallet.d.cts +3 -0
  184. package/dist/wallet.d.ts +3 -0
  185. package/dist/wallet.js +3 -0
  186. package/package.json +122 -4
@@ -0,0 +1,746 @@
1
+ //#region src/transport/types.d.ts
2
+ /**
3
+ * Minimal JSON-RPC transport contract used by all SDK actions.
4
+ *
5
+ * Implement this interface to plug the SDK into a custom runtime, test harness,
6
+ * or request pipeline. The transport is responsible for sending a JSON-RPC
7
+ * method name and named params object, then returning the raw decoded `result` value.
8
+ */
9
+ interface Transport {
10
+ /**
11
+ * Send one JSON-RPC request and return the decoded `result` value.
12
+ *
13
+ * @typeParam T - Expected JSON-RPC result type before action-level parsing.
14
+ */
15
+ request<T = unknown>(method: string, params?: RpcParams, options?: TransportRequestOptions): Promise<T>;
16
+ }
17
+ /** Per-request transport controls supported by built-in transports. */
18
+ interface TransportRequestOptions {
19
+ /**
20
+ * Cancel this request without affecting other requests on the same transport.
21
+ * Public reads accept these options as their final argument; generated view
22
+ * methods accept signal alongside their contract arguments.
23
+ */
24
+ readonly signal?: AbortSignal;
25
+ }
26
+ /** Named native parameters; arrays remain accepted by the general JSON-RPC transport. */
27
+ type RpcParams = Record<string, unknown> | unknown[];
28
+ //#endregion
29
+ //#region src/rpc/codec.d.ts
30
+ /** An unfamiliar variant is data, never success, absence, or retry permission. */
31
+ declare class UnsupportedRpcValue {
32
+ readonly raw: unknown;
33
+ readonly unsupported = true;
34
+ constructor(raw: unknown);
35
+ }
36
+ /** Malformed known result data, with the complete original result retained. */
37
+ declare class RpcDecodingError extends Error {
38
+ readonly path: string;
39
+ readonly raw: unknown;
40
+ constructor(path: string, raw: unknown);
41
+ }
42
+ /** Invalid local input. The transport was not called; this is not retry permission. */
43
+ declare class RpcRequestValidationError extends Error {
44
+ readonly path: string;
45
+ constructor(path: string, message?: string);
46
+ }
47
+ //#endregion
48
+ //#region src/rpc/generated.d.ts
49
+ type RpcAdmission = "accepted" | UnsupportedRpcValue;
50
+ type RpcAirdropAttempt = {
51
+ attemptStatus: "pending";
52
+ rawAmount: bigint;
53
+ recipient: RpcBase58_ContractAddress;
54
+ retryAfterSeconds: RpcDecimalU64;
55
+ transactionHash?: RpcTxHash;
56
+ } | {
57
+ attemptStatus: "succeeded";
58
+ blockHeight: bigint;
59
+ execution: RpcAirdropExecution;
60
+ rawAmount: bigint;
61
+ recipient: RpcBase58_ContractAddress;
62
+ transactionHash: RpcTxHash;
63
+ } | UnsupportedRpcValue;
64
+ type RpcAirdropExecution = {
65
+ result: "return";
66
+ returnData: Uint8Array;
67
+ } | UnsupportedRpcValue;
68
+ type RpcAscendingAnchor = {
69
+ kind: "atBeginning";
70
+ } | {
71
+ blockHeight: bigint;
72
+ kind: "atHeight";
73
+ };
74
+ type RpcAssumedAuth = {
75
+ accountNonce: bigint;
76
+ kind: "pubkeySignature";
77
+ pubkeyHash: RpcBase58_PublicKeyHash;
78
+ } | {
79
+ allowedKeys: number;
80
+ kind: "sourceAddress";
81
+ requiredWeight: number;
82
+ };
83
+ type RpcAuthConfiguration = {
84
+ requiredWeight: number;
85
+ signers: RpcAuthSigner[];
86
+ };
87
+ type RpcAuthSigner = {
88
+ keyId: number;
89
+ maxWeight: number;
90
+ publicKey: RpcPublicKey;
91
+ };
92
+ type RpcBalanceResult = {
93
+ address: RpcBase58_ContractAddress;
94
+ rawBalance: bigint;
95
+ stateBlockHeight: bigint;
96
+ };
97
+ type RpcBase58_ContractAddress = Uint8Array;
98
+ type RpcBase58_Ed25519PublicKey = Uint8Array;
99
+ type RpcBase58_PublicKeyHash = Uint8Array;
100
+ type RpcBase58_SHA256Hash = Uint8Array;
101
+ type RpcBase58_ValidatorID = Uint8Array;
102
+ type RpcBlockInfo = {
103
+ blockHash: RpcBase58_SHA256Hash;
104
+ blockHeight: bigint;
105
+ blockTimepoint: RpcDecimalTimePoint;
106
+ configHash: RpcBase58_SHA256Hash;
107
+ eventsHash: RpcBase58_SHA256Hash;
108
+ networkHash: RpcBase58_SHA256Hash;
109
+ prevBlockHash: RpcBase58_SHA256Hash;
110
+ proposalTxsHash: RpcBase58_SHA256Hash;
111
+ proposer: RpcBase58_ValidatorID;
112
+ protocol: number;
113
+ storageHash: RpcBase58_SHA256Hash;
114
+ txsHash: RpcBase58_SHA256Hash;
115
+ upgrades: Uint8Array[];
116
+ };
117
+ type RpcBlockStart = {
118
+ order: RpcIterationOrder;
119
+ };
120
+ type RpcChainConfig = {
121
+ execution?: RpcExecutionConfig;
122
+ stated: RpcConfigLimits;
123
+ };
124
+ type RpcChainTip = {
125
+ blockHash: RpcBase58_SHA256Hash;
126
+ blockHeight: bigint;
127
+ };
128
+ type RpcConfigLimits = {
129
+ maxAuthTokenDepth?: number;
130
+ maxBytestringLen?: number;
131
+ maxContractSizeBytes?: number;
132
+ maxCrossInvokeDepth?: number;
133
+ maxNewContractsPerTx?: number;
134
+ maxRv32CodeBytes?: number;
135
+ maxRv32MemoryBytes?: number;
136
+ maxSavepointDepth?: number;
137
+ maxSha256Buffers?: number;
138
+ maxTxGas?: RpcDecimalU64;
139
+ };
140
+ type RpcConflictCode = "exclusiveLock" | "typeMismatch" | "valueMismatch" | "boundsExceeded" | "overflow" | "replayProtection" | "queueConsumer" | "capacityExceeded" | "insufficientFunds" | "other" | UnsupportedRpcValue;
141
+ type RpcConflictDiagnostic = {
142
+ address: RpcBase58_ContractAddress;
143
+ code: RpcConflictCode;
144
+ key: Uint8Array;
145
+ };
146
+ type RpcContractArtifactResult = {
147
+ contractXdr: Uint8Array;
148
+ hash: RpcBase58_SHA256Hash;
149
+ };
150
+ type RpcContractDeployment = {
151
+ contractType: number;
152
+ hash: RpcBase58_SHA256Hash;
153
+ size: number;
154
+ };
155
+ type RpcContractDeploymentResult = {
156
+ address: RpcBase58_ContractAddress;
157
+ deployment: RpcContractDeployment | null;
158
+ stateBlockHeight: bigint;
159
+ };
160
+ type RpcContractRejectCode = "tooMany" | "blobTooLarge" | "notDeployable" | "duplicate" | "malformedArtifact" | "unsupportedFormat" | "unsupportedAbi" | "gasScheduleMismatch" | "memoryTooLarge" | "codeSizeInvalid" | "initialMemoryInvalid" | "digestMismatch" | "invalidProgram" | "other" | UnsupportedRpcValue;
161
+ type RpcDecimalTimePoint = bigint;
162
+ type RpcDecimalU64 = bigint;
163
+ type RpcDescendingAnchor = {
164
+ kind: "atEnd";
165
+ } | {
166
+ blockHeight: bigint;
167
+ kind: "atHeight";
168
+ };
169
+ type RpcEffectiveContract = {
170
+ contract: RpcContractDeployment;
171
+ source: "explicitDeployment";
172
+ } | {
173
+ contract: RpcContractDeployment;
174
+ source: "networkDefault";
175
+ } | UnsupportedRpcValue;
176
+ type RpcEffectiveContractResult = {
177
+ address: RpcBase58_ContractAddress;
178
+ context: RpcInvocationContext;
179
+ selection: RpcEffectiveContract | null;
180
+ stateBlockHeight: bigint;
181
+ };
182
+ type RpcEmittedEvent = {
183
+ address: RpcBase58_ContractAddress;
184
+ data: Uint8Array;
185
+ topics: Uint8Array[];
186
+ };
187
+ type RpcEventFilter = {
188
+ addresses: RpcBase58_ContractAddress[];
189
+ topics?: RpcTopicFilter;
190
+ };
191
+ type RpcEventPage = {
192
+ events: RpcIdentifiedEvent[];
193
+ latestIndexedBlockHeight: bigint;
194
+ nextCursor: string | null;
195
+ oldestIndexedBlockHeight: bigint;
196
+ };
197
+ type RpcExecutionConfig = {
198
+ configHash: RpcBase58_SHA256Hash;
199
+ effectiveLimits: RpcConfigLimits;
200
+ observedTip: RpcChainTip;
201
+ storageCosts: RpcStorageCosts;
202
+ };
203
+ type RpcFailureCause = {
204
+ conflict: RpcConflictDiagnostic;
205
+ kind: "dbConflict";
206
+ } | {
207
+ code: RpcContractRejectCode;
208
+ contractIndex: number;
209
+ kind: "contractRejected";
210
+ } | {
211
+ kind: "other";
212
+ } | UnsupportedRpcValue;
213
+ type RpcFundingSubmission = {
214
+ rawAmount: bigint;
215
+ recipient: RpcBase58_ContractAddress;
216
+ signedTransaction: Uint8Array;
217
+ transactionHash: RpcTxHash;
218
+ };
219
+ type RpcHistoryStart = {
220
+ anchor: RpcAscendingAnchor;
221
+ order: "ascending";
222
+ } | {
223
+ anchor: RpcDescendingAnchor;
224
+ order: "descending";
225
+ };
226
+ type RpcIdentifiedEvent = {
227
+ blockHeight: bigint;
228
+ event: RpcEmittedEvent;
229
+ sequenceNumber: number;
230
+ transactionHash: RpcTxHash;
231
+ };
232
+ type RpcInvocation = {
233
+ address: RpcBase58_ContractAddress;
234
+ assumedAuth?: RpcAssumedAuth;
235
+ calldata: Uint8Array;
236
+ caller?: RpcBase58_ContractAddress;
237
+ entrypoint: Uint8Array;
238
+ gasLimit?: bigint;
239
+ };
240
+ type RpcInvocationContext = "root" | "nested";
241
+ type RpcInvocationOutput = {
242
+ result: "return";
243
+ returnData: Uint8Array;
244
+ } | {
245
+ abortData: Uint8Array;
246
+ result: "abort";
247
+ } | {
248
+ result: "fault";
249
+ } | UnsupportedRpcValue;
250
+ type RpcInvocationResult = {
251
+ events: RpcEmittedEvent[];
252
+ gasUsed: RpcDecimalU64;
253
+ output: RpcInvocationOutput;
254
+ };
255
+ type RpcIterationOrder = "ascending" | "descending";
256
+ type RpcNetworkInfo = {
257
+ networkHash: RpcBase58_SHA256Hash;
258
+ };
259
+ type RpcPendingTransactionCount = {
260
+ count: RpcDecimalU64;
261
+ };
262
+ type RpcPublicKey = {
263
+ key: RpcBase58_Ed25519PublicKey;
264
+ scheme: "ed25519";
265
+ } | {
266
+ scheme: "unknown";
267
+ schemeId: number;
268
+ } | UnsupportedRpcValue;
269
+ type RpcReceiptExecution = {
270
+ result: "return";
271
+ returnData: Uint8Array;
272
+ } | {
273
+ abortData: Uint8Array;
274
+ result: "abort";
275
+ } | {
276
+ result: "fault";
277
+ } | {
278
+ result: "nonDeterministicError";
279
+ } | {
280
+ result: "failedGasSponsorship";
281
+ } | {
282
+ result: "other";
283
+ } | UnsupportedRpcValue;
284
+ type RpcRecentAttemptFailure = {
285
+ attemptBlockHeight: bigint;
286
+ cause: RpcFailureCause;
287
+ };
288
+ type RpcRegisteredAuthResult = {
289
+ address: RpcBase58_ContractAddress;
290
+ configuration: RpcAuthConfiguration | null;
291
+ stateBlockHeight: bigint;
292
+ };
293
+ type RpcSchedulerError = {
294
+ code: number;
295
+ source: RpcSchedulerErrorSource;
296
+ };
297
+ type RpcSchedulerErrorSource = "auth" | "scheduler" | "executor" | "other" | UnsupportedRpcValue;
298
+ type RpcSendTransactionResult = {
299
+ admission: RpcAdmission;
300
+ transactionHash: RpcTxHash;
301
+ };
302
+ type RpcServerLimits = {
303
+ maxCursorBytes: RpcDecimalU64;
304
+ maxEventsPerPage: number;
305
+ maxSimulationCalldataBytes: RpcDecimalU64;
306
+ maxSimulationGas: RpcDecimalU64;
307
+ maxTransactionsPerPage: number;
308
+ simulationBatch?: RpcSimulationBatchLimits;
309
+ };
310
+ type RpcSimulationBatchLimits = {
311
+ maxBackendResponseBytes: number;
312
+ maxCalldataBytes: number;
313
+ maxGas: RpcDecimalU64;
314
+ maxInvocations: number;
315
+ timeoutMs: RpcDecimalU64;
316
+ };
317
+ type RpcSimulationResult = {
318
+ events: RpcEmittedEvent[];
319
+ gasUsed: RpcDecimalU64;
320
+ output: RpcInvocationOutput;
321
+ stateBlockHeight: bigint;
322
+ };
323
+ type RpcSimulationResults = {
324
+ results: RpcInvocationResult[];
325
+ stateBlockHeight: bigint;
326
+ };
327
+ type RpcStorageCosts = {
328
+ authPerKeyCost: RpcDecimalU64;
329
+ balanceCost: RpcDecimalU64;
330
+ baseContractDeploymentCost: RpcDecimalU64;
331
+ baseDataItemCost: RpcDecimalU64;
332
+ bytestringCostPerByte: bigint;
333
+ contractDeploymentCostPerByte: RpcDecimalU64;
334
+ rcqCostPerEntry: RpcDecimalU64;
335
+ replayCacheCostPerEntry: RpcDecimalU64;
336
+ };
337
+ type RpcStorageItem = {
338
+ kind: "nonnegativeInt";
339
+ value: bigint;
340
+ } | {
341
+ bytes: Uint8Array;
342
+ kind: "bytestring";
343
+ } | {
344
+ kind: "authData";
345
+ } | {
346
+ kind: "retrocausalQueue";
347
+ } | {
348
+ kind: "replayCacheEntry";
349
+ } | {
350
+ contractType: number;
351
+ hash: RpcBase58_SHA256Hash;
352
+ kind: "deployedContract";
353
+ size: number;
354
+ } | {
355
+ kind: "unknown";
356
+ typeId: number;
357
+ } | UnsupportedRpcValue;
358
+ type RpcStorageResult = {
359
+ item: RpcStorageItem | null;
360
+ stateBlockHeight: bigint;
361
+ };
362
+ type RpcTopicFilter = {
363
+ topic0?: Uint8Array[];
364
+ topic1?: Uint8Array[];
365
+ topic2?: Uint8Array[];
366
+ };
367
+ type RpcTransactionInputResult = {
368
+ blockHeight: bigint;
369
+ status: "available";
370
+ transactionHash: RpcTxHash;
371
+ transactionXdr: Uint8Array;
372
+ } | {
373
+ status: "unavailable";
374
+ } | UnsupportedRpcValue;
375
+ type RpcTransactionReceipt = {
376
+ blockHeight: bigint;
377
+ events: RpcEmittedEvent[];
378
+ execution: RpcReceiptExecution;
379
+ gasUsed: RpcDecimalU64;
380
+ transactionHash: RpcTxHash;
381
+ };
382
+ type RpcTransactionRef = {
383
+ blockHeight: bigint;
384
+ transactionHash: RpcTxHash;
385
+ };
386
+ type RpcTransactionRefPage = {
387
+ latestIndexedBlockHeight: bigint;
388
+ nextCursor: string | null;
389
+ oldestIndexedBlockHeight: bigint;
390
+ transactions: RpcTransactionRef[];
391
+ };
392
+ type RpcTransactionStatus = {
393
+ recentFailure?: RpcRecentAttemptFailure;
394
+ status: "pending";
395
+ } | {
396
+ blockHeight: bigint;
397
+ status: "committed";
398
+ } | {
399
+ error: RpcSchedulerError;
400
+ recentFailure?: RpcRecentAttemptFailure;
401
+ status: "retry";
402
+ } | {
403
+ error: RpcSchedulerError;
404
+ recentFailure?: RpcRecentAttemptFailure;
405
+ status: "dropped";
406
+ } | {
407
+ attemptBlockHeight: bigint;
408
+ cause: RpcFailureCause;
409
+ status: "recentFailure";
410
+ } | {
411
+ status: "unknown";
412
+ } | {
413
+ status: "other";
414
+ } | UnsupportedRpcValue;
415
+ type RpcTxHash = RpcBase58_SHA256Hash;
416
+ type RpcVersionInfo = {
417
+ bundleManifestDigest?: string;
418
+ commitHash?: string;
419
+ implementation: string;
420
+ platformVersion?: string;
421
+ releaseVersion?: string;
422
+ supportedMethods: string[];
423
+ wireFormat: string;
424
+ };
425
+ interface RpcRequests {
426
+ getVersionInfo: {};
427
+ getNetworkInfo: {};
428
+ getChainTip: {};
429
+ getChainConfig: {};
430
+ getServerLimits: {};
431
+ sendTransaction: {
432
+ signedTransaction: Uint8Array;
433
+ };
434
+ getTransactionStatus: {
435
+ transactionHash: RpcTxHash;
436
+ };
437
+ getTransactionReceipt: {
438
+ transactionHash: RpcTxHash;
439
+ };
440
+ getTransactionInput: {
441
+ transactionHash: RpcTxHash;
442
+ };
443
+ simulateInvocation: {
444
+ address: RpcBase58_ContractAddress;
445
+ calldata: Uint8Array;
446
+ entrypoint: Uint8Array;
447
+ assumedAuth?: RpcAssumedAuth;
448
+ caller?: RpcBase58_ContractAddress;
449
+ gasLimit?: bigint;
450
+ minStateBlockHeight?: bigint;
451
+ };
452
+ simulateInvocations: {
453
+ invocations: RpcInvocation[];
454
+ minStateBlockHeight?: bigint;
455
+ };
456
+ getStorage: {
457
+ address: RpcBase58_ContractAddress;
458
+ key: Uint8Array;
459
+ };
460
+ getBalance: {
461
+ address: RpcBase58_ContractAddress;
462
+ };
463
+ getRegisteredAuth: {
464
+ address: RpcBase58_ContractAddress;
465
+ };
466
+ getContractDeployment: {
467
+ address: RpcBase58_ContractAddress;
468
+ };
469
+ getEffectiveContract: {
470
+ address: RpcBase58_ContractAddress;
471
+ context: RpcInvocationContext;
472
+ };
473
+ getContractArtifact: {
474
+ hash: RpcBase58_SHA256Hash;
475
+ };
476
+ getEvents: {
477
+ filters: RpcEventFilter[];
478
+ limit?: number;
479
+ } & ({
480
+ start: RpcHistoryStart;
481
+ cursor?: never;
482
+ } | {
483
+ cursor: string;
484
+ start?: never;
485
+ });
486
+ getTransactionsByRootAddress: {
487
+ address: RpcBase58_ContractAddress;
488
+ limit?: number;
489
+ } & ({
490
+ start: RpcHistoryStart;
491
+ cursor?: never;
492
+ } | {
493
+ cursor: string;
494
+ start?: never;
495
+ });
496
+ getBlockByHeight: {
497
+ blockHeight: bigint;
498
+ };
499
+ getTransactionsByBlock: {
500
+ blockHeight: bigint;
501
+ limit?: number;
502
+ } & ({
503
+ start: RpcBlockStart;
504
+ cursor?: never;
505
+ } | {
506
+ cursor: string;
507
+ start?: never;
508
+ });
509
+ faucet_requestAirdrop: {
510
+ clientNonce: Uint8Array;
511
+ recipient: RpcBase58_ContractAddress;
512
+ };
513
+ dev_fundAccount: {
514
+ clientNonce: Uint8Array;
515
+ faucet: RpcBase58_ContractAddress;
516
+ rawAmount: bigint;
517
+ recipient: RpcBase58_ContractAddress;
518
+ };
519
+ dev_getPendingTransactionCount: {};
520
+ }
521
+ interface RpcResults {
522
+ getVersionInfo: RpcVersionInfo;
523
+ getNetworkInfo: RpcNetworkInfo;
524
+ getChainTip: RpcChainTip;
525
+ getChainConfig: RpcChainConfig;
526
+ getServerLimits: RpcServerLimits;
527
+ sendTransaction: RpcSendTransactionResult;
528
+ getTransactionStatus: RpcTransactionStatus;
529
+ getTransactionReceipt: RpcTransactionReceipt | null;
530
+ getTransactionInput: RpcTransactionInputResult;
531
+ simulateInvocation: RpcSimulationResult;
532
+ simulateInvocations: RpcSimulationResults;
533
+ getStorage: RpcStorageResult;
534
+ getBalance: RpcBalanceResult;
535
+ getRegisteredAuth: RpcRegisteredAuthResult;
536
+ getContractDeployment: RpcContractDeploymentResult;
537
+ getEffectiveContract: RpcEffectiveContractResult;
538
+ getContractArtifact: RpcContractArtifactResult;
539
+ getEvents: RpcEventPage;
540
+ getTransactionsByRootAddress: RpcTransactionRefPage;
541
+ getBlockByHeight: RpcBlockInfo | null;
542
+ getTransactionsByBlock: RpcTransactionRefPage;
543
+ faucet_requestAirdrop: RpcAirdropAttempt;
544
+ dev_fundAccount: RpcFundingSubmission;
545
+ dev_getPendingTransactionCount: RpcPendingTransactionCount;
546
+ }
547
+ type RpcErrorData = {
548
+ kind: "invalidParams";
549
+ path?: string;
550
+ reason?: string;
551
+ } | {
552
+ admission?: "notAttempted" | "rejected" | "unknown";
553
+ error?: {
554
+ code: number;
555
+ source: "auth" | "scheduler" | "executor" | "other" | UnsupportedRpcValue;
556
+ };
557
+ kind: "backendUnavailable";
558
+ retryAfterMs?: bigint;
559
+ serviceCode?: string;
560
+ transactionHash?: Uint8Array;
561
+ } | {
562
+ admission?: "notAttempted" | "rejected" | "unknown";
563
+ kind: "backendTimeout";
564
+ retryAfterMs?: bigint;
565
+ transactionHash?: Uint8Array;
566
+ } | {
567
+ admission?: "notAttempted" | "rejected" | "unknown";
568
+ error?: {
569
+ code: number;
570
+ source: "auth" | "scheduler" | "executor" | "other" | UnsupportedRpcValue;
571
+ };
572
+ kind: "overloaded";
573
+ retryAfterMs?: bigint;
574
+ transactionHash?: Uint8Array;
575
+ } | {
576
+ admission?: "notAttempted" | "rejected" | "unknown";
577
+ kind: "backendDataInvalid";
578
+ observation?: {
579
+ blockHeight: bigint;
580
+ transactionHash: Uint8Array;
581
+ };
582
+ reason?: string;
583
+ transactionHash?: Uint8Array;
584
+ } | {
585
+ admission: "notAttempted";
586
+ detail?: {
587
+ attached: number;
588
+ max: number;
589
+ reason: "tooManyContracts";
590
+ } | {
591
+ index: number;
592
+ maxBytes: number;
593
+ reason: "contractTooLarge";
594
+ sizeBytes: number;
595
+ } | {
596
+ firstIndex: number;
597
+ index: number;
598
+ reason: "duplicateContract";
599
+ } | {
600
+ index: number;
601
+ maxBytes: number;
602
+ memoryBytes: number;
603
+ reason: "rv32MemoryTooLarge";
604
+ } | {
605
+ codeBytes: number;
606
+ index: number;
607
+ maxBytes: number;
608
+ reason: "rv32CodeTooLarge";
609
+ } | {
610
+ gasLimit: bigint;
611
+ maxGas: bigint;
612
+ reason: "gasLimitTooHigh";
613
+ } | UnsupportedRpcValue;
614
+ kind: "transactionInvalid";
615
+ reason?: string;
616
+ transactionHash?: Uint8Array;
617
+ } | {
618
+ admission: "notAttempted" | "rejected";
619
+ error?: {
620
+ code: number;
621
+ source: "auth" | "scheduler" | "executor" | "other" | UnsupportedRpcValue;
622
+ };
623
+ kind: "transactionRejected";
624
+ reason?: string;
625
+ transactionHash?: Uint8Array;
626
+ } | {
627
+ kind: "stateHeightUnavailable";
628
+ observedStateBlockHeight: bigint;
629
+ requestedStateBlockHeight: bigint;
630
+ } | {
631
+ hash: Uint8Array;
632
+ kind: "contractArtifactUnavailable";
633
+ } | {
634
+ kind: "invalidCursor";
635
+ path?: string;
636
+ reason?: string;
637
+ } | {
638
+ kind: "historyUnavailable";
639
+ latestIndexedBlockHeight?: bigint;
640
+ oldestIndexedBlockHeight?: bigint;
641
+ reason?: string;
642
+ } | {
643
+ receipt?: {
644
+ blockHeight: bigint;
645
+ events: {
646
+ address: Uint8Array;
647
+ data: Uint8Array;
648
+ topics: Uint8Array[];
649
+ }[];
650
+ execution: {
651
+ result: "return";
652
+ returnData: Uint8Array;
653
+ } | {
654
+ abortData: Uint8Array;
655
+ result: "abort";
656
+ } | {
657
+ result: "fault";
658
+ } | {
659
+ result: "nonDeterministicError";
660
+ } | {
661
+ result: "failedGasSponsorship";
662
+ } | {
663
+ result: "other";
664
+ } | UnsupportedRpcValue;
665
+ gasUsed: bigint;
666
+ transactionHash: Uint8Array;
667
+ };
668
+ serviceCode?: string;
669
+ signedTransaction?: Uint8Array;
670
+ transactionHash?: Uint8Array;
671
+ kind: "fundingAttemptStopped";
672
+ } | {
673
+ cause?: {
674
+ receipt?: {
675
+ blockHeight: bigint;
676
+ events: {
677
+ address: Uint8Array;
678
+ data: Uint8Array;
679
+ topics: Uint8Array[];
680
+ }[];
681
+ execution: {
682
+ result: "return";
683
+ returnData: Uint8Array;
684
+ } | {
685
+ abortData: Uint8Array;
686
+ result: "abort";
687
+ } | {
688
+ result: "fault";
689
+ } | {
690
+ result: "nonDeterministicError";
691
+ } | {
692
+ result: "failedGasSponsorship";
693
+ } | {
694
+ result: "other";
695
+ } | UnsupportedRpcValue;
696
+ gasUsed: bigint;
697
+ transactionHash: Uint8Array;
698
+ };
699
+ serviceCode?: string;
700
+ signedTransaction?: Uint8Array;
701
+ transactionHash?: Uint8Array;
702
+ kind: "fundingAttemptStopped";
703
+ };
704
+ kind: "localFundingUnresolved";
705
+ signedTransaction: Uint8Array;
706
+ transactionHash: Uint8Array;
707
+ };
708
+ //#endregion
709
+ //#region src/rpc/client.d.ts
710
+ type RpcMethod = keyof RpcRequests;
711
+ /**
712
+ * Exact low-level operations. Each accepts one named object; empty requests default to {}.
713
+ * Cancellation options are always the second argument, including for empty requests:
714
+ * `client.getChainTip({}, { signal })`.
715
+ */
716
+ type RpcMethods = { [M in RpcMethod]: keyof RpcRequests[M] extends never ? (request?: RpcRequests[M], options?: TransportRequestOptions) => Promise<RpcResults[M]> : (request: RpcRequests[M], options?: TransportRequestOptions) => Promise<RpcResults[M]> };
717
+ interface RpcDiscovery {
718
+ version: RpcVersionInfo;
719
+ network: RpcNetworkInfo;
720
+ limits?: RpcServerLimits;
721
+ }
722
+ type RpcClient = RpcMethods & {
723
+ /** Copy of the last explicitly refreshed, validated discovery snapshot. */readonly discovery: RpcDiscovery; /** Reads discovery again. Never repeats a failed write. */
724
+ refreshDiscovery(options?: TransportRequestOptions): Promise<RpcDiscovery>; /** Check the configured methods before composing a multi-call workflow. */
725
+ requireMethods(methods: readonly RpcMethod[]): void;
726
+ };
727
+ interface RpcClientOptions {
728
+ transport: Transport;
729
+ /** Required signing network, compared by bytes before the client is returned. */
730
+ expectedNetworkHash?: Uint8Array;
731
+ /** Methods needed by a composed workflow; partial development endpoints are supported. */
732
+ requiredMethods?: readonly RpcMethod[];
733
+ signal?: AbortSignal;
734
+ }
735
+ declare class RpcCompatibilityError extends Error {
736
+ constructor(message: string);
737
+ }
738
+ /**
739
+ * Connect a native wire-14 client. This layer reads once or sends once; it does
740
+ * not sign, poll, retry, refresh discovery on failure, or switch wire formats.
741
+ * Unknown response variants are UnsupportedRpcValue objects retaining raw data.
742
+ */
743
+ declare function createRpcClient(options: RpcClientOptions): Promise<RpcClient>;
744
+ //#endregion
745
+ export { RpcPublicKey as $, RpcContractDeploymentResult as A, RpcEventPage as B, RpcChainConfig as C, RpcDecodingError as Ct, RpcConflictDiagnostic as D, Transport as Dt, RpcConflictCode as E, RpcParams as Et, RpcEffectiveContract as F, RpcIdentifiedEvent as G, RpcFailureCause as H, RpcEffectiveContractResult as I, RpcInvocationOutput as J, RpcInvocation as K, RpcEmittedEvent as L, RpcDecimalTimePoint as M, RpcDecimalU64 as N, RpcContractArtifactResult as O, TransportRequestOptions as Ot, RpcDescendingAnchor as P, RpcPendingTransactionCount as Q, RpcErrorData as R, RpcBlockStart as S, RpcVersionInfo as St, RpcConfigLimits as T, UnsupportedRpcValue as Tt, RpcFundingSubmission as U, RpcExecutionConfig as V, RpcHistoryStart as W, RpcIterationOrder as X, RpcInvocationResult as Y, RpcNetworkInfo as Z, RpcBase58_Ed25519PublicKey as _, RpcTransactionReceipt as _t, RpcMethod as a, RpcSchedulerError as at, RpcBase58_ValidatorID as b, RpcTransactionStatus as bt, RpcAdmission as c, RpcServerLimits as ct, RpcAscendingAnchor as d, RpcSimulationResults as dt, RpcReceiptExecution as et, RpcAssumedAuth as f, RpcStorageCosts as ft, RpcBase58_ContractAddress as g, RpcTransactionInputResult as gt, RpcBalanceResult as h, RpcTopicFilter as ht, RpcDiscovery as i, RpcResults as it, RpcContractRejectCode as j, RpcContractDeployment as k, RpcAirdropAttempt as l, RpcSimulationBatchLimits as lt, RpcAuthSigner as m, RpcStorageResult as mt, RpcClientOptions as n, RpcRegisteredAuthResult as nt, RpcMethods as o, RpcSchedulerErrorSource as ot, RpcAuthConfiguration as p, RpcStorageItem as pt, RpcInvocationContext as q, RpcCompatibilityError as r, RpcRequests as rt, createRpcClient as s, RpcSendTransactionResult as st, RpcClient as t, RpcRecentAttemptFailure as tt, RpcAirdropExecution as u, RpcSimulationResult as ut, RpcBase58_PublicKeyHash as v, RpcTransactionRef as vt, RpcChainTip as w, RpcRequestValidationError as wt, RpcBlockInfo as x, RpcTxHash as xt, RpcBase58_SHA256Hash as y, RpcTransactionRefPage as yt, RpcEventFilter as z };
746
+ //# sourceMappingURL=client-JixxskeH.d.cts.map