@thruputchain/client 0.28.0 → 0.30.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/README.md +113 -18
- package/dist/actions-B7htk5FS.js +698 -0
- package/dist/actions-B7htk5FS.js.map +1 -0
- package/dist/actions-CIaI049y.cjs +788 -0
- package/dist/actions-CIaI049y.cjs.map +1 -0
- package/dist/actions.cjs +5 -8
- package/dist/actions.d.cts +4 -4
- package/dist/actions.d.ts +4 -4
- package/dist/actions.js +3 -3
- package/dist/{contract-D77iA2iY.js → contract-BOlNskwd.js} +235 -87
- package/dist/contract-BOlNskwd.js.map +1 -0
- package/dist/{contract-DSu2UPPm.cjs → contract-D_vxUudr.cjs} +281 -109
- package/dist/contract-D_vxUudr.cjs.map +1 -0
- package/dist/contract.cjs +1 -5
- package/dist/contract.d.cts +3 -4
- package/dist/contract.d.ts +3 -4
- package/dist/contract.js +2 -2
- package/dist/contracts.cjs +5 -5
- package/dist/contracts.d.cts +6 -74
- package/dist/contracts.d.cts.map +1 -1
- package/dist/contracts.d.ts +6 -74
- package/dist/contracts.d.ts.map +1 -1
- package/dist/contracts.js +4 -4
- package/dist/decimal-BX7abv5J.cjs +171 -0
- package/dist/decimal-BX7abv5J.cjs.map +1 -0
- package/dist/decimal-CoHOISys.js +124 -0
- package/dist/decimal-CoHOISys.js.map +1 -0
- package/dist/default_wallet-DkqsCa5C.d.ts +90 -0
- package/dist/default_wallet-DkqsCa5C.d.ts.map +1 -0
- package/dist/default_wallet-Dqs4_iTD.d.cts +90 -0
- package/dist/default_wallet-Dqs4_iTD.d.cts.map +1 -0
- package/dist/{dev_wallet-CAbOSrak.cjs → dev_wallet-BVChhV6j.cjs} +85 -6
- package/dist/dev_wallet-BVChhV6j.cjs.map +1 -0
- package/dist/{dev_wallet-CU3RpQLm.js → dev_wallet-D9LuPZ-h.js} +84 -5
- package/dist/dev_wallet-D9LuPZ-h.js.map +1 -0
- package/dist/{execution-J5jkXhV1.d.cts → execution-pSt6k620.d.cts} +23 -50
- package/dist/execution-pSt6k620.d.cts.map +1 -0
- package/dist/{execution-XJ0iwFaX.d.ts → execution-uiuFPV0d.d.ts} +23 -50
- package/dist/execution-uiuFPV0d.d.ts.map +1 -0
- package/dist/{hex-DIcaALXL.js → hex-B8D-jBgz.js} +2 -2
- package/dist/{hex-DIcaALXL.js.map → hex-B8D-jBgz.js.map} +1 -1
- package/dist/{hex-DkGpiZ5e.cjs → hex-CSDZ9d6z.cjs} +2 -2
- package/dist/{hex-DkGpiZ5e.cjs.map → hex-CSDZ9d6z.cjs.map} +1 -1
- package/dist/{index-soFVQX9j.d.cts → index-B1efA-Y_.d.ts} +24 -21
- package/dist/index-B1efA-Y_.d.ts.map +1 -0
- package/dist/{index-C3HVRvQd.d.ts → index-BGmH_Sm7.d.cts} +12 -62
- package/dist/index-BGmH_Sm7.d.cts.map +1 -0
- package/dist/{index-DeS1S0m-.d.ts → index-BmOG68Hd.d.ts} +39 -17
- package/dist/index-BmOG68Hd.d.ts.map +1 -0
- package/dist/{index-B5KqSHeL.d.cts → index-BsvYcU_Y.d.cts} +2 -2
- package/dist/{index-B5KqSHeL.d.cts.map → index-BsvYcU_Y.d.cts.map} +1 -1
- package/dist/{index-CtjZ61tl.d.cts → index-CG-q0j9w.d.ts} +12 -62
- package/dist/index-CG-q0j9w.d.ts.map +1 -0
- package/dist/index-CPtBvHE8.d.ts +145 -0
- package/dist/index-CPtBvHE8.d.ts.map +1 -0
- package/dist/{index-DfmDUk5Y.d.ts → index-DBKsOzCN.d.cts} +24 -21
- package/dist/index-DBKsOzCN.d.cts.map +1 -0
- package/dist/{index-Bb01ytjJ.d.ts → index-Dtv_GV6M.d.ts} +40 -11
- package/dist/index-Dtv_GV6M.d.ts.map +1 -0
- package/dist/{index-CtjWsAXV.d.cts → index-JKm4TBlY.d.cts} +40 -11
- package/dist/index-JKm4TBlY.d.cts.map +1 -0
- package/dist/index-Xre-0Jka.d.cts +145 -0
- package/dist/index-Xre-0Jka.d.cts.map +1 -0
- package/dist/{index-CedOvhGY.d.cts → index-ozfbEuYI.d.cts} +39 -17
- package/dist/index-ozfbEuYI.d.cts.map +1 -0
- package/dist/index.cjs +40 -68
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +11 -17
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.ts +11 -17
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +27 -38
- package/dist/index.js.map +1 -1
- package/dist/provider.cjs +3 -3
- package/dist/provider.cjs.map +1 -1
- package/dist/provider.d.cts +2 -1
- package/dist/provider.d.ts +2 -1
- package/dist/provider.js +3 -3
- package/dist/provider.js.map +1 -1
- package/dist/{codec-Bxlt1gKO.js → readError-B3Rz7rgs.js} +359 -56
- package/dist/readError-B3Rz7rgs.js.map +1 -0
- package/dist/{codec-BcK8ASsg.cjs → readError-COcEDNoZ.cjs} +363 -96
- package/dist/readError-COcEDNoZ.cjs.map +1 -0
- package/dist/requestAirdrop-DBCOST2B.d.ts +1818 -0
- package/dist/requestAirdrop-DBCOST2B.d.ts.map +1 -0
- package/dist/requestAirdrop-T1eVn3l5.d.cts +1818 -0
- package/dist/requestAirdrop-T1eVn3l5.d.cts.map +1 -0
- package/dist/sendInvocation-185ZJrta.cjs +583 -0
- package/dist/sendInvocation-185ZJrta.cjs.map +1 -0
- package/dist/sendInvocation-DBaNWhr3.js +439 -0
- package/dist/sendInvocation-DBaNWhr3.js.map +1 -0
- package/dist/signed-op.cjs +2 -2
- package/dist/signed-op.d.cts +2 -2
- package/dist/signed-op.d.ts +1 -1
- package/dist/signed-op.js +2 -2
- package/dist/{signedOp-DAucp6xg.cjs → signedOp-CVyeJ5ig.cjs} +3 -3
- package/dist/{signedOp-DAucp6xg.cjs.map → signedOp-CVyeJ5ig.cjs.map} +1 -1
- package/dist/{signedOp-DpmUpH-e.js → signedOp-D6WYZG9j.js} +3 -3
- package/dist/{signedOp-DpmUpH-e.js.map → signedOp-D6WYZG9j.js.map} +1 -1
- package/dist/{signed_op-_lR85dn2.cjs → signed_op-BBsDKOlD.cjs} +4 -4
- package/dist/{signed_op-_lR85dn2.cjs.map → signed_op-BBsDKOlD.cjs.map} +1 -1
- package/dist/{signed_op-zGq4eBo8.d.ts → signed_op-DHb4n2JO.d.cts} +3 -3
- package/dist/{signed_op-D2usgASc.d.cts.map → signed_op-DHb4n2JO.d.cts.map} +1 -1
- package/dist/{signed_op-D2usgASc.d.cts → signed_op-Dfa8WD0j.d.ts} +3 -3
- package/dist/{signed_op-zGq4eBo8.d.ts.map → signed_op-Dfa8WD0j.d.ts.map} +1 -1
- package/dist/{signed_op-CwN-_CXw.js → signed_op-h9X9-vBL.js} +3 -3
- package/dist/{signed_op-CwN-_CXw.js.map → signed_op-h9X9-vBL.js.map} +1 -1
- package/dist/transport-BhWZxHcz.cjs +528 -0
- package/dist/transport-BhWZxHcz.cjs.map +1 -0
- package/dist/transport-EyDYuibb.js +504 -0
- package/dist/transport-EyDYuibb.js.map +1 -0
- package/dist/transport.cjs +6 -13
- package/dist/transport.d.cts +3 -3
- package/dist/transport.d.ts +3 -3
- package/dist/transport.js +4 -4
- package/dist/types-VYjJcTip.d.cts +161 -0
- package/dist/types-VYjJcTip.d.cts.map +1 -0
- package/dist/types-VYjJcTip.d.ts +161 -0
- package/dist/types-VYjJcTip.d.ts.map +1 -0
- package/dist/{validation-eXATmgO0.js → validation-BLQ64Dfh.js} +3 -3
- package/dist/validation-BLQ64Dfh.js.map +1 -0
- package/dist/{validation-4w-vDGAi.cjs → validation-CZqtmMLJ.cjs} +3 -3
- package/dist/validation-CZqtmMLJ.cjs.map +1 -0
- package/dist/{wallet-BNKgOXrF.js → wallet-NlZiI4-3.js} +161 -77
- package/dist/wallet-NlZiI4-3.js.map +1 -0
- package/dist/{wallet-7R5M_7h4.cjs → wallet-UvyXtxh5.cjs} +161 -77
- package/dist/wallet-UvyXtxh5.cjs.map +1 -0
- package/dist/wallet.cjs +2 -8
- package/dist/wallet.d.cts +4 -3
- package/dist/wallet.d.ts +4 -3
- package/dist/wallet.js +3 -3
- package/package.json +5 -5
- package/dist/actions-B5-CjpEF.cjs +0 -513
- package/dist/actions-B5-CjpEF.cjs.map +0 -1
- package/dist/actions-C1SMLWO5.js +0 -430
- package/dist/actions-C1SMLWO5.js.map +0 -1
- package/dist/artifact-BM_MVzhL.d.cts +0 -35
- package/dist/artifact-BM_MVzhL.d.cts.map +0 -1
- package/dist/artifact-BM_MVzhL.d.ts +0 -35
- package/dist/artifact-BM_MVzhL.d.ts.map +0 -1
- package/dist/client-jOZxB8yW.d.cts +0 -798
- package/dist/client-jOZxB8yW.d.cts.map +0 -1
- package/dist/client-jOZxB8yW.d.ts +0 -798
- package/dist/client-jOZxB8yW.d.ts.map +0 -1
- package/dist/codec-BcK8ASsg.cjs.map +0 -1
- package/dist/codec-Bxlt1gKO.js.map +0 -1
- package/dist/contract-D77iA2iY.js.map +0 -1
- package/dist/contract-DSu2UPPm.cjs.map +0 -1
- package/dist/dev_wallet-CAbOSrak.cjs.map +0 -1
- package/dist/dev_wallet-CU3RpQLm.js.map +0 -1
- package/dist/execution-J5jkXhV1.d.cts.map +0 -1
- package/dist/execution-XJ0iwFaX.d.ts.map +0 -1
- package/dist/index-Bb01ytjJ.d.ts.map +0 -1
- package/dist/index-C3HVRvQd.d.ts.map +0 -1
- package/dist/index-CIHK7Ew9.d.cts +0 -303
- package/dist/index-CIHK7Ew9.d.cts.map +0 -1
- package/dist/index-CIHK7Ew9.d.ts +0 -303
- package/dist/index-CIHK7Ew9.d.ts.map +0 -1
- package/dist/index-CedOvhGY.d.cts.map +0 -1
- package/dist/index-CtjWsAXV.d.cts.map +0 -1
- package/dist/index-CtjZ61tl.d.cts.map +0 -1
- package/dist/index-DeS1S0m-.d.ts.map +0 -1
- package/dist/index-DfmDUk5Y.d.ts.map +0 -1
- package/dist/index-soFVQX9j.d.cts.map +0 -1
- package/dist/readError-CCVlmBhj.cjs +0 -624
- package/dist/readError-CCVlmBhj.cjs.map +0 -1
- package/dist/readError-D1dppovI.js +0 -571
- package/dist/readError-D1dppovI.js.map +0 -1
- package/dist/readViews-DbWELMMq.d.cts +0 -609
- package/dist/readViews-DbWELMMq.d.cts.map +0 -1
- package/dist/readViews-nV3jbpYc.d.ts +0 -609
- package/dist/readViews-nV3jbpYc.d.ts.map +0 -1
- package/dist/sendInvocation-Dsr9ij5P.cjs +0 -661
- package/dist/sendInvocation-Dsr9ij5P.cjs.map +0 -1
- package/dist/sendInvocation-tBmf8haQ.js +0 -505
- package/dist/sendInvocation-tBmf8haQ.js.map +0 -1
- package/dist/transport-5FPeNwuv.cjs +0 -279
- package/dist/transport-5FPeNwuv.cjs.map +0 -1
- package/dist/transport-IrhVlS4w.js +0 -261
- package/dist/transport-IrhVlS4w.js.map +0 -1
- package/dist/validation-4w-vDGAi.cjs.map +0 -1
- package/dist/validation-eXATmgO0.js.map +0 -1
- package/dist/wallet-7R5M_7h4.cjs.map +0 -1
- package/dist/wallet-BNKgOXrF.js.map +0 -1
package/dist/wallet.cjs
CHANGED
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_sendInvocation = require("./sendInvocation-
|
|
3
|
-
const require_wallet = require("./wallet-
|
|
4
|
-
exports.ExecutionDecodeError = require_sendInvocation.ExecutionDecodeError;
|
|
5
|
-
exports.ExecutionReturnUnavailableError = require_sendInvocation.ExecutionReturnUnavailableError;
|
|
6
|
-
exports.TransactionExecutionError = require_sendInvocation.TransactionExecutionError;
|
|
7
|
-
exports.TransactionObservationError = require_sendInvocation.TransactionObservationError;
|
|
8
|
-
exports.UnsupportedTransactionAdmissionError = require_sendInvocation.UnsupportedTransactionAdmissionError;
|
|
9
|
-
exports.UnsupportedTransactionOutcomeError = require_sendInvocation.UnsupportedTransactionOutcomeError;
|
|
2
|
+
const require_sendInvocation = require("./sendInvocation-185ZJrta.cjs");
|
|
3
|
+
const require_wallet = require("./wallet-UvyXtxh5.cjs");
|
|
10
4
|
exports.assertTransactionAdmission = require_sendInvocation.assertTransactionAdmission;
|
|
11
5
|
exports.assertTransactionSuccess = require_sendInvocation.assertTransactionSuccess;
|
|
12
6
|
exports.createDefaultWalletBatchInvocation = require_sendInvocation.createDefaultWalletBatchInvocation;
|
package/dist/wallet.d.cts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as
|
|
3
|
-
|
|
1
|
+
import { b as SubmissionEvidence, x as createSubmissionEvidence } from "./requestAirdrop-T1eVn3l5.cjs";
|
|
2
|
+
import { C as CreatePubkeyAccountOptions, D as WalletAccount, E as SourceAddressAccount, O as createPubkeyAccount, T as PubkeyAccount, _ as DeploymentOptions, a as decodeExecution, b as rv32Contract, c as walletGasLimit, d as WalletInvocationAdapter, f as createDefaultWalletBatchInvocation, g as ContractDeployment, h as devWalletAdapter, i as assertTransactionSuccess, k as createSourceAddressAccount, l as WalletBatchExecutionRequest, m as defineWalletInvocationAdapter, n as ExecutionResult, o as submitAndObserve, p as defaultWalletAdapter, r as assertTransactionAdmission, s as waitForExecution, t as CallResults, u as WalletExecutionRequest, v as decodeDeployment, w as CreateSourceAddressAccountOptions, y as prepareContractDeployment } from "./execution-pSt6k620.cjs";
|
|
3
|
+
import { a as WalletClient, c as WalletRequestAirdropOptions, d as ExecuteCallsRequest, f as PendingWalletTransaction, g as createProviderWalletClient, h as ProviderWalletClient, i as WalletAirdropActions, l as createWalletClient, m as ProviderExecutionOptions, n as PrepareExecutionRequest, o as WalletExecutionActions, p as PrepareBatchExecutionRequest, r as WalletActions, s as WalletNetworkOptions, t as ExecutableWalletClient, u as CreateProviderWalletClientOptions } from "./index-DBKsOzCN.cjs";
|
|
4
|
+
export { CallResults, type ContractDeployment, type CreateProviderWalletClientOptions, type CreatePubkeyAccountOptions, type CreateSourceAddressAccountOptions, type DeploymentOptions, type ExecutableWalletClient, type ExecuteCallsRequest, ExecutionResult, type PendingWalletTransaction, type PrepareBatchExecutionRequest, type PrepareExecutionRequest, type ProviderExecutionOptions, type ProviderWalletClient, type PubkeyAccount, type SourceAddressAccount, type SubmissionEvidence, type WalletAccount, type WalletActions, type WalletAirdropActions, type WalletBatchExecutionRequest, type WalletClient, type WalletExecutionActions, type WalletExecutionRequest, type WalletInvocationAdapter, type WalletNetworkOptions, type WalletRequestAirdropOptions, assertTransactionAdmission, assertTransactionSuccess, createDefaultWalletBatchInvocation, createProviderWalletClient, createPubkeyAccount, createSourceAddressAccount, createSubmissionEvidence, createWalletClient, decodeDeployment, decodeExecution, defaultWalletAdapter, defineWalletInvocationAdapter, devWalletAdapter, prepareContractDeployment, rv32Contract, submitAndObserve, waitForExecution, walletGasLimit };
|
package/dist/wallet.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as
|
|
3
|
-
|
|
1
|
+
import { b as SubmissionEvidence, x as createSubmissionEvidence } from "./requestAirdrop-DBCOST2B.js";
|
|
2
|
+
import { C as CreatePubkeyAccountOptions, D as WalletAccount, E as SourceAddressAccount, O as createPubkeyAccount, T as PubkeyAccount, _ as DeploymentOptions, a as decodeExecution, b as rv32Contract, c as walletGasLimit, d as WalletInvocationAdapter, f as createDefaultWalletBatchInvocation, g as ContractDeployment, h as devWalletAdapter, i as assertTransactionSuccess, k as createSourceAddressAccount, l as WalletBatchExecutionRequest, m as defineWalletInvocationAdapter, n as ExecutionResult, o as submitAndObserve, p as defaultWalletAdapter, r as assertTransactionAdmission, s as waitForExecution, t as CallResults, u as WalletExecutionRequest, v as decodeDeployment, w as CreateSourceAddressAccountOptions, y as prepareContractDeployment } from "./execution-uiuFPV0d.js";
|
|
3
|
+
import { a as WalletClient, c as WalletRequestAirdropOptions, d as ExecuteCallsRequest, f as PendingWalletTransaction, g as createProviderWalletClient, h as ProviderWalletClient, i as WalletAirdropActions, l as createWalletClient, m as ProviderExecutionOptions, n as PrepareExecutionRequest, o as WalletExecutionActions, p as PrepareBatchExecutionRequest, r as WalletActions, s as WalletNetworkOptions, t as ExecutableWalletClient, u as CreateProviderWalletClientOptions } from "./index-B1efA-Y_.js";
|
|
4
|
+
export { CallResults, type ContractDeployment, type CreateProviderWalletClientOptions, type CreatePubkeyAccountOptions, type CreateSourceAddressAccountOptions, type DeploymentOptions, type ExecutableWalletClient, type ExecuteCallsRequest, ExecutionResult, type PendingWalletTransaction, type PrepareBatchExecutionRequest, type PrepareExecutionRequest, type ProviderExecutionOptions, type ProviderWalletClient, type PubkeyAccount, type SourceAddressAccount, type SubmissionEvidence, type WalletAccount, type WalletActions, type WalletAirdropActions, type WalletBatchExecutionRequest, type WalletClient, type WalletExecutionActions, type WalletExecutionRequest, type WalletInvocationAdapter, type WalletNetworkOptions, type WalletRequestAirdropOptions, assertTransactionAdmission, assertTransactionSuccess, createDefaultWalletBatchInvocation, createProviderWalletClient, createPubkeyAccount, createSourceAddressAccount, createSubmissionEvidence, createWalletClient, decodeDeployment, decodeExecution, defaultWalletAdapter, defineWalletInvocationAdapter, devWalletAdapter, prepareContractDeployment, rv32Contract, submitAndObserve, waitForExecution, walletGasLimit };
|
package/dist/wallet.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as rv32Contract, i as prepareContractDeployment, n as createWalletClient, o as createPubkeyAccount, r as decodeDeployment, s as createSourceAddressAccount, t as createProviderWalletClient } from "./wallet-
|
|
3
|
-
export {
|
|
1
|
+
import { a as assertTransactionSuccess, b as defineWalletInvocationAdapter, c as waitForExecution, g as createSubmissionEvidence, i as assertTransactionAdmission, l as walletGasLimit, o as decodeExecution, s as submitAndObserve, v as createDefaultWalletBatchInvocation, x as devWalletAdapter, y as defaultWalletAdapter } from "./sendInvocation-DBaNWhr3.js";
|
|
2
|
+
import { a as rv32Contract, i as prepareContractDeployment, n as createWalletClient, o as createPubkeyAccount, r as decodeDeployment, s as createSourceAddressAccount, t as createProviderWalletClient } from "./wallet-NlZiI4-3.js";
|
|
3
|
+
export { assertTransactionAdmission, assertTransactionSuccess, createDefaultWalletBatchInvocation, createProviderWalletClient, createPubkeyAccount, createSourceAddressAccount, createSubmissionEvidence, createWalletClient, decodeDeployment, decodeExecution, defaultWalletAdapter, defineWalletInvocationAdapter, devWalletAdapter, prepareContractDeployment, rv32Contract, submitAndObserve, waitForExecution, walletGasLimit };
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thruputchain/client",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.30.0",
|
|
4
4
|
"description": "TypeScript client for the Thruput blockchain",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "git+https://github.com/thruputchain/thruput-sdk-ts.git"
|
|
8
8
|
},
|
|
9
|
-
"homepage": "https://
|
|
9
|
+
"homepage": "https://www.thruput.network/docs/typescript/reference/sdk/",
|
|
10
10
|
"bugs": {
|
|
11
11
|
"url": "https://github.com/thruputchain/thruput-sdk-ts/issues"
|
|
12
12
|
},
|
|
@@ -117,8 +117,8 @@
|
|
|
117
117
|
"@noble/hashes": "^2.2.0",
|
|
118
118
|
"@noble/post-quantum": "^0.7.1",
|
|
119
119
|
"@scure/base": "2.0.0",
|
|
120
|
-
"@thruputchain/contract-spec": "0.
|
|
121
|
-
"@thruputchain/protocol": "0.
|
|
122
|
-
"@thruputchain/xdr": "0.
|
|
120
|
+
"@thruputchain/contract-spec": "0.21.0",
|
|
121
|
+
"@thruputchain/protocol": "0.21.0",
|
|
122
|
+
"@thruputchain/xdr": "0.21.0"
|
|
123
123
|
}
|
|
124
124
|
}
|
|
@@ -1,513 +0,0 @@
|
|
|
1
|
-
const require_contract = require("./contract-DSu2UPPm.cjs");
|
|
2
|
-
const require_codec = require("./codec-BcK8ASsg.cjs");
|
|
3
|
-
const require_hex = require("./hex-DkGpiZ5e.cjs");
|
|
4
|
-
const require_readError = require("./readError-CCVlmBhj.cjs");
|
|
5
|
-
const require_sendInvocation = require("./sendInvocation-Dsr9ij5P.cjs");
|
|
6
|
-
const require_dev_wallet = require("./dev_wallet-CAbOSrak.cjs");
|
|
7
|
-
let _thruputchain_protocol = require("@thruputchain/protocol");
|
|
8
|
-
let _noble_hashes_sha2_js = require("@noble/hashes/sha2.js");
|
|
9
|
-
//#region src/actions/public/requestAirdrop.ts
|
|
10
|
-
/** Funding stopped without permission to call the faucet again. */
|
|
11
|
-
var FundingObservationError = class extends Error {
|
|
12
|
-
request;
|
|
13
|
-
lastResponse;
|
|
14
|
-
knownCommitment;
|
|
15
|
-
constructor(request, lastResponse, cause, knownCommitment) {
|
|
16
|
-
super("Funding observation stopped", { cause });
|
|
17
|
-
this.request = request;
|
|
18
|
-
this.lastResponse = lastResponse;
|
|
19
|
-
this.knownCommitment = knownCommitment;
|
|
20
|
-
this.name = "FundingObservationError";
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
|
-
/** Perform exactly one faucet call. It neither polls nor repeats an ambiguous attempt. */
|
|
24
|
-
async function requestAirdropAttempt(client, request, options = {}) {
|
|
25
|
-
return client.faucet_requestAirdrop(request, options);
|
|
26
|
-
}
|
|
27
|
-
/** Call the faucet once, then observe a returned pending hash using read-only calls. */
|
|
28
|
-
async function requestAirdrop(client, options) {
|
|
29
|
-
const timeoutMs = options.timeoutMs ?? 6e4;
|
|
30
|
-
require_sendInvocation.validateTimer(timeoutMs, "timeoutMs");
|
|
31
|
-
const request = {
|
|
32
|
-
recipient: new Uint8Array(options.recipient),
|
|
33
|
-
clientNonce: options.clientNonce ? new Uint8Array(options.clientNonce) : crypto.getRandomValues(new Uint8Array(16)),
|
|
34
|
-
networkHash: new Uint8Array(options.expectedNetworkHash ?? client.discovery.network.networkHash)
|
|
35
|
-
};
|
|
36
|
-
if (request.recipient.length !== 32 || request.networkHash.length !== 32 || request.clientNonce.length < 1 || request.clientNonce.length > 32) throw new RangeError("Funding requires 32-byte addresses/hashes and a 1–32 byte nonce");
|
|
37
|
-
client.requireMethods([
|
|
38
|
-
"faucet_requestAirdrop",
|
|
39
|
-
"getNetworkInfo",
|
|
40
|
-
"getTransactionReceipt",
|
|
41
|
-
"getTransactionStatus"
|
|
42
|
-
]);
|
|
43
|
-
const deadline = performance.now() + timeoutMs;
|
|
44
|
-
let lastResponse;
|
|
45
|
-
const timeout = () => /* @__PURE__ */ new Error("Funding observation timed out");
|
|
46
|
-
const run = (operation) => require_sendInvocation.beforeDeadline(operation, deadline, options.signal, timeout);
|
|
47
|
-
try {
|
|
48
|
-
if ((await run((signal) => client.getNetworkInfo({}, { signal }))).networkHash.some((v, i) => v !== request.networkHash[i])) throw new require_readError.RpcCompatibilityError("Funding endpoint network does not match");
|
|
49
|
-
lastResponse = await run((signal) => requestAirdropAttempt(client, {
|
|
50
|
-
recipient: request.recipient,
|
|
51
|
-
clientNonce: request.clientNonce
|
|
52
|
-
}, { signal }));
|
|
53
|
-
if (lastResponse instanceof require_codec.UnsupportedRpcValue) throw lastResponse;
|
|
54
|
-
if (lastResponse.attemptStatus === "succeeded") {
|
|
55
|
-
if (lastResponse.execution instanceof require_codec.UnsupportedRpcValue) throw lastResponse.execution;
|
|
56
|
-
return lastResponse;
|
|
57
|
-
}
|
|
58
|
-
if (!lastResponse.transactionHash) throw new Error("Pending funding did not identify a transaction");
|
|
59
|
-
const receipt = await require_sendInvocation.waitForTransactionReceipt(client, lastResponse.transactionHash, {
|
|
60
|
-
expectedNetworkHash: request.networkHash,
|
|
61
|
-
timeoutMs: Math.max(0, deadline - performance.now()),
|
|
62
|
-
signal: options.signal
|
|
63
|
-
});
|
|
64
|
-
require_sendInvocation.assertTransactionSuccess(receipt);
|
|
65
|
-
return {
|
|
66
|
-
attemptStatus: "succeeded",
|
|
67
|
-
recipient: lastResponse.recipient,
|
|
68
|
-
rawAmount: lastResponse.rawAmount,
|
|
69
|
-
transactionHash: receipt.transactionHash,
|
|
70
|
-
blockHeight: receipt.blockHeight,
|
|
71
|
-
execution: receipt.execution
|
|
72
|
-
};
|
|
73
|
-
} catch (cause) {
|
|
74
|
-
const nativeReceipt = cause instanceof require_readError.NativeRpcError && cause.decoded.classification === "known" && "receipt" in cause.decoded.data ? cause.decoded.data.receipt : void 0;
|
|
75
|
-
const committedResult = cause instanceof require_sendInvocation.TransactionExecutionError ? cause.receipt : nativeReceipt ?? (!(lastResponse instanceof require_codec.UnsupportedRpcValue) && lastResponse?.attemptStatus === "succeeded" ? lastResponse : void 0);
|
|
76
|
-
throw new FundingObservationError(request, lastResponse, cause, cause instanceof require_sendInvocation.TransactionReceiptObservationError ? cause.knownCommitment : committedResult ? {
|
|
77
|
-
networkHash: request.networkHash.slice(),
|
|
78
|
-
transactionHash: new Uint8Array(committedResult.transactionHash),
|
|
79
|
-
blockHeight: committedResult.blockHeight
|
|
80
|
-
} : void 0);
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
//#endregion
|
|
84
|
-
//#region src/actions/public/getContractEvents.ts
|
|
85
|
-
/**
|
|
86
|
-
* Fetch exactly one page using a generated event's filter and decoder.
|
|
87
|
-
*
|
|
88
|
-
* No additional pages are fetched. Pass the returned cursor into the next call
|
|
89
|
-
* with the same filters. Malformed events and unexpected signatures throw
|
|
90
|
-
* ContractDecodeError rather than silently disappearing from the page.
|
|
91
|
-
*
|
|
92
|
-
* @example
|
|
93
|
-
* ```ts
|
|
94
|
-
* const page = await getContractEvents(client, {
|
|
95
|
-
* event: thruput_erc20_if.v0_1.events.TransferEvent,
|
|
96
|
-
* addresses: [tokenAddress],
|
|
97
|
-
* topics: { to: accountAddress },
|
|
98
|
-
* start: { order: "ascending", anchor: { kind: "atBeginning" } },
|
|
99
|
-
* limit: 20,
|
|
100
|
-
* }, { signal });
|
|
101
|
-
* ```
|
|
102
|
-
*/
|
|
103
|
-
async function getContractEvents(client, query, options) {
|
|
104
|
-
options?.signal?.throwIfAborted();
|
|
105
|
-
const { event, addresses, topics, ...pageQuery } = query;
|
|
106
|
-
const page = await client.getEvents({
|
|
107
|
-
...pageQuery,
|
|
108
|
-
filters: [event.filter({
|
|
109
|
-
addresses,
|
|
110
|
-
topics
|
|
111
|
-
})]
|
|
112
|
-
}, options);
|
|
113
|
-
return {
|
|
114
|
-
...page,
|
|
115
|
-
events: page.events.map(({ event: raw, ...identity }) => {
|
|
116
|
-
const decoded = event.decode(raw);
|
|
117
|
-
if (decoded === null) throw new require_contract.ContractDecodeError("Event query returned an unexpected event signature");
|
|
118
|
-
return {
|
|
119
|
-
...decoded,
|
|
120
|
-
...identity,
|
|
121
|
-
address: raw.address
|
|
122
|
-
};
|
|
123
|
-
})
|
|
124
|
-
};
|
|
125
|
-
}
|
|
126
|
-
//#endregion
|
|
127
|
-
//#region src/actions/public/historyWalk.ts
|
|
128
|
-
var HistoryWalkError = class extends Error {
|
|
129
|
-
page;
|
|
130
|
-
constructor(message, page) {
|
|
131
|
-
super(message);
|
|
132
|
-
this.page = page;
|
|
133
|
-
this.name = "HistoryWalkError";
|
|
134
|
-
}
|
|
135
|
-
};
|
|
136
|
-
const compare = (a, b) => {
|
|
137
|
-
for (let i = 0; i < 3; i++) {
|
|
138
|
-
if (a[i] < b[i]) return -1;
|
|
139
|
-
if (a[i] > b[i]) return 1;
|
|
140
|
-
}
|
|
141
|
-
return 0;
|
|
142
|
-
};
|
|
143
|
-
/** Shared cross-page checks; single-page shape, filter and identity checks belong to RpcClient. */
|
|
144
|
-
async function* walkHistory(fetch, kind, scope, options) {
|
|
145
|
-
const order = "start" in scope ? scope.start.order : scope.order;
|
|
146
|
-
let cursor, watermark, lowerBound, upperBound, last;
|
|
147
|
-
const cursors = /* @__PURE__ */ new Set(), identities = /* @__PURE__ */ new Set();
|
|
148
|
-
for (;;) {
|
|
149
|
-
options.signal?.throwIfAborted();
|
|
150
|
-
const page = await fetch(cursor);
|
|
151
|
-
options.signal?.throwIfAborted();
|
|
152
|
-
const fail = (message) => {
|
|
153
|
-
throw new HistoryWalkError(message, page);
|
|
154
|
-
};
|
|
155
|
-
const rows = kind === "events" ? page.events : page.transactions;
|
|
156
|
-
if (watermark === void 0) {
|
|
157
|
-
watermark = page.latestIndexedBlockHeight;
|
|
158
|
-
lowerBound = "start" in scope && order === "ascending" && scope.start.anchor.kind === "atHeight" ? scope.start.anchor.blockHeight : page.oldestIndexedBlockHeight;
|
|
159
|
-
upperBound = "start" in scope && order === "descending" && scope.start.anchor.kind === "atHeight" && scope.start.anchor.blockHeight < watermark ? scope.start.anchor.blockHeight : watermark;
|
|
160
|
-
}
|
|
161
|
-
if ("blockHeight" in scope) {
|
|
162
|
-
if (scope.blockHeight < page.oldestIndexedBlockHeight || scope.blockHeight > page.latestIndexedBlockHeight) fail("Requested block is outside current indexed coverage");
|
|
163
|
-
} else {
|
|
164
|
-
if (page.latestIndexedBlockHeight < watermark) fail("History coverage regressed below the initial watermark");
|
|
165
|
-
if (page.oldestIndexedBlockHeight > lowerBound) fail("History retention no longer covers the requested range");
|
|
166
|
-
}
|
|
167
|
-
for (const row of rows) {
|
|
168
|
-
if ("blockHeight" in scope ? row.blockHeight !== scope.blockHeight : row.blockHeight > upperBound || row.blockHeight < lowerBound) fail("History row is outside the fixed walk scope");
|
|
169
|
-
const hash = require_hex.toHex0x(row.transactionHash), sequence = kind === "events" ? row.sequenceNumber : 0;
|
|
170
|
-
const identity = kind === "events" ? `${hash}/${sequence}` : hash;
|
|
171
|
-
if (identities.has(identity)) fail("History returned a duplicate identity across pages");
|
|
172
|
-
const key = [
|
|
173
|
-
row.blockHeight,
|
|
174
|
-
hash,
|
|
175
|
-
sequence
|
|
176
|
-
];
|
|
177
|
-
if (last && (order === "ascending" ? compare(last, key) >= 0 : compare(last, key) <= 0)) fail("History order did not advance across pages");
|
|
178
|
-
identities.add(identity);
|
|
179
|
-
last = key;
|
|
180
|
-
}
|
|
181
|
-
const next = page.nextCursor;
|
|
182
|
-
if (next !== null) {
|
|
183
|
-
if (cursors.has(next)) fail("History returned a repeated pagination cursor");
|
|
184
|
-
cursors.add(next);
|
|
185
|
-
}
|
|
186
|
-
yield page;
|
|
187
|
-
if (next === null) {
|
|
188
|
-
options.signal?.throwIfAborted();
|
|
189
|
-
if ("blockHeight" in scope) return;
|
|
190
|
-
return {
|
|
191
|
-
watermarkBlockHeight: watermark,
|
|
192
|
-
...order === "ascending" && lowerBound <= watermark ? { completedThroughBlockHeight: watermark } : {}
|
|
193
|
-
};
|
|
194
|
-
}
|
|
195
|
-
cursor = next;
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
//#endregion
|
|
199
|
-
//#region src/actions/public/iterateEventPages.ts
|
|
200
|
-
/** Start a fixed event range. Saved opaque cursors remain available through getEvents. */
|
|
201
|
-
function iterateEventPages(client, query, options = {}) {
|
|
202
|
-
const snapshot = structuredClone(query);
|
|
203
|
-
if (!snapshot.start || snapshot.cursor !== void 0) throw new TypeError("Event walks require an explicit start");
|
|
204
|
-
return walkHistory((cursor) => client.getEvents(cursor === void 0 ? snapshot : {
|
|
205
|
-
filters: snapshot.filters,
|
|
206
|
-
limit: snapshot.limit,
|
|
207
|
-
cursor
|
|
208
|
-
}, options), "events", { start: snapshot.start }, options);
|
|
209
|
-
}
|
|
210
|
-
//#endregion
|
|
211
|
-
//#region src/actions/public/readViews.ts
|
|
212
|
-
/**
|
|
213
|
-
* Read generated method requests against one shared committed snapshot.
|
|
214
|
-
* Contract aborts and faults are outcomes. Transport, freshness, and decoding
|
|
215
|
-
* failures reject the group. Calls are never split or emulated with separate views.
|
|
216
|
-
*
|
|
217
|
-
* @example
|
|
218
|
-
* ```ts
|
|
219
|
-
* const result = await client.readViews({ calls: [
|
|
220
|
-
* ERC20.v0_1.totalSupply.viewRequest({ address: token }),
|
|
221
|
-
* ERC20.v0_1.getBalanceOf.viewRequest({ address: token, args: { addr: owner } }),
|
|
222
|
-
* ] });
|
|
223
|
-
* ```
|
|
224
|
-
*/
|
|
225
|
-
async function readViews(client, request, options) {
|
|
226
|
-
options?.signal?.throwIfAborted();
|
|
227
|
-
const calls = request.calls.map((call) => {
|
|
228
|
-
if ("minStateBlockHeight" in call) throw new TypeError("Set minStateBlockHeight on readViews, not on a prepared call");
|
|
229
|
-
return {
|
|
230
|
-
request: call.request,
|
|
231
|
-
name: call.method.name,
|
|
232
|
-
decode: call.method.decodeViewOutcome
|
|
233
|
-
};
|
|
234
|
-
});
|
|
235
|
-
const response = await client.simulateInvocations({
|
|
236
|
-
invocations: calls.map((call) => call.request),
|
|
237
|
-
...request.minStateBlockHeight === void 0 ? {} : { minStateBlockHeight: request.minStateBlockHeight }
|
|
238
|
-
}, options);
|
|
239
|
-
const results = calls.map((call, index) => {
|
|
240
|
-
try {
|
|
241
|
-
return call.decode({
|
|
242
|
-
...response.results[index],
|
|
243
|
-
stateBlockHeight: response.stateBlockHeight
|
|
244
|
-
});
|
|
245
|
-
} catch (cause) {
|
|
246
|
-
throw new require_contract.ContractDecodeError(`Failed to decode readViews result ${index} (${call.name})`, { cause });
|
|
247
|
-
}
|
|
248
|
-
});
|
|
249
|
-
return {
|
|
250
|
-
stateBlockHeight: response.stateBlockHeight,
|
|
251
|
-
results
|
|
252
|
-
};
|
|
253
|
-
}
|
|
254
|
-
//#endregion
|
|
255
|
-
//#region src/actions/public/iterateTransactionPages.ts
|
|
256
|
-
/** Transactions sent by this root address; incoming transfers use token events. */
|
|
257
|
-
function iterateTransactionsByRootAddress(client, query, options = {}) {
|
|
258
|
-
const snapshot = structuredClone(query);
|
|
259
|
-
if (!snapshot.start || snapshot.cursor !== void 0) throw new TypeError("Root-address walks require an explicit start");
|
|
260
|
-
return walkHistory((cursor) => client.getTransactionsByRootAddress(cursor === void 0 ? snapshot : {
|
|
261
|
-
address: snapshot.address,
|
|
262
|
-
limit: snapshot.limit,
|
|
263
|
-
cursor
|
|
264
|
-
}, options), "transactions", { start: snapshot.start }, options);
|
|
265
|
-
}
|
|
266
|
-
/** Walk one covered block. Completion never establishes a whole-chain checkpoint. */
|
|
267
|
-
function iterateTransactionsByBlock(client, query, options = {}) {
|
|
268
|
-
const snapshot = structuredClone(query);
|
|
269
|
-
if (!snapshot.start || snapshot.cursor !== void 0) throw new TypeError("Block walks require an explicit start");
|
|
270
|
-
return walkHistory((cursor) => client.getTransactionsByBlock(cursor === void 0 ? snapshot : {
|
|
271
|
-
blockHeight: snapshot.blockHeight,
|
|
272
|
-
limit: snapshot.limit,
|
|
273
|
-
cursor
|
|
274
|
-
}, options), "transactions", {
|
|
275
|
-
blockHeight: snapshot.blockHeight,
|
|
276
|
-
order: snapshot.start.order
|
|
277
|
-
}, options);
|
|
278
|
-
}
|
|
279
|
-
//#endregion
|
|
280
|
-
//#region src/actions/public/getContractSpec.ts
|
|
281
|
-
/**
|
|
282
|
-
* Resolve a current deployment and verify its embedded spec against its hash.
|
|
283
|
-
* Missing artifacts and invalid responses throw; neither means no deployment.
|
|
284
|
-
* The snapshot does not establish which implementation produced historical events.
|
|
285
|
-
*/
|
|
286
|
-
async function getContractSpec(client, request, options) {
|
|
287
|
-
client.requireMethods(["getContractDeployment", "getContractArtifact"]);
|
|
288
|
-
const address = new Uint8Array(request.address);
|
|
289
|
-
const result = await client.getContractDeployment({ address }, options);
|
|
290
|
-
if (!require_contract.bytesEqual(address, result.address)) throw new require_contract.ContractVerificationError("Contract deployment address mismatch");
|
|
291
|
-
if (result.deployment === null) return {
|
|
292
|
-
...result,
|
|
293
|
-
artifactSpec: null
|
|
294
|
-
};
|
|
295
|
-
return {
|
|
296
|
-
...result,
|
|
297
|
-
artifactSpec: await readDeploymentSpec(client, result.deployment, options)
|
|
298
|
-
};
|
|
299
|
-
}
|
|
300
|
-
/** Shared identity validation for explicit deployments and effective contract selection. */
|
|
301
|
-
async function readDeploymentSpec(client, deployment, options) {
|
|
302
|
-
const artifact = await client.getContractArtifact({ hash: deployment.hash }, options);
|
|
303
|
-
if (!require_contract.bytesEqual(artifact.hash, deployment.hash)) throw new require_contract.ContractVerificationError("Contract artifact response hash mismatch");
|
|
304
|
-
const artifactSpec = require_contract.readContractArtifactSpec(artifact.contractXdr, (0, _thruputchain_protocol.sha256Hash)(deployment.hash));
|
|
305
|
-
const contract = (0, _thruputchain_protocol.deserialize)(artifact.contractXdr, _thruputchain_protocol.codec.Contract);
|
|
306
|
-
const size = contract.contract_type === _thruputchain_protocol.ContractType.kRv32 ? contract.rv32_contract.data.length : 0;
|
|
307
|
-
if (contract.contract_type !== deployment.contractType || size !== deployment.size) throw new require_contract.ContractVerificationError("Contract artifact does not match deployment metadata");
|
|
308
|
-
return artifactSpec;
|
|
309
|
-
}
|
|
310
|
-
//#endregion
|
|
311
|
-
//#region src/actions/public/getEffectiveContractSpec.ts
|
|
312
|
-
const nativeWalletHash = require_contract.hashContract({
|
|
313
|
-
contract_type: _thruputchain_protocol.ContractType.kNative,
|
|
314
|
-
native_contract_id: _thruputchain_protocol.HogexecPrecompiledNativeContracts.kNativeContractDefaultWallet
|
|
315
|
-
});
|
|
316
|
-
/**
|
|
317
|
-
* Discover current contract selection without inferring authorization or historical identity.
|
|
318
|
-
* Root context allows the chain-configured fallback; nested excludes that fallback.
|
|
319
|
-
* Transaction-local deployments are outside this committed-state reading.
|
|
320
|
-
*/
|
|
321
|
-
async function getEffectiveContractSpec(client, request, options) {
|
|
322
|
-
client.requireMethods(["getEffectiveContract", "getContractArtifact"]);
|
|
323
|
-
const address = new Uint8Array(request.address);
|
|
324
|
-
const context = request.context;
|
|
325
|
-
const result = await client.getEffectiveContract({
|
|
326
|
-
address,
|
|
327
|
-
context
|
|
328
|
-
}, options);
|
|
329
|
-
if (!require_contract.bytesEqual(address, result.address) || result.context !== context) throw new require_contract.ContractVerificationError("Effective contract request identity mismatch");
|
|
330
|
-
if (result.selection instanceof require_codec.UnsupportedRpcValue) throw new require_readError.RpcCompatibilityError("Unsupported effective contract selection");
|
|
331
|
-
if (result.selection === null) return {
|
|
332
|
-
...result,
|
|
333
|
-
artifactSpec: null,
|
|
334
|
-
nativeInterface: null
|
|
335
|
-
};
|
|
336
|
-
if (context === "nested" && result.selection.source === "networkDefault") throw new require_contract.ContractVerificationError("Network default cannot apply to a nested invocation");
|
|
337
|
-
const contract = result.selection.contract;
|
|
338
|
-
const artifactSpec = await readDeploymentSpec(client, contract, options);
|
|
339
|
-
const nativeInterface = artifactSpec.kind === "native" && require_contract.bytesEqual(contract.hash, nativeWalletHash) ? {
|
|
340
|
-
name: "DefaultWallet",
|
|
341
|
-
spec: require_dev_wallet.spec$1
|
|
342
|
-
} : null;
|
|
343
|
-
return {
|
|
344
|
-
...result,
|
|
345
|
-
artifactSpec,
|
|
346
|
-
nativeInterface
|
|
347
|
-
};
|
|
348
|
-
}
|
|
349
|
-
//#endregion
|
|
350
|
-
//#region src/actions/public/decodeWalletRequests.ts
|
|
351
|
-
/**
|
|
352
|
-
* Interpret a known DefaultWallet root using built-in binding descriptors.
|
|
353
|
-
* Call only after identifying the root as DefaultWallet; matching selectors
|
|
354
|
-
* alone do not establish wallet identity. Malformed recognized inputs throw.
|
|
355
|
-
*/
|
|
356
|
-
function decodeDefaultWalletRequests(root) {
|
|
357
|
-
if (require_contract.bytesEqual(root.entrypoint, require_dev_wallet.DefaultWallet.v0_1.execute.entrypoint)) {
|
|
358
|
-
const { calls } = require_dev_wallet.DefaultWallet.v0_1.execute.decodeArgs(root.calldata);
|
|
359
|
-
return {
|
|
360
|
-
wrapper: "DefaultWallet.execute",
|
|
361
|
-
requestedCalls: calls.map((call) => ({
|
|
362
|
-
invoked_address: call.target,
|
|
363
|
-
entrypoint: (0, _thruputchain_protocol.contractEntrypointID)(call.entrypoint),
|
|
364
|
-
gas_limit: (0, _thruputchain_protocol.gasAmount)(call.gas_limit),
|
|
365
|
-
calldata: (0, _thruputchain_protocol.calldata)(call.calldata)
|
|
366
|
-
}))
|
|
367
|
-
};
|
|
368
|
-
}
|
|
369
|
-
if (require_contract.bytesEqual(root.entrypoint, require_dev_wallet.DefaultWallet.v0_1.deploy.entrypoint)) {
|
|
370
|
-
const args = require_dev_wallet.DefaultWallet.v0_1.deploy.decodeArgs(root.calldata);
|
|
371
|
-
const init = args.initializer;
|
|
372
|
-
return {
|
|
373
|
-
wrapper: "DefaultWallet.deploy",
|
|
374
|
-
requestedCalls: init ? [{
|
|
375
|
-
invoked_address: require_contract.deriveContractAddress(root.invoked_address, (0, _thruputchain_protocol.sha256Hash)(args.nonce), (0, _thruputchain_protocol.sha256Hash)(args.contractHash)),
|
|
376
|
-
entrypoint: (0, _thruputchain_protocol.contractEntrypointID)(init.entrypoint),
|
|
377
|
-
gas_limit: (0, _thruputchain_protocol.gasAmount)(init.gas_limit),
|
|
378
|
-
calldata: (0, _thruputchain_protocol.calldata)(init.calldata)
|
|
379
|
-
}] : []
|
|
380
|
-
};
|
|
381
|
-
}
|
|
382
|
-
return null;
|
|
383
|
-
}
|
|
384
|
-
//#endregion
|
|
385
|
-
//#region src/actions/public/readTransactionInput.ts
|
|
386
|
-
/**
|
|
387
|
-
* Read and authenticate a retained Transaction, including its root invocation.
|
|
388
|
-
* Unavailable does not prove nonexecution. A matching body hash authenticates
|
|
389
|
-
* neither signatures nor the reported block height, and does not imply success.
|
|
390
|
-
*/
|
|
391
|
-
async function readTransactionInput(client, request, options) {
|
|
392
|
-
client.requireMethods(["getTransactionInput"]);
|
|
393
|
-
const hash = new Uint8Array(request.transactionHash);
|
|
394
|
-
const result = await client.getTransactionInput({ transactionHash: hash }, options);
|
|
395
|
-
if (result instanceof require_codec.UnsupportedRpcValue || result.status === "unavailable") return result;
|
|
396
|
-
try {
|
|
397
|
-
if (result.transactionXdr.length > 4 * 1024 * 1024) throw new Error("Transaction input exceeds 4 MiB");
|
|
398
|
-
if (!require_contract.bytesEqual(result.transactionHash, hash) || !require_contract.bytesEqual((0, _noble_hashes_sha2_js.sha256)(result.transactionXdr), hash)) throw new Error("Retained transaction input hash mismatch");
|
|
399
|
-
const transaction = (0, _thruputchain_protocol.deserialize)(result.transactionXdr, _thruputchain_protocol.codec.Transaction);
|
|
400
|
-
if (!require_contract.bytesEqual((0, _thruputchain_protocol.serialize)(transaction, _thruputchain_protocol.codec.Transaction), result.transactionXdr)) throw new Error("Noncanonical Transaction XDR");
|
|
401
|
-
return {
|
|
402
|
-
...result,
|
|
403
|
-
transaction
|
|
404
|
-
};
|
|
405
|
-
} catch (cause) {
|
|
406
|
-
throw new require_contract.ContractVerificationError(cause instanceof Error ? cause.message : "Invalid transaction input", { cause });
|
|
407
|
-
}
|
|
408
|
-
}
|
|
409
|
-
//#endregion
|
|
410
|
-
//#region src/actions/wallet/sendTransaction.ts
|
|
411
|
-
/**
|
|
412
|
-
* Serialize and submit once through the native RPC boundary.
|
|
413
|
-
* Unknown admission throws TransactionObservationError with the signed bytes and
|
|
414
|
-
* destination discovery network; that network does not prove the signing network
|
|
415
|
-
* of an already-signed envelope. RPC and transport failures propagate unchanged.
|
|
416
|
-
*/
|
|
417
|
-
async function sendTransaction(client, signedTx, options) {
|
|
418
|
-
const evidence = require_sendInvocation.createSubmissionEvidence((0, _thruputchain_protocol.serialize)(signedTx, _thruputchain_protocol.codec.SignedTransaction), client.discovery.network.networkHash);
|
|
419
|
-
const result = await client.sendTransaction({ signedTransaction: evidence.signedTransaction }, options);
|
|
420
|
-
try {
|
|
421
|
-
require_sendInvocation.assertTransactionAdmission(result);
|
|
422
|
-
} catch (cause) {
|
|
423
|
-
throw new require_sendInvocation.TransactionObservationError(evidence, cause, void 0, void 0, "submission");
|
|
424
|
-
}
|
|
425
|
-
return (0, _thruputchain_protocol.sha256Hash)(result.transactionHash);
|
|
426
|
-
}
|
|
427
|
-
//#endregion
|
|
428
|
-
Object.defineProperty(exports, "FundingObservationError", {
|
|
429
|
-
enumerable: true,
|
|
430
|
-
get: function() {
|
|
431
|
-
return FundingObservationError;
|
|
432
|
-
}
|
|
433
|
-
});
|
|
434
|
-
Object.defineProperty(exports, "HistoryWalkError", {
|
|
435
|
-
enumerable: true,
|
|
436
|
-
get: function() {
|
|
437
|
-
return HistoryWalkError;
|
|
438
|
-
}
|
|
439
|
-
});
|
|
440
|
-
Object.defineProperty(exports, "decodeDefaultWalletRequests", {
|
|
441
|
-
enumerable: true,
|
|
442
|
-
get: function() {
|
|
443
|
-
return decodeDefaultWalletRequests;
|
|
444
|
-
}
|
|
445
|
-
});
|
|
446
|
-
Object.defineProperty(exports, "getContractEvents", {
|
|
447
|
-
enumerable: true,
|
|
448
|
-
get: function() {
|
|
449
|
-
return getContractEvents;
|
|
450
|
-
}
|
|
451
|
-
});
|
|
452
|
-
Object.defineProperty(exports, "getContractSpec", {
|
|
453
|
-
enumerable: true,
|
|
454
|
-
get: function() {
|
|
455
|
-
return getContractSpec;
|
|
456
|
-
}
|
|
457
|
-
});
|
|
458
|
-
Object.defineProperty(exports, "getEffectiveContractSpec", {
|
|
459
|
-
enumerable: true,
|
|
460
|
-
get: function() {
|
|
461
|
-
return getEffectiveContractSpec;
|
|
462
|
-
}
|
|
463
|
-
});
|
|
464
|
-
Object.defineProperty(exports, "iterateEventPages", {
|
|
465
|
-
enumerable: true,
|
|
466
|
-
get: function() {
|
|
467
|
-
return iterateEventPages;
|
|
468
|
-
}
|
|
469
|
-
});
|
|
470
|
-
Object.defineProperty(exports, "iterateTransactionsByBlock", {
|
|
471
|
-
enumerable: true,
|
|
472
|
-
get: function() {
|
|
473
|
-
return iterateTransactionsByBlock;
|
|
474
|
-
}
|
|
475
|
-
});
|
|
476
|
-
Object.defineProperty(exports, "iterateTransactionsByRootAddress", {
|
|
477
|
-
enumerable: true,
|
|
478
|
-
get: function() {
|
|
479
|
-
return iterateTransactionsByRootAddress;
|
|
480
|
-
}
|
|
481
|
-
});
|
|
482
|
-
Object.defineProperty(exports, "readTransactionInput", {
|
|
483
|
-
enumerable: true,
|
|
484
|
-
get: function() {
|
|
485
|
-
return readTransactionInput;
|
|
486
|
-
}
|
|
487
|
-
});
|
|
488
|
-
Object.defineProperty(exports, "readViews", {
|
|
489
|
-
enumerable: true,
|
|
490
|
-
get: function() {
|
|
491
|
-
return readViews;
|
|
492
|
-
}
|
|
493
|
-
});
|
|
494
|
-
Object.defineProperty(exports, "requestAirdrop", {
|
|
495
|
-
enumerable: true,
|
|
496
|
-
get: function() {
|
|
497
|
-
return requestAirdrop;
|
|
498
|
-
}
|
|
499
|
-
});
|
|
500
|
-
Object.defineProperty(exports, "requestAirdropAttempt", {
|
|
501
|
-
enumerable: true,
|
|
502
|
-
get: function() {
|
|
503
|
-
return requestAirdropAttempt;
|
|
504
|
-
}
|
|
505
|
-
});
|
|
506
|
-
Object.defineProperty(exports, "sendTransaction", {
|
|
507
|
-
enumerable: true,
|
|
508
|
-
get: function() {
|
|
509
|
-
return sendTransaction;
|
|
510
|
-
}
|
|
511
|
-
});
|
|
512
|
-
|
|
513
|
-
//# sourceMappingURL=actions-B5-CjpEF.cjs.map
|