Skip to content

Commit

Permalink
[AUTOMATED] Update files from 0xsequence/stack (#637)
Browse files Browse the repository at this point in the history
* [AUTOMATED] Update: api/proto/clients/api.gen.ts

* [AUTOMATED] pnpm format

---------

Co-authored-by: VojtechVitek <[email protected]>
  • Loading branch information
0xsequence-bot and VojtechVitek authored Jan 10, 2025
1 parent d465239 commit a0f4208
Showing 1 changed file with 119 additions and 7 deletions.
126 changes: 119 additions & 7 deletions packages/api/src/api.gen.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable */
// sequence-api v0.4.0 470a0f88ea399c2a57ff8c22da54358c033ed5f0
// sequence-api v0.4.0 24814ebb88457c0545aa80e8388cb0f08ec59bec
// --
// Code generated by webrpc-gen@v0.18.7 with typescript generator. DO NOT EDIT.
// Code generated by webrpc-gen@v0.20.3 with typescript generator. DO NOT EDIT.
//
// webrpc-gen -schema=api.ridl -target=typescript -client -out=./clients/api.gen.ts

Expand All @@ -12,7 +12,7 @@ export const WebRPCVersion = 'v1'
export const WebRPCSchemaVersion = 'v0.4.0'

// Schema hash generated from your RIDL schema
export const WebRPCSchemaHash = '470a0f88ea399c2a57ff8c22da54358c033ed5f0'
export const WebRPCSchemaHash = '24814ebb88457c0545aa80e8388cb0f08ec59bec'

//
// Types
Expand Down Expand Up @@ -78,6 +78,12 @@ export interface SequenceContext {
utils: string
}

export interface PublicKey {
id: string
x: string
y: string
}

export interface User {
address: string
username: string
Expand Down Expand Up @@ -362,7 +368,7 @@ export interface SwapPrice {
currencyAddress: string
currencyBalance: string
price: string
to: string
maxPrice: string
transactionValue: string
}

Expand Down Expand Up @@ -432,6 +438,10 @@ export interface PaymentResponse {
txData: string
}

export interface AdoptedChildWallet {
address: string
}

export interface API {
ping(headers?: object, signal?: AbortSignal): Promise<PingReturn>
version(headers?: object, signal?: AbortSignal): Promise<VersionReturn>
Expand All @@ -445,6 +455,8 @@ export interface API {
headers?: object,
signal?: AbortSignal
): Promise<SendPasswordlessLinkReturn>
registerPublicKey(args: RegisterPublicKeyArgs, headers?: object, signal?: AbortSignal): Promise<RegisterPublicKeyReturn>
getPublicKey(args: GetPublicKeyArgs, headers?: object, signal?: AbortSignal): Promise<GetPublicKeyReturn>
friendList(args: FriendListArgs, headers?: object, signal?: AbortSignal): Promise<FriendListReturn>
getFriendByAddress(args: GetFriendByAddressArgs, headers?: object, signal?: AbortSignal): Promise<GetFriendByAddressReturn>
searchFriends(args: SearchFriendsArgs, headers?: object, signal?: AbortSignal): Promise<SearchFriendsReturn>
Expand Down Expand Up @@ -539,6 +551,8 @@ export interface API {
headers?: object,
signal?: AbortSignal
): Promise<ValidateWaaSVerificationNonceReturn>
listAdoptedWallets(args: ListAdoptedWalletsArgs, headers?: object, signal?: AbortSignal): Promise<ListAdoptedWalletsReturn>
getSwapPrice(args: GetSwapPriceArgs, headers?: object, signal?: AbortSignal): Promise<GetSwapPriceReturn>
getSwapPrices(args: GetSwapPricesArgs, headers?: object, signal?: AbortSignal): Promise<GetSwapPricesReturn>
getSwapQuote(args: GetSwapQuoteArgs, headers?: object, signal?: AbortSignal): Promise<GetSwapQuoteReturn>
listCurrencyGroups(headers?: object, signal?: AbortSignal): Promise<ListCurrencyGroupsReturn>
Expand Down Expand Up @@ -635,6 +649,20 @@ export interface SendPasswordlessLinkArgs {
export interface SendPasswordlessLinkReturn {
status: boolean
}
export interface RegisterPublicKeyArgs {
publicKey: PublicKey
}

export interface RegisterPublicKeyReturn {
status: boolean
}
export interface GetPublicKeyArgs {
id: string
}

export interface GetPublicKeyReturn {
publicKey: PublicKey
}
export interface FriendListArgs {
nickname?: string
page?: Page
Expand Down Expand Up @@ -971,8 +999,6 @@ export interface RemoveLinkedWalletArgs {
parentWalletMessage: string
parentWalletSignature: string
linkedWalletAddress: string
linkedWalletMessage: string
linkedWalletSignature: string
signatureChainId: string
}

Expand All @@ -997,11 +1023,31 @@ export interface ValidateWaaSVerificationNonceArgs {
export interface ValidateWaaSVerificationNonceReturn {
walletAddress: string
}
export interface ListAdoptedWalletsArgs {
page?: Page
}

export interface ListAdoptedWalletsReturn {
page: Page
wallets: Array<AdoptedChildWallet>
}
export interface GetSwapPriceArgs {
buyCurrencyAddress: string
sellCurrencyAddress: string
buyAmount: string
chainId: number
slippagePercentage?: number
}

export interface GetSwapPriceReturn {
swapPrice: SwapPrice
}
export interface GetSwapPricesArgs {
userAddress: string
buyCurrencyAddress: string
buyAmount: string
chainId: number
slippagePercentage?: number
}

export interface GetSwapPricesReturn {
Expand All @@ -1014,6 +1060,7 @@ export interface GetSwapQuoteArgs {
buyAmount: string
chainId: number
includeApprove: boolean
slippagePercentage?: number
}

export interface GetSwapQuoteReturn {
Expand Down Expand Up @@ -1086,7 +1133,7 @@ export class API implements API {
protected path = '/rpc/API/'

constructor(hostname: string, fetch: Fetch) {
this.hostname = hostname
this.hostname = hostname.replace(/\/*$/, '')
this.fetch = (input: RequestInfo, init?: RequestInit) => fetch(input, init)
}

Expand Down Expand Up @@ -1224,6 +1271,36 @@ export class API implements API {
)
}

registerPublicKey = (args: RegisterPublicKeyArgs, headers?: object, signal?: AbortSignal): Promise<RegisterPublicKeyReturn> => {
return this.fetch(this.url('RegisterPublicKey'), createHTTPRequest(args, headers, signal)).then(
res => {
return buildResponse(res).then(_data => {
return {
status: <boolean>_data.status
}
})
},
error => {
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
}
)
}

getPublicKey = (args: GetPublicKeyArgs, headers?: object, signal?: AbortSignal): Promise<GetPublicKeyReturn> => {
return this.fetch(this.url('GetPublicKey'), createHTTPRequest(args, headers, signal)).then(
res => {
return buildResponse(res).then(_data => {
return {
publicKey: <PublicKey>_data.publicKey
}
})
},
error => {
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
}
)
}

friendList = (args: FriendListArgs, headers?: object, signal?: AbortSignal): Promise<FriendListReturn> => {
return this.fetch(this.url('FriendList'), createHTTPRequest(args, headers, signal)).then(
res => {
Expand Down Expand Up @@ -1999,6 +2076,41 @@ export class API implements API {
)
}

listAdoptedWallets = (
args: ListAdoptedWalletsArgs,
headers?: object,
signal?: AbortSignal
): Promise<ListAdoptedWalletsReturn> => {
return this.fetch(this.url('ListAdoptedWallets'), createHTTPRequest(args, headers, signal)).then(
res => {
return buildResponse(res).then(_data => {
return {
page: <Page>_data.page,
wallets: <Array<AdoptedChildWallet>>_data.wallets
}
})
},
error => {
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
}
)
}

getSwapPrice = (args: GetSwapPriceArgs, headers?: object, signal?: AbortSignal): Promise<GetSwapPriceReturn> => {
return this.fetch(this.url('GetSwapPrice'), createHTTPRequest(args, headers, signal)).then(
res => {
return buildResponse(res).then(_data => {
return {
swapPrice: <SwapPrice>_data.swapPrice
}
})
},
error => {
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
}
)
}

getSwapPrices = (args: GetSwapPricesArgs, headers?: object, signal?: AbortSignal): Promise<GetSwapPricesReturn> => {
return this.fetch(this.url('GetSwapPrices'), createHTTPRequest(args, headers, signal)).then(
res => {
Expand Down

0 comments on commit a0f4208

Please sign in to comment.