@eco-foundation/api-schemas 0.8.0 → 0.9.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 +89 -12
- package/dist/fixtures/index.js +6 -6
- package/dist/fixtures/index.js.map +1 -1
- package/dist/fixtures/v1/deposit-addresses-create.request.gateway-erc20.json +1 -1
- package/dist/fixtures/v1/deposit-addresses-create.response.gateway-erc20.json +1 -1
- package/dist/fixtures/v1/deposit-addresses-lookup.response.default.json +1 -1
- package/dist/fixtures/v1/intents-status.response.quote-filled-detail.json +60 -0
- package/dist/fixtures/v1/{quotes-create.request.public-swap.json → quotes-create.request.swap.json} +4 -4
- package/dist/fixtures/v1/quotes-create.response.all-quotes.json +288 -81
- package/dist/fixtures/v1/quotes-create.response.swap.json +228 -0
- package/dist/generated/build-digest.json +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/openapi.js +18 -0
- package/dist/openapi.js.map +1 -1
- package/dist/v1/endpoints/deposit-addresses.d.ts +12 -12
- package/dist/v1/endpoints/deposit-addresses.js +9 -9
- package/dist/v1/endpoints/quotes.d.ts +343 -193
- package/dist/v1/endpoints/quotes.js +50 -60
- package/dist/v1/endpoints/quotes.js.map +1 -1
- package/dist/v1/endpoints/registry.d.ts +114 -76
- package/dist/v1/endpoints/routes.js +1 -1
- package/dist/v1/endpoints/routes.js.map +1 -1
- package/dist/v1/endpoints/status.d.ts +4 -0
- package/dist/v1/endpoints/status.js +1 -0
- package/dist/v1/endpoints/status.js.map +1 -1
- package/dist/v1/enums.d.ts +12 -30
- package/dist/v1/enums.js +10 -15
- package/dist/v1/enums.js.map +1 -1
- package/dist/v1/types.d.ts +42 -42
- package/openapi/v1.json +1076 -673
- package/package.json +1 -1
- package/dist/fixtures/v1/quotes-create.response.private-swap.json +0 -153
- package/dist/fixtures/v1/quotes-create.response.public-swap.json +0 -159
package/dist/v1/enums.js
CHANGED
|
@@ -1,19 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.STATUS_VOCABULARY = exports.GaslessSubState = exports.GASLESS_SUB_STATES = exports.GASLESS_JOB_STATUSES = exports.StatusType = exports.STATUS_TYPES = exports.STANDARDS_BY_TARGET = exports.SubmitStandard = exports.SUBMIT_STANDARDS = exports.
|
|
3
|
+
exports.STATUS_VOCABULARY = exports.GaslessSubState = exports.GASLESS_SUB_STATES = exports.GASLESS_JOB_STATUSES = exports.StatusType = exports.STATUS_TYPES = exports.STANDARDS_BY_TARGET = exports.SubmitStandard = exports.SUBMIT_STANDARDS = exports.StepTypeTolerant = exports.StepType = exports.STEP_TYPES = exports.RelatedIntentRoleTolerant = exports.RelatedIntentRole = exports.RELATED_INTENT_ROLES = exports.ChainStatus = exports.CHAIN_STATUSES = exports.ChainEncoding = exports.CHAIN_ENCODINGS = exports.ChainType = exports.CHAIN_TYPES = exports.FeeTypeTolerant = exports.FeeType = exports.FEE_TYPES = exports.QuoteTypeTolerant = exports.QuoteType = exports.QUOTE_TYPES = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const primitives_1 = require("./primitives");
|
|
6
|
-
exports.
|
|
7
|
-
exports.
|
|
8
|
-
exports.
|
|
9
|
-
exports.
|
|
10
|
-
exports.
|
|
11
|
-
exports.
|
|
12
|
-
exports.FEE_KINDS = ['gas', 'proving', 'protocol', 'gateway'];
|
|
13
|
-
exports.FeeKind = zod_1.z.enum(exports.FEE_KINDS);
|
|
14
|
-
exports.FeeKindTolerant = (0, primitives_1.tolerantEnum)(exports.FEE_KINDS);
|
|
15
|
-
exports.VISIBILITIES = ['public', 'private'];
|
|
16
|
-
exports.Visibility = zod_1.z.enum(exports.VISIBILITIES);
|
|
6
|
+
exports.QUOTE_TYPES = ['exact-in', 'exact-out', 'custom'];
|
|
7
|
+
exports.QuoteType = zod_1.z.enum(exports.QUOTE_TYPES);
|
|
8
|
+
exports.QuoteTypeTolerant = (0, primitives_1.tolerantEnum)(exports.QUOTE_TYPES);
|
|
9
|
+
exports.FEE_TYPES = ['gas', 'proving', 'protocol', 'gateway'];
|
|
10
|
+
exports.FeeType = zod_1.z.enum(exports.FEE_TYPES);
|
|
11
|
+
exports.FeeTypeTolerant = (0, primitives_1.tolerantEnum)(exports.FEE_TYPES);
|
|
17
12
|
exports.CHAIN_TYPES = ['evm', 'svm', 'tvm'];
|
|
18
13
|
exports.ChainType = zod_1.z.enum(exports.CHAIN_TYPES);
|
|
19
14
|
exports.CHAIN_ENCODINGS = ['abi', 'borsh'];
|
|
@@ -23,9 +18,9 @@ exports.ChainStatus = zod_1.z.enum(exports.CHAIN_STATUSES);
|
|
|
23
18
|
exports.RELATED_INTENT_ROLES = ['local', 'bucket-candidate', 'stitched-destination'];
|
|
24
19
|
exports.RelatedIntentRole = zod_1.z.enum(exports.RELATED_INTENT_ROLES);
|
|
25
20
|
exports.RelatedIntentRoleTolerant = (0, primitives_1.tolerantEnum)(exports.RELATED_INTENT_ROLES);
|
|
26
|
-
exports.
|
|
27
|
-
exports.
|
|
28
|
-
exports.
|
|
21
|
+
exports.STEP_TYPES = ['swap', 'bridge', 'deposit', 'transfer'];
|
|
22
|
+
exports.StepType = zod_1.z.enum(exports.STEP_TYPES);
|
|
23
|
+
exports.StepTypeTolerant = (0, primitives_1.tolerantEnum)(exports.STEP_TYPES);
|
|
29
24
|
exports.SUBMIT_STANDARDS = ['permit3', 'permit2', 'erc-3009', 'erc-2612'];
|
|
30
25
|
exports.SubmitStandard = zod_1.z.enum(exports.SUBMIT_STANDARDS);
|
|
31
26
|
exports.STANDARDS_BY_TARGET = {
|
package/dist/v1/enums.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enums.js","sourceRoot":"","sources":["../../src/v1/enums.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAExB,6CAA4C;AAE/B,QAAA,
|
|
1
|
+
{"version":3,"file":"enums.js","sourceRoot":"","sources":["../../src/v1/en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ErrorDefinition } from './errors/catalog';
|
|
2
|
-
export type
|
|
3
|
-
export type
|
|
4
|
-
export type V1FeeKind = 'gas' | 'proving' | 'protocol' | 'gateway';
|
|
5
|
-
export type V1Visibility = 'public' | 'private';
|
|
2
|
+
export type V1QuoteType = 'exact-in' | 'exact-out' | 'custom';
|
|
3
|
+
export type V1FeeType = 'gas' | 'proving' | 'protocol' | 'gateway';
|
|
6
4
|
export type V1ChainType = 'evm' | 'svm' | 'tvm';
|
|
7
5
|
export type V1RelatedIntentRole = 'local' | 'bucket-candidate' | 'stitched-destination';
|
|
8
|
-
export type
|
|
6
|
+
export type V1StepType = 'swap' | 'bridge' | 'deposit' | 'transfer';
|
|
9
7
|
export type V1StatusType = 'intent' | 'quote' | 'gasless' | 'deposit-address';
|
|
10
8
|
export type V1GaslessSubState = 'pending' | 'submitted' | 'published' | 'failed';
|
|
11
9
|
export type V1GaslessJobStatus = 'pending' | 'processing' | 'published' | 'partial' | 'failed' | 'unknown';
|
|
@@ -17,11 +15,12 @@ export type V1DestinationCall = {
|
|
|
17
15
|
gasLimit?: string;
|
|
18
16
|
};
|
|
19
17
|
export type V1QuoteRequest = {
|
|
20
|
-
|
|
18
|
+
type: V1QuoteType;
|
|
21
19
|
source: {
|
|
22
20
|
chainId: number;
|
|
23
21
|
token: string;
|
|
24
22
|
amount?: string;
|
|
23
|
+
funder: string;
|
|
25
24
|
};
|
|
26
25
|
destination: {
|
|
27
26
|
chainId: number;
|
|
@@ -30,13 +29,11 @@ export type V1QuoteRequest = {
|
|
|
30
29
|
recipient: string;
|
|
31
30
|
calls?: V1DestinationCall[];
|
|
32
31
|
};
|
|
33
|
-
funder: string;
|
|
34
32
|
refundRecipient?: string;
|
|
35
33
|
slippage?: number;
|
|
36
|
-
dappId
|
|
34
|
+
dappId: string;
|
|
37
35
|
options?: {
|
|
38
36
|
deadlineSec?: number;
|
|
39
|
-
visibility?: V1Visibility;
|
|
40
37
|
allQuotes?: boolean;
|
|
41
38
|
};
|
|
42
39
|
};
|
|
@@ -48,7 +45,7 @@ export type V1FeeToken = {
|
|
|
48
45
|
[extension: string]: unknown;
|
|
49
46
|
};
|
|
50
47
|
export type V1Fee = {
|
|
51
|
-
|
|
48
|
+
type: V1FeeType;
|
|
52
49
|
amount: string;
|
|
53
50
|
token: V1FeeToken;
|
|
54
51
|
estimate: boolean;
|
|
@@ -60,23 +57,6 @@ export type V1StepLeg = {
|
|
|
60
57
|
amount: string;
|
|
61
58
|
[extension: string]: unknown;
|
|
62
59
|
};
|
|
63
|
-
export type V1Step = {
|
|
64
|
-
kind: V1StepKind;
|
|
65
|
-
tool: string;
|
|
66
|
-
aggregator?: string;
|
|
67
|
-
from: V1StepLeg;
|
|
68
|
-
to: V1StepLeg;
|
|
69
|
-
fees: V1Fee[];
|
|
70
|
-
estimatedDurationSec: number;
|
|
71
|
-
[extension: string]: unknown;
|
|
72
|
-
};
|
|
73
|
-
export type V1RelatedIntent = {
|
|
74
|
-
role: V1RelatedIntentRole;
|
|
75
|
-
intentHash: string;
|
|
76
|
-
routeHash?: string;
|
|
77
|
-
bucketIndex?: number;
|
|
78
|
-
[extension: string]: unknown;
|
|
79
|
-
};
|
|
80
60
|
export type V1SolverIdentity = {
|
|
81
61
|
id: string;
|
|
82
62
|
name?: string;
|
|
@@ -95,14 +75,14 @@ export type V1SvmInstruction = {
|
|
|
95
75
|
[extension: string]: unknown;
|
|
96
76
|
};
|
|
97
77
|
export type V1FundingTransaction = {
|
|
98
|
-
|
|
78
|
+
type: 'evm';
|
|
99
79
|
chainId: number;
|
|
100
80
|
to: string;
|
|
101
81
|
data: string;
|
|
102
82
|
value: string;
|
|
103
83
|
[k: string]: unknown;
|
|
104
84
|
} | {
|
|
105
|
-
|
|
85
|
+
type: 'svm';
|
|
106
86
|
chainId: number;
|
|
107
87
|
feePayer: string;
|
|
108
88
|
instructions: V1SvmInstruction[];
|
|
@@ -127,7 +107,7 @@ export type V1IntentRoute = {
|
|
|
127
107
|
portal: string;
|
|
128
108
|
nativeAmount: string;
|
|
129
109
|
tokens: V1IntentTokenAmount[];
|
|
130
|
-
calls: V1IntentCall[]
|
|
110
|
+
calls: V1IntentCall[];
|
|
131
111
|
[extension: string]: unknown;
|
|
132
112
|
};
|
|
133
113
|
export type V1IntentReward = {
|
|
@@ -138,6 +118,29 @@ export type V1IntentReward = {
|
|
|
138
118
|
tokens: V1IntentTokenAmount[];
|
|
139
119
|
[extension: string]: unknown;
|
|
140
120
|
};
|
|
121
|
+
export type V1StepIntent = {
|
|
122
|
+
role: V1RelatedIntentRole;
|
|
123
|
+
intentHash: string;
|
|
124
|
+
routeHash?: string;
|
|
125
|
+
bucketIndex?: number;
|
|
126
|
+
intent: {
|
|
127
|
+
route: V1IntentRoute;
|
|
128
|
+
reward: V1IntentReward;
|
|
129
|
+
[extension: string]: unknown;
|
|
130
|
+
};
|
|
131
|
+
[extension: string]: unknown;
|
|
132
|
+
};
|
|
133
|
+
export type V1Step = {
|
|
134
|
+
type: V1StepType;
|
|
135
|
+
provider: string;
|
|
136
|
+
aggregator?: string;
|
|
137
|
+
from: V1StepLeg;
|
|
138
|
+
to: V1StepLeg;
|
|
139
|
+
fees: V1Fee[];
|
|
140
|
+
estimatedDurationSec: number;
|
|
141
|
+
intents: V1StepIntent[];
|
|
142
|
+
[extension: string]: unknown;
|
|
143
|
+
};
|
|
141
144
|
export type V1Execution = {
|
|
142
145
|
transaction: V1FundingTransaction;
|
|
143
146
|
intent: {
|
|
@@ -145,20 +148,17 @@ export type V1Execution = {
|
|
|
145
148
|
reward: V1IntentReward;
|
|
146
149
|
[extension: string]: unknown;
|
|
147
150
|
};
|
|
148
|
-
encodedRoute: string | null;
|
|
149
|
-
encodedReward: string | null;
|
|
150
151
|
vault?: string | null;
|
|
151
152
|
[extension: string]: unknown;
|
|
152
153
|
};
|
|
153
154
|
export type V1QuoteCore = {
|
|
154
155
|
id: string;
|
|
155
|
-
|
|
156
|
-
visibility: V1Visibility;
|
|
157
|
-
guarantee: V1Guarantee;
|
|
156
|
+
type: V1QuoteType;
|
|
158
157
|
source: {
|
|
159
158
|
chainId: number;
|
|
160
159
|
token: string;
|
|
161
160
|
amount: string;
|
|
161
|
+
funder: string;
|
|
162
162
|
symbol: string | null;
|
|
163
163
|
decimals: number | null;
|
|
164
164
|
[extension: string]: unknown;
|
|
@@ -166,7 +166,7 @@ export type V1QuoteCore = {
|
|
|
166
166
|
destination: {
|
|
167
167
|
chainId: number;
|
|
168
168
|
token: string;
|
|
169
|
-
|
|
169
|
+
amountOut: string;
|
|
170
170
|
minAmountOut: string;
|
|
171
171
|
recipient: string | null;
|
|
172
172
|
symbol: string | null;
|
|
@@ -176,7 +176,6 @@ export type V1QuoteCore = {
|
|
|
176
176
|
slippage: number;
|
|
177
177
|
fees: V1Fee[];
|
|
178
178
|
steps: V1Step[];
|
|
179
|
-
relatedIntents: V1RelatedIntent[];
|
|
180
179
|
solver: V1SolverIdentity;
|
|
181
180
|
intentHash: string | null;
|
|
182
181
|
execution: V1Execution | null;
|
|
@@ -226,6 +225,7 @@ export type V1StatusTxDetail = {
|
|
|
226
225
|
};
|
|
227
226
|
export type V1StatusStep = {
|
|
228
227
|
type: V1StatusStepType;
|
|
228
|
+
intentHash: string;
|
|
229
229
|
status: string;
|
|
230
230
|
from: V1StatusTokenAmount;
|
|
231
231
|
to: V1StatusTokenAmount;
|
|
@@ -276,21 +276,21 @@ export type V1TokenEntry = {
|
|
|
276
276
|
};
|
|
277
277
|
[extension: string]: unknown;
|
|
278
278
|
};
|
|
279
|
-
export type
|
|
279
|
+
export type V1DepositAddressType = 'solana' | 'gateway' | 'gateway-erc20';
|
|
280
280
|
export type V1DepositAddressCreateRequest = {
|
|
281
281
|
chainId: number;
|
|
282
282
|
depositor: string;
|
|
283
|
-
|
|
283
|
+
type: 'solana';
|
|
284
284
|
destinationAddress: string;
|
|
285
285
|
} | {
|
|
286
286
|
chainId: number;
|
|
287
287
|
depositor: string;
|
|
288
|
-
|
|
288
|
+
type: 'gateway';
|
|
289
289
|
destinationAddress: string;
|
|
290
290
|
} | {
|
|
291
291
|
chainId: number;
|
|
292
292
|
depositor: string;
|
|
293
|
-
|
|
293
|
+
type: 'gateway-erc20';
|
|
294
294
|
destinationAddress: string;
|
|
295
295
|
destinationChainId: number;
|
|
296
296
|
};
|
|
@@ -299,7 +299,7 @@ export type V1DepositAddress = {
|
|
|
299
299
|
depositAddress: string;
|
|
300
300
|
chainId: number;
|
|
301
301
|
depositor: string;
|
|
302
|
-
|
|
302
|
+
type: V1DepositAddressType;
|
|
303
303
|
destinationAddress: string;
|
|
304
304
|
destinationChainId?: number;
|
|
305
305
|
expiresAt: number | null;
|