zklighter-perps 1.0.73 → 1.0.75
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/apis/BridgeApi.ts +76 -1
- package/models/BridgeSupportedNetwork.ts +0 -9
- package/models/Deposit.ts +45 -0
- package/openapi.json +93 -14
- package/package.json +1 -1
package/apis/BridgeApi.ts
CHANGED
|
@@ -38,9 +38,15 @@ import {
|
|
|
38
38
|
} from '../models/index';
|
|
39
39
|
|
|
40
40
|
export interface CreateIntentAddressRequest {
|
|
41
|
-
chain_id:
|
|
41
|
+
chain_id: string;
|
|
42
42
|
from_addr: string;
|
|
43
43
|
amount: string;
|
|
44
|
+
is_external_deposit?: boolean;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export interface DepositCancelRequest {
|
|
48
|
+
from_addr: string;
|
|
49
|
+
chain_id: string;
|
|
44
50
|
}
|
|
45
51
|
|
|
46
52
|
export interface DepositHistoryRequest {
|
|
@@ -118,6 +124,10 @@ export class BridgeApi extends runtime.BaseAPI {
|
|
|
118
124
|
formParams.append('amount', requestParameters['amount'] as any);
|
|
119
125
|
}
|
|
120
126
|
|
|
127
|
+
if (requestParameters['is_external_deposit'] != null) {
|
|
128
|
+
formParams.append('is_external_deposit', requestParameters['is_external_deposit'] as any);
|
|
129
|
+
}
|
|
130
|
+
|
|
121
131
|
const response = await this.request({
|
|
122
132
|
path: `/api/v1/createIntentAddress`,
|
|
123
133
|
method: 'POST',
|
|
@@ -138,6 +148,71 @@ export class BridgeApi extends runtime.BaseAPI {
|
|
|
138
148
|
return await response.value();
|
|
139
149
|
}
|
|
140
150
|
|
|
151
|
+
/**
|
|
152
|
+
* Cancel bridge deposit
|
|
153
|
+
* deposit_cancel
|
|
154
|
+
*/
|
|
155
|
+
async depositCancelRaw(requestParameters: DepositCancelRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ResultCode>> {
|
|
156
|
+
if (requestParameters['from_addr'] == null) {
|
|
157
|
+
throw new runtime.RequiredError(
|
|
158
|
+
'from_addr',
|
|
159
|
+
'Required parameter "from_addr" was null or undefined when calling depositCancel().'
|
|
160
|
+
);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
if (requestParameters['chain_id'] == null) {
|
|
164
|
+
throw new runtime.RequiredError(
|
|
165
|
+
'chain_id',
|
|
166
|
+
'Required parameter "chain_id" was null or undefined when calling depositCancel().'
|
|
167
|
+
);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
const queryParameters: any = {};
|
|
171
|
+
|
|
172
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
173
|
+
|
|
174
|
+
const consumes: runtime.Consume[] = [
|
|
175
|
+
{ contentType: 'multipart/form-data' },
|
|
176
|
+
];
|
|
177
|
+
// @ts-ignore: canConsumeForm may be unused
|
|
178
|
+
const canConsumeForm = runtime.canConsumeForm(consumes);
|
|
179
|
+
|
|
180
|
+
let formParams: { append(param: string, value: any): any };
|
|
181
|
+
let useForm = false;
|
|
182
|
+
if (useForm) {
|
|
183
|
+
formParams = new FormData();
|
|
184
|
+
} else {
|
|
185
|
+
formParams = new URLSearchParams();
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
if (requestParameters['from_addr'] != null) {
|
|
189
|
+
formParams.append('from_addr', requestParameters['from_addr'] as any);
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
if (requestParameters['chain_id'] != null) {
|
|
193
|
+
formParams.append('chain_id', requestParameters['chain_id'] as any);
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
const response = await this.request({
|
|
197
|
+
path: `/api/v1/deposit/cancel`,
|
|
198
|
+
method: 'POST',
|
|
199
|
+
headers: headerParameters,
|
|
200
|
+
query: queryParameters,
|
|
201
|
+
body: formParams,
|
|
202
|
+
}, initOverrides);
|
|
203
|
+
|
|
204
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => ResultCodeFromJSON(jsonValue));
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
/**
|
|
208
|
+
* Cancel bridge deposit
|
|
209
|
+
* deposit_cancel
|
|
210
|
+
*/
|
|
211
|
+
async depositCancel(requestParameters: DepositCancelRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ResultCode> {
|
|
212
|
+
const response = await this.depositCancelRaw(requestParameters, initOverrides);
|
|
213
|
+
return await response.value();
|
|
214
|
+
}
|
|
215
|
+
|
|
141
216
|
/**
|
|
142
217
|
* Get deposit history
|
|
143
218
|
* deposit_history
|
|
@@ -37,12 +37,6 @@ export interface BridgeSupportedNetwork {
|
|
|
37
37
|
* @memberof BridgeSupportedNetwork
|
|
38
38
|
*/
|
|
39
39
|
explorer: string;
|
|
40
|
-
/**
|
|
41
|
-
*
|
|
42
|
-
* @type {boolean}
|
|
43
|
-
* @memberof BridgeSupportedNetwork
|
|
44
|
-
*/
|
|
45
|
-
is_cex: boolean;
|
|
46
40
|
}
|
|
47
41
|
|
|
48
42
|
/**
|
|
@@ -52,7 +46,6 @@ export function instanceOfBridgeSupportedNetwork(value: object): value is Bridge
|
|
|
52
46
|
if (!('name' in value) || value['name'] === undefined) return false;
|
|
53
47
|
if (!('chain_id' in value) || value['chain_id'] === undefined) return false;
|
|
54
48
|
if (!('explorer' in value) || value['explorer'] === undefined) return false;
|
|
55
|
-
if (!('is_cex' in value) || value['is_cex'] === undefined) return false;
|
|
56
49
|
return true;
|
|
57
50
|
}
|
|
58
51
|
|
|
@@ -69,7 +62,6 @@ export function BridgeSupportedNetworkFromJSONTyped(json: any, ignoreDiscriminat
|
|
|
69
62
|
'name': json['name'],
|
|
70
63
|
'chain_id': json['chain_id'],
|
|
71
64
|
'explorer': json['explorer'],
|
|
72
|
-
'is_cex': json['is_cex'],
|
|
73
65
|
};
|
|
74
66
|
}
|
|
75
67
|
|
|
@@ -82,7 +74,6 @@ export function BridgeSupportedNetworkToJSON(value?: BridgeSupportedNetwork | nu
|
|
|
82
74
|
'name': value['name'],
|
|
83
75
|
'chain_id': value['chain_id'],
|
|
84
76
|
'explorer': value['explorer'],
|
|
85
|
-
'is_cex': value['is_cex'],
|
|
86
77
|
};
|
|
87
78
|
}
|
|
88
79
|
|
package/models/Deposit.ts
CHANGED
|
@@ -37,6 +37,30 @@ export interface Deposit {
|
|
|
37
37
|
* @memberof Deposit
|
|
38
38
|
*/
|
|
39
39
|
source: string;
|
|
40
|
+
/**
|
|
41
|
+
*
|
|
42
|
+
* @type {string}
|
|
43
|
+
* @memberof Deposit
|
|
44
|
+
*/
|
|
45
|
+
source_chain_id: string;
|
|
46
|
+
/**
|
|
47
|
+
*
|
|
48
|
+
* @type {string}
|
|
49
|
+
* @memberof Deposit
|
|
50
|
+
*/
|
|
51
|
+
fast_bridge_tx_hash: string;
|
|
52
|
+
/**
|
|
53
|
+
*
|
|
54
|
+
* @type {string}
|
|
55
|
+
* @memberof Deposit
|
|
56
|
+
*/
|
|
57
|
+
batch_claim_tx_hash: string;
|
|
58
|
+
/**
|
|
59
|
+
*
|
|
60
|
+
* @type {string}
|
|
61
|
+
* @memberof Deposit
|
|
62
|
+
*/
|
|
63
|
+
cctp_burn_tx_hash: string;
|
|
40
64
|
/**
|
|
41
65
|
*
|
|
42
66
|
* @type {string}
|
|
@@ -79,6 +103,12 @@ export interface Deposit {
|
|
|
79
103
|
* @memberof Deposit
|
|
80
104
|
*/
|
|
81
105
|
updated_at: number;
|
|
106
|
+
/**
|
|
107
|
+
*
|
|
108
|
+
* @type {boolean}
|
|
109
|
+
* @memberof Deposit
|
|
110
|
+
*/
|
|
111
|
+
is_external_deposit: boolean;
|
|
82
112
|
}
|
|
83
113
|
|
|
84
114
|
/**
|
|
@@ -87,6 +117,10 @@ export interface Deposit {
|
|
|
87
117
|
export function instanceOfDeposit(value: object): value is Deposit {
|
|
88
118
|
if (!('code' in value) || value['code'] === undefined) return false;
|
|
89
119
|
if (!('source' in value) || value['source'] === undefined) return false;
|
|
120
|
+
if (!('source_chain_id' in value) || value['source_chain_id'] === undefined) return false;
|
|
121
|
+
if (!('fast_bridge_tx_hash' in value) || value['fast_bridge_tx_hash'] === undefined) return false;
|
|
122
|
+
if (!('batch_claim_tx_hash' in value) || value['batch_claim_tx_hash'] === undefined) return false;
|
|
123
|
+
if (!('cctp_burn_tx_hash' in value) || value['cctp_burn_tx_hash'] === undefined) return false;
|
|
90
124
|
if (!('amount' in value) || value['amount'] === undefined) return false;
|
|
91
125
|
if (!('intent_address' in value) || value['intent_address'] === undefined) return false;
|
|
92
126
|
if (!('status' in value) || value['status'] === undefined) return false;
|
|
@@ -94,6 +128,7 @@ export function instanceOfDeposit(value: object): value is Deposit {
|
|
|
94
128
|
if (!('description' in value) || value['description'] === undefined) return false;
|
|
95
129
|
if (!('created_at' in value) || value['created_at'] === undefined) return false;
|
|
96
130
|
if (!('updated_at' in value) || value['updated_at'] === undefined) return false;
|
|
131
|
+
if (!('is_external_deposit' in value) || value['is_external_deposit'] === undefined) return false;
|
|
97
132
|
return true;
|
|
98
133
|
}
|
|
99
134
|
|
|
@@ -110,6 +145,10 @@ export function DepositFromJSONTyped(json: any, ignoreDiscriminator: boolean): D
|
|
|
110
145
|
'code': json['code'],
|
|
111
146
|
'message': json['message'] == null ? undefined : json['message'],
|
|
112
147
|
'source': json['source'],
|
|
148
|
+
'source_chain_id': json['source_chain_id'],
|
|
149
|
+
'fast_bridge_tx_hash': json['fast_bridge_tx_hash'],
|
|
150
|
+
'batch_claim_tx_hash': json['batch_claim_tx_hash'],
|
|
151
|
+
'cctp_burn_tx_hash': json['cctp_burn_tx_hash'],
|
|
113
152
|
'amount': json['amount'],
|
|
114
153
|
'intent_address': json['intent_address'],
|
|
115
154
|
'status': json['status'],
|
|
@@ -117,6 +156,7 @@ export function DepositFromJSONTyped(json: any, ignoreDiscriminator: boolean): D
|
|
|
117
156
|
'description': json['description'],
|
|
118
157
|
'created_at': json['created_at'],
|
|
119
158
|
'updated_at': json['updated_at'],
|
|
159
|
+
'is_external_deposit': json['is_external_deposit'],
|
|
120
160
|
};
|
|
121
161
|
}
|
|
122
162
|
|
|
@@ -129,6 +169,10 @@ export function DepositToJSON(value?: Deposit | null): any {
|
|
|
129
169
|
'code': value['code'],
|
|
130
170
|
'message': value['message'],
|
|
131
171
|
'source': value['source'],
|
|
172
|
+
'source_chain_id': value['source_chain_id'],
|
|
173
|
+
'fast_bridge_tx_hash': value['fast_bridge_tx_hash'],
|
|
174
|
+
'batch_claim_tx_hash': value['batch_claim_tx_hash'],
|
|
175
|
+
'cctp_burn_tx_hash': value['cctp_burn_tx_hash'],
|
|
132
176
|
'amount': value['amount'],
|
|
133
177
|
'intent_address': value['intent_address'],
|
|
134
178
|
'status': value['status'],
|
|
@@ -136,6 +180,7 @@ export function DepositToJSON(value?: Deposit | null): any {
|
|
|
136
180
|
'description': value['description'],
|
|
137
181
|
'created_at': value['created_at'],
|
|
138
182
|
'updated_at': value['updated_at'],
|
|
183
|
+
'is_external_deposit': value['is_external_deposit'],
|
|
139
184
|
};
|
|
140
185
|
}
|
|
141
186
|
|
package/openapi.json
CHANGED
|
@@ -800,6 +800,43 @@
|
|
|
800
800
|
"description": "Get current height"
|
|
801
801
|
}
|
|
802
802
|
},
|
|
803
|
+
"/api/v1/deposit/cancel": {
|
|
804
|
+
"post": {
|
|
805
|
+
"summary": "deposit_cancel",
|
|
806
|
+
"operationId": "deposit_cancel",
|
|
807
|
+
"responses": {
|
|
808
|
+
"200": {
|
|
809
|
+
"description": "A successful response.",
|
|
810
|
+
"schema": {
|
|
811
|
+
"$ref": "#/definitions/ResultCode"
|
|
812
|
+
}
|
|
813
|
+
},
|
|
814
|
+
"400": {
|
|
815
|
+
"description": "Bad request",
|
|
816
|
+
"schema": {
|
|
817
|
+
"$ref": "#/definitions/ResultCode"
|
|
818
|
+
}
|
|
819
|
+
}
|
|
820
|
+
},
|
|
821
|
+
"parameters": [
|
|
822
|
+
{
|
|
823
|
+
"name": "body",
|
|
824
|
+
"in": "body",
|
|
825
|
+
"required": true,
|
|
826
|
+
"schema": {
|
|
827
|
+
"$ref": "#/definitions/ReqCancelDeposit"
|
|
828
|
+
}
|
|
829
|
+
}
|
|
830
|
+
],
|
|
831
|
+
"tags": [
|
|
832
|
+
"bridge"
|
|
833
|
+
],
|
|
834
|
+
"consumes": [
|
|
835
|
+
"multipart/form-data"
|
|
836
|
+
],
|
|
837
|
+
"description": "Cancel bridge deposit"
|
|
838
|
+
}
|
|
839
|
+
},
|
|
803
840
|
"/api/v1/deposit/history": {
|
|
804
841
|
"get": {
|
|
805
842
|
"summary": "deposit_history",
|
|
@@ -2467,19 +2504,13 @@
|
|
|
2467
2504
|
"explorer": {
|
|
2468
2505
|
"type": "string",
|
|
2469
2506
|
"example": "https://arbiscan.io/"
|
|
2470
|
-
},
|
|
2471
|
-
"is_cex": {
|
|
2472
|
-
"type": "boolean",
|
|
2473
|
-
"format": "boolean",
|
|
2474
|
-
"example": "false"
|
|
2475
2507
|
}
|
|
2476
2508
|
},
|
|
2477
2509
|
"title": "BridgeSupportedNetwork",
|
|
2478
2510
|
"required": [
|
|
2479
2511
|
"name",
|
|
2480
2512
|
"chain_id",
|
|
2481
|
-
"explorer"
|
|
2482
|
-
"is_cex"
|
|
2513
|
+
"explorer"
|
|
2483
2514
|
]
|
|
2484
2515
|
},
|
|
2485
2516
|
"BridgeSupportedNetworks": {
|
|
@@ -2676,6 +2707,22 @@
|
|
|
2676
2707
|
"type": "string",
|
|
2677
2708
|
"example": "Arbitrum"
|
|
2678
2709
|
},
|
|
2710
|
+
"source_chain_id": {
|
|
2711
|
+
"type": "string",
|
|
2712
|
+
"example": "42161"
|
|
2713
|
+
},
|
|
2714
|
+
"fast_bridge_tx_hash": {
|
|
2715
|
+
"type": "string",
|
|
2716
|
+
"example": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8"
|
|
2717
|
+
},
|
|
2718
|
+
"batch_claim_tx_hash": {
|
|
2719
|
+
"type": "string",
|
|
2720
|
+
"example": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8"
|
|
2721
|
+
},
|
|
2722
|
+
"cctp_burn_tx_hash": {
|
|
2723
|
+
"type": "string",
|
|
2724
|
+
"example": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8"
|
|
2725
|
+
},
|
|
2679
2726
|
"amount": {
|
|
2680
2727
|
"type": "string"
|
|
2681
2728
|
},
|
|
@@ -2698,19 +2745,28 @@
|
|
|
2698
2745
|
"updated_at": {
|
|
2699
2746
|
"type": "integer",
|
|
2700
2747
|
"format": "int64"
|
|
2748
|
+
},
|
|
2749
|
+
"is_external_deposit": {
|
|
2750
|
+
"type": "boolean",
|
|
2751
|
+
"format": "boolean"
|
|
2701
2752
|
}
|
|
2702
2753
|
},
|
|
2703
2754
|
"title": "Deposit",
|
|
2704
2755
|
"required": [
|
|
2705
2756
|
"code",
|
|
2706
2757
|
"source",
|
|
2758
|
+
"source_chain_id",
|
|
2759
|
+
"fast_bridge_tx_hash",
|
|
2760
|
+
"batch_claim_tx_hash",
|
|
2761
|
+
"cctp_burn_tx_hash",
|
|
2707
2762
|
"amount",
|
|
2708
2763
|
"intent_address",
|
|
2709
2764
|
"status",
|
|
2710
2765
|
"step",
|
|
2711
2766
|
"description",
|
|
2712
2767
|
"created_at",
|
|
2713
|
-
"updated_at"
|
|
2768
|
+
"updated_at",
|
|
2769
|
+
"is_external_deposit"
|
|
2714
2770
|
]
|
|
2715
2771
|
},
|
|
2716
2772
|
"DepositHistory": {
|
|
@@ -2748,11 +2804,13 @@
|
|
|
2748
2804
|
"type": "string"
|
|
2749
2805
|
},
|
|
2750
2806
|
"amount": {
|
|
2751
|
-
"type": "string"
|
|
2807
|
+
"type": "string",
|
|
2808
|
+
"example": "0.1"
|
|
2752
2809
|
},
|
|
2753
2810
|
"timestamp": {
|
|
2754
2811
|
"type": "integer",
|
|
2755
|
-
"format": "int64"
|
|
2812
|
+
"format": "int64",
|
|
2813
|
+
"example": "1640995200"
|
|
2756
2814
|
}
|
|
2757
2815
|
},
|
|
2758
2816
|
"title": "DepositHistoryItem",
|
|
@@ -4405,18 +4463,37 @@
|
|
|
4405
4463
|
"public_pools"
|
|
4406
4464
|
]
|
|
4407
4465
|
},
|
|
4466
|
+
"ReqCancelDeposit": {
|
|
4467
|
+
"type": "object",
|
|
4468
|
+
"properties": {
|
|
4469
|
+
"from_addr": {
|
|
4470
|
+
"type": "string"
|
|
4471
|
+
},
|
|
4472
|
+
"chain_id": {
|
|
4473
|
+
"type": "string"
|
|
4474
|
+
}
|
|
4475
|
+
},
|
|
4476
|
+
"title": "ReqCancelDeposit",
|
|
4477
|
+
"required": [
|
|
4478
|
+
"from_addr",
|
|
4479
|
+
"chain_id"
|
|
4480
|
+
]
|
|
4481
|
+
},
|
|
4408
4482
|
"ReqCreateIntentAddress": {
|
|
4409
4483
|
"type": "object",
|
|
4410
4484
|
"properties": {
|
|
4411
4485
|
"chain_id": {
|
|
4412
|
-
"type": "
|
|
4413
|
-
"format": "int64"
|
|
4486
|
+
"type": "string"
|
|
4414
4487
|
},
|
|
4415
4488
|
"from_addr": {
|
|
4416
4489
|
"type": "string"
|
|
4417
4490
|
},
|
|
4418
4491
|
"amount": {
|
|
4419
4492
|
"type": "string"
|
|
4493
|
+
},
|
|
4494
|
+
"is_external_deposit": {
|
|
4495
|
+
"type": "boolean",
|
|
4496
|
+
"format": "boolean"
|
|
4420
4497
|
}
|
|
4421
4498
|
},
|
|
4422
4499
|
"title": "ReqCreateIntentAddress",
|
|
@@ -5722,11 +5799,13 @@
|
|
|
5722
5799
|
"type": "string"
|
|
5723
5800
|
},
|
|
5724
5801
|
"amount": {
|
|
5725
|
-
"type": "string"
|
|
5802
|
+
"type": "string",
|
|
5803
|
+
"example": "0.1"
|
|
5726
5804
|
},
|
|
5727
5805
|
"timestamp": {
|
|
5728
5806
|
"type": "integer",
|
|
5729
|
-
"format": "int64"
|
|
5807
|
+
"format": "int64",
|
|
5808
|
+
"example": "1640995200"
|
|
5730
5809
|
}
|
|
5731
5810
|
},
|
|
5732
5811
|
"title": "WithdrawHistoryItem",
|