zklighter-perps 1.0.73 → 1.0.74
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/Deposit.ts +9 -0
- package/openapi.json +72 -7
- 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
|
package/models/Deposit.ts
CHANGED
|
@@ -79,6 +79,12 @@ export interface Deposit {
|
|
|
79
79
|
* @memberof Deposit
|
|
80
80
|
*/
|
|
81
81
|
updated_at: number;
|
|
82
|
+
/**
|
|
83
|
+
*
|
|
84
|
+
* @type {boolean}
|
|
85
|
+
* @memberof Deposit
|
|
86
|
+
*/
|
|
87
|
+
is_external_deposit: boolean;
|
|
82
88
|
}
|
|
83
89
|
|
|
84
90
|
/**
|
|
@@ -94,6 +100,7 @@ export function instanceOfDeposit(value: object): value is Deposit {
|
|
|
94
100
|
if (!('description' in value) || value['description'] === undefined) return false;
|
|
95
101
|
if (!('created_at' in value) || value['created_at'] === undefined) return false;
|
|
96
102
|
if (!('updated_at' in value) || value['updated_at'] === undefined) return false;
|
|
103
|
+
if (!('is_external_deposit' in value) || value['is_external_deposit'] === undefined) return false;
|
|
97
104
|
return true;
|
|
98
105
|
}
|
|
99
106
|
|
|
@@ -117,6 +124,7 @@ export function DepositFromJSONTyped(json: any, ignoreDiscriminator: boolean): D
|
|
|
117
124
|
'description': json['description'],
|
|
118
125
|
'created_at': json['created_at'],
|
|
119
126
|
'updated_at': json['updated_at'],
|
|
127
|
+
'is_external_deposit': json['is_external_deposit'],
|
|
120
128
|
};
|
|
121
129
|
}
|
|
122
130
|
|
|
@@ -136,6 +144,7 @@ export function DepositToJSON(value?: Deposit | null): any {
|
|
|
136
144
|
'description': value['description'],
|
|
137
145
|
'created_at': value['created_at'],
|
|
138
146
|
'updated_at': value['updated_at'],
|
|
147
|
+
'is_external_deposit': value['is_external_deposit'],
|
|
139
148
|
};
|
|
140
149
|
}
|
|
141
150
|
|
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",
|
|
@@ -2698,6 +2735,10 @@
|
|
|
2698
2735
|
"updated_at": {
|
|
2699
2736
|
"type": "integer",
|
|
2700
2737
|
"format": "int64"
|
|
2738
|
+
},
|
|
2739
|
+
"is_external_deposit": {
|
|
2740
|
+
"type": "boolean",
|
|
2741
|
+
"format": "boolean"
|
|
2701
2742
|
}
|
|
2702
2743
|
},
|
|
2703
2744
|
"title": "Deposit",
|
|
@@ -2710,7 +2751,8 @@
|
|
|
2710
2751
|
"step",
|
|
2711
2752
|
"description",
|
|
2712
2753
|
"created_at",
|
|
2713
|
-
"updated_at"
|
|
2754
|
+
"updated_at",
|
|
2755
|
+
"is_external_deposit"
|
|
2714
2756
|
]
|
|
2715
2757
|
},
|
|
2716
2758
|
"DepositHistory": {
|
|
@@ -2748,11 +2790,13 @@
|
|
|
2748
2790
|
"type": "string"
|
|
2749
2791
|
},
|
|
2750
2792
|
"amount": {
|
|
2751
|
-
"type": "string"
|
|
2793
|
+
"type": "string",
|
|
2794
|
+
"example": "0.1"
|
|
2752
2795
|
},
|
|
2753
2796
|
"timestamp": {
|
|
2754
2797
|
"type": "integer",
|
|
2755
|
-
"format": "int64"
|
|
2798
|
+
"format": "int64",
|
|
2799
|
+
"example": "1640995200"
|
|
2756
2800
|
}
|
|
2757
2801
|
},
|
|
2758
2802
|
"title": "DepositHistoryItem",
|
|
@@ -4405,18 +4449,37 @@
|
|
|
4405
4449
|
"public_pools"
|
|
4406
4450
|
]
|
|
4407
4451
|
},
|
|
4452
|
+
"ReqCancelDeposit": {
|
|
4453
|
+
"type": "object",
|
|
4454
|
+
"properties": {
|
|
4455
|
+
"from_addr": {
|
|
4456
|
+
"type": "string"
|
|
4457
|
+
},
|
|
4458
|
+
"chain_id": {
|
|
4459
|
+
"type": "string"
|
|
4460
|
+
}
|
|
4461
|
+
},
|
|
4462
|
+
"title": "ReqCancelDeposit",
|
|
4463
|
+
"required": [
|
|
4464
|
+
"from_addr",
|
|
4465
|
+
"chain_id"
|
|
4466
|
+
]
|
|
4467
|
+
},
|
|
4408
4468
|
"ReqCreateIntentAddress": {
|
|
4409
4469
|
"type": "object",
|
|
4410
4470
|
"properties": {
|
|
4411
4471
|
"chain_id": {
|
|
4412
|
-
"type": "
|
|
4413
|
-
"format": "int64"
|
|
4472
|
+
"type": "string"
|
|
4414
4473
|
},
|
|
4415
4474
|
"from_addr": {
|
|
4416
4475
|
"type": "string"
|
|
4417
4476
|
},
|
|
4418
4477
|
"amount": {
|
|
4419
4478
|
"type": "string"
|
|
4479
|
+
},
|
|
4480
|
+
"is_external_deposit": {
|
|
4481
|
+
"type": "boolean",
|
|
4482
|
+
"format": "boolean"
|
|
4420
4483
|
}
|
|
4421
4484
|
},
|
|
4422
4485
|
"title": "ReqCreateIntentAddress",
|
|
@@ -5722,11 +5785,13 @@
|
|
|
5722
5785
|
"type": "string"
|
|
5723
5786
|
},
|
|
5724
5787
|
"amount": {
|
|
5725
|
-
"type": "string"
|
|
5788
|
+
"type": "string",
|
|
5789
|
+
"example": "0.1"
|
|
5726
5790
|
},
|
|
5727
5791
|
"timestamp": {
|
|
5728
5792
|
"type": "integer",
|
|
5729
|
-
"format": "int64"
|
|
5793
|
+
"format": "int64",
|
|
5794
|
+
"example": "1640995200"
|
|
5730
5795
|
}
|
|
5731
5796
|
},
|
|
5732
5797
|
"title": "WithdrawHistoryItem",
|