zklighter-perps 1.0.297 → 1.0.299
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/.openapi-generator/FILES +1 -0
- package/apis/BridgeApi.ts +117 -0
- package/models/PnlLeaderboardEntry.ts +0 -9
- package/models/RespGaslessDeposit.ts +78 -0
- package/models/index.ts +1 -0
- package/openapi.json +100 -5
- package/package.json +1 -1
package/.openapi-generator/FILES
CHANGED
|
@@ -215,6 +215,7 @@ models/RespAtomicOrder.ts
|
|
|
215
215
|
models/RespAtomicOrderList.ts
|
|
216
216
|
models/RespChangeAccountTier.ts
|
|
217
217
|
models/RespCreateRFQ.ts
|
|
218
|
+
models/RespGaslessDeposit.ts
|
|
218
219
|
models/RespGetApiTokens.ts
|
|
219
220
|
models/RespGetBridgesByL1Addr.ts
|
|
220
221
|
models/RespGetExchangeMetrics.ts
|
package/apis/BridgeApi.ts
CHANGED
|
@@ -18,6 +18,7 @@ import type {
|
|
|
18
18
|
BridgeSupportedNetworks,
|
|
19
19
|
CreateIntentAddressResp,
|
|
20
20
|
Deposit,
|
|
21
|
+
RespGaslessDeposit,
|
|
21
22
|
RespGetBridgesByL1Addr,
|
|
22
23
|
RespGetFastBridgeInfo,
|
|
23
24
|
RespGetFastwithdrawalInfo,
|
|
@@ -31,6 +32,8 @@ import {
|
|
|
31
32
|
CreateIntentAddressRespToJSON,
|
|
32
33
|
DepositFromJSON,
|
|
33
34
|
DepositToJSON,
|
|
35
|
+
RespGaslessDepositFromJSON,
|
|
36
|
+
RespGaslessDepositToJSON,
|
|
34
37
|
RespGetBridgesByL1AddrFromJSON,
|
|
35
38
|
RespGetBridgesByL1AddrToJSON,
|
|
36
39
|
RespGetFastBridgeInfoFromJSON,
|
|
@@ -75,6 +78,17 @@ export interface FastwithdrawInfoRequest {
|
|
|
75
78
|
auth?: string;
|
|
76
79
|
}
|
|
77
80
|
|
|
81
|
+
export interface GaslessDepositRequest {
|
|
82
|
+
from: string;
|
|
83
|
+
amount: string;
|
|
84
|
+
signature: string;
|
|
85
|
+
valid_after: string;
|
|
86
|
+
token?: string;
|
|
87
|
+
valid_before?: string;
|
|
88
|
+
nonce?: string;
|
|
89
|
+
deadline?: string;
|
|
90
|
+
}
|
|
91
|
+
|
|
78
92
|
/**
|
|
79
93
|
*
|
|
80
94
|
*/
|
|
@@ -453,4 +467,107 @@ export class BridgeApi extends runtime.BaseAPI {
|
|
|
453
467
|
return await response.value();
|
|
454
468
|
}
|
|
455
469
|
|
|
470
|
+
/**
|
|
471
|
+
* Relay a gasless deposit (EIP-3009 authorization or EIP-2612 permit signed by the user) into zkLighter; the relayer pays gas
|
|
472
|
+
* gaslessDeposit
|
|
473
|
+
*/
|
|
474
|
+
async gaslessDepositRaw(requestParameters: GaslessDepositRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<RespGaslessDeposit>> {
|
|
475
|
+
if (requestParameters['from'] == null) {
|
|
476
|
+
throw new runtime.RequiredError(
|
|
477
|
+
'from',
|
|
478
|
+
'Required parameter "from" was null or undefined when calling gaslessDeposit().'
|
|
479
|
+
);
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
if (requestParameters['amount'] == null) {
|
|
483
|
+
throw new runtime.RequiredError(
|
|
484
|
+
'amount',
|
|
485
|
+
'Required parameter "amount" was null or undefined when calling gaslessDeposit().'
|
|
486
|
+
);
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
if (requestParameters['signature'] == null) {
|
|
490
|
+
throw new runtime.RequiredError(
|
|
491
|
+
'signature',
|
|
492
|
+
'Required parameter "signature" was null or undefined when calling gaslessDeposit().'
|
|
493
|
+
);
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
if (requestParameters['valid_after'] == null) {
|
|
497
|
+
throw new runtime.RequiredError(
|
|
498
|
+
'valid_after',
|
|
499
|
+
'Required parameter "valid_after" was null or undefined when calling gaslessDeposit().'
|
|
500
|
+
);
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
const queryParameters: any = {};
|
|
504
|
+
|
|
505
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
506
|
+
|
|
507
|
+
const consumes: runtime.Consume[] = [
|
|
508
|
+
{ contentType: 'multipart/form-data' },
|
|
509
|
+
];
|
|
510
|
+
// @ts-ignore: canConsumeForm may be unused
|
|
511
|
+
const canConsumeForm = runtime.canConsumeForm(consumes);
|
|
512
|
+
|
|
513
|
+
let formParams: { append(param: string, value: any): any };
|
|
514
|
+
let useForm = false;
|
|
515
|
+
if (useForm) {
|
|
516
|
+
formParams = new FormData();
|
|
517
|
+
} else {
|
|
518
|
+
formParams = new URLSearchParams();
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
if (requestParameters['token'] != null) {
|
|
522
|
+
formParams.append('token', requestParameters['token'] as any);
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
if (requestParameters['from'] != null) {
|
|
526
|
+
formParams.append('from', requestParameters['from'] as any);
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
if (requestParameters['amount'] != null) {
|
|
530
|
+
formParams.append('amount', requestParameters['amount'] as any);
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
if (requestParameters['signature'] != null) {
|
|
534
|
+
formParams.append('signature', requestParameters['signature'] as any);
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
if (requestParameters['valid_after'] != null) {
|
|
538
|
+
formParams.append('valid_after', requestParameters['valid_after'] as any);
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
if (requestParameters['valid_before'] != null) {
|
|
542
|
+
formParams.append('valid_before', requestParameters['valid_before'] as any);
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
if (requestParameters['nonce'] != null) {
|
|
546
|
+
formParams.append('nonce', requestParameters['nonce'] as any);
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
if (requestParameters['deadline'] != null) {
|
|
550
|
+
formParams.append('deadline', requestParameters['deadline'] as any);
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
const response = await this.request({
|
|
554
|
+
path: `/api/v1/gaslessDeposit`,
|
|
555
|
+
method: 'POST',
|
|
556
|
+
headers: headerParameters,
|
|
557
|
+
query: queryParameters,
|
|
558
|
+
body: formParams,
|
|
559
|
+
}, initOverrides);
|
|
560
|
+
|
|
561
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => RespGaslessDepositFromJSON(jsonValue));
|
|
562
|
+
}
|
|
563
|
+
|
|
564
|
+
/**
|
|
565
|
+
* Relay a gasless deposit (EIP-3009 authorization or EIP-2612 permit signed by the user) into zkLighter; the relayer pays gas
|
|
566
|
+
* gaslessDeposit
|
|
567
|
+
*/
|
|
568
|
+
async gaslessDeposit(requestParameters: GaslessDepositRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<RespGaslessDeposit> {
|
|
569
|
+
const response = await this.gaslessDepositRaw(requestParameters, initOverrides);
|
|
570
|
+
return await response.value();
|
|
571
|
+
}
|
|
572
|
+
|
|
456
573
|
}
|
|
@@ -31,12 +31,6 @@ export interface PnlLeaderboardEntry {
|
|
|
31
31
|
* @memberof PnlLeaderboardEntry
|
|
32
32
|
*/
|
|
33
33
|
l1_address: string;
|
|
34
|
-
/**
|
|
35
|
-
*
|
|
36
|
-
* @type {string}
|
|
37
|
-
* @memberof PnlLeaderboardEntry
|
|
38
|
-
*/
|
|
39
|
-
display_name: string;
|
|
40
34
|
/**
|
|
41
35
|
*
|
|
42
36
|
* @type {number}
|
|
@@ -69,7 +63,6 @@ export interface PnlLeaderboardEntry {
|
|
|
69
63
|
export function instanceOfPnlLeaderboardEntry(value: object): value is PnlLeaderboardEntry {
|
|
70
64
|
if (!('rank' in value) || value['rank'] === undefined) return false;
|
|
71
65
|
if (!('l1_address' in value) || value['l1_address'] === undefined) return false;
|
|
72
|
-
if (!('display_name' in value) || value['display_name'] === undefined) return false;
|
|
73
66
|
if (!('account_value' in value) || value['account_value'] === undefined) return false;
|
|
74
67
|
if (!('pnl' in value) || value['pnl'] === undefined) return false;
|
|
75
68
|
if (!('roi' in value) || value['roi'] === undefined) return false;
|
|
@@ -89,7 +82,6 @@ export function PnlLeaderboardEntryFromJSONTyped(json: any, ignoreDiscriminator:
|
|
|
89
82
|
|
|
90
83
|
'rank': json['rank'],
|
|
91
84
|
'l1_address': json['l1_address'],
|
|
92
|
-
'display_name': json['display_name'],
|
|
93
85
|
'account_value': json['account_value'],
|
|
94
86
|
'pnl': json['pnl'],
|
|
95
87
|
'roi': json['roi'],
|
|
@@ -105,7 +97,6 @@ export function PnlLeaderboardEntryToJSON(value?: PnlLeaderboardEntry | null): a
|
|
|
105
97
|
|
|
106
98
|
'rank': value['rank'],
|
|
107
99
|
'l1_address': value['l1_address'],
|
|
108
|
-
'display_name': value['display_name'],
|
|
109
100
|
'account_value': value['account_value'],
|
|
110
101
|
'pnl': value['pnl'],
|
|
111
102
|
'roi': value['roi'],
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
*
|
|
5
|
+
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document:
|
|
8
|
+
*
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
+
* https://openapi-generator.tech
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import { mapValues } from '../runtime';
|
|
16
|
+
/**
|
|
17
|
+
*
|
|
18
|
+
* @export
|
|
19
|
+
* @interface RespGaslessDeposit
|
|
20
|
+
*/
|
|
21
|
+
export interface RespGaslessDeposit {
|
|
22
|
+
/**
|
|
23
|
+
*
|
|
24
|
+
* @type {number}
|
|
25
|
+
* @memberof RespGaslessDeposit
|
|
26
|
+
*/
|
|
27
|
+
code: number;
|
|
28
|
+
/**
|
|
29
|
+
*
|
|
30
|
+
* @type {string}
|
|
31
|
+
* @memberof RespGaslessDeposit
|
|
32
|
+
*/
|
|
33
|
+
message?: string;
|
|
34
|
+
/**
|
|
35
|
+
*
|
|
36
|
+
* @type {string}
|
|
37
|
+
* @memberof RespGaslessDeposit
|
|
38
|
+
*/
|
|
39
|
+
tx_hash: string;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Check if a given object implements the RespGaslessDeposit interface.
|
|
44
|
+
*/
|
|
45
|
+
export function instanceOfRespGaslessDeposit(value: object): value is RespGaslessDeposit {
|
|
46
|
+
if (!('code' in value) || value['code'] === undefined) return false;
|
|
47
|
+
if (!('tx_hash' in value) || value['tx_hash'] === undefined) return false;
|
|
48
|
+
return true;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export function RespGaslessDepositFromJSON(json: any): RespGaslessDeposit {
|
|
52
|
+
return RespGaslessDepositFromJSONTyped(json, false);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export function RespGaslessDepositFromJSONTyped(json: any, ignoreDiscriminator: boolean): RespGaslessDeposit {
|
|
56
|
+
if (json == null) {
|
|
57
|
+
return json;
|
|
58
|
+
}
|
|
59
|
+
return {
|
|
60
|
+
|
|
61
|
+
'code': json['code'],
|
|
62
|
+
'message': json['message'] == null ? undefined : json['message'],
|
|
63
|
+
'tx_hash': json['tx_hash'],
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export function RespGaslessDepositToJSON(value?: RespGaslessDeposit | null): any {
|
|
68
|
+
if (value == null) {
|
|
69
|
+
return value;
|
|
70
|
+
}
|
|
71
|
+
return {
|
|
72
|
+
|
|
73
|
+
'code': value['code'],
|
|
74
|
+
'message': value['message'],
|
|
75
|
+
'tx_hash': value['tx_hash'],
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
|
package/models/index.ts
CHANGED
|
@@ -193,6 +193,7 @@ export * from './RespAtomicOrder';
|
|
|
193
193
|
export * from './RespAtomicOrderList';
|
|
194
194
|
export * from './RespChangeAccountTier';
|
|
195
195
|
export * from './RespCreateRFQ';
|
|
196
|
+
export * from './RespGaslessDeposit';
|
|
196
197
|
export * from './RespGetApiTokens';
|
|
197
198
|
export * from './RespGetBridgesByL1Addr';
|
|
198
199
|
export * from './RespGetExchangeMetrics';
|
package/openapi.json
CHANGED
|
@@ -2199,6 +2199,43 @@
|
|
|
2199
2199
|
"description": "Get fundings"
|
|
2200
2200
|
}
|
|
2201
2201
|
},
|
|
2202
|
+
"/api/v1/gaslessDeposit": {
|
|
2203
|
+
"post": {
|
|
2204
|
+
"summary": "gaslessDeposit",
|
|
2205
|
+
"operationId": "gaslessDeposit",
|
|
2206
|
+
"responses": {
|
|
2207
|
+
"200": {
|
|
2208
|
+
"description": "A successful response.",
|
|
2209
|
+
"schema": {
|
|
2210
|
+
"$ref": "#/definitions/RespGaslessDeposit"
|
|
2211
|
+
}
|
|
2212
|
+
},
|
|
2213
|
+
"400": {
|
|
2214
|
+
"description": "Bad request",
|
|
2215
|
+
"schema": {
|
|
2216
|
+
"$ref": "#/definitions/ResultCode"
|
|
2217
|
+
}
|
|
2218
|
+
}
|
|
2219
|
+
},
|
|
2220
|
+
"parameters": [
|
|
2221
|
+
{
|
|
2222
|
+
"name": "body",
|
|
2223
|
+
"in": "body",
|
|
2224
|
+
"required": true,
|
|
2225
|
+
"schema": {
|
|
2226
|
+
"$ref": "#/definitions/ReqGaslessDeposit"
|
|
2227
|
+
}
|
|
2228
|
+
}
|
|
2229
|
+
],
|
|
2230
|
+
"tags": [
|
|
2231
|
+
"bridge"
|
|
2232
|
+
],
|
|
2233
|
+
"consumes": [
|
|
2234
|
+
"multipart/form-data"
|
|
2235
|
+
],
|
|
2236
|
+
"description": "Relay a gasless deposit (EIP-3009 authorization or EIP-2612 permit signed by the user) into zkLighter; the relayer pays gas"
|
|
2237
|
+
}
|
|
2238
|
+
},
|
|
2202
2239
|
"/api/v1/gecko/contracts": {
|
|
2203
2240
|
"get": {
|
|
2204
2241
|
"summary": "gecko_contracts",
|
|
@@ -10459,10 +10496,6 @@
|
|
|
10459
10496
|
"type": "string",
|
|
10460
10497
|
"example": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8"
|
|
10461
10498
|
},
|
|
10462
|
-
"display_name": {
|
|
10463
|
-
"type": "string",
|
|
10464
|
-
"example": "BobbyBigSize"
|
|
10465
|
-
},
|
|
10466
10499
|
"account_value": {
|
|
10467
10500
|
"type": "number",
|
|
10468
10501
|
"format": "double",
|
|
@@ -10488,7 +10521,6 @@
|
|
|
10488
10521
|
"required": [
|
|
10489
10522
|
"rank",
|
|
10490
10523
|
"l1_address",
|
|
10491
|
-
"display_name",
|
|
10492
10524
|
"account_value",
|
|
10493
10525
|
"pnl",
|
|
10494
10526
|
"roi",
|
|
@@ -11611,6 +11643,48 @@
|
|
|
11611
11643
|
"to_address"
|
|
11612
11644
|
]
|
|
11613
11645
|
},
|
|
11646
|
+
"ReqGaslessDeposit": {
|
|
11647
|
+
"type": "object",
|
|
11648
|
+
"properties": {
|
|
11649
|
+
"token": {
|
|
11650
|
+
"type": "string",
|
|
11651
|
+
"description": " token address; may be omitted when a single token is configured"
|
|
11652
|
+
},
|
|
11653
|
+
"from": {
|
|
11654
|
+
"type": "string"
|
|
11655
|
+
},
|
|
11656
|
+
"amount": {
|
|
11657
|
+
"type": "string"
|
|
11658
|
+
},
|
|
11659
|
+
"signature": {
|
|
11660
|
+
"type": "string"
|
|
11661
|
+
},
|
|
11662
|
+
"valid_after": {
|
|
11663
|
+
"type": "string",
|
|
11664
|
+
"default": "0",
|
|
11665
|
+
"description": " EIP-3009 only"
|
|
11666
|
+
},
|
|
11667
|
+
"valid_before": {
|
|
11668
|
+
"type": "string",
|
|
11669
|
+
"description": " EIP-3009 only"
|
|
11670
|
+
},
|
|
11671
|
+
"nonce": {
|
|
11672
|
+
"type": "string",
|
|
11673
|
+
"description": " EIP-3009: 32-byte hex (required); EIP-2612: decimal, optional cross-check against the on-chain nonce"
|
|
11674
|
+
},
|
|
11675
|
+
"deadline": {
|
|
11676
|
+
"type": "string",
|
|
11677
|
+
"description": " EIP-2612 only"
|
|
11678
|
+
}
|
|
11679
|
+
},
|
|
11680
|
+
"title": "ReqGaslessDeposit",
|
|
11681
|
+
"required": [
|
|
11682
|
+
"from",
|
|
11683
|
+
"amount",
|
|
11684
|
+
"signature",
|
|
11685
|
+
"valid_after"
|
|
11686
|
+
]
|
|
11687
|
+
},
|
|
11614
11688
|
"ReqGetAccount": {
|
|
11615
11689
|
"type": "object",
|
|
11616
11690
|
"properties": {
|
|
@@ -13846,6 +13920,27 @@
|
|
|
13846
13920
|
"updated_at"
|
|
13847
13921
|
]
|
|
13848
13922
|
},
|
|
13923
|
+
"RespGaslessDeposit": {
|
|
13924
|
+
"type": "object",
|
|
13925
|
+
"properties": {
|
|
13926
|
+
"code": {
|
|
13927
|
+
"type": "integer",
|
|
13928
|
+
"format": "int32",
|
|
13929
|
+
"example": "200"
|
|
13930
|
+
},
|
|
13931
|
+
"message": {
|
|
13932
|
+
"type": "string"
|
|
13933
|
+
},
|
|
13934
|
+
"tx_hash": {
|
|
13935
|
+
"type": "string"
|
|
13936
|
+
}
|
|
13937
|
+
},
|
|
13938
|
+
"title": "RespGaslessDeposit",
|
|
13939
|
+
"required": [
|
|
13940
|
+
"code",
|
|
13941
|
+
"tx_hash"
|
|
13942
|
+
]
|
|
13943
|
+
},
|
|
13849
13944
|
"RespGetApiTokens": {
|
|
13850
13945
|
"type": "object",
|
|
13851
13946
|
"properties": {
|