11/* eslint-disable */
2- // sequence-api v0.4.0 470a0f88ea399c2a57ff8c22da54358c033ed5f0
2+ // sequence-api v0.4.0 bbe47e0331a18438fe5f7fe590a4b7b4e5102738
33// --
4- // Code generated by webrpc-gen@v0.18.7 with typescript generator. DO NOT EDIT.
4+ // Code generated by webrpc-gen@v0.20.3 with typescript generator. DO NOT EDIT.
55//
66// webrpc-gen -schema=api.ridl -target=typescript -client -out=./clients/api.gen.ts
77
@@ -12,7 +12,7 @@ export const WebRPCVersion = 'v1'
1212export const WebRPCSchemaVersion = 'v0.4.0'
1313
1414// Schema hash generated from your RIDL schema
15- export const WebRPCSchemaHash = '470a0f88ea399c2a57ff8c22da54358c033ed5f0 '
15+ export const WebRPCSchemaHash = 'bbe47e0331a18438fe5f7fe590a4b7b4e5102738 '
1616
1717//
1818// Types
@@ -78,6 +78,12 @@ export interface SequenceContext {
7878 utils : string
7979}
8080
81+ export interface PublicKey {
82+ id : string
83+ x : string
84+ y : string
85+ }
86+
8187export interface User {
8288 address : string
8389 username : string
@@ -362,7 +368,7 @@ export interface SwapPrice {
362368 currencyAddress : string
363369 currencyBalance : string
364370 price : string
365- to : string
371+ maxPrice : string
366372 transactionValue : string
367373}
368374
@@ -445,6 +451,8 @@ export interface API {
445451 headers ?: object ,
446452 signal ?: AbortSignal
447453 ) : Promise < SendPasswordlessLinkReturn >
454+ registerPublicKey ( args : RegisterPublicKeyArgs , headers ?: object , signal ?: AbortSignal ) : Promise < RegisterPublicKeyReturn >
455+ getPublicKey ( args : GetPublicKeyArgs , headers ?: object , signal ?: AbortSignal ) : Promise < GetPublicKeyReturn >
448456 friendList ( args : FriendListArgs , headers ?: object , signal ?: AbortSignal ) : Promise < FriendListReturn >
449457 getFriendByAddress ( args : GetFriendByAddressArgs , headers ?: object , signal ?: AbortSignal ) : Promise < GetFriendByAddressReturn >
450458 searchFriends ( args : SearchFriendsArgs , headers ?: object , signal ?: AbortSignal ) : Promise < SearchFriendsReturn >
@@ -539,6 +547,7 @@ export interface API {
539547 headers ?: object ,
540548 signal ?: AbortSignal
541549 ) : Promise < ValidateWaaSVerificationNonceReturn >
550+ getSwapPrice ( args : GetSwapPriceArgs , headers ?: object , signal ?: AbortSignal ) : Promise < GetSwapPriceReturn >
542551 getSwapPrices ( args : GetSwapPricesArgs , headers ?: object , signal ?: AbortSignal ) : Promise < GetSwapPricesReturn >
543552 getSwapQuote ( args : GetSwapQuoteArgs , headers ?: object , signal ?: AbortSignal ) : Promise < GetSwapQuoteReturn >
544553 listCurrencyGroups ( headers ?: object , signal ?: AbortSignal ) : Promise < ListCurrencyGroupsReturn >
@@ -635,6 +644,20 @@ export interface SendPasswordlessLinkArgs {
635644export interface SendPasswordlessLinkReturn {
636645 status : boolean
637646}
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+ }
638661export interface FriendListArgs {
639662 nickname ?: string
640663 page ?: Page
@@ -971,8 +994,6 @@ export interface RemoveLinkedWalletArgs {
971994 parentWalletMessage : string
972995 parentWalletSignature : string
973996 linkedWalletAddress : string
974- linkedWalletMessage : string
975- linkedWalletSignature : string
976997 signatureChainId : string
977998}
978999
@@ -997,11 +1018,23 @@ export interface ValidateWaaSVerificationNonceArgs {
9971018export interface ValidateWaaSVerificationNonceReturn {
9981019 walletAddress : string
9991020}
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+ }
10001032export interface GetSwapPricesArgs {
10011033 userAddress : string
10021034 buyCurrencyAddress : string
10031035 buyAmount : string
10041036 chainId : number
1037+ slippagePercentage ?: number
10051038}
10061039
10071040export interface GetSwapPricesReturn {
@@ -1014,6 +1047,7 @@ export interface GetSwapQuoteArgs {
10141047 buyAmount : string
10151048 chainId : number
10161049 includeApprove : boolean
1050+ slippagePercentage ?: number
10171051}
10181052
10191053export interface GetSwapQuoteReturn {
@@ -1086,7 +1120,7 @@ export class API implements API {
10861120 protected path = '/rpc/API/'
10871121
10881122 constructor ( hostname : string , fetch : Fetch ) {
1089- this . hostname = hostname
1123+ this . hostname = hostname . replace ( / \/ * $ / , '' )
10901124 this . fetch = ( input : RequestInfo , init ?: RequestInit ) => fetch ( input , init )
10911125 }
10921126
@@ -1224,6 +1258,36 @@ export class API implements API {
12241258 )
12251259 }
12261260
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+
12271291 friendList = ( args : FriendListArgs , headers ?: object , signal ?: AbortSignal ) : Promise < FriendListReturn > => {
12281292 return this . fetch ( this . url ( 'FriendList' ) , createHTTPRequest ( args , headers , signal ) ) . then (
12291293 res => {
@@ -1999,6 +2063,21 @@ export class API implements API {
19992063 )
20002064 }
20012065
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+
20022081 getSwapPrices = ( args : GetSwapPricesArgs , headers ?: object , signal ?: AbortSignal ) : Promise < GetSwapPricesReturn > => {
20032082 return this . fetch ( this . url ( 'GetSwapPrices' ) , createHTTPRequest ( args , headers , signal ) ) . then (
20042083 res => {
0 commit comments