@0xsequence/api 0.0.0-20241114193032 → 0.0.0-20241216114019
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/0xsequence-api.cjs.dev.js +54 -11
- package/dist/0xsequence-api.cjs.prod.js +54 -11
- package/dist/0xsequence-api.esm.js +54 -11
- package/dist/declarations/src/api.gen.d.ts +37 -4
- package/package.json +1 -1
- package/src/api.gen.ts +86 -7
- package/src/index.ts +0 -2
|
@@ -3,19 +3,24 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
function _extends() {
|
|
6
|
-
|
|
7
|
-
for (var
|
|
8
|
-
var
|
|
9
|
-
for (var
|
|
6
|
+
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
7
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
8
|
+
var source = arguments[i];
|
|
9
|
+
for (var key in source) {
|
|
10
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
11
|
+
target[key] = source[key];
|
|
12
|
+
}
|
|
13
|
+
}
|
|
10
14
|
}
|
|
11
|
-
return
|
|
12
|
-
}
|
|
15
|
+
return target;
|
|
16
|
+
};
|
|
17
|
+
return _extends.apply(this, arguments);
|
|
13
18
|
}
|
|
14
19
|
|
|
15
20
|
/* eslint-disable */
|
|
16
|
-
// sequence-api v0.4.0
|
|
21
|
+
// sequence-api v0.4.0 bbe47e0331a18438fe5f7fe590a4b7b4e5102738
|
|
17
22
|
// --
|
|
18
|
-
// Code generated by webrpc-gen@v0.
|
|
23
|
+
// Code generated by webrpc-gen@v0.20.3 with typescript generator. DO NOT EDIT.
|
|
19
24
|
//
|
|
20
25
|
// webrpc-gen -schema=api.ridl -target=typescript -client -out=./clients/api.gen.ts
|
|
21
26
|
|
|
@@ -26,7 +31,7 @@ const WebRPCVersion = 'v1';
|
|
|
26
31
|
const WebRPCSchemaVersion = 'v0.4.0';
|
|
27
32
|
|
|
28
33
|
// Schema hash generated from your RIDL schema
|
|
29
|
-
const WebRPCSchemaHash = '
|
|
34
|
+
const WebRPCSchemaHash = 'bbe47e0331a18438fe5f7fe590a4b7b4e5102738';
|
|
30
35
|
|
|
31
36
|
//
|
|
32
37
|
// Types
|
|
@@ -175,6 +180,32 @@ class API {
|
|
|
175
180
|
});
|
|
176
181
|
});
|
|
177
182
|
};
|
|
183
|
+
this.registerPublicKey = (args, headers, signal) => {
|
|
184
|
+
return this.fetch(this.url('RegisterPublicKey'), createHTTPRequest(args, headers, signal)).then(res => {
|
|
185
|
+
return buildResponse(res).then(_data => {
|
|
186
|
+
return {
|
|
187
|
+
status: _data.status
|
|
188
|
+
};
|
|
189
|
+
});
|
|
190
|
+
}, error => {
|
|
191
|
+
throw WebrpcRequestFailedError.new({
|
|
192
|
+
cause: `fetch(): ${error.message || ''}`
|
|
193
|
+
});
|
|
194
|
+
});
|
|
195
|
+
};
|
|
196
|
+
this.getPublicKey = (args, headers, signal) => {
|
|
197
|
+
return this.fetch(this.url('GetPublicKey'), createHTTPRequest(args, headers, signal)).then(res => {
|
|
198
|
+
return buildResponse(res).then(_data => {
|
|
199
|
+
return {
|
|
200
|
+
publicKey: _data.publicKey
|
|
201
|
+
};
|
|
202
|
+
});
|
|
203
|
+
}, error => {
|
|
204
|
+
throw WebrpcRequestFailedError.new({
|
|
205
|
+
cause: `fetch(): ${error.message || ''}`
|
|
206
|
+
});
|
|
207
|
+
});
|
|
208
|
+
};
|
|
178
209
|
this.friendList = (args, headers, signal) => {
|
|
179
210
|
return this.fetch(this.url('FriendList'), createHTTPRequest(args, headers, signal)).then(res => {
|
|
180
211
|
return buildResponse(res).then(_data => {
|
|
@@ -779,6 +810,19 @@ class API {
|
|
|
779
810
|
});
|
|
780
811
|
});
|
|
781
812
|
};
|
|
813
|
+
this.getSwapPrice = (args, headers, signal) => {
|
|
814
|
+
return this.fetch(this.url('GetSwapPrice'), createHTTPRequest(args, headers, signal)).then(res => {
|
|
815
|
+
return buildResponse(res).then(_data => {
|
|
816
|
+
return {
|
|
817
|
+
swapPrice: _data.swapPrice
|
|
818
|
+
};
|
|
819
|
+
});
|
|
820
|
+
}, error => {
|
|
821
|
+
throw WebrpcRequestFailedError.new({
|
|
822
|
+
cause: `fetch(): ${error.message || ''}`
|
|
823
|
+
});
|
|
824
|
+
});
|
|
825
|
+
};
|
|
782
826
|
this.getSwapPrices = (args, headers, signal) => {
|
|
783
827
|
return this.fetch(this.url('GetSwapPrices'), createHTTPRequest(args, headers, signal)).then(res => {
|
|
784
828
|
return buildResponse(res).then(_data => {
|
|
@@ -908,7 +952,7 @@ class API {
|
|
|
908
952
|
});
|
|
909
953
|
});
|
|
910
954
|
};
|
|
911
|
-
this.hostname = hostname;
|
|
955
|
+
this.hostname = hostname.replace(/\/*$/, '');
|
|
912
956
|
this.fetch = (input, init) => fetch(input, init);
|
|
913
957
|
}
|
|
914
958
|
url(name) {
|
|
@@ -1146,7 +1190,6 @@ const webrpcErrorByCode = {
|
|
|
1146
1190
|
[3000]: NotFoundError
|
|
1147
1191
|
};
|
|
1148
1192
|
|
|
1149
|
-
const fetch = globalThis.fetch;
|
|
1150
1193
|
class SequenceAPIClient extends API {
|
|
1151
1194
|
constructor(hostname, projectAccessKey, jwtAuth) {
|
|
1152
1195
|
super(hostname.endsWith('/') ? hostname.slice(0, -1) : hostname, fetch);
|
|
@@ -3,19 +3,24 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
function _extends() {
|
|
6
|
-
|
|
7
|
-
for (var
|
|
8
|
-
var
|
|
9
|
-
for (var
|
|
6
|
+
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
7
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
8
|
+
var source = arguments[i];
|
|
9
|
+
for (var key in source) {
|
|
10
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
11
|
+
target[key] = source[key];
|
|
12
|
+
}
|
|
13
|
+
}
|
|
10
14
|
}
|
|
11
|
-
return
|
|
12
|
-
}
|
|
15
|
+
return target;
|
|
16
|
+
};
|
|
17
|
+
return _extends.apply(this, arguments);
|
|
13
18
|
}
|
|
14
19
|
|
|
15
20
|
/* eslint-disable */
|
|
16
|
-
// sequence-api v0.4.0
|
|
21
|
+
// sequence-api v0.4.0 bbe47e0331a18438fe5f7fe590a4b7b4e5102738
|
|
17
22
|
// --
|
|
18
|
-
// Code generated by webrpc-gen@v0.
|
|
23
|
+
// Code generated by webrpc-gen@v0.20.3 with typescript generator. DO NOT EDIT.
|
|
19
24
|
//
|
|
20
25
|
// webrpc-gen -schema=api.ridl -target=typescript -client -out=./clients/api.gen.ts
|
|
21
26
|
|
|
@@ -26,7 +31,7 @@ const WebRPCVersion = 'v1';
|
|
|
26
31
|
const WebRPCSchemaVersion = 'v0.4.0';
|
|
27
32
|
|
|
28
33
|
// Schema hash generated from your RIDL schema
|
|
29
|
-
const WebRPCSchemaHash = '
|
|
34
|
+
const WebRPCSchemaHash = 'bbe47e0331a18438fe5f7fe590a4b7b4e5102738';
|
|
30
35
|
|
|
31
36
|
//
|
|
32
37
|
// Types
|
|
@@ -175,6 +180,32 @@ class API {
|
|
|
175
180
|
});
|
|
176
181
|
});
|
|
177
182
|
};
|
|
183
|
+
this.registerPublicKey = (args, headers, signal) => {
|
|
184
|
+
return this.fetch(this.url('RegisterPublicKey'), createHTTPRequest(args, headers, signal)).then(res => {
|
|
185
|
+
return buildResponse(res).then(_data => {
|
|
186
|
+
return {
|
|
187
|
+
status: _data.status
|
|
188
|
+
};
|
|
189
|
+
});
|
|
190
|
+
}, error => {
|
|
191
|
+
throw WebrpcRequestFailedError.new({
|
|
192
|
+
cause: `fetch(): ${error.message || ''}`
|
|
193
|
+
});
|
|
194
|
+
});
|
|
195
|
+
};
|
|
196
|
+
this.getPublicKey = (args, headers, signal) => {
|
|
197
|
+
return this.fetch(this.url('GetPublicKey'), createHTTPRequest(args, headers, signal)).then(res => {
|
|
198
|
+
return buildResponse(res).then(_data => {
|
|
199
|
+
return {
|
|
200
|
+
publicKey: _data.publicKey
|
|
201
|
+
};
|
|
202
|
+
});
|
|
203
|
+
}, error => {
|
|
204
|
+
throw WebrpcRequestFailedError.new({
|
|
205
|
+
cause: `fetch(): ${error.message || ''}`
|
|
206
|
+
});
|
|
207
|
+
});
|
|
208
|
+
};
|
|
178
209
|
this.friendList = (args, headers, signal) => {
|
|
179
210
|
return this.fetch(this.url('FriendList'), createHTTPRequest(args, headers, signal)).then(res => {
|
|
180
211
|
return buildResponse(res).then(_data => {
|
|
@@ -779,6 +810,19 @@ class API {
|
|
|
779
810
|
});
|
|
780
811
|
});
|
|
781
812
|
};
|
|
813
|
+
this.getSwapPrice = (args, headers, signal) => {
|
|
814
|
+
return this.fetch(this.url('GetSwapPrice'), createHTTPRequest(args, headers, signal)).then(res => {
|
|
815
|
+
return buildResponse(res).then(_data => {
|
|
816
|
+
return {
|
|
817
|
+
swapPrice: _data.swapPrice
|
|
818
|
+
};
|
|
819
|
+
});
|
|
820
|
+
}, error => {
|
|
821
|
+
throw WebrpcRequestFailedError.new({
|
|
822
|
+
cause: `fetch(): ${error.message || ''}`
|
|
823
|
+
});
|
|
824
|
+
});
|
|
825
|
+
};
|
|
782
826
|
this.getSwapPrices = (args, headers, signal) => {
|
|
783
827
|
return this.fetch(this.url('GetSwapPrices'), createHTTPRequest(args, headers, signal)).then(res => {
|
|
784
828
|
return buildResponse(res).then(_data => {
|
|
@@ -908,7 +952,7 @@ class API {
|
|
|
908
952
|
});
|
|
909
953
|
});
|
|
910
954
|
};
|
|
911
|
-
this.hostname = hostname;
|
|
955
|
+
this.hostname = hostname.replace(/\/*$/, '');
|
|
912
956
|
this.fetch = (input, init) => fetch(input, init);
|
|
913
957
|
}
|
|
914
958
|
url(name) {
|
|
@@ -1146,7 +1190,6 @@ const webrpcErrorByCode = {
|
|
|
1146
1190
|
[3000]: NotFoundError
|
|
1147
1191
|
};
|
|
1148
1192
|
|
|
1149
|
-
const fetch = globalThis.fetch;
|
|
1150
1193
|
class SequenceAPIClient extends API {
|
|
1151
1194
|
constructor(hostname, projectAccessKey, jwtAuth) {
|
|
1152
1195
|
super(hostname.endsWith('/') ? hostname.slice(0, -1) : hostname, fetch);
|
|
@@ -1,17 +1,22 @@
|
|
|
1
1
|
function _extends() {
|
|
2
|
-
|
|
3
|
-
for (var
|
|
4
|
-
var
|
|
5
|
-
for (var
|
|
2
|
+
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
3
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
4
|
+
var source = arguments[i];
|
|
5
|
+
for (var key in source) {
|
|
6
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
7
|
+
target[key] = source[key];
|
|
8
|
+
}
|
|
9
|
+
}
|
|
6
10
|
}
|
|
7
|
-
return
|
|
8
|
-
}
|
|
11
|
+
return target;
|
|
12
|
+
};
|
|
13
|
+
return _extends.apply(this, arguments);
|
|
9
14
|
}
|
|
10
15
|
|
|
11
16
|
/* eslint-disable */
|
|
12
|
-
// sequence-api v0.4.0
|
|
17
|
+
// sequence-api v0.4.0 bbe47e0331a18438fe5f7fe590a4b7b4e5102738
|
|
13
18
|
// --
|
|
14
|
-
// Code generated by webrpc-gen@v0.
|
|
19
|
+
// Code generated by webrpc-gen@v0.20.3 with typescript generator. DO NOT EDIT.
|
|
15
20
|
//
|
|
16
21
|
// webrpc-gen -schema=api.ridl -target=typescript -client -out=./clients/api.gen.ts
|
|
17
22
|
|
|
@@ -22,7 +27,7 @@ const WebRPCVersion = 'v1';
|
|
|
22
27
|
const WebRPCSchemaVersion = 'v0.4.0';
|
|
23
28
|
|
|
24
29
|
// Schema hash generated from your RIDL schema
|
|
25
|
-
const WebRPCSchemaHash = '
|
|
30
|
+
const WebRPCSchemaHash = 'bbe47e0331a18438fe5f7fe590a4b7b4e5102738';
|
|
26
31
|
|
|
27
32
|
//
|
|
28
33
|
// Types
|
|
@@ -171,6 +176,32 @@ class API {
|
|
|
171
176
|
});
|
|
172
177
|
});
|
|
173
178
|
};
|
|
179
|
+
this.registerPublicKey = (args, headers, signal) => {
|
|
180
|
+
return this.fetch(this.url('RegisterPublicKey'), createHTTPRequest(args, headers, signal)).then(res => {
|
|
181
|
+
return buildResponse(res).then(_data => {
|
|
182
|
+
return {
|
|
183
|
+
status: _data.status
|
|
184
|
+
};
|
|
185
|
+
});
|
|
186
|
+
}, error => {
|
|
187
|
+
throw WebrpcRequestFailedError.new({
|
|
188
|
+
cause: `fetch(): ${error.message || ''}`
|
|
189
|
+
});
|
|
190
|
+
});
|
|
191
|
+
};
|
|
192
|
+
this.getPublicKey = (args, headers, signal) => {
|
|
193
|
+
return this.fetch(this.url('GetPublicKey'), createHTTPRequest(args, headers, signal)).then(res => {
|
|
194
|
+
return buildResponse(res).then(_data => {
|
|
195
|
+
return {
|
|
196
|
+
publicKey: _data.publicKey
|
|
197
|
+
};
|
|
198
|
+
});
|
|
199
|
+
}, error => {
|
|
200
|
+
throw WebrpcRequestFailedError.new({
|
|
201
|
+
cause: `fetch(): ${error.message || ''}`
|
|
202
|
+
});
|
|
203
|
+
});
|
|
204
|
+
};
|
|
174
205
|
this.friendList = (args, headers, signal) => {
|
|
175
206
|
return this.fetch(this.url('FriendList'), createHTTPRequest(args, headers, signal)).then(res => {
|
|
176
207
|
return buildResponse(res).then(_data => {
|
|
@@ -775,6 +806,19 @@ class API {
|
|
|
775
806
|
});
|
|
776
807
|
});
|
|
777
808
|
};
|
|
809
|
+
this.getSwapPrice = (args, headers, signal) => {
|
|
810
|
+
return this.fetch(this.url('GetSwapPrice'), createHTTPRequest(args, headers, signal)).then(res => {
|
|
811
|
+
return buildResponse(res).then(_data => {
|
|
812
|
+
return {
|
|
813
|
+
swapPrice: _data.swapPrice
|
|
814
|
+
};
|
|
815
|
+
});
|
|
816
|
+
}, error => {
|
|
817
|
+
throw WebrpcRequestFailedError.new({
|
|
818
|
+
cause: `fetch(): ${error.message || ''}`
|
|
819
|
+
});
|
|
820
|
+
});
|
|
821
|
+
};
|
|
778
822
|
this.getSwapPrices = (args, headers, signal) => {
|
|
779
823
|
return this.fetch(this.url('GetSwapPrices'), createHTTPRequest(args, headers, signal)).then(res => {
|
|
780
824
|
return buildResponse(res).then(_data => {
|
|
@@ -904,7 +948,7 @@ class API {
|
|
|
904
948
|
});
|
|
905
949
|
});
|
|
906
950
|
};
|
|
907
|
-
this.hostname = hostname;
|
|
951
|
+
this.hostname = hostname.replace(/\/*$/, '');
|
|
908
952
|
this.fetch = (input, init) => fetch(input, init);
|
|
909
953
|
}
|
|
910
954
|
url(name) {
|
|
@@ -1142,7 +1186,6 @@ const webrpcErrorByCode = {
|
|
|
1142
1186
|
[3000]: NotFoundError
|
|
1143
1187
|
};
|
|
1144
1188
|
|
|
1145
|
-
const fetch = globalThis.fetch;
|
|
1146
1189
|
class SequenceAPIClient extends API {
|
|
1147
1190
|
constructor(hostname, projectAccessKey, jwtAuth) {
|
|
1148
1191
|
super(hostname.endsWith('/') ? hostname.slice(0, -1) : hostname, fetch);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare const WebRPCVersion = "v1";
|
|
2
2
|
export declare const WebRPCSchemaVersion = "v0.4.0";
|
|
3
|
-
export declare const WebRPCSchemaHash = "
|
|
3
|
+
export declare const WebRPCSchemaHash = "bbe47e0331a18438fe5f7fe590a4b7b4e5102738";
|
|
4
4
|
export declare enum SortOrder {
|
|
5
5
|
DESC = "DESC",
|
|
6
6
|
ASC = "ASC"
|
|
@@ -55,6 +55,11 @@ export interface SequenceContext {
|
|
|
55
55
|
guestModule: string;
|
|
56
56
|
utils: string;
|
|
57
57
|
}
|
|
58
|
+
export interface PublicKey {
|
|
59
|
+
id: string;
|
|
60
|
+
x: string;
|
|
61
|
+
y: string;
|
|
62
|
+
}
|
|
58
63
|
export interface User {
|
|
59
64
|
address: string;
|
|
60
65
|
username: string;
|
|
@@ -310,7 +315,7 @@ export interface SwapPrice {
|
|
|
310
315
|
currencyAddress: string;
|
|
311
316
|
currencyBalance: string;
|
|
312
317
|
price: string;
|
|
313
|
-
|
|
318
|
+
maxPrice: string;
|
|
314
319
|
transactionValue: string;
|
|
315
320
|
}
|
|
316
321
|
export interface SwapQuote {
|
|
@@ -382,6 +387,8 @@ export interface API {
|
|
|
382
387
|
getAuthToken(args: GetAuthTokenArgs, headers?: object, signal?: AbortSignal): Promise<GetAuthTokenReturn>;
|
|
383
388
|
getAuthToken2(args: GetAuthToken2Args, headers?: object, signal?: AbortSignal): Promise<GetAuthToken2Return>;
|
|
384
389
|
sendPasswordlessLink(args: SendPasswordlessLinkArgs, headers?: object, signal?: AbortSignal): Promise<SendPasswordlessLinkReturn>;
|
|
390
|
+
registerPublicKey(args: RegisterPublicKeyArgs, headers?: object, signal?: AbortSignal): Promise<RegisterPublicKeyReturn>;
|
|
391
|
+
getPublicKey(args: GetPublicKeyArgs, headers?: object, signal?: AbortSignal): Promise<GetPublicKeyReturn>;
|
|
385
392
|
friendList(args: FriendListArgs, headers?: object, signal?: AbortSignal): Promise<FriendListReturn>;
|
|
386
393
|
getFriendByAddress(args: GetFriendByAddressArgs, headers?: object, signal?: AbortSignal): Promise<GetFriendByAddressReturn>;
|
|
387
394
|
searchFriends(args: SearchFriendsArgs, headers?: object, signal?: AbortSignal): Promise<SearchFriendsReturn>;
|
|
@@ -428,6 +435,7 @@ export interface API {
|
|
|
428
435
|
removeLinkedWallet(args: RemoveLinkedWalletArgs, headers?: object, signal?: AbortSignal): Promise<RemoveLinkedWalletReturn>;
|
|
429
436
|
generateWaaSVerificationURL(args: GenerateWaaSVerificationURLArgs, headers?: object, signal?: AbortSignal): Promise<GenerateWaaSVerificationURLReturn>;
|
|
430
437
|
validateWaaSVerificationNonce(args: ValidateWaaSVerificationNonceArgs, headers?: object, signal?: AbortSignal): Promise<ValidateWaaSVerificationNonceReturn>;
|
|
438
|
+
getSwapPrice(args: GetSwapPriceArgs, headers?: object, signal?: AbortSignal): Promise<GetSwapPriceReturn>;
|
|
431
439
|
getSwapPrices(args: GetSwapPricesArgs, headers?: object, signal?: AbortSignal): Promise<GetSwapPricesReturn>;
|
|
432
440
|
getSwapQuote(args: GetSwapQuoteArgs, headers?: object, signal?: AbortSignal): Promise<GetSwapQuoteReturn>;
|
|
433
441
|
listCurrencyGroups(headers?: object, signal?: AbortSignal): Promise<ListCurrencyGroupsReturn>;
|
|
@@ -492,6 +500,18 @@ export interface SendPasswordlessLinkArgs {
|
|
|
492
500
|
export interface SendPasswordlessLinkReturn {
|
|
493
501
|
status: boolean;
|
|
494
502
|
}
|
|
503
|
+
export interface RegisterPublicKeyArgs {
|
|
504
|
+
publicKey: PublicKey;
|
|
505
|
+
}
|
|
506
|
+
export interface RegisterPublicKeyReturn {
|
|
507
|
+
status: boolean;
|
|
508
|
+
}
|
|
509
|
+
export interface GetPublicKeyArgs {
|
|
510
|
+
id: string;
|
|
511
|
+
}
|
|
512
|
+
export interface GetPublicKeyReturn {
|
|
513
|
+
publicKey: PublicKey;
|
|
514
|
+
}
|
|
495
515
|
export interface FriendListArgs {
|
|
496
516
|
nickname?: string;
|
|
497
517
|
page?: Page;
|
|
@@ -794,8 +814,6 @@ export interface RemoveLinkedWalletArgs {
|
|
|
794
814
|
parentWalletMessage: string;
|
|
795
815
|
parentWalletSignature: string;
|
|
796
816
|
linkedWalletAddress: string;
|
|
797
|
-
linkedWalletMessage: string;
|
|
798
|
-
linkedWalletSignature: string;
|
|
799
817
|
signatureChainId: string;
|
|
800
818
|
}
|
|
801
819
|
export interface RemoveLinkedWalletReturn {
|
|
@@ -817,11 +835,22 @@ export interface ValidateWaaSVerificationNonceArgs {
|
|
|
817
835
|
export interface ValidateWaaSVerificationNonceReturn {
|
|
818
836
|
walletAddress: string;
|
|
819
837
|
}
|
|
838
|
+
export interface GetSwapPriceArgs {
|
|
839
|
+
buyCurrencyAddress: string;
|
|
840
|
+
sellCurrencyAddress: string;
|
|
841
|
+
buyAmount: string;
|
|
842
|
+
chainId: number;
|
|
843
|
+
slippagePercentage?: number;
|
|
844
|
+
}
|
|
845
|
+
export interface GetSwapPriceReturn {
|
|
846
|
+
swapPrice: SwapPrice;
|
|
847
|
+
}
|
|
820
848
|
export interface GetSwapPricesArgs {
|
|
821
849
|
userAddress: string;
|
|
822
850
|
buyCurrencyAddress: string;
|
|
823
851
|
buyAmount: string;
|
|
824
852
|
chainId: number;
|
|
853
|
+
slippagePercentage?: number;
|
|
825
854
|
}
|
|
826
855
|
export interface GetSwapPricesReturn {
|
|
827
856
|
swapPrices: Array<SwapPrice>;
|
|
@@ -833,6 +862,7 @@ export interface GetSwapQuoteArgs {
|
|
|
833
862
|
buyAmount: string;
|
|
834
863
|
chainId: number;
|
|
835
864
|
includeApprove: boolean;
|
|
865
|
+
slippagePercentage?: number;
|
|
836
866
|
}
|
|
837
867
|
export interface GetSwapQuoteReturn {
|
|
838
868
|
swapQuote: SwapQuote;
|
|
@@ -902,6 +932,8 @@ export declare class API implements API {
|
|
|
902
932
|
getAuthToken: (args: GetAuthTokenArgs, headers?: object, signal?: AbortSignal) => Promise<GetAuthTokenReturn>;
|
|
903
933
|
getAuthToken2: (args: GetAuthToken2Args, headers?: object, signal?: AbortSignal) => Promise<GetAuthToken2Return>;
|
|
904
934
|
sendPasswordlessLink: (args: SendPasswordlessLinkArgs, headers?: object, signal?: AbortSignal) => Promise<SendPasswordlessLinkReturn>;
|
|
935
|
+
registerPublicKey: (args: RegisterPublicKeyArgs, headers?: object, signal?: AbortSignal) => Promise<RegisterPublicKeyReturn>;
|
|
936
|
+
getPublicKey: (args: GetPublicKeyArgs, headers?: object, signal?: AbortSignal) => Promise<GetPublicKeyReturn>;
|
|
905
937
|
friendList: (args: FriendListArgs, headers?: object, signal?: AbortSignal) => Promise<FriendListReturn>;
|
|
906
938
|
getFriendByAddress: (args: GetFriendByAddressArgs, headers?: object, signal?: AbortSignal) => Promise<GetFriendByAddressReturn>;
|
|
907
939
|
searchFriends: (args: SearchFriendsArgs, headers?: object, signal?: AbortSignal) => Promise<SearchFriendsReturn>;
|
|
@@ -948,6 +980,7 @@ export declare class API implements API {
|
|
|
948
980
|
removeLinkedWallet: (args: RemoveLinkedWalletArgs, headers?: object, signal?: AbortSignal) => Promise<RemoveLinkedWalletReturn>;
|
|
949
981
|
generateWaaSVerificationURL: (args: GenerateWaaSVerificationURLArgs, headers?: object, signal?: AbortSignal) => Promise<GenerateWaaSVerificationURLReturn>;
|
|
950
982
|
validateWaaSVerificationNonce: (args: ValidateWaaSVerificationNonceArgs, headers?: object, signal?: AbortSignal) => Promise<ValidateWaaSVerificationNonceReturn>;
|
|
983
|
+
getSwapPrice: (args: GetSwapPriceArgs, headers?: object, signal?: AbortSignal) => Promise<GetSwapPriceReturn>;
|
|
951
984
|
getSwapPrices: (args: GetSwapPricesArgs, headers?: object, signal?: AbortSignal) => Promise<GetSwapPricesReturn>;
|
|
952
985
|
getSwapQuote: (args: GetSwapQuoteArgs, headers?: object, signal?: AbortSignal) => Promise<GetSwapQuoteReturn>;
|
|
953
986
|
listCurrencyGroups: (headers?: object, signal?: AbortSignal) => Promise<ListCurrencyGroupsReturn>;
|
package/package.json
CHANGED
package/src/api.gen.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* eslint-disable */
|
|
2
|
-
// sequence-api v0.4.0
|
|
2
|
+
// sequence-api v0.4.0 bbe47e0331a18438fe5f7fe590a4b7b4e5102738
|
|
3
3
|
// --
|
|
4
|
-
// Code generated by webrpc-gen@v0.
|
|
4
|
+
// Code generated by webrpc-gen@v0.20.3 with typescript generator. DO NOT EDIT.
|
|
5
5
|
//
|
|
6
6
|
// webrpc-gen -schema=api.ridl -target=typescript -client -out=./clients/api.gen.ts
|
|
7
7
|
|
|
@@ -12,7 +12,7 @@ export const WebRPCVersion = 'v1'
|
|
|
12
12
|
export const WebRPCSchemaVersion = 'v0.4.0'
|
|
13
13
|
|
|
14
14
|
// Schema hash generated from your RIDL schema
|
|
15
|
-
export const WebRPCSchemaHash = '
|
|
15
|
+
export const WebRPCSchemaHash = 'bbe47e0331a18438fe5f7fe590a4b7b4e5102738'
|
|
16
16
|
|
|
17
17
|
//
|
|
18
18
|
// Types
|
|
@@ -78,6 +78,12 @@ export interface SequenceContext {
|
|
|
78
78
|
utils: string
|
|
79
79
|
}
|
|
80
80
|
|
|
81
|
+
export interface PublicKey {
|
|
82
|
+
id: string
|
|
83
|
+
x: string
|
|
84
|
+
y: string
|
|
85
|
+
}
|
|
86
|
+
|
|
81
87
|
export interface User {
|
|
82
88
|
address: string
|
|
83
89
|
username: string
|
|
@@ -362,7 +368,7 @@ export interface SwapPrice {
|
|
|
362
368
|
currencyAddress: string
|
|
363
369
|
currencyBalance: string
|
|
364
370
|
price: string
|
|
365
|
-
|
|
371
|
+
maxPrice: string
|
|
366
372
|
transactionValue: string
|
|
367
373
|
}
|
|
368
374
|
|
|
@@ -445,6 +451,8 @@ export interface API {
|
|
|
445
451
|
headers?: object,
|
|
446
452
|
signal?: AbortSignal
|
|
447
453
|
): Promise<SendPasswordlessLinkReturn>
|
|
454
|
+
registerPublicKey(args: RegisterPublicKeyArgs, headers?: object, signal?: AbortSignal): Promise<RegisterPublicKeyReturn>
|
|
455
|
+
getPublicKey(args: GetPublicKeyArgs, headers?: object, signal?: AbortSignal): Promise<GetPublicKeyReturn>
|
|
448
456
|
friendList(args: FriendListArgs, headers?: object, signal?: AbortSignal): Promise<FriendListReturn>
|
|
449
457
|
getFriendByAddress(args: GetFriendByAddressArgs, headers?: object, signal?: AbortSignal): Promise<GetFriendByAddressReturn>
|
|
450
458
|
searchFriends(args: SearchFriendsArgs, headers?: object, signal?: AbortSignal): Promise<SearchFriendsReturn>
|
|
@@ -539,6 +547,7 @@ export interface API {
|
|
|
539
547
|
headers?: object,
|
|
540
548
|
signal?: AbortSignal
|
|
541
549
|
): Promise<ValidateWaaSVerificationNonceReturn>
|
|
550
|
+
getSwapPrice(args: GetSwapPriceArgs, headers?: object, signal?: AbortSignal): Promise<GetSwapPriceReturn>
|
|
542
551
|
getSwapPrices(args: GetSwapPricesArgs, headers?: object, signal?: AbortSignal): Promise<GetSwapPricesReturn>
|
|
543
552
|
getSwapQuote(args: GetSwapQuoteArgs, headers?: object, signal?: AbortSignal): Promise<GetSwapQuoteReturn>
|
|
544
553
|
listCurrencyGroups(headers?: object, signal?: AbortSignal): Promise<ListCurrencyGroupsReturn>
|
|
@@ -635,6 +644,20 @@ export interface SendPasswordlessLinkArgs {
|
|
|
635
644
|
export interface SendPasswordlessLinkReturn {
|
|
636
645
|
status: boolean
|
|
637
646
|
}
|
|
647
|
+
export interface RegisterPublicKeyArgs {
|
|
648
|
+
publicKey: PublicKey
|
|
649
|
+
}
|
|
650
|
+
|
|
651
|
+
export interface RegisterPublicKeyReturn {
|
|
652
|
+
status: boolean
|
|
653
|
+
}
|
|
654
|
+
export interface GetPublicKeyArgs {
|
|
655
|
+
id: string
|
|
656
|
+
}
|
|
657
|
+
|
|
658
|
+
export interface GetPublicKeyReturn {
|
|
659
|
+
publicKey: PublicKey
|
|
660
|
+
}
|
|
638
661
|
export interface FriendListArgs {
|
|
639
662
|
nickname?: string
|
|
640
663
|
page?: Page
|
|
@@ -971,8 +994,6 @@ export interface RemoveLinkedWalletArgs {
|
|
|
971
994
|
parentWalletMessage: string
|
|
972
995
|
parentWalletSignature: string
|
|
973
996
|
linkedWalletAddress: string
|
|
974
|
-
linkedWalletMessage: string
|
|
975
|
-
linkedWalletSignature: string
|
|
976
997
|
signatureChainId: string
|
|
977
998
|
}
|
|
978
999
|
|
|
@@ -997,11 +1018,23 @@ export interface ValidateWaaSVerificationNonceArgs {
|
|
|
997
1018
|
export interface ValidateWaaSVerificationNonceReturn {
|
|
998
1019
|
walletAddress: string
|
|
999
1020
|
}
|
|
1021
|
+
export interface GetSwapPriceArgs {
|
|
1022
|
+
buyCurrencyAddress: string
|
|
1023
|
+
sellCurrencyAddress: string
|
|
1024
|
+
buyAmount: string
|
|
1025
|
+
chainId: number
|
|
1026
|
+
slippagePercentage?: number
|
|
1027
|
+
}
|
|
1028
|
+
|
|
1029
|
+
export interface GetSwapPriceReturn {
|
|
1030
|
+
swapPrice: SwapPrice
|
|
1031
|
+
}
|
|
1000
1032
|
export interface GetSwapPricesArgs {
|
|
1001
1033
|
userAddress: string
|
|
1002
1034
|
buyCurrencyAddress: string
|
|
1003
1035
|
buyAmount: string
|
|
1004
1036
|
chainId: number
|
|
1037
|
+
slippagePercentage?: number
|
|
1005
1038
|
}
|
|
1006
1039
|
|
|
1007
1040
|
export interface GetSwapPricesReturn {
|
|
@@ -1014,6 +1047,7 @@ export interface GetSwapQuoteArgs {
|
|
|
1014
1047
|
buyAmount: string
|
|
1015
1048
|
chainId: number
|
|
1016
1049
|
includeApprove: boolean
|
|
1050
|
+
slippagePercentage?: number
|
|
1017
1051
|
}
|
|
1018
1052
|
|
|
1019
1053
|
export interface GetSwapQuoteReturn {
|
|
@@ -1086,7 +1120,7 @@ export class API implements API {
|
|
|
1086
1120
|
protected path = '/rpc/API/'
|
|
1087
1121
|
|
|
1088
1122
|
constructor(hostname: string, fetch: Fetch) {
|
|
1089
|
-
this.hostname = hostname
|
|
1123
|
+
this.hostname = hostname.replace(/\/*$/, '')
|
|
1090
1124
|
this.fetch = (input: RequestInfo, init?: RequestInit) => fetch(input, init)
|
|
1091
1125
|
}
|
|
1092
1126
|
|
|
@@ -1224,6 +1258,36 @@ export class API implements API {
|
|
|
1224
1258
|
)
|
|
1225
1259
|
}
|
|
1226
1260
|
|
|
1261
|
+
registerPublicKey = (args: RegisterPublicKeyArgs, headers?: object, signal?: AbortSignal): Promise<RegisterPublicKeyReturn> => {
|
|
1262
|
+
return this.fetch(this.url('RegisterPublicKey'), createHTTPRequest(args, headers, signal)).then(
|
|
1263
|
+
res => {
|
|
1264
|
+
return buildResponse(res).then(_data => {
|
|
1265
|
+
return {
|
|
1266
|
+
status: <boolean>_data.status
|
|
1267
|
+
}
|
|
1268
|
+
})
|
|
1269
|
+
},
|
|
1270
|
+
error => {
|
|
1271
|
+
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
|
|
1272
|
+
}
|
|
1273
|
+
)
|
|
1274
|
+
}
|
|
1275
|
+
|
|
1276
|
+
getPublicKey = (args: GetPublicKeyArgs, headers?: object, signal?: AbortSignal): Promise<GetPublicKeyReturn> => {
|
|
1277
|
+
return this.fetch(this.url('GetPublicKey'), createHTTPRequest(args, headers, signal)).then(
|
|
1278
|
+
res => {
|
|
1279
|
+
return buildResponse(res).then(_data => {
|
|
1280
|
+
return {
|
|
1281
|
+
publicKey: <PublicKey>_data.publicKey
|
|
1282
|
+
}
|
|
1283
|
+
})
|
|
1284
|
+
},
|
|
1285
|
+
error => {
|
|
1286
|
+
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
|
|
1287
|
+
}
|
|
1288
|
+
)
|
|
1289
|
+
}
|
|
1290
|
+
|
|
1227
1291
|
friendList = (args: FriendListArgs, headers?: object, signal?: AbortSignal): Promise<FriendListReturn> => {
|
|
1228
1292
|
return this.fetch(this.url('FriendList'), createHTTPRequest(args, headers, signal)).then(
|
|
1229
1293
|
res => {
|
|
@@ -1999,6 +2063,21 @@ export class API implements API {
|
|
|
1999
2063
|
)
|
|
2000
2064
|
}
|
|
2001
2065
|
|
|
2066
|
+
getSwapPrice = (args: GetSwapPriceArgs, headers?: object, signal?: AbortSignal): Promise<GetSwapPriceReturn> => {
|
|
2067
|
+
return this.fetch(this.url('GetSwapPrice'), createHTTPRequest(args, headers, signal)).then(
|
|
2068
|
+
res => {
|
|
2069
|
+
return buildResponse(res).then(_data => {
|
|
2070
|
+
return {
|
|
2071
|
+
swapPrice: <SwapPrice>_data.swapPrice
|
|
2072
|
+
}
|
|
2073
|
+
})
|
|
2074
|
+
},
|
|
2075
|
+
error => {
|
|
2076
|
+
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
|
|
2077
|
+
}
|
|
2078
|
+
)
|
|
2079
|
+
}
|
|
2080
|
+
|
|
2002
2081
|
getSwapPrices = (args: GetSwapPricesArgs, headers?: object, signal?: AbortSignal): Promise<GetSwapPricesReturn> => {
|
|
2003
2082
|
return this.fetch(this.url('GetSwapPrices'), createHTTPRequest(args, headers, signal)).then(
|
|
2004
2083
|
res => {
|