Skip to content

Commit b711ab2

Browse files
committed
[AUTOMATED] Update: proto/clients/trails-api.gen.ts
1 parent dbb63e8 commit b711ab2

File tree

1 file changed

+39
-21
lines changed

1 file changed

+39
-21
lines changed

packages/trails-api/src/trails-api.gen.ts

Lines changed: 39 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* eslint-disable */
2-
// trails-api v1.0.0 005a369b19dfebdb65dde9e0e5ddac91bfc04c44
2+
// trails-api v1.0.0 0b6de03a213c68572c446338975ad1f080d68655
33
// --
44
// Code generated by [email protected] with typescript generator. DO NOT EDIT.
55
//
@@ -12,7 +12,7 @@ export const WebrpcVersion = 'v1'
1212
export const WebrpcSchemaVersion = 'v1.0.0'
1313

1414
// Schema hash generated from your RIDL schema
15-
export const WebrpcSchemaHash = '005a369b19dfebdb65dde9e0e5ddac91bfc04c44'
15+
export const WebrpcSchemaHash = '0b6de03a213c68572c446338975ad1f080d68655'
1616

1717
//
1818
// Client interface
@@ -58,6 +58,8 @@ export interface TrailsClient {
5858
headers?: object,
5959
signal?: AbortSignal
6060
): Promise<GetIntentEntryTransactionResponse>
61+
62+
getTokenPrices(req: GetTokenPricesRequest, headers?: object, signal?: AbortSignal): Promise<GetTokenPricesResponse>
6163
}
6264

6365
//
@@ -272,9 +274,7 @@ export interface IntentSummary {
272274
status: IntentStatus
273275
ownerAddress: string
274276
originChainId: number
275-
originChainMetadata: ChainMetadata
276277
destinationChainId: number
277-
destinationChainMetadata: ChainMetadata
278278
originIntentAddress: string
279279
destinationIntentAddress: string
280280
depositTransactionHash?: string
@@ -294,37 +294,30 @@ export interface IntentSummary {
294294
}
295295

296296
export interface ChainMetadata {
297+
chainId: number
297298
name: string
298299
logoUri?: string
300+
testnet?: boolean
299301
}
300302

301303
export interface TokenMetadata {
304+
tokenAddress: string
302305
name: string
303306
symbol: string
304-
decimals: number
307+
decimals?: number
305308
logoUri?: string
306309
}
307310

308-
export interface TokenPrice {
309-
token: Token
310-
price?: Price
311-
price24hChange?: Price
312-
price24hVol?: Price
313-
floorPrice: Price
314-
buyPrice: Price
315-
sellPrice: Price
316-
updatedAt: string
317-
}
318-
319311
export interface Token {
320312
chainId: number
321313
tokenAddress: string
322-
tokenId?: string
314+
tokenSymbol?: string
323315
}
324316

325-
export interface Price {
326-
value: number
327-
currency: string
317+
export interface TokenPrice {
318+
token: Token
319+
priceUsd?: number
320+
updatedAt: string
328321
}
329322

330323
export interface CCTPTransfer {
@@ -542,6 +535,14 @@ export interface ClockResponse {
542535
serverTime: string
543536
}
544537

538+
export interface GetTokenPricesRequest {
539+
tokens: Array<Token>
540+
}
541+
542+
export interface GetTokenPricesResponse {
543+
tokenPrices: Array<TokenPrice>
544+
}
545+
545546
//
546547
// Client
547548
//
@@ -575,7 +576,8 @@ export class Trails implements TrailsClient {
575576
getIntentTransactionHistory: (req: GetIntentTransactionHistoryRequest) =>
576577
['Trails', 'getIntentTransactionHistory', req] as const,
577578
getIntentGasFeeOptions: (req: GetIntentGasFeeOptionsRequest) => ['Trails', 'getIntentGasFeeOptions', req] as const,
578-
getIntentEntryTransaction: (req: GetIntentEntryTransactionRequest) => ['Trails', 'getIntentEntryTransaction', req] as const
579+
getIntentEntryTransaction: (req: GetIntentEntryTransactionRequest) => ['Trails', 'getIntentEntryTransaction', req] as const,
580+
getTokenPrices: (req: GetTokenPricesRequest) => ['Trails', 'getTokenPrices', req] as const
579581
}
580582

581583
ping = (headers?: object, signal?: AbortSignal): Promise<PingResponse> => {
@@ -800,6 +802,22 @@ export class Trails implements TrailsClient {
800802
}
801803
)
802804
}
805+
806+
getTokenPrices = (req: GetTokenPricesRequest, headers?: object, signal?: AbortSignal): Promise<GetTokenPricesResponse> => {
807+
return this.fetch(
808+
this.url('GetTokenPrices'),
809+
createHttpRequest(JsonEncode(req, 'GetTokenPricesRequest'), headers, signal)
810+
).then(
811+
res => {
812+
return buildResponse(res).then(_data => {
813+
return JsonDecode<GetTokenPricesResponse>(_data, 'GetTokenPricesResponse')
814+
})
815+
},
816+
error => {
817+
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error instanceof Error ? error.message : String(error)}` })
818+
}
819+
)
820+
}
803821
}
804822

805823
const createHttpRequest = (body: string = '{}', headers: object = {}, signal: AbortSignal | null = null): object => {

0 commit comments

Comments
 (0)