@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
|
@@ -1,7 +1,39 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Bt as ContractSpec$1, K as ContractViewOptions, Kt as ContractType$1, R as ContractMethod, qt as ContractTypeDef$1, rt as ThruputClient } from "./requestAirdrop-DBCOST2B.js";
|
|
2
2
|
import { Calldata, Contract, ContractAddress, Invocation, SHA256Hash } from "@thruputchain/protocol";
|
|
3
3
|
import { FixedArray, FixedBytes as FixedBytes$1, XdrCodec, fixedArray as fixedArray$1, fixedBytes as fixedBytes$1 } from "@thruputchain/xdr";
|
|
4
|
+
import { ContractSpec } from "@thruputchain/contract-spec";
|
|
4
5
|
|
|
6
|
+
//#region src/contract/artifact.d.ts
|
|
7
|
+
/** Authenticated metadata. Native identifiers do not authenticate runtime code. */
|
|
8
|
+
type ContractArtifactSpec = {
|
|
9
|
+
kind: "native";
|
|
10
|
+
} | {
|
|
11
|
+
kind: "unsupportedContract";
|
|
12
|
+
contractType: number;
|
|
13
|
+
} | {
|
|
14
|
+
kind: "unsupportedFormat";
|
|
15
|
+
formatVersion: number;
|
|
16
|
+
} | {
|
|
17
|
+
kind: "absent";
|
|
18
|
+
} | {
|
|
19
|
+
kind: "unsupportedSchema";
|
|
20
|
+
schemaVersion: number;
|
|
21
|
+
bytes: Uint8Array;
|
|
22
|
+
} | {
|
|
23
|
+
kind: "spec";
|
|
24
|
+
schemaVersion: 1;
|
|
25
|
+
spec: ContractSpec;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Verify complete Contract XDR against the requested hash, then read its spec.
|
|
29
|
+
* Rejects malformed known envelopes. Unknown versions remain explicit results.
|
|
30
|
+
* Reads RV32 artifact formats v5, v6 and v7. Reads v5 as having no spec. In v6
|
|
31
|
+
* and v7, validates all extension framing and skips unknown kinds. Only the
|
|
32
|
+
* contract-spec extension body is interpreted.
|
|
33
|
+
* This proves byte identity, not deployment, executable validity, or spec truth.
|
|
34
|
+
*/
|
|
35
|
+
declare function readContractArtifactSpec(contractXdr: Uint8Array, expectedHash: SHA256Hash): ContractArtifactSpec;
|
|
36
|
+
//#endregion
|
|
5
37
|
//#region src/contract/encode.d.ts
|
|
6
38
|
/**
|
|
7
39
|
* Resolve a contract-spec type into the XDR/CXS codec used to encode values.
|
|
@@ -28,14 +60,14 @@ declare function resolveCodec(ty: ContractType$1, namedCodecs?: Record<string, X
|
|
|
28
60
|
* );
|
|
29
61
|
* ```
|
|
30
62
|
*/
|
|
31
|
-
declare function encodeCalldata(spec: ContractSpec, interfaceName: string, methodName: string, args: unknown[], namedCodecs: Record<string, XdrCodec<unknown>>): Calldata;
|
|
63
|
+
declare function encodeCalldata(spec: ContractSpec$1, interfaceName: string, methodName: string, args: unknown[], namedCodecs: Record<string, XdrCodec<unknown>>): Calldata;
|
|
32
64
|
/**
|
|
33
65
|
* Decode contract calldata into an object keyed by argument name.
|
|
34
66
|
*
|
|
35
67
|
* This is primarily useful for tooling, tests, and debugging generated
|
|
36
68
|
* invocations.
|
|
37
69
|
*/
|
|
38
|
-
declare function decodeCalldata(spec: ContractSpec, interfaceName: string, methodName: string, data: Uint8Array, namedCodecs: Record<string, XdrCodec<unknown>>): Record<string, unknown>;
|
|
70
|
+
declare function decodeCalldata(spec: ContractSpec$1, interfaceName: string, methodName: string, data: Uint8Array, namedCodecs: Record<string, XdrCodec<unknown>>): Record<string, unknown>;
|
|
39
71
|
//#endregion
|
|
40
72
|
//#region src/contract/specMethod.d.ts
|
|
41
73
|
/** A declared exception decoded from a spec without generated value types. */
|
|
@@ -58,7 +90,7 @@ interface SpecDecodedCall {
|
|
|
58
90
|
* Unknown selectors return null; malformed known inputs throw. The caller must
|
|
59
91
|
* establish the spec's identity. A current spec does not prove historical code.
|
|
60
92
|
*/
|
|
61
|
-
declare function createContractCallDecoder(spec: ContractSpec): (invocation: Pick<Invocation, "entrypoint" | "calldata">) => SpecDecodedCall | null;
|
|
93
|
+
declare function createContractCallDecoder(spec: ContractSpec$1): (invocation: Pick<Invocation, "entrypoint" | "calldata">) => SpecDecodedCall | null;
|
|
62
94
|
//#endregion
|
|
63
95
|
//#region src/contract/codegen.d.ts
|
|
64
96
|
/**
|
|
@@ -71,7 +103,7 @@ declare function createContractCallDecoder(spec: ContractSpec): (invocation: Pic
|
|
|
71
103
|
*
|
|
72
104
|
* @throws If two definitions share a spec id.
|
|
73
105
|
*/
|
|
74
|
-
declare function buildNamedCodecs(typeDefs: ContractTypeDef[]): Record<string, XdrCodec<unknown>>;
|
|
106
|
+
declare function buildNamedCodecs(typeDefs: ContractTypeDef$1[]): Record<string, XdrCodec<unknown>>;
|
|
75
107
|
//#endregion
|
|
76
108
|
//#region src/contract/hash.d.ts
|
|
77
109
|
/**
|
|
@@ -102,16 +134,6 @@ declare function hashContract(contract: Contract): SHA256Hash;
|
|
|
102
134
|
*/
|
|
103
135
|
declare function deriveContractAddress(deployer: ContractAddress, nonce: SHA256Hash, contractHash: SHA256Hash): ContractAddress;
|
|
104
136
|
//#endregion
|
|
105
|
-
//#region src/contract/errors.d.ts
|
|
106
|
-
/** Error raised when contract bytes do not match their declared ABI type. */
|
|
107
|
-
declare class ContractDecodeError extends Error {
|
|
108
|
-
constructor(message: string, options?: ErrorOptions);
|
|
109
|
-
}
|
|
110
|
-
/** Retrieved bytes or response metadata failed identity/canonical validation. */
|
|
111
|
-
declare class ContractVerificationError extends Error {
|
|
112
|
-
constructor(message: string, options?: ErrorOptions);
|
|
113
|
-
}
|
|
114
|
-
//#endregion
|
|
115
137
|
//#region src/contract/signedToken.d.ts
|
|
116
138
|
declare const signedTokenPreimageBrand: unique symbol;
|
|
117
139
|
/**
|
|
@@ -160,5 +182,5 @@ declare function getContract<T extends Record<string, ContractMethod<any, unknow
|
|
|
160
182
|
client: Pick<ThruputClient, "simulateInvocation">;
|
|
161
183
|
}): ContractInstance<T>;
|
|
162
184
|
//#endregion
|
|
163
|
-
export {
|
|
164
|
-
//# sourceMappingURL=index-
|
|
185
|
+
export { decodeCalldata as _, BoundContractMethod as a, ContractArtifactSpec as b, SignedToken as c, deriveContractAddress as d, hashContract as f, createContractCallDecoder as g, SpecDecodedCall as h, fixedBytes$1 as i, isSignedToken as l, SpecDeclaredException as m, FixedBytes$1 as n, ContractInstance as o, buildNamedCodecs as p, fixedArray$1 as r, getContract as s, FixedArray as t, signedToken as u, encodeCalldata as v, readContractArtifactSpec as x, resolveCodec as y };
|
|
186
|
+
//# sourceMappingURL=index-BmOG68Hd.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-BmOG68Hd.d.ts","names":[],"sources":["../src/contract/artifact.ts","../src/contract/encode.ts","../src/contract/specMethod.ts","../src/contract/codegen.ts","../src/contract/hash.ts","../src/derivation/contractAddress.ts","../src/contract/signedToken.ts","../src/contract/instance.ts"],"mappings":";;;;;;;KAsBY,oBAAA;EACN,IAAA;AAAA;EACA,IAAA;EAA6B,YAAA;AAAA;EAC7B,IAAA;EAA2B,aAAA;AAAA;EAC3B,IAAA;AAAA;EACA,IAAA;EAA2B,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;;iBAMxB,WAAA,yBAAoC,WAAW,CAAC,SAAA;;iBAKhD,aAAA,CAAc,KAAA,YAAiB,KAAA,IAAS,WAAW;;;;KCrBvD,mBAAA,YAA+B,IAAA,CACzC,cAAA,CAAe,CAAA,EAAG,CAAA,EAAG,CAAA;EAGrB,WAAA,CACE,OAAA,EAAS,IAAA,CACP,UAAA,CAAW,cAAA,CAAe,CAAA,EAAG,CAAA,EAAG,CAAA,mCAGjC,UAAA,CAAW,cAAA,CAAe,CAAA,EAAG,CAAA,EAAG,CAAA;EACnC,IAAA,CACE,OAAA,EAAS,IAAA,CAAK,mBAAA,CAAoB,CAAA,2BACjC,UAAA,CAAW,cAAA,CAAe,CAAA,EAAG,CAAA,EAAG,CAAA;EACnC,WAAA,CACE,OAAA,EAAS,IAAA,CAAK,mBAAA,CAAoB,CAAA,2BACjC,UAAA,CAAW,cAAA,CAAe,CAAA,EAAG,CAAA,EAAG,CAAA;EACnC,IAAA,CACE,OAAA,EAAS,IAAA,CAAK,UAAA,CAAW,cAAA,CAAe,CAAA,EAAG,CAAA,EAAG,CAAA,4BAC7C,UAAA,CAAW,cAAA,CAAe,CAAA,EAAG,CAAA,EAAG,CAAA;AAAA;;KAIzB,gBAAA,oBACE,CAAA,GAAI,CAAA,CAAE,CAAA,UAAW,cAAA,8BACzB,mBAAA,CAAoB,CAAA,EAAG,CAAA,EAAG,CAAA;;;;;;;;;;;;APDwB;iBOiBxC,WAAA,WAEJ,MAAA,SAAe,cAAA,0BACzB,OAAA;EACA,OAAA,EAAS,CAAA;EACT,OAAA,EAAS,eAAA;EACT,MAAA,EAAQ,IAAA,CAAK,aAAA;AAAA,IACX,gBAAA,CAAiB,CAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as Signer } from "./types-BE40oD_Q.cjs";
|
|
2
2
|
import { BlockHeight, ContractAddress, NetworkHash } from "@thruputchain/protocol";
|
|
3
|
-
import { FixedBytes } from "@thruputchain/xdr";
|
|
4
3
|
import { ContractTypeDef } from "@thruputchain/contract-spec";
|
|
4
|
+
import { FixedBytes } from "@thruputchain/xdr";
|
|
5
5
|
|
|
6
6
|
//#region src/signedOp/operation.d.ts
|
|
7
7
|
/**
|
|
@@ -189,4 +189,4 @@ interface SignedOperationPreimage {
|
|
|
189
189
|
declare function signedOperationPreimage(preimage: SignedOperationPreimage): Uint8Array;
|
|
190
190
|
//#endregion
|
|
191
191
|
export { Operation as a, SignedOperationType as c, DefineSignedOperationOptions as i, defineSignedOperation as l, signedOperationPreimage as n, SignedOperation as o, ContractTypeSelector as r, SignedOperationRequest as s, SignedOperationPreimage as t, randomNonce as u };
|
|
192
|
-
//# sourceMappingURL=index-
|
|
192
|
+
//# sourceMappingURL=index-BsvYcU_Y.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-
|
|
1
|
+
{"version":3,"file":"index-BsvYcU_Y.d.cts","names":[],"sources":["../src/signedOp/operation.ts","../src/signedOp/preimage.ts"],"mappings":";;;;;;;;;AAmCA;;;;;;;;;AAakB;UAbD,SAAA;EAiBe;EAf9B,mBAAA;EAiB8B;;;;;;AAAA;AAIhC;EAZE,KAAA;EAYqC;EAVrC,IAAA,EAAM,UAAU;AAAA;;UAID,eAAA;EAAA,SACN,EAAA,EAAI,SAAA;EAAA,SACJ,SAAA,EAAW,UAAU;AAAA;;UAIf,sBAAA;EAIa;EAAA,SAFnB,OAAA,EAAS,WAAA;EAST;EAAA,SAPA,iBAAA,EAAmB,eAAA;EASb;EAAA,SAPN,iBAAA;EAOW;AAItB;;;EAJsB,SAFX,KAAA;EAeQ;EAAA,SAbR,IAAA,EAAM,KAAA;AAAA;;UAIA,mBAAA;EAcL;;;;EAAA,SATD,QAAA;EAWC;EAAA,SATD,OAAA,EAAS,eAAA;EAPiB;EASnC,UAAA,CAAW,IAAA,EAAM,KAAA,GAAQ,UAAA;EAFhB;EAIT,QAAA,CAAS,OAAA,EAAS,sBAAA,CAAuB,KAAA,IAAS,UAAA;EAFlD;EAIA,IAAA,CACE,MAAA,EAAQ,MAAA,EACR,OAAA,EAAS,sBAAA,CAAuB,KAAA,IAC/B,OAAA,CAAQ,eAAA;AAAA;;UAII,4BAAA;EATG;;;;;EAAA,SAeT,QAAA,WAAmB,eAAA;EAZ1B;;;;;;EAAA,SAmBO,QAAA,WAAmB,oBAAoB;AAAA;AAblD;;;;AAAA,UAoBiB,oBAAA;EAAA,SACN,UAAA;EAAA,SACA,KAAA;EAAA,SACA,WAAA;EAAA,SACA,QAAA;AAAA;AAJX;;;;;;;;AAAA,iBAegB,WAAA;AAXG;AAWnB;;;;AAA2B;AA8C3B;;;;;;;;;;;;;;AAE4B;;;;ACrK5B;;;;;;;;;;;;;;AD0GmB,iBAyDH,qBAAA,QACd,OAAA,EAAS,4BAAA,GACR,mBAAA,CAAoB,KAAA;;;;UCrKN,uBAAA;;WAEN,OAAA,EAAS,WAAA;;WAET,iBAAA,EAAmB,eAAA;EDkBJ;;;;;EAAA,SCZf,OAAA,EAAS,eAAA;EDyBZ;EAAA,SCvBG,iBAAA,EAAmB,WAAA;EDuBZ;AAIlB;;;EAJkB,SClBP,KAAA;EDuBA;EAAA,SCrBA,IAAA,EAAM,UAAA;AAAA;;;ADsBe;AAIhC;;;;;;;;;;;;;;;;iBCJgB,uBAAA,CACd,QAAA,EAAU,uBAAA,GACT,UAAU"}
|
|
@@ -1,37 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Wi as UnsupportedRpcValue, cn as TransportRequestOptions, on as RpcParams, ri as RpcErrorData, sn as Transport } from "./requestAirdrop-DBCOST2B.js";
|
|
2
2
|
|
|
3
3
|
//#region src/transport/http.d.ts
|
|
4
|
-
/**
|
|
5
|
-
* Error thrown when a JSON-RPC response contains an `error` object.
|
|
6
|
-
*
|
|
7
|
-
* Malformed envelopes throw `RpcResponseError`, preserving the raw reply.
|
|
8
|
-
*/
|
|
9
|
-
declare class JsonRpcError extends Error {
|
|
10
|
-
/** JSON-RPC numeric error code. */
|
|
11
|
-
code: number;
|
|
12
|
-
/** Optional JSON-RPC error data returned by the gateway. */
|
|
13
|
-
data?: unknown;
|
|
14
|
-
/** JSON-RPC method associated with the failed request, when known. */
|
|
15
|
-
method?: string;
|
|
16
|
-
/** Complete original JSON-RPC error object, including additive fields. */
|
|
17
|
-
readonly raw: unknown;
|
|
18
|
-
readonly rpcMessage: string;
|
|
19
|
-
constructor(code: number, message: string, data?: unknown, method?: string, raw?: unknown);
|
|
20
|
-
}
|
|
21
|
-
/** Error thrown when an HTTP response has a non-successful status. */
|
|
22
|
-
declare class HttpResponseError extends Error {
|
|
23
|
-
readonly endpoint?: string | undefined;
|
|
24
|
-
readonly method?: string | undefined;
|
|
25
|
-
readonly status: number;
|
|
26
|
-
readonly statusText: string;
|
|
27
|
-
constructor(status: number, statusText: string, endpoint?: string | undefined, method?: string | undefined);
|
|
28
|
-
}
|
|
29
|
-
/** Network failure with sanitized endpoint and method context. */
|
|
30
|
-
declare class HttpRequestError extends TypeError {
|
|
31
|
-
readonly endpoint: string;
|
|
32
|
-
readonly method: string;
|
|
33
|
-
constructor(endpoint: string, method: string, cause: unknown);
|
|
34
|
-
}
|
|
35
4
|
/** Limits for opt-in HTTP JSON-RPC batching. */
|
|
36
5
|
interface HttpBatchOptions {
|
|
37
6
|
/** Maximum calls per HTTP request (1–1,000). Defaults to 100. Full batches send immediately. */
|
|
@@ -70,7 +39,9 @@ interface HttpTransportOptions {
|
|
|
70
39
|
*
|
|
71
40
|
* `HttpTransport` handles request IDs, JSON-RPC envelopes, optional custom
|
|
72
41
|
* headers, optional timeout cancellation, and conversion of JSON-RPC error
|
|
73
|
-
* responses into
|
|
42
|
+
* responses into `ThruputError` with code `rpcError`. Network failures use
|
|
43
|
+
* `httpRequestFailed`, failed HTTP statuses use `httpResponseError`, and
|
|
44
|
+
* malformed replies use `rpcResponseInvalid`.
|
|
74
45
|
*
|
|
75
46
|
* @example
|
|
76
47
|
* ```ts
|
|
@@ -105,11 +76,12 @@ type ReadErrorKind = "transient" | "permanent" | "cancelled" | "unknown";
|
|
|
105
76
|
* Classify an infrastructure read failure without replacing the original error.
|
|
106
77
|
*
|
|
107
78
|
* Pass the caller's signal to distinguish explicit cancellation from a transport
|
|
108
|
-
* timeout. Plain Error wrappers are inspected through their causes;
|
|
109
|
-
* and unrecognized failures remain unknown. A bare TypeError
|
|
110
|
-
* a network failure. Custom transports should
|
|
111
|
-
* Transaction-not-found remains
|
|
112
|
-
*
|
|
79
|
+
* timeout. Plain Error wrappers are inspected through their causes; other
|
|
80
|
+
* `ThruputError` codes and unrecognized failures remain unknown. A bare TypeError
|
|
81
|
+
* is not evidence of a network failure. Custom transports should throw code
|
|
82
|
+
* `httpRequestFailed` for that case. Transaction-not-found remains
|
|
83
|
+
* operation-specific rather than a general retry. This classification never
|
|
84
|
+
* authorizes transaction resubmission.
|
|
113
85
|
*/
|
|
114
86
|
declare function classifyReadError(error: unknown, options?: TransportRequestOptions): ReadErrorKind;
|
|
115
87
|
//#endregion
|
|
@@ -138,27 +110,5 @@ declare const NativeRpcErrorCode: {
|
|
|
138
110
|
readonly TransactionRejected: -32001;
|
|
139
111
|
};
|
|
140
112
|
//#endregion
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
classification: "known";
|
|
144
|
-
data: RpcErrorData;
|
|
145
|
-
raw: unknown;
|
|
146
|
-
} | {
|
|
147
|
-
classification: "unclassified";
|
|
148
|
-
raw: unknown;
|
|
149
|
-
};
|
|
150
|
-
/** A native RPC failure retains the transport error and a conservative typed interpretation. */
|
|
151
|
-
declare class NativeRpcError extends JsonRpcError {
|
|
152
|
-
readonly decoded: DecodedRpcError;
|
|
153
|
-
constructor(error: JsonRpcError, method: string, expectedTransactionHash?: Uint8Array);
|
|
154
|
-
}
|
|
155
|
-
//#endregion
|
|
156
|
-
//#region src/transport/responseError.d.ts
|
|
157
|
-
/** Malformed JSON-RPC reply after dispatch. Raw data is retained; write outcome is unknown. */
|
|
158
|
-
declare class RpcResponseError extends Error {
|
|
159
|
-
readonly raw: unknown;
|
|
160
|
-
constructor(message: string, raw: unknown);
|
|
161
|
-
}
|
|
162
|
-
//#endregion
|
|
163
|
-
export { TxInvalidDetail as a, classifyReadError as c, HttpRequestError as d, HttpResponseError as f, JsonRpcError as h, NativeRpcErrorCode as i, MockTransport as l, HttpTransportOptions as m, DecodedRpcError as n, txInvalidDetail as o, HttpTransport as p, NativeRpcError as r, ReadErrorKind as s, RpcResponseError as t, HttpBatchOptions as u };
|
|
164
|
-
//# sourceMappingURL=index-CtjZ61tl.d.cts.map
|
|
113
|
+
export { classifyReadError as a, HttpTransport as c, ReadErrorKind as i, HttpTransportOptions as l, TxInvalidDetail as n, MockTransport as o, txInvalidDetail as r, HttpBatchOptions as s, NativeRpcErrorCode as t };
|
|
114
|
+
//# sourceMappingURL=index-CG-q0j9w.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-CG-q0j9w.d.ts","names":[],"sources":["../src/transport/http.ts","../src/transport/mock.ts","../src/transport/readError.ts","../src/transport/txInvalidDetail.ts","../src/rpc/errors.ts"],"mappings":";;;;UAWiB,gBAAA;EAAA;EAEf,OAAA;;EAEA,MAAM;AAAA;AAIR;AAAA,UAAiB,oBAAA;;EAEf,OAAA,GAAU,MAAA;EAGK;EAAf,KAAA,UAAe,KAAA;EAqBmB;EAlBlC,SAAA;EANA;;;;;;;;AAwBkC;AAuBpC;;;;;;;EAvBE,KAAA,aAAkB,gBAAA;AAAA;;;;;;;;;;;;;;;;;;;AA0DN;;cAnCD,aAAA,YAAyB,SAAA;EAAA;ECnCzB;cD4CC,GAAA,UAAa,OAAA,GAAS,oBAAA;EC5CT;EDkEnB,OAAA,cACJ,MAAA,UACA,MAAA,GAAS,SAAA,EACT,OAAA,GAAS,uBAAA,GACR,OAAA,CAAQ,CAAA;AAAA;;;;cCtEA,aAAA,YAAyB,SAAA;EAAA;EAG9B,OAAA,cACJ,MAAA,UACA,MAAA,GAAQ,SAAA,EACR,OAAA,GAAU,uBAAA,GACT,OAAA,CAAQ,CAAA;AAAA;;;;KCpCD,aAAA;AFOZ;;;;AAIQ;AAIR;;;;;;AARA,iBEMgB,iBAAA,CACd,KAAA,WACA,OAAA,GAAS,uBAAA,GACR,aAAa;;;;KCbJ,eAAA,GAAkB,OAAA,CAC5B,WAAA,CAAY,OAAA,CAAQ,YAAA;EAAgB,IAAA;AAAA,eACpC,mBAAA;;iBAGc,eAAA,CAAgB,KAAA,YAAiB,eAAe;;;;cCVnD,kBAAA;EAAA"}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import { a as WalletCapabilities, i as WalletAccount, l as WalletProviderInfo, n as SignTransactionResult, o as WalletProvider, r as SubmitTransactionResult, s as WalletProviderError, t as ProviderRequest, u as WalletSession } from "./types-VYjJcTip.js";
|
|
2
|
+
import { SignedTransaction, Transaction } from "@thruputchain/protocol";
|
|
3
|
+
|
|
4
|
+
//#region src/provider/validation.d.ts
|
|
5
|
+
/** Maximum decoded signed XDR size: 1,048,576 bytes (1 MiB). */
|
|
6
|
+
declare const MAX_TRANSACTION_BYTES = 1048576;
|
|
7
|
+
/**
|
|
8
|
+
* Maximum unsigned XDR size: 1,048,460 bytes. Providers must enforce this before
|
|
9
|
+
* requesting user approval. Reserves 116 bytes within {@link MAX_TRANSACTION_BYTES}
|
|
10
|
+
* for the Ed25519 pubkey envelope: the signature vector count, key ID, scheme,
|
|
11
|
+
* and 64-byte signature, plus the present `pubkey_claim_key` option holding the
|
|
12
|
+
* scheme-tagged 32-byte key.
|
|
13
|
+
*/
|
|
14
|
+
declare const MAX_UNSIGNED_TRANSACTION_BYTES: number;
|
|
15
|
+
/** Maximum accounts in one session. */
|
|
16
|
+
declare const MAX_WALLET_ACCOUNTS = 32;
|
|
17
|
+
/** Current native DefaultWallet execute call limit. */
|
|
18
|
+
declare const MAX_DEFAULT_WALLET_CALLS = 16;
|
|
19
|
+
/** Validate scoped DefaultWallet capabilities. Does not establish authorization. */
|
|
20
|
+
declare function parseWalletCapabilities(value: unknown): WalletCapabilities;
|
|
21
|
+
/** Validate an unprefixed, case-sensitive base58 address, public key, or hash. */
|
|
22
|
+
declare function parseWalletIdentifier(value: unknown): string;
|
|
23
|
+
/** Validate a case-sensitive, unprefixed base58 network hash. */
|
|
24
|
+
declare function parseWalletNetworkHash(value: unknown): string;
|
|
25
|
+
/**
|
|
26
|
+
* Validate and freeze an account snapshot, including a non-small-order, prime-order
|
|
27
|
+
* Ed25519 key and its derived address. The nonce is canonical decimal u64 account
|
|
28
|
+
* derivation data, not a transaction nonce. Rejects extra fields and noncanonical
|
|
29
|
+
* values rather than normalizing them; malformed input throws code -32602.
|
|
30
|
+
*/
|
|
31
|
+
declare function parseWalletAccount(value: unknown): WalletAccount;
|
|
32
|
+
/**
|
|
33
|
+
* Strictly validate a session and return a frozen snapshot with frozen accounts.
|
|
34
|
+
* Requires a canonical network hash and at most {@link MAX_WALLET_ACCOUNTS} unique
|
|
35
|
+
* account addresses. Empty accounts are valid for an unauthorized origin; this
|
|
36
|
+
* parser does not enforce the nonempty result required by a successful `connect`.
|
|
37
|
+
*/
|
|
38
|
+
declare function parseWalletSession(value: unknown): WalletSession;
|
|
39
|
+
/** Validate bounded display metadata; never render provider names as HTML. */
|
|
40
|
+
declare function parseWalletProviderInfo(value: unknown): WalletProviderInfo;
|
|
41
|
+
/**
|
|
42
|
+
* Validate a provider's structural boundary and return the original live object.
|
|
43
|
+
* Preserves identity and method receivers; metadata is validated, not snapshotted.
|
|
44
|
+
* Unlike {@link parseWalletAccount} and {@link parseWalletSession}, this does not
|
|
45
|
+
* freeze the input. Checks versioned metadata and callable `request`/`on` members,
|
|
46
|
+
* not their behavior, permissions, returned values, or the provider's trustworthiness.
|
|
47
|
+
*/
|
|
48
|
+
declare function parseWalletProvider(value: unknown): WalletProvider;
|
|
49
|
+
/**
|
|
50
|
+
* Reconstruct a serialized provider error, without relying on `instanceof`.
|
|
51
|
+
* Requires a recognized {@link WalletProviderErrorCode} and a message of at most
|
|
52
|
+
* 1,024 characters. Invalid errors throw a new error with code -32602.
|
|
53
|
+
*/
|
|
54
|
+
declare function parseWalletProviderError(value: unknown): WalletProviderError;
|
|
55
|
+
/**
|
|
56
|
+
* Decode bounded canonical unsigned XDR, rejecting trailing or altered encodings.
|
|
57
|
+
* Accepts lowercase, even-length, 0x-prefixed hex within
|
|
58
|
+
* {@link MAX_UNSIGNED_TRANSACTION_BYTES}; providers must check this before approval.
|
|
59
|
+
* Does not establish account authorization; use {@link assertWalletTransaction}
|
|
60
|
+
* to check the transaction's account claim and enforce origin permission separately.
|
|
61
|
+
*/
|
|
62
|
+
declare function parseTransactionHex(value: unknown): Transaction;
|
|
63
|
+
/** Decode bounded canonical signed XDR; signature verification is separate. */
|
|
64
|
+
declare function parseSignedTransactionHex(value: unknown): SignedTransaction;
|
|
65
|
+
/**
|
|
66
|
+
* Parse the exact request union into a new request object, including bounded,
|
|
67
|
+
* canonical XDR. Unknown methods fail with 4200; malformed known requests fail
|
|
68
|
+
* with -32602. This validates input, not origin permission or prior approval.
|
|
69
|
+
* Bridges must bound raw messages before JSON parsing: at most 2,096,922 unsigned
|
|
70
|
+
* or 2,097,154 signed transaction-hex characters, including 0x.
|
|
71
|
+
*/
|
|
72
|
+
declare function parseProviderRequest(value: unknown): ProviderRequest;
|
|
73
|
+
/**
|
|
74
|
+
* Validate a signing response's wire structure and return a new result object.
|
|
75
|
+
* Checks canonical signed XDR and hash encoding, not signature, hash correctness,
|
|
76
|
+
* or approval. Use {@link verifySignTransactionResult} for cryptographic validation.
|
|
77
|
+
*/
|
|
78
|
+
declare function parseSignTransactionResult(value: unknown): SignTransactionResult;
|
|
79
|
+
/**
|
|
80
|
+
* Validate a submission response's hash encoding and return a new result object.
|
|
81
|
+
* Does not compare the hash to approved bytes or confirm broadcast or execution.
|
|
82
|
+
*/
|
|
83
|
+
declare function parseSubmitTransactionResult(value: unknown): SubmitTransactionResult;
|
|
84
|
+
/** Require the root address and complete pubkey claim to match a wire account. */
|
|
85
|
+
declare function assertWalletTransaction(tx: Transaction, account: WalletAccount): void;
|
|
86
|
+
/**
|
|
87
|
+
* Verify unchanged XDR, a single strict network-bound signature, and receipt hash.
|
|
88
|
+
* Requires the exact unsigned transaction bytes and matching root address/pubkey
|
|
89
|
+
* claim, and an attached `pubkey_claim_key` equal to the account's Ed25519 key.
|
|
90
|
+
* The signature must be Ed25519 with public-key ID zero, verified over
|
|
91
|
+
* `transactionSignaturePreimage(networkHash, tx)` with ZIP-215 disabled and both
|
|
92
|
+
* key and signature point R non-small-order and prime-order. The hash is SHA-256
|
|
93
|
+
* of unsigned XDR, excluding signatures and network.
|
|
94
|
+
*
|
|
95
|
+
* @param networkHash - A 32-byte base58 identifier from the authorized session.
|
|
96
|
+
* @returns A frozen verified result. This does not establish origin permission
|
|
97
|
+
* or a retained approval to submit; the provider must enforce both separately.
|
|
98
|
+
*
|
|
99
|
+
* @remarks
|
|
100
|
+
* Requires Web Crypto (HTTPS or localhost in browsers). Invalid signing results
|
|
101
|
+
* throw code -32603; invalid expected inputs fail their boundary validation first.
|
|
102
|
+
*
|
|
103
|
+
* @see https://www.thruput.network/docs/typescript/reference/wallet-provider/
|
|
104
|
+
*/
|
|
105
|
+
declare function verifySignTransactionResult(value: unknown, transaction: string, account: WalletAccount, networkHash: string): Promise<SignTransactionResult>;
|
|
106
|
+
//#endregion
|
|
107
|
+
//#region src/provider/discovery.d.ts
|
|
108
|
+
/** Discovery request event name. */
|
|
109
|
+
declare const REQUEST_PROVIDER_EVENT = "thruput:requestProvider";
|
|
110
|
+
/** Announcement detail is the provider itself, not an envelope. */
|
|
111
|
+
declare const ANNOUNCE_PROVIDER_EVENT = "thruput:announceProvider";
|
|
112
|
+
/** Maximum distinct provider IDs retained by one discovery subscription. */
|
|
113
|
+
declare const MAX_DISCOVERED_PROVIDERS = 32;
|
|
114
|
+
/**
|
|
115
|
+
* Validate and announce a live provider now and on each discovery request.
|
|
116
|
+
* Announcement detail is the provider itself. Defaults to `window`; pass an
|
|
117
|
+
* `EventTarget` outside a browser. Importing this module needs no browser globals.
|
|
118
|
+
*
|
|
119
|
+
* @returns Idempotent cleanup that removes the request listener. It stops future
|
|
120
|
+
* announcements from this registration, but does not retract a provider already
|
|
121
|
+
* discovered, disconnect sessions, or revoke permissions. There is no unregister event.
|
|
122
|
+
*
|
|
123
|
+
* @see https://www.thruput.network/docs/typescript/reference/wallet-provider/
|
|
124
|
+
*/
|
|
125
|
+
declare function registerWalletProvider(provider: WalletProvider, target?: EventTarget): () => void;
|
|
126
|
+
/**
|
|
127
|
+
* Discover multiple providers in either load order, reporting each valid ID once.
|
|
128
|
+
* Installs the announcement listener before requesting providers. Malformed
|
|
129
|
+
* announcements are ignored; the first valid announcement for an ID wins, up to
|
|
130
|
+
* {@link MAX_DISCOVERED_PROVIDERS} IDs per subscription. IDs remain reserved until
|
|
131
|
+
* cleanup, even if a provider stops announcing. Discovery does not track removals.
|
|
132
|
+
*
|
|
133
|
+
* Defaults to `window`; pass an `EventTarget` outside a browser. IDs and names can
|
|
134
|
+
* be spoofed by page scripts: discovery validates shape, not wallet identity or trust.
|
|
135
|
+
* Render names as text, never HTML.
|
|
136
|
+
*
|
|
137
|
+
* @returns Idempotent cleanup that removes the listener and releases retained IDs.
|
|
138
|
+
* It does not disconnect discovered providers or revoke their permissions.
|
|
139
|
+
*
|
|
140
|
+
* @see https://www.thruput.network/docs/typescript/wallet-integration/
|
|
141
|
+
*/
|
|
142
|
+
declare function discoverWalletProviders(listener: (provider: WalletProvider) => void, target?: EventTarget): () => void;
|
|
143
|
+
//#endregion
|
|
144
|
+
export { parseWalletSession as C, parseWalletProviderInfo as S, parseWalletCapabilities as _, registerWalletProvider as a, parseWalletProvider as b, MAX_UNSIGNED_TRANSACTION_BYTES as c, parseProviderRequest as d, parseSignTransactionResult as f, parseWalletAccount as g, parseTransactionHex as h, discoverWalletProviders as i, MAX_WALLET_ACCOUNTS as l, parseSubmitTransactionResult as m, MAX_DISCOVERED_PROVIDERS as n, MAX_DEFAULT_WALLET_CALLS as o, parseSignedTransactionHex as p, REQUEST_PROVIDER_EVENT as r, MAX_TRANSACTION_BYTES as s, ANNOUNCE_PROVIDER_EVENT as t, assertWalletTransaction as u, parseWalletIdentifier as v, verifySignTransactionResult as w, parseWalletProviderError as x, parseWalletNetworkHash as y };
|
|
145
|
+
//# sourceMappingURL=index-CPtBvHE8.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-CPtBvHE8.d.ts","names":[],"sources":["../src/provider/validation.ts","../src/provider/discovery.ts"],"mappings":";;;;;cAuCa,qBAAA;AAAb;;;;AAAkC;AAQlC;;AARA,cAQa,8BAAA;;cAIA,mBAAA;AAAb;AAAA,cAEa,wBAAA;;iBAGG,uBAAA,CAAwB,KAAA,YAAiB,kBAAkB;AAL3C;AAAA,iBAkDhB,qBAAA,CAAsB,KAAc;;iBAYpC,sBAAA,CAAuB,KAAc;;AA5DhB;AAGrC;;;;iBAmEgB,kBAAA,CAAmB,KAAA,YAAiB,aAAa;AAtBjE;;;;AAAoD;AAYpD;AAZA,iBA+DgB,kBAAA,CAAmB,KAAA,YAAiB,aAAa;;iBAqBjD,uBAAA,CAAwB,KAAA,YAAiB,kBAAkB;AAxEtB;AAUrD;;;;AAAiE;AAyCjE;AAnDqD,iBAuGrC,mBAAA,CAAoB,KAAA,YAAiB,cAAc;;;AApDF;AAqBjE;;iBAsDgB,wBAAA,CAAyB,KAAA,YAAiB,mBAAmB;;AAtDF;AA+B3E;;;;AAAmE;iBA2DnD,mBAAA,CAAoB,KAAA,YAAiB,WAAW;;iBAahD,yBAAA,CAA0B,KAAA,YAAiB,iBAAiB;;AAjDC;AAoC7E;;;;AAAgE;iBAgChD,oBAAA,CAAqB,KAAA,YAAiB,eAAe;;;;AAnBO;AAmB5E;iBAgEgB,0BAAA,CACd,KAAA,YACC,qBAAqB;;;AAlE6C;AAgErE;iBAiBgB,4BAAA,CACd,KAAA,YACC,uBAAuB;;iBAOV,uBAAA,CACd,EAAA,EAAI,WAAA,EACJ,OAAA,EAAS,aAAa;AA1BA;AAexB;;;;AAE0B;AAO1B;;;;;;;;;AAEwB;AA4CxB;;;AAtEwB,iBAsEF,2BAAA,CACpB,KAAA,WACA,WAAA,UACA,OAAA,EAAS,aAAA,EACT,WAAA,WACC,OAAA,CAAQ,qBAAA;;;;cC5bE,sBAAA;;cAEA,uBAAA;;cAEA,wBAAA;;AD+BqB;AAQlC;;;;AAE2D;AAE3D;;;;iBCpBgB,sBAAA,CACd,QAAA,EAAU,cAAA,EACV,MAAA,GAAQ,WAA6B;ADoBvC;;;;AAAqC;AAGrC;;;;AAA2E;AA6C3E;;;;AAAoD;AAYpD;AA5DA,iBCSgB,uBAAA,CACd,QAAA,GAAW,QAAA,EAAU,cAAA,WACrB,MAAA,GAAQ,WAA6B"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { A as WalletProvider, D as SubmitTransactionResult, E as SignTransactionResult, O as WalletAccount$1, k as WalletCapabilities } from "./index-CIHK7Ew9.js";
|
|
1
|
+
import { $ as AirdropActions, Fn as BalanceResponse, Mn as AirdropSucceeded, N as ContractCall, b as SubmissionEvidence, cn as TransportRequestOptions, nt as CoreThruputClient, t as RequestAirdropOptions, wn as WaitForTransactionReceiptOptions } from "./requestAirdrop-T1eVn3l5.cjs";
|
|
2
|
+
import { a as WalletCapabilities, i as WalletAccount, n as SignTransactionResult, o as WalletProvider, r as SubmitTransactionResult } from "./types-VYjJcTip.cjs";
|
|
3
|
+
import { D as WalletAccount$1, E as SourceAddressAccount, T as PubkeyAccount, _ as DeploymentOptions, d as WalletInvocationAdapter, g as ContractDeployment, l as WalletBatchExecutionRequest, n as ExecutionResult, t as CallResults, u as WalletExecutionRequest, x as PrepareTransactionRequest } from "./execution-pSt6k620.cjs";
|
|
5
4
|
import { ContractAddress, GasAmount, NetworkHash, SHA256Hash, SignedTransaction, Transaction } from "@thruputchain/protocol";
|
|
6
5
|
|
|
7
6
|
//#region src/wallet/providerClient.d.ts
|
|
@@ -9,7 +8,7 @@ import { ContractAddress, GasAmount, NetworkHash, SHA256Hash, SignedTransaction,
|
|
|
9
8
|
type PrepareBatchExecutionRequest = WalletBatchExecutionRequest & Omit<PrepareExecutionRequest, "invocation">;
|
|
10
9
|
/** Exact signed evidence available before broadcasting. Persist on the original network. */
|
|
11
10
|
interface PendingWalletTransaction extends SignTransactionResult {
|
|
12
|
-
readonly account: WalletAccount
|
|
11
|
+
readonly account: WalletAccount;
|
|
13
12
|
readonly networkHash: string;
|
|
14
13
|
}
|
|
15
14
|
/** Lifecycle controls. Cancellation can prevent dispatch; it never cancels a broadcast already sent. */
|
|
@@ -37,18 +36,21 @@ interface CreateProviderWalletClientOptions {
|
|
|
37
36
|
/** Live external provider with an already authorized session. */
|
|
38
37
|
provider: WalletProvider;
|
|
39
38
|
/** Wire pubkey account from the provider subpath, snapshotted at construction. */
|
|
40
|
-
account: WalletAccount
|
|
39
|
+
account: WalletAccount;
|
|
41
40
|
/** Trusted application network identity: 32-byte base58; must match the session exactly. */
|
|
42
41
|
networkHash: string;
|
|
43
42
|
}
|
|
44
43
|
/**
|
|
45
44
|
* Explicit prepare/sign/persist/submit flow without access to a raw signer.
|
|
46
|
-
*
|
|
45
|
+
* Errors are `ThruputError`s with named codes: provider code 4001 becomes
|
|
46
|
+
* `userRejected`, and the others become `wallet*` codes, with the wire code in
|
|
47
|
+
* `context.providerCode`. Allows one in-flight operation; concurrent calls fail
|
|
48
|
+
* with code `walletRequestPending` (provider code -32002). Checks
|
|
47
49
|
* `getSession` before each operation and permanently invalidates on every `change`,
|
|
48
50
|
* a failed session read, or a mismatched session. Dispose and recreate after a
|
|
49
51
|
* change or reconnect; there is no automatic reconnect or retry.
|
|
50
52
|
*
|
|
51
|
-
* @see https://
|
|
53
|
+
* @see https://www.thruput.network/docs/typescript/wallet-integration/
|
|
52
54
|
*/
|
|
53
55
|
interface ProviderWalletClient {
|
|
54
56
|
/** Prepare a root deployment, preserving the explicit signing boundary. */
|
|
@@ -63,7 +65,7 @@ interface ProviderWalletClient {
|
|
|
63
65
|
executeCallsAndWait<T extends readonly ContractCall[]>(request: ExecuteCallsRequest<T>, options: ProviderExecutionOptions): Promise<ExecutionResult & {
|
|
64
66
|
values: CallResults<T>;
|
|
65
67
|
}>;
|
|
66
|
-
/** Read fresh account/network capabilities; only 4200 falls back to unsupported. */
|
|
68
|
+
/** Read fresh account/network capabilities; only provider code 4200 falls back to unsupported. */
|
|
67
69
|
getCapabilities(): Promise<WalletCapabilities>;
|
|
68
70
|
/** Prepare one atomic batch after checking support. Does not sign or submit. */
|
|
69
71
|
prepareBatchExecution(request: PrepareBatchExecutionRequest): Promise<Transaction>;
|
|
@@ -92,10 +94,11 @@ interface ProviderWalletClient {
|
|
|
92
94
|
* fails; the adapter never retries. Returns a broadcast acknowledgement, not an
|
|
93
95
|
* execution receipt, and verifies its hash against the approved result.
|
|
94
96
|
*
|
|
95
|
-
*
|
|
96
|
-
*
|
|
97
|
-
*
|
|
98
|
-
* or
|
|
97
|
+
* Every failure has `transaction` facts. When `transaction.outcome` is
|
|
98
|
+
* `unknown`, the bytes may have been broadcast: keep the persisted hash and
|
|
99
|
+
* query status/receipt on the original network; do not automatically prepare,
|
|
100
|
+
* sign, or execute a replacement transaction. A timeout, session change, or
|
|
101
|
+
* invalid response can occur after broadcast. See the factory's persistence example.
|
|
99
102
|
*/
|
|
100
103
|
submitTransaction(signed: SignTransactionResult): Promise<SubmitTransactionResult>;
|
|
101
104
|
/**
|
|
@@ -171,8 +174,8 @@ interface ProviderWalletClient {
|
|
|
171
174
|
* }
|
|
172
175
|
* ```
|
|
173
176
|
*
|
|
174
|
-
* @see https://
|
|
175
|
-
* @see https://
|
|
177
|
+
* @see https://www.thruput.network/docs/typescript/wallet-integration/
|
|
178
|
+
* @see https://www.thruput.network/docs/typescript/reference/wallet-provider/
|
|
176
179
|
*/
|
|
177
180
|
declare function createProviderWalletClient(options: CreateProviderWalletClientOptions): ProviderWalletClient;
|
|
178
181
|
//#endregion
|
|
@@ -182,7 +185,7 @@ type WalletRequestAirdropOptions = Omit<RequestAirdropOptions, "recipient"> & {
|
|
|
182
185
|
readonly recipient?: ContractAddress;
|
|
183
186
|
};
|
|
184
187
|
/** Signer-bound transaction and account actions. */
|
|
185
|
-
interface WalletActions<TAccount extends WalletAccount = WalletAccount> {
|
|
188
|
+
interface WalletActions<TAccount extends WalletAccount$1 = WalletAccount$1> {
|
|
186
189
|
readonly account: TAccount;
|
|
187
190
|
getBalance(request?: {
|
|
188
191
|
address?: Uint8Array;
|
|
@@ -220,9 +223,9 @@ interface WalletAirdropActions {
|
|
|
220
223
|
requestAirdrop(options?: WalletRequestAirdropOptions): Promise<AirdropSucceeded>;
|
|
221
224
|
}
|
|
222
225
|
/** Existing client methods plus signer-bound wallet actions. */
|
|
223
|
-
type WalletClient<TClient extends CoreThruputClient, TAccount extends WalletAccount = WalletAccount> = Omit<TClient, "getBalance" | "requestAirdrop" | "account" | "prepareTransaction" | "signTransaction" | "sendInvocation" | "prepareExecution" | "execute"> & WalletActions<TAccount> & (TClient extends AirdropActions ? WalletAirdropActions : object);
|
|
226
|
+
type WalletClient<TClient extends CoreThruputClient, TAccount extends WalletAccount$1 = WalletAccount$1> = Omit<TClient, "getBalance" | "requestAirdrop" | "account" | "prepareTransaction" | "signTransaction" | "sendInvocation" | "prepareExecution" | "execute"> & WalletActions<TAccount> & (TClient extends AirdropActions ? WalletAirdropActions : object);
|
|
224
227
|
/** Wallet client with adapter-aware inner invocation execution. */
|
|
225
|
-
type ExecutableWalletClient<TClient extends CoreThruputClient, TAccount extends WalletAccount = WalletAccount, TRequest extends WalletExecutionRequest = WalletExecutionRequest> = WalletClient<TClient, TAccount> & WalletExecutionActions<TRequest>;
|
|
228
|
+
type ExecutableWalletClient<TClient extends CoreThruputClient, TAccount extends WalletAccount$1 = WalletAccount$1, TRequest extends WalletExecutionRequest = WalletExecutionRequest> = WalletClient<TClient, TAccount> & WalletExecutionActions<TRequest>;
|
|
226
229
|
/** Signing-network input inferred from whether a client has validated identity. */
|
|
227
230
|
type WalletNetworkOptions<TClient extends CoreThruputClient> = TClient extends {
|
|
228
231
|
readonly network: {
|
|
@@ -234,7 +237,7 @@ type WalletNetworkOptions<TClient extends CoreThruputClient> = TClient extends {
|
|
|
234
237
|
/** Signing network required when the client has no validated identity. */readonly networkHash: NetworkHash;
|
|
235
238
|
};
|
|
236
239
|
/** Decorate an existing client with signer-bound wallet behavior. */
|
|
237
|
-
declare function createWalletClient<TClient extends CoreThruputClient, TAccount extends WalletAccount, TRequest extends WalletExecutionRequest>(options: {
|
|
240
|
+
declare function createWalletClient<TClient extends CoreThruputClient, TAccount extends WalletAccount$1, TRequest extends WalletExecutionRequest>(options: {
|
|
238
241
|
readonly client: TClient;
|
|
239
242
|
readonly account: TAccount;
|
|
240
243
|
readonly onSigned?: (submission: SubmissionEvidence) => void | Promise<void>;
|
|
@@ -252,7 +255,7 @@ declare function createWalletClient<TClient extends CoreThruputClient, TAccount
|
|
|
252
255
|
readonly onSigned?: (submission: SubmissionEvidence) => void | Promise<void>;
|
|
253
256
|
readonly invocationAdapter?: undefined;
|
|
254
257
|
} & WalletNetworkOptions<TClient>): WalletClient<TClient, TAccount>;
|
|
255
|
-
declare function createWalletClient<TClient extends CoreThruputClient, TAccount extends WalletAccount>(options: {
|
|
258
|
+
declare function createWalletClient<TClient extends CoreThruputClient, TAccount extends WalletAccount$1>(options: {
|
|
256
259
|
readonly client: TClient;
|
|
257
260
|
readonly account: TAccount;
|
|
258
261
|
readonly onSigned?: (submission: SubmissionEvidence) => void | Promise<void>;
|
|
@@ -260,4 +263,4 @@ declare function createWalletClient<TClient extends CoreThruputClient, TAccount
|
|
|
260
263
|
} & WalletNetworkOptions<TClient>): WalletClient<TClient, TAccount>;
|
|
261
264
|
//#endregion
|
|
262
265
|
export { WalletClient as a, WalletRequestAirdropOptions as c, ExecuteCallsRequest as d, PendingWalletTransaction as f, createProviderWalletClient as g, ProviderWalletClient as h, WalletAirdropActions as i, createWalletClient as l, ProviderExecutionOptions as m, PrepareExecutionRequest as n, WalletExecutionActions as o, PrepareBatchExecutionRequest as p, WalletActions as r, WalletNetworkOptions as s, ExecutableWalletClient as t, CreateProviderWalletClientOptions as u };
|
|
263
|
-
//# sourceMappingURL=index-
|
|
266
|
+
//# sourceMappingURL=index-DBKsOzCN.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-DBKsOzCN.d.cts","names":[],"sources":["../src/wallet/providerClient.ts","../src/wallet/client.ts"],"mappings":";;;;;;;KAyEY,4BAAA,GAA+B,2BAAA,GACzC,IAAA,CAAK,uBAAA;;UAGU,wBAAA,SAAiC,qBAAqB;EAAA,SAC5D,OAAA,EAAS,aAAA;EAAA,SACT,WAAA;AAAA;;UAIM,wBAAA;EATa;EAW5B,QAAA,GAAW,OAAA,EAAS,wBAAA,YAAoC,OAAA;EARzC;EAUf,IAAA,GAAO,gCAAA;AAAA;;UAIQ,mBAAA,oBAAuC,YAAA;EACtD,KAAA,EAAO,CAAA;EACP,QAAA,EAAU,SAAA;EACV,iBAAA,GAAoB,uBAAA;EACpB,YAAA;AAAA;AAZF;AAAA,UAgBiB,iCAAA;;;;;;EAMf,MAAA,EAAQ,iBAAA;EApBR;EAsBA,QAAA,EAAU,cAAA;EAtBC;EAwBX,OAAA,EAAS,aAAA;EAtBT;EAwBA,WAAA;AAAA;AAxBuC;AAIzC;;;;;;;;;;;AAJyC,UAuCxB,oBAAA;EAlCR;EAoCP,iBAAA,CACE,UAAA,EAAY,kBAAA,EACZ,OAAA,EAAS,iBAAA,GACR,OAAA,CAAQ,WAAA;EAtCD;EAwCV,qBAAA,CACE,UAAA,EAAY,kBAAA,EACZ,OAAA,EAAS,iBAAA,EACT,QAAA,EAAU,wBAAA,GACT,OAAA,CACD,eAAA;IACE,OAAA,mCAA0C,eAAA;EAAA;EA5ClC;E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AY,kBAAA,YACF,OAAA;EAAA,SACH,iBAAA;AAAA,IACP,oBAAA,CAAqB,OAAA,IACxB,YAAA,CAAa,OAAA,EAAS,QAAA"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { t as
|
|
4
|
-
import {
|
|
5
|
-
import { Invocation, NetworkHash, SHA256Hash, SignedTransaction, Transaction } from "@thruputchain/protocol";
|
|
1
|
+
import { Bt as ContractSpec, Wi as UnsupportedRpcValue, Yr as RpcContractDeploymentResult, b as SubmissionEvidence, cn as TransportRequestOptions, i as RpcClient, nt as CoreThruputClient, ti as RpcEffectiveContractResult } from "./requestAirdrop-DBCOST2B.js";
|
|
2
|
+
import { b as ContractArtifactSpec } from "./index-BmOG68Hd.js";
|
|
3
|
+
import { t as DefaultWallet } from "./default_wallet-DkqsCa5C.js";
|
|
4
|
+
import { D as WalletAccount, x as PrepareTransactionRequest } from "./execution-uiuFPV0d.js";
|
|
5
|
+
import { AuthTokenNode, Invocation, NetworkHash, SHA256Hash, SignedTransaction, Transaction } from "@thruputchain/protocol";
|
|
6
6
|
|
|
7
7
|
//#region src/actions/public/getContractSpec.d.ts
|
|
8
8
|
/** Snapshot deployment evidence and its authenticated metadata, if deployed. */
|
|
@@ -43,10 +43,37 @@ interface WalletRequests {
|
|
|
43
43
|
wrapper: "DefaultWallet.execute" | "DefaultWallet.deploy";
|
|
44
44
|
requestedCalls: Invocation[];
|
|
45
45
|
}
|
|
46
|
+
/** A mint in its original position, including the bytes of an unreadable grant. */
|
|
47
|
+
type WalletMint = {
|
|
48
|
+
kind: "decoded";
|
|
49
|
+
node: AuthTokenNode;
|
|
50
|
+
} | {
|
|
51
|
+
kind: "unreadable";
|
|
52
|
+
bytes: Uint8Array;
|
|
53
|
+
};
|
|
54
|
+
/** Calls and grants requested by a wallet root, in calldata order. */
|
|
55
|
+
interface WalletRequestDescription {
|
|
56
|
+
wrapper: WalletRequests["wrapper"];
|
|
57
|
+
mints: WalletMint[];
|
|
58
|
+
calls: {
|
|
59
|
+
invocation: Invocation; /** Ordered references to mints or to tokens returned by earlier calls. */
|
|
60
|
+
tokens: DefaultWallet.v0_1.ExecuteArgs["calls"][number]["tokens"];
|
|
61
|
+
}[];
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Describe the grants and calls in a known DefaultWallet root before execution.
|
|
65
|
+
* The caller must establish wallet identity. An unknown selector returns null;
|
|
66
|
+
* malformed wrapper calldata throws. An unreadable mint retains its bytes and
|
|
67
|
+
* position. Token references describe requests; they do not establish that a
|
|
68
|
+
* token exists or will be returned.
|
|
69
|
+
*/
|
|
70
|
+
declare function describeDefaultWalletRequests(root: Invocation): WalletRequestDescription | null;
|
|
46
71
|
/**
|
|
47
72
|
* Interpret a known DefaultWallet root using built-in binding descriptors.
|
|
48
73
|
* Call only after identifying the root as DefaultWallet; matching selectors
|
|
49
|
-
* alone do not establish wallet identity. Malformed recognized inputs throw
|
|
74
|
+
* alone do not establish wallet identity. Malformed recognized inputs throw,
|
|
75
|
+
* as does an `execute` that mints or forwards auth tokens. To read grants,
|
|
76
|
+
* use {@link describeDefaultWalletRequests}.
|
|
50
77
|
*/
|
|
51
78
|
declare function decodeDefaultWalletRequests(root: Invocation): WalletRequests | null;
|
|
52
79
|
//#endregion
|
|
@@ -73,9 +100,11 @@ declare function readTransactionInput(client: RpcClient, request: {
|
|
|
73
100
|
//#region src/actions/wallet/sendTransaction.d.ts
|
|
74
101
|
/**
|
|
75
102
|
* Serialize and submit once through the native RPC boundary.
|
|
76
|
-
*
|
|
77
|
-
*
|
|
78
|
-
*
|
|
103
|
+
* Every failure has `transaction` facts with the signed bytes and destination
|
|
104
|
+
* discovery network; that network does not prove the signing network of an
|
|
105
|
+
* already-signed envelope. Unknown admission throws code
|
|
106
|
+
* `transactionAdmissionUnsupported`. RPC and transport failures keep their
|
|
107
|
+
* code, with outcome `unknown`, or `notSubmitted` for a local request error.
|
|
79
108
|
*/
|
|
80
109
|
declare function sendTransaction(client: Pick<RpcClient, "sendTransaction" | "discovery">, signedTx: SignedTransaction, options?: TransportRequestOptions): Promise<SHA256Hash>;
|
|
81
110
|
//#endregion
|
|
@@ -86,5 +115,5 @@ declare function sendInvocation(client: Pick<CoreThruputClient, "getChainTip" |
|
|
|
86
115
|
onSigned?: (evidence: SubmissionEvidence) => void | Promise<void>;
|
|
87
116
|
}): Promise<SHA256Hash>;
|
|
88
117
|
//#endregion
|
|
89
|
-
export {
|
|
90
|
-
//# sourceMappingURL=index-
|
|
118
|
+
export { WalletMint as a, decodeDefaultWalletRequests as c, getEffectiveContractSpec as d, ContractSpecResult as f, readTransactionInput as i, describeDefaultWalletRequests as l, sendTransaction as n, WalletRequestDescription as o, getContractSpec as p, VerifiedTransactionInput as r, WalletRequests as s, sendInvocation as t, EffectiveContractSpecResult as u };
|
|
119
|
+
//# sourceMappingURL=index-Dtv_GV6M.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-Dtv_GV6M.d.ts","names":[],"sources":["../src/actions/public/getContractSpec.ts","../src/actions/public/getEffectiveContractSpec.ts","../src/actions/public/decodeWalletRequests.ts","../src/actions/public/readTransactionInput.ts","../src/actions/wallet/sendTransaction.ts","../src/actions/wallet/sendInvocation.ts"],"mappings":";;;;;;;;UAoBiB,kBAAA,SAA2B,2BAA2B;EACrE,YAAA,EAAc,oBAAA;AAAA;;;;;;iBAQM,eAAA,CACpB,MAAA,EAAQ,SAAA,EACR,OAAA;EAAW,OAAA,EAAS,UAAA;AAAA,GACpB,OAAA,GAAU,uBAAA,GACT,OAAA,CAAQ,kBAAA;;;UCVM,2BAAA,SAAoC,0BAAA;EACnD,YAAA,EAAc,oBAAA;EDJC;ECMf,eAAA;IAAmB,IAAA;IAAuB,IAAA,EAAM,YAAA;EAAA;AAAA;;;ADLd;AAQpC;;iBCKsB,wBAAA,CACpB,MAAA,EAAQ,SAAA,EACR,OAAA;EAAW,OAAA,EAAS,UAAA;EA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