@mimicprotocol/sdk 0.0.1-rc.15 → 0.0.1-rc.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/axia/constants.d.ts +0 -1
- package/dist/axia/constants.d.ts.map +1 -1
- package/dist/axia/constants.js +1 -2
- package/dist/axia/constants.js.map +1 -1
- package/dist/axia/validators.d.ts +15 -10
- package/dist/axia/validators.d.ts.map +1 -1
- package/dist/axia/validators.js +2 -1
- package/dist/axia/validators.js.map +1 -1
- package/dist/client/domains/ConfigsClient.d.ts +1 -0
- package/dist/client/domains/ConfigsClient.d.ts.map +1 -1
- package/dist/client/domains/ConfigsClient.js +3 -0
- package/dist/client/domains/ConfigsClient.js.map +1 -1
- package/dist/client/domains/IntentsClient.d.ts +14 -7
- package/dist/client/domains/IntentsClient.d.ts.map +1 -1
- package/dist/client/domains/IntentsClient.js +16 -13
- package/dist/client/domains/IntentsClient.js.map +1 -1
- package/dist/registry/types.d.ts +2 -1
- package/dist/registry/types.d.ts.map +1 -1
- package/dist/registry/types.js.map +1 -1
- package/dist/registry/validations.d.ts +2 -0
- package/dist/registry/validations.d.ts.map +1 -1
- package/dist/registry/validations.js +8 -1
- package/dist/registry/validations.js.map +1 -1
- package/dist/registry/validators.d.ts +26 -6
- package/dist/registry/validators.d.ts.map +1 -1
- package/dist/registry/validators.js +14 -3
- package/dist/registry/validators.js.map +1 -1
- package/dist/relayer/validators.d.ts +358 -2
- package/dist/relayer/validators.d.ts.map +1 -1
- package/dist/relayer/validators.js +2 -1
- package/dist/relayer/validators.js.map +1 -1
- package/dist/runner/validators.d.ts +186 -1
- package/dist/runner/validators.d.ts.map +1 -1
- package/dist/runner/validators.js +6 -1
- package/dist/runner/validators.js.map +1 -1
- package/dist/shared/codec/chains/evm.d.ts +3 -1
- package/dist/shared/codec/chains/evm.d.ts.map +1 -1
- package/dist/shared/codec/chains/evm.js +19 -0
- package/dist/shared/codec/chains/evm.js.map +1 -1
- package/dist/shared/codec/chains/svm.d.ts +15 -10
- package/dist/shared/codec/chains/svm.d.ts.map +1 -1
- package/dist/shared/codec/chains/svm.js +91 -35
- package/dist/shared/codec/chains/svm.js.map +1 -1
- package/dist/shared/codec/decoder.d.ts +4 -2
- package/dist/shared/codec/decoder.d.ts.map +1 -1
- package/dist/shared/codec/decoder.js +20 -14
- package/dist/shared/codec/decoder.js.map +1 -1
- package/dist/shared/codec/encoder.d.ts +31 -3
- package/dist/shared/codec/encoder.d.ts.map +1 -1
- package/dist/shared/codec/encoder.js +12 -5
- package/dist/shared/codec/encoder.js.map +1 -1
- package/dist/shared/codec/index.d.ts +1 -1
- package/dist/shared/codec/index.d.ts.map +1 -1
- package/dist/shared/codec/index.js +13 -8
- package/dist/shared/codec/index.js.map +1 -1
- package/dist/shared/types/intents.d.ts +8 -4
- package/dist/shared/types/intents.d.ts.map +1 -1
- package/dist/shared/utils/random.d.ts +1 -0
- package/dist/shared/utils/random.d.ts.map +1 -1
- package/dist/shared/utils/random.js +10 -2
- package/dist/shared/utils/random.js.map +1 -1
- package/dist/shared/validators/intents.d.ts +228 -10
- package/dist/shared/validators/intents.d.ts.map +1 -1
- package/dist/shared/validators/intents.js +25 -9
- package/dist/shared/validators/intents.js.map +1 -1
- package/dist/shared/validators/primitives.d.ts.map +1 -1
- package/dist/shared/validators/primitives.js +1 -1
- package/dist/shared/validators/primitives.js.map +1 -1
- package/package.json +1 -1
|
@@ -3,12 +3,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.decodeSwapIntent = decodeSwapIntent;
|
|
4
4
|
exports.decodeSwapProposal = decodeSwapProposal;
|
|
5
5
|
exports.decodeTransferIntent = decodeTransferIntent;
|
|
6
|
-
exports.
|
|
6
|
+
exports.decodeEvmCallIntent = decodeEvmCallIntent;
|
|
7
|
+
exports.decodeSvmCallIntent = decodeSvmCallIntent;
|
|
8
|
+
exports.getChainId = getChainId;
|
|
7
9
|
exports.decodeCronExecution = decodeCronExecution;
|
|
8
10
|
exports.decodeEventExecution = decodeEventExecution;
|
|
9
11
|
const ethers_1 = require("ethers");
|
|
10
12
|
const eip712Types_1 = require("../eip712Types");
|
|
11
13
|
const utils_1 = require("../utils");
|
|
14
|
+
const validators_1 = require("../validators");
|
|
12
15
|
const evm_1 = require("./chains/evm");
|
|
13
16
|
const svm_1 = require("./chains/svm");
|
|
14
17
|
function decodeSwapIntent(intent) {
|
|
@@ -33,19 +36,22 @@ function decodeTransferIntent(intent) {
|
|
|
33
36
|
throw new Error(`Failed to decode intent: ${JSON.stringify(intent)}`);
|
|
34
37
|
return decoded;
|
|
35
38
|
}
|
|
36
|
-
function
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
39
|
+
function decodeEvmCallIntent(intent) {
|
|
40
|
+
return (0, evm_1.evmDecodeCallIntent)(intent);
|
|
41
|
+
}
|
|
42
|
+
function decodeSvmCallIntent(intent) {
|
|
43
|
+
return (0, svm_1.svmDecodeCallIntent)(intent);
|
|
44
|
+
}
|
|
45
|
+
function getChainId(intent) {
|
|
46
|
+
if (intent.op === validators_1.OpType.Swap)
|
|
47
|
+
return decodeSwapIntent(intent).sourceChain;
|
|
48
|
+
if (intent.op === validators_1.OpType.Transfer)
|
|
49
|
+
return decodeTransferIntent(intent).chainId;
|
|
50
|
+
if (intent.op === validators_1.OpType.EvmCall)
|
|
51
|
+
return decodeEvmCallIntent(intent).chainId;
|
|
52
|
+
if (intent.op === validators_1.OpType.SvmCall)
|
|
53
|
+
return utils_1.Chains.Solana;
|
|
54
|
+
throw new Error(`Unsupported intent op: ${intent.op}`);
|
|
49
55
|
}
|
|
50
56
|
function decodeCronExecution(data) {
|
|
51
57
|
const [decoded] = ethers_1.AbiCoder.defaultAbiCoder().decode([eip712Types_1.CRON_EXECUTION_ABI_TYPE], data);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decoder.js","sourceRoot":"","sources":["../../../src/shared/codec/decoder.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"decoder.js","sourceRoot":"","sources":["../../../src/shared/codec/decoder.ts"],"names":[],"mappings":";;AAoBA,4CAIC;AAED,gDAUC;AAED,oDAMC;AAED,kDAEC;AAED,kDAEC;AAED,gCAMC;AAED,kDAGC;AAED,oDAIC;AAvED,mCAA8C;AAE9C,gDAA0G;AAY1G,oCAAiC;AACjC,8CAAsC;AAEtC,sCAAgG;AAChG,sCAAgG;AAEhG,SAAgB,gBAAgB,CAAC,MAAc;IAC7C,MAAM,YAAY,GAAG,IAAA,oBAAW,EAAC,MAAM,CAAC,OAAO,CAAC,CAAA;IAChD,MAAM,OAAO,GAAG,YAAY,CAAC,CAAC,CAAC,IAAA,yBAAmB,EAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAA,yBAAmB,EAAC,MAAM,CAAC,CAAA;IACxF,OAAO,OAAO,CAAA;AAChB,CAAC;AAED,SAAgB,kBAAkB,CAAC,QAAkB;IACnD,MAAM,CAAC,OAAO,CAAC,GAAG,iBAAQ,CAAC,eAAe,EAAE,CAAC,MAAM,CAAC,CAAC,oCAAsB,CAAC,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAA;IAC5F,MAAM,CAAC,QAAQ,EAAE,YAAY,EAAE,UAAU,CAAC,GAAG,OAAO,CAAA;IAEpD,OAAO;QACL,GAAG,QAAQ;QACX,QAAQ,EAAE,QAAQ,CAAC,WAAW,EAAE;QAChC,YAAY;QACZ,UAAU,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC,SAAiB,EAAE,EAAE,CAAC,SAAS,CAAC,QAAQ,EAAE,CAAC;KACxE,CAAA;AACH,CAAC;AAED,SAAgB,oBAAoB,CAAC,MAAc;IACjD,MAAM,YAAY,GAAG,IAAA,oBAAW,EAAC,MAAM,CAAC,OAAO,CAAC,CAAA;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AAC,EAAE,IAAI,CAAC,CAAA;IACpF,OAAO,EAAE,SAAS,EAAE,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAA;AACzC,CAAC;AAED,SAAgB,oBAAoB,CAAC,IAAY;IAC/C,MAAM,CAAC,OAAO,CAAC,GAAG,iBAAQ,CAAC,eAAe,EAAE,CAAC,MAAM,CAAC,CAAC,sCAAwB,CAAC,EAAE,IAAI,CAAC,CAAA;IACrF,MAAM,CAAC,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,CAAC,GAAG,OAAO,CAAA;IACrD,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,CAAA;AACjE,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CronExecutionData, EventExecutionData, EvmCallIntent, EvmCallIntentData, Execution, Intent, Proposal, SvmCallIntent, SvmCallIntentData, SwapIntent, SwapIntentData, SwapProposalData, TransferIntent, TransferIntentData } from '../types';
|
|
2
2
|
import { OpType } from '../validators';
|
|
3
3
|
export declare function hashIntent(intent: Intent): string;
|
|
4
4
|
export declare function encodeIntent(intent: Intent): string;
|
|
@@ -7,12 +7,13 @@ export declare function encodeProposal(proposal: Proposal, intentOrHash: string
|
|
|
7
7
|
export declare function encodeSwapIntent(intent: SwapIntentData): string;
|
|
8
8
|
export declare function encodeSwapProposal(proposal: SwapProposalData): string;
|
|
9
9
|
export declare function encodeTransferIntent(intent: TransferIntentData): string;
|
|
10
|
-
export declare function
|
|
10
|
+
export declare function encodeSvmCallIntent(intent: SvmCallIntentData): string;
|
|
11
|
+
export declare function encodeEvmCallIntent(intent: EvmCallIntentData): string;
|
|
11
12
|
export declare function hashExecution(execution: Execution): string;
|
|
12
13
|
export declare function encodeExecution(execution: Execution): string;
|
|
13
14
|
export declare function encodeCronExecution(execution: CronExecutionData): string;
|
|
14
15
|
export declare function encodeEventExecution(execution: EventExecutionData): string;
|
|
15
|
-
export declare function toRawIntent(output: Omit<SwapIntent, 'data'> | Omit<TransferIntent, 'data'> | Omit<
|
|
16
|
+
export declare function toRawIntent(output: Omit<SwapIntent, 'data'> | Omit<TransferIntent, 'data'> | Omit<EvmCallIntent, 'data'> | Omit<SvmCallIntent, 'data'>): {
|
|
16
17
|
data: string;
|
|
17
18
|
hash: string;
|
|
18
19
|
configSig: string;
|
|
@@ -89,5 +90,32 @@ export declare function toRawIntent(output: Omit<SwapIntent, 'data'> | Omit<Tran
|
|
|
89
90
|
value: string;
|
|
90
91
|
target: string;
|
|
91
92
|
}[];
|
|
93
|
+
} | {
|
|
94
|
+
data: string;
|
|
95
|
+
hash: string;
|
|
96
|
+
configSig: string;
|
|
97
|
+
op: OpType;
|
|
98
|
+
user: string;
|
|
99
|
+
settler: string;
|
|
100
|
+
nonce: string;
|
|
101
|
+
deadline: string;
|
|
102
|
+
maxFees: {
|
|
103
|
+
token: string;
|
|
104
|
+
amount: string;
|
|
105
|
+
}[];
|
|
106
|
+
events: {
|
|
107
|
+
data: string;
|
|
108
|
+
topic: string;
|
|
109
|
+
}[];
|
|
110
|
+
minValidations: number;
|
|
111
|
+
instructions: {
|
|
112
|
+
data: string;
|
|
113
|
+
programId: string;
|
|
114
|
+
accountsMeta: {
|
|
115
|
+
pubkey: string;
|
|
116
|
+
isSigner: boolean;
|
|
117
|
+
isWritable: boolean;
|
|
118
|
+
}[];
|
|
119
|
+
}[];
|
|
92
120
|
};
|
|
93
121
|
//# sourceMappingURL=encoder.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"encoder.d.ts","sourceRoot":"","sources":["../../../src/shared/codec/encoder.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"encoder.d.ts","sourceRoot":"","sources":["../../../src/shared/codec/encoder.ts"],"names":[],"mappings":"AASA,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,aAAa,EACb,iBAAiB,EACjB,SAAS,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,CAAC,aAAa,EAAE,MAAM,CAAC,GAC3B,IAAI,CAAC,aAAa,EAAE,MAAM,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwBhC"}
|
|
@@ -7,7 +7,8 @@ exports.encodeProposal = encodeProposal;
|
|
|
7
7
|
exports.encodeSwapIntent = encodeSwapIntent;
|
|
8
8
|
exports.encodeSwapProposal = encodeSwapProposal;
|
|
9
9
|
exports.encodeTransferIntent = encodeTransferIntent;
|
|
10
|
-
exports.
|
|
10
|
+
exports.encodeSvmCallIntent = encodeSvmCallIntent;
|
|
11
|
+
exports.encodeEvmCallIntent = encodeEvmCallIntent;
|
|
11
12
|
exports.hashExecution = hashExecution;
|
|
12
13
|
exports.encodeExecution = encodeExecution;
|
|
13
14
|
exports.encodeCronExecution = encodeCronExecution;
|
|
@@ -69,8 +70,11 @@ function encodeTransferIntent(intent) {
|
|
|
69
70
|
return (0, evm_1.evmEncodeTransferIntent)(intent);
|
|
70
71
|
}
|
|
71
72
|
}
|
|
72
|
-
function
|
|
73
|
-
return
|
|
73
|
+
function encodeSvmCallIntent(intent) {
|
|
74
|
+
return (0, svm_1.svmEncodeCallIntent)(intent);
|
|
75
|
+
}
|
|
76
|
+
function encodeEvmCallIntent(intent) {
|
|
77
|
+
return (0, evm_1.evmEncodeCallIntent)(intent);
|
|
74
78
|
}
|
|
75
79
|
function hashExecution(execution) {
|
|
76
80
|
return (0, ethers_1.keccak256)(encodeExecution(execution));
|
|
@@ -98,8 +102,11 @@ function toRawIntent(output) {
|
|
|
98
102
|
case validators_1.OpType.Transfer:
|
|
99
103
|
data = encodeTransferIntent(output);
|
|
100
104
|
break;
|
|
101
|
-
case validators_1.OpType.
|
|
102
|
-
data =
|
|
105
|
+
case validators_1.OpType.EvmCall:
|
|
106
|
+
data = encodeEvmCallIntent(output);
|
|
107
|
+
break;
|
|
108
|
+
case validators_1.OpType.SvmCall:
|
|
109
|
+
data = encodeSvmCallIntent(output);
|
|
103
110
|
break;
|
|
104
111
|
}
|
|
105
112
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"encoder.js","sourceRoot":"","sources":["../../../src/shared/codec/encoder.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"encoder.js","sourceRoot":"","sources":["../../../src/shared/codec/encoder.ts"],"names":[],"mappings":";;AA+BA,gCAEC;AAED,oCAGC;AAED,oCAEC;AAED,wCAoBC;AAMD,4CAMC;AAED,gDAKC;AAED,oDAOC;AAED,kDAEC;AAED,kDAEC;AAED,sCAEC;AAED,0CAUC;AAED,kDAEC;AAED,oDAKC;AAED,kCA6BC;AA9JD,mCAA4C;AAE5C,gDAMuB;AAiBvB,oCAA+C;AAC/C,8CAAsC;AAEtC,sCAAiH;AACjH,sCAAiH;AAEjH,SAAgB,UAAU,CAAC,MAAc;IACvC,OAAO,IAAA,kBAAS,EAAC,YAAY,CAAC,MAAM,CAAC,CAAC,CAAA;AACxC,CAAC;AAED,SAAgB,YAAY,CAAC,MAAc;IACzC,MAAM,YAAY,GAAG,IAAA,oBAAY,EAAC,MAAM,CAAC,OAAO,CAAC,CAAA;IACjD,OAAO,YAAY,CAAC,CAAC,CAAC,IAAA,qBAAe,EAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAA,qBAAe,EAAC,MAAM,CAAC,CAAA;AACzE,CAAC;AAED,SAAgB,YAAY,CAAC,QAAkB,EAAE,YAA6B;IAC5E,OAAO,IAAA,kBAAS,EAAC,cAAc,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC,CAAA;AAC1D,CAAC;AAED,SAAgB,cAAc,CAAC,QAAkB,EAAE,YAA6B;IAC9E,MAAM,UAAU,GAAG,OAAO,YAAY,IAAI,QAAQ,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,UAAU,CAAC,YAAY,CAAC,CAAA;IAC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, SVM_UINT8_ARRAY_SCHEMA, } from './chains/svm';
|
|
2
2
|
export * from './decoder';
|
|
3
3
|
export * from './encoder';
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/shared/codec/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/shared/codec/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,wBAAwB,EACxB,gCAAgC,EAChC,2BAA2B,EAC3B,uBAAuB,EACvB,iBAAiB,EACjB,kBAAkB,EAClB,2BAA2B,EAC3B,mBAAmB,EACnB,oBAAoB,EACpB,+BAA+B,EAC/B,mBAAmB,EACnB,sBAAsB,GACvB,MAAM,cAAc,CAAA;AACrB,cAAc,WAAW,CAAA;AACzB,cAAc,WAAW,CAAA"}
|
|
@@ -14,15 +14,20 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.
|
|
17
|
+
exports.SVM_UINT8_ARRAY_SCHEMA = exports.SVM_TRANSFER_SCHEMA = exports.SVM_TRANSFER_INTENT_DATA_SCHEMA = exports.SVM_TOKEN_OUT_SCHEMA = exports.SVM_TOKEN_IN_SCHEMA = exports.SVM_SWAP_INTENT_DATA_SCHEMA = exports.SVM_MAX_FEE_SCHEMA = exports.SVM_INTENT_SCHEMA = exports.SVM_INTENT_EVENT_SCHEMA = exports.SVM_CALL_INTENT_DATA_SCHEMA = exports.SVM_CALL_INSTRUCTION_DATA_SCHEMA = exports.SVM_ACCOUNTS_META_SCHEMA = void 0;
|
|
18
18
|
var svm_1 = require("./chains/svm");
|
|
19
|
-
Object.defineProperty(exports, "
|
|
20
|
-
Object.defineProperty(exports, "
|
|
21
|
-
Object.defineProperty(exports, "
|
|
22
|
-
Object.defineProperty(exports, "
|
|
23
|
-
Object.defineProperty(exports, "
|
|
24
|
-
Object.defineProperty(exports, "
|
|
25
|
-
Object.defineProperty(exports, "
|
|
19
|
+
Object.defineProperty(exports, "SVM_ACCOUNTS_META_SCHEMA", { enumerable: true, get: function () { return svm_1.SVM_ACCOUNTS_META_SCHEMA; } });
|
|
20
|
+
Object.defineProperty(exports, "SVM_CALL_INSTRUCTION_DATA_SCHEMA", { enumerable: true, get: function () { return svm_1.SVM_CALL_INSTRUCTION_DATA_SCHEMA; } });
|
|
21
|
+
Object.defineProperty(exports, "SVM_CALL_INTENT_DATA_SCHEMA", { enumerable: true, get: function () { return svm_1.SVM_CALL_INTENT_DATA_SCHEMA; } });
|
|
22
|
+
Object.defineProperty(exports, "SVM_INTENT_EVENT_SCHEMA", { enumerable: true, get: function () { return svm_1.SVM_INTENT_EVENT_SCHEMA; } });
|
|
23
|
+
Object.defineProperty(exports, "SVM_INTENT_SCHEMA", { enumerable: true, get: function () { return svm_1.SVM_INTENT_SCHEMA; } });
|
|
24
|
+
Object.defineProperty(exports, "SVM_MAX_FEE_SCHEMA", { enumerable: true, get: function () { return svm_1.SVM_MAX_FEE_SCHEMA; } });
|
|
25
|
+
Object.defineProperty(exports, "SVM_SWAP_INTENT_DATA_SCHEMA", { enumerable: true, get: function () { return svm_1.SVM_SWAP_INTENT_DATA_SCHEMA; } });
|
|
26
|
+
Object.defineProperty(exports, "SVM_TOKEN_IN_SCHEMA", { enumerable: true, get: function () { return svm_1.SVM_TOKEN_IN_SCHEMA; } });
|
|
27
|
+
Object.defineProperty(exports, "SVM_TOKEN_OUT_SCHEMA", { enumerable: true, get: function () { return svm_1.SVM_TOKEN_OUT_SCHEMA; } });
|
|
28
|
+
Object.defineProperty(exports, "SVM_TRANSFER_INTENT_DATA_SCHEMA", { enumerable: true, get: function () { return svm_1.SVM_TRANSFER_INTENT_DATA_SCHEMA; } });
|
|
29
|
+
Object.defineProperty(exports, "SVM_TRANSFER_SCHEMA", { enumerable: true, get: function () { return svm_1.SVM_TRANSFER_SCHEMA; } });
|
|
30
|
+
Object.defineProperty(exports, "SVM_UINT8_ARRAY_SCHEMA", { enumerable: true, get: function () { return svm_1.SVM_UINT8_ARRAY_SCHEMA; } });
|
|
26
31
|
__exportStar(require("./decoder"), exports);
|
|
27
32
|
__exportStar(require("./encoder"), exports);
|
|
28
33
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/shared/codec/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/shared/codec/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,oCAaqB;AAZnB,+GAAA,wBAAwB,OAAA;AACxB,uHAAA,gCAAgC,OAAA;AAChC,kHAAA,2BAA2B,OAAA;AAC3B,8GAAA,uBAAuB,OAAA;AACvB,wGAAA,iBAAiB,OAAA;AACjB,yGAAA,kBAAkB,OAAA;AAClB,kHAAA,2BAA2B,OAAA;AAC3B,0GAAA,mBAAmB,OAAA;AACnB,2GAAA,oBAAoB,OAAA;AACpB,sHAAA,+BAA+B,OAAA;AAC/B,0GAAA,mBAAmB,OAAA;AACnB,6GAAA,sBAAsB,OAAA;AAExB,4CAAyB;AACzB,4CAAyB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import {
|
|
2
|
+
import { EvmCallIntentCallValidator, EvmCallIntentDataValidator, EvmCallIntentValidator, IntentEventsValidator, IntentEventValidator, IntentValidator, MaxFeesValidator, MaxFeeValidator, ProposalValidator, SvmAccountMetaValidator, SvmCallIntentDataValidator, SvmCallIntentInstructionValidator, SvmCallIntentValidator, SwapIntentDataValidator, SwapIntentTokenInValidator, SwapIntentTokenOutValidator, SwapIntentValidator, SwapProposalDataValidator, SwapProposalValidator, TransferIntentDataValidator, TransferIntentTransferValidator, TransferIntentValidator, ValidatedIntentValidator } from '../validators';
|
|
3
3
|
export type Intent = z.infer<typeof IntentValidator>;
|
|
4
4
|
export type ValidatedIntent = z.infer<typeof ValidatedIntentValidator>;
|
|
5
5
|
export type Proposal = z.infer<typeof ProposalValidator>;
|
|
@@ -16,7 +16,11 @@ export type SwapProposal = z.infer<typeof SwapProposalValidator>;
|
|
|
16
16
|
export type TransferIntentTransfer = z.infer<typeof TransferIntentTransferValidator>;
|
|
17
17
|
export type TransferIntentData = z.infer<typeof TransferIntentDataValidator>;
|
|
18
18
|
export type TransferIntent = z.infer<typeof TransferIntentValidator>;
|
|
19
|
-
export type
|
|
20
|
-
export type
|
|
21
|
-
export type
|
|
19
|
+
export type EvmCallIntentCall = z.infer<typeof EvmCallIntentCallValidator>;
|
|
20
|
+
export type EvmCallIntentData = z.infer<typeof EvmCallIntentDataValidator>;
|
|
21
|
+
export type EvmCallIntent = z.infer<typeof EvmCallIntentValidator>;
|
|
22
|
+
export type SvmAccountMeta = z.infer<typeof SvmAccountMetaValidator>;
|
|
23
|
+
export type SvmCallIntentInstruction = z.infer<typeof SvmCallIntentInstructionValidator>;
|
|
24
|
+
export type SvmCallIntentData = z.infer<typeof SvmCallIntentDataValidator>;
|
|
25
|
+
export type SvmCallIntent = z.infer<typeof SvmCallIntentValidator>;
|
|
22
26
|
//# sourceMappingURL=intents.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"intents.d.ts","sourceRoot":"","sources":["../../../src/shared/types/intents.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,OAAO,EACL,
|
|
1
|
+
{"version":3,"file":"intents.d.ts","sourceRoot":"","sources":["../../../src/shared/types/intents.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,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AAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAA;AAE5D,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAA;AAExE,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAA;AAIhE,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAA;AAEpF,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAA;AAE5E,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAA;AAIpE,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAA;AAE1E,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAA;AAE1E,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAA;AAIlE,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAA;AAEpE,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iCAAiC,CAAC,CAAA;AAExF,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAA;AAE1E,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAA"}
|
|
@@ -5,4 +5,5 @@ export declare function randomHex(length: number): string;
|
|
|
5
5
|
export declare function randomBase58(length: number): string;
|
|
6
6
|
export declare function randomCid(): string;
|
|
7
7
|
export declare function randomString(length: number, dictionary?: string): string;
|
|
8
|
+
export declare function randomNumber(length: number): number;
|
|
8
9
|
//# sourceMappingURL=random.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"random.d.ts","sourceRoot":"","sources":["../../../src/shared/utils/random.ts"],"names":[],"mappings":"AAKA,wBAAgB,gBAAgB,IAAI,MAAM,CAEzC;AAED,wBAAgB,gBAAgB,IAAI,MAAM,CAEzC;AAED,wBAAgB,SAAS,IAAI,MAAM,CAElC;AAED,wBAAgB,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAEhD;AAED,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAEnD;AAED,wBAAgB,SAAS,IAAI,MAAM,CAElC;AAED,wBAAgB,YAAY,CAC1B,MAAM,EAAE,MAAM,EACd,UAAU,SAAyD,GAClE,MAAM,
|
|
1
|
+
{"version":3,"file":"random.d.ts","sourceRoot":"","sources":["../../../src/shared/utils/random.ts"],"names":[],"mappings":"AAKA,wBAAgB,gBAAgB,IAAI,MAAM,CAEzC;AAED,wBAAgB,gBAAgB,IAAI,MAAM,CAEzC;AAED,wBAAgB,SAAS,IAAI,MAAM,CAElC;AAED,wBAAgB,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAEhD;AAED,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAEnD;AAED,wBAAgB,SAAS,IAAI,MAAM,CAElC;AAED,wBAAgB,YAAY,CAC1B,MAAM,EAAE,MAAM,EACd,UAAU,SAAyD,GAClE,MAAM,CASR;AAED,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAKnD"}
|
|
@@ -8,6 +8,7 @@ exports.randomHex = randomHex;
|
|
|
8
8
|
exports.randomBase58 = randomBase58;
|
|
9
9
|
exports.randomCid = randomCid;
|
|
10
10
|
exports.randomString = randomString;
|
|
11
|
+
exports.randomNumber = randomNumber;
|
|
11
12
|
const web3_js_1 = require("@solana/web3.js");
|
|
12
13
|
const crypto_1 = require("crypto");
|
|
13
14
|
function randomEvmAddress() {
|
|
@@ -29,12 +30,19 @@ function randomCid() {
|
|
|
29
30
|
return 'b' + randomString(58, 'abcdefghijklmnopqrstuvwxyz234567');
|
|
30
31
|
}
|
|
31
32
|
function randomString(length, dictionary = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz') {
|
|
32
|
-
const charactersLength = dictionary.length;
|
|
33
33
|
let result = '';
|
|
34
34
|
for (let i = 0; i < length; i++) {
|
|
35
|
-
const randomIndex = Math.floor(Math.random() *
|
|
35
|
+
const randomIndex = Math.floor(Math.random() * dictionary.length);
|
|
36
36
|
result += dictionary.charAt(randomIndex);
|
|
37
37
|
}
|
|
38
38
|
return result;
|
|
39
39
|
}
|
|
40
|
+
function randomNumber(length) {
|
|
41
|
+
if (length > 15)
|
|
42
|
+
throw new Error('Length exceeds max safe integer');
|
|
43
|
+
let result = String((0, crypto_1.randomInt)(1, 10));
|
|
44
|
+
for (let i = 1; i < length; i++)
|
|
45
|
+
result += (0, crypto_1.randomInt)(0, 10).toString();
|
|
46
|
+
return Number(result);
|
|
47
|
+
}
|
|
40
48
|
//# sourceMappingURL=random.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"random.js","sourceRoot":"","sources":["../../../src/shared/utils/random.ts"],"names":[],"mappings":";AAAA,0CAA0C;;AAK1C,4CAEC;AAED,4CAEC;AAED,8BAEC;AAED,8BAEC;AAED,oCAEC;AAED,8BAEC;AAED,
|
|
1
|
+
{"version":3,"file":"random.js","sourceRoot":"","sources":["../../../src/shared/utils/random.ts"],"names":[],"mappings":";AAAA,0CAA0C;;AAK1C,4CAEC;AAED,4CAEC;AAED,8BAEC;AAED,8BAEC;AAED,oCAEC;AAED,8BAEC;AAED,oCAYC;AAED,oCAKC;AA9CD,6CAA2C;AAC3C,mCAA+C;AAE/C,SAAgB,gBAAgB;IAC9B,OAAO,SAAS,CAAC,EAAE,CAAC,CAAA;AACtB,CAAC;AAED,SAAgB,g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EAAE,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAA;IACtE,OAAO,MAAM,CAAC,MAAM,CAAC,CAAA;AACvB,CAAC"}
|
|
@@ -2,7 +2,8 @@ import { z } from 'zod';
|
|
|
2
2
|
export declare enum OpType {
|
|
3
3
|
Swap = 0,
|
|
4
4
|
Transfer = 1,
|
|
5
|
-
|
|
5
|
+
EvmCall = 2,
|
|
6
|
+
SvmCall = 3
|
|
6
7
|
}
|
|
7
8
|
export declare const MaxFeeValidator: z.ZodObject<{
|
|
8
9
|
token: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
|
@@ -138,7 +139,7 @@ export declare const ValidatedIntentValidator: z.ZodObject<z.objectUtil.extendSh
|
|
|
138
139
|
configSig: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
|
139
140
|
minValidations: z.ZodNumber;
|
|
140
141
|
}, {
|
|
141
|
-
validations: z.ZodArray<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, "many">;
|
|
142
|
+
validations: z.ZodArray<z.ZodArray<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, "many">, "many">;
|
|
142
143
|
}>, "strip", z.ZodTypeAny, {
|
|
143
144
|
data: string;
|
|
144
145
|
configSig: string;
|
|
@@ -156,7 +157,7 @@ export declare const ValidatedIntentValidator: z.ZodObject<z.objectUtil.extendSh
|
|
|
156
157
|
topic: string;
|
|
157
158
|
}[];
|
|
158
159
|
minValidations: number;
|
|
159
|
-
validations: string[];
|
|
160
|
+
validations: string[][];
|
|
160
161
|
}, {
|
|
161
162
|
data: string;
|
|
162
163
|
configSig: string;
|
|
@@ -174,7 +175,7 @@ export declare const ValidatedIntentValidator: z.ZodObject<z.objectUtil.extendSh
|
|
|
174
175
|
topic: string;
|
|
175
176
|
}[];
|
|
176
177
|
minValidations: number;
|
|
177
|
-
validations: string[];
|
|
178
|
+
validations: string[][];
|
|
178
179
|
}>;
|
|
179
180
|
export declare const ProposalValidator: z.ZodObject<{
|
|
180
181
|
solver: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
|
@@ -551,8 +552,8 @@ export declare const TransferIntentValidator: z.ZodObject<z.objectUtil.extendSha
|
|
|
551
552
|
recipient: string;
|
|
552
553
|
}[];
|
|
553
554
|
}>;
|
|
554
|
-
export declare const
|
|
555
|
-
target: z.ZodEffects<z.
|
|
555
|
+
export declare const EvmCallIntentCallValidator: z.ZodObject<{
|
|
556
|
+
target: z.ZodEffects<z.ZodString, string, string>;
|
|
556
557
|
data: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
|
557
558
|
value: z.ZodEffects<z.ZodString, string, string>;
|
|
558
559
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -564,10 +565,10 @@ export declare const CallIntentCallValidator: z.ZodObject<{
|
|
|
564
565
|
value: string;
|
|
565
566
|
target: string;
|
|
566
567
|
}>;
|
|
567
|
-
export declare const
|
|
568
|
+
export declare const EvmCallIntentDataValidator: z.ZodObject<{
|
|
568
569
|
chainId: z.ZodEffects<z.ZodNumber, number, number>;
|
|
569
570
|
calls: z.ZodArray<z.ZodObject<{
|
|
570
|
-
target: z.ZodEffects<z.
|
|
571
|
+
target: z.ZodEffects<z.ZodString, string, string>;
|
|
571
572
|
data: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
|
572
573
|
value: z.ZodEffects<z.ZodString, string, string>;
|
|
573
574
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -594,7 +595,7 @@ export declare const CallIntentDataValidator: z.ZodObject<{
|
|
|
594
595
|
target: string;
|
|
595
596
|
}[];
|
|
596
597
|
}>;
|
|
597
|
-
export declare const
|
|
598
|
+
export declare const EvmCallIntentValidator: z.ZodObject<z.objectUtil.extendShape<{
|
|
598
599
|
op: z.ZodNativeEnum<typeof OpType>;
|
|
599
600
|
user: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
|
600
601
|
settler: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
|
@@ -626,7 +627,7 @@ export declare const CallIntentValidator: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
626
627
|
}, {
|
|
627
628
|
chainId: z.ZodEffects<z.ZodNumber, number, number>;
|
|
628
629
|
calls: z.ZodArray<z.ZodObject<{
|
|
629
|
-
target: z.ZodEffects<z.
|
|
630
|
+
target: z.ZodEffects<z.ZodString, string, string>;
|
|
630
631
|
data: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
|
631
632
|
value: z.ZodEffects<z.ZodString, string, string>;
|
|
632
633
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -685,4 +686,221 @@ export declare const CallIntentValidator: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
685
686
|
target: string;
|
|
686
687
|
}[];
|
|
687
688
|
}>;
|
|
689
|
+
export declare const SvmAccountMetaValidator: z.ZodObject<{
|
|
690
|
+
pubkey: z.ZodEffects<z.ZodString, string, string>;
|
|
691
|
+
isSigner: z.ZodBoolean;
|
|
692
|
+
isWritable: z.ZodBoolean;
|
|
693
|
+
}, "strip", z.ZodTypeAny, {
|
|
694
|
+
pubkey: string;
|
|
695
|
+
isSigner: boolean;
|
|
696
|
+
isWritable: boolean;
|
|
697
|
+
}, {
|
|
698
|
+
pubkey: string;
|
|
699
|
+
isSigner: boolean;
|
|
700
|
+
isWritable: boolean;
|
|
701
|
+
}>;
|
|
702
|
+
export declare const SvmCallIntentInstructionValidator: z.ZodObject<{
|
|
703
|
+
programId: z.ZodEffects<z.ZodString, string, string>;
|
|
704
|
+
accountsMeta: z.ZodArray<z.ZodObject<{
|
|
705
|
+
pubkey: z.ZodEffects<z.ZodString, string, string>;
|
|
706
|
+
isSigner: z.ZodBoolean;
|
|
707
|
+
isWritable: z.ZodBoolean;
|
|
708
|
+
}, "strip", z.ZodTypeAny, {
|
|
709
|
+
pubkey: string;
|
|
710
|
+
isSigner: boolean;
|
|
711
|
+
isWritable: boolean;
|
|
712
|
+
}, {
|
|
713
|
+
pubkey: string;
|
|
714
|
+
isSigner: boolean;
|
|
715
|
+
isWritable: boolean;
|
|
716
|
+
}>, "many">;
|
|
717
|
+
data: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
|
718
|
+
}, "strip", z.ZodTypeAny, {
|
|
719
|
+
data: string;
|
|
720
|
+
programId: string;
|
|
721
|
+
accountsMeta: {
|
|
722
|
+
pubkey: string;
|
|
723
|
+
isSigner: boolean;
|
|
724
|
+
isWritable: boolean;
|
|
725
|
+
}[];
|
|
726
|
+
}, {
|
|
727
|
+
data: string;
|
|
728
|
+
programId: string;
|
|
729
|
+
accountsMeta: {
|
|
730
|
+
pubkey: string;
|
|
731
|
+
isSigner: boolean;
|
|
732
|
+
isWritable: boolean;
|
|
733
|
+
}[];
|
|
734
|
+
}>;
|
|
735
|
+
export declare const SvmCallIntentDataValidator: z.ZodObject<{
|
|
736
|
+
instructions: z.ZodArray<z.ZodObject<{
|
|
737
|
+
programId: z.ZodEffects<z.ZodString, string, string>;
|
|
738
|
+
accountsMeta: z.ZodArray<z.ZodObject<{
|
|
739
|
+
pubkey: z.ZodEffects<z.ZodString, string, string>;
|
|
740
|
+
isSigner: z.ZodBoolean;
|
|
741
|
+
isWritable: z.ZodBoolean;
|
|
742
|
+
}, "strip", z.ZodTypeAny, {
|
|
743
|
+
pubkey: string;
|
|
744
|
+
isSigner: boolean;
|
|
745
|
+
isWritable: boolean;
|
|
746
|
+
}, {
|
|
747
|
+
pubkey: string;
|
|
748
|
+
isSigner: boolean;
|
|
749
|
+
isWritable: boolean;
|
|
750
|
+
}>, "many">;
|
|
751
|
+
data: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
|
752
|
+
}, "strip", z.ZodTypeAny, {
|
|
753
|
+
data: string;
|
|
754
|
+
programId: string;
|
|
755
|
+
accountsMeta: {
|
|
756
|
+
pubkey: string;
|
|
757
|
+
isSigner: boolean;
|
|
758
|
+
isWritable: boolean;
|
|
759
|
+
}[];
|
|
760
|
+
}, {
|
|
761
|
+
data: string;
|
|
762
|
+
programId: string;
|
|
763
|
+
accountsMeta: {
|
|
764
|
+
pubkey: string;
|
|
765
|
+
isSigner: boolean;
|
|
766
|
+
isWritable: boolean;
|
|
767
|
+
}[];
|
|
768
|
+
}>, "many">;
|
|
769
|
+
}, "strip", z.ZodTypeAny, {
|
|
770
|
+
instructions: {
|
|
771
|
+
data: string;
|
|
772
|
+
programId: string;
|
|
773
|
+
accountsMeta: {
|
|
774
|
+
pubkey: string;
|
|
775
|
+
isSigner: boolean;
|
|
776
|
+
isWritable: boolean;
|
|
777
|
+
}[];
|
|
778
|
+
}[];
|
|
779
|
+
}, {
|
|
780
|
+
instructions: {
|
|
781
|
+
data: string;
|
|
782
|
+
programId: string;
|
|
783
|
+
accountsMeta: {
|
|
784
|
+
pubkey: string;
|
|
785
|
+
isSigner: boolean;
|
|
786
|
+
isWritable: boolean;
|
|
787
|
+
}[];
|
|
788
|
+
}[];
|
|
789
|
+
}>;
|
|
790
|
+
export declare const SvmCallIntentValidator: z.ZodObject<z.objectUtil.extendShape<{
|
|
791
|
+
op: z.ZodNativeEnum<typeof OpType>;
|
|
792
|
+
user: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
|
793
|
+
settler: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
|
794
|
+
nonce: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
|
795
|
+
deadline: z.ZodEffects<z.ZodString, string, string>;
|
|
796
|
+
data: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
|
797
|
+
maxFees: z.ZodArray<z.ZodObject<{
|
|
798
|
+
token: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
|
799
|
+
amount: z.ZodEffects<z.ZodString, string, string>;
|
|
800
|
+
}, "strip", z.ZodTypeAny, {
|
|
801
|
+
token: string;
|
|
802
|
+
amount: string;
|
|
803
|
+
}, {
|
|
804
|
+
token: string;
|
|
805
|
+
amount: string;
|
|
806
|
+
}>, "many">;
|
|
807
|
+
events: z.ZodArray<z.ZodObject<{
|
|
808
|
+
topic: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
|
809
|
+
data: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
|
810
|
+
}, "strip", z.ZodTypeAny, {
|
|
811
|
+
data: string;
|
|
812
|
+
topic: string;
|
|
813
|
+
}, {
|
|
814
|
+
data: string;
|
|
815
|
+
topic: string;
|
|
816
|
+
}>, "many">;
|
|
817
|
+
configSig: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
|
818
|
+
minValidations: z.ZodNumber;
|
|
819
|
+
}, {
|
|
820
|
+
instructions: z.ZodArray<z.ZodObject<{
|
|
821
|
+
programId: z.ZodEffects<z.ZodString, string, string>;
|
|
822
|
+
accountsMeta: z.ZodArray<z.ZodObject<{
|
|
823
|
+
pubkey: z.ZodEffects<z.ZodString, string, string>;
|
|
824
|
+
isSigner: z.ZodBoolean;
|
|
825
|
+
isWritable: z.ZodBoolean;
|
|
826
|
+
}, "strip", z.ZodTypeAny, {
|
|
827
|
+
pubkey: string;
|
|
828
|
+
isSigner: boolean;
|
|
829
|
+
isWritable: boolean;
|
|
830
|
+
}, {
|
|
831
|
+
pubkey: string;
|
|
832
|
+
isSigner: boolean;
|
|
833
|
+
isWritable: boolean;
|
|
834
|
+
}>, "many">;
|
|
835
|
+
data: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
|
836
|
+
}, "strip", z.ZodTypeAny, {
|
|
837
|
+
data: string;
|
|
838
|
+
programId: string;
|
|
839
|
+
accountsMeta: {
|
|
840
|
+
pubkey: string;
|
|
841
|
+
isSigner: boolean;
|
|
842
|
+
isWritable: boolean;
|
|
843
|
+
}[];
|
|
844
|
+
}, {
|
|
845
|
+
data: string;
|
|
846
|
+
programId: string;
|
|
847
|
+
accountsMeta: {
|
|
848
|
+
pubkey: string;
|
|
849
|
+
isSigner: boolean;
|
|
850
|
+
isWritable: boolean;
|
|
851
|
+
}[];
|
|
852
|
+
}>, "many">;
|
|
853
|
+
}>, "strip", z.ZodTypeAny, {
|
|
854
|
+
data: string;
|
|
855
|
+
configSig: string;
|
|
856
|
+
op: OpType;
|
|
857
|
+
user: string;
|
|
858
|
+
settler: string;
|
|
859
|
+
nonce: string;
|
|
860
|
+
deadline: string;
|
|
861
|
+
maxFees: {
|
|
862
|
+
token: string;
|
|
863
|
+
amount: string;
|
|
864
|
+
}[];
|
|
865
|
+
events: {
|
|
866
|
+
data: string;
|
|
867
|
+
topic: string;
|
|
868
|
+
}[];
|
|
869
|
+
minValidations: number;
|
|
870
|
+
instructions: {
|
|
871
|
+
data: string;
|
|
872
|
+
programId: string;
|
|
873
|
+
accountsMeta: {
|
|
874
|
+
pubkey: string;
|
|
875
|
+
isSigner: boolean;
|
|
876
|
+
isWritable: boolean;
|
|
877
|
+
}[];
|
|
878
|
+
}[];
|
|
879
|
+
}, {
|
|
880
|
+
data: string;
|
|
881
|
+
configSig: string;
|
|
882
|
+
op: OpType;
|
|
883
|
+
user: string;
|
|
884
|
+
settler: string;
|
|
885
|
+
nonce: string;
|
|
886
|
+
deadline: string;
|
|
887
|
+
maxFees: {
|
|
888
|
+
token: string;
|
|
889
|
+
amount: string;
|
|
890
|
+
}[];
|
|
891
|
+
events: {
|
|
892
|
+
data: string;
|
|
893
|
+
topic: string;
|
|
894
|
+
}[];
|
|
895
|
+
minValidations: number;
|
|
896
|
+
instructions: {
|
|
897
|
+
data: string;
|
|
898
|
+
programId: string;
|
|
899
|
+
accountsMeta: {
|
|
900
|
+
pubkey: string;
|
|
901
|
+
isSigner: boolean;
|
|
902
|
+
isWritable: boolean;
|
|
903
|
+
}[];
|
|
904
|
+
}[];
|
|
905
|
+
}>;
|
|
688
906
|
//# sourceMappingURL=intents.d.ts.map
|