11/* eslint-disable */
2- // trails-api v0.4.0 fed97360e921855da1cdb97cf0a96404edb2950f
2+ // trails-api v0.4.0 7ae581ed6118efc338a137a9a4699e2ec1f87f03
33// --
44// Code generated by [email protected] with typescript generator. DO NOT EDIT. 55//
@@ -16,7 +16,7 @@ export const WebRPCVersion = 'v1'
1616export const WebRPCSchemaVersion = 'v0.4.0'
1717
1818// Schema hash generated from your RIDL schema
19- export const WebRPCSchemaHash = 'fed97360e921855da1cdb97cf0a96404edb2950f '
19+ export const WebRPCSchemaHash = '7ae581ed6118efc338a137a9a4699e2ec1f87f03 '
2020
2121type WebrpcGenVersions = {
2222 webrpcGenVersion : string
@@ -94,18 +94,8 @@ export interface RuntimeStatus {
9494 ver : string
9595 branch : string
9696 commitHash : string
97- checks : RuntimeChecks
9897}
9998
100- export interface NumTxnsRelayed {
101- chainID : number
102- prev : number
103- current : number
104- period : number
105- }
106-
107- export interface RuntimeChecks { }
108-
10999export interface MetaTxn {
110100 id : string
111101 chainId : string
@@ -178,11 +168,6 @@ export interface AddressOverrides {
178168 sequenceWalletUtilsAddress ?: string
179169}
180170
181- export interface TakerFee {
182- address : string
183- bps : number
184- }
185-
186171export interface OriginCall {
187172 chainId : number
188173 to : string
@@ -193,7 +178,13 @@ export interface OriginCall {
193178export interface IntentPrecondition {
194179 type : string
195180 chainId : string
196- data : any
181+ data : IntentPreconditionData
182+ }
183+
184+ export interface IntentPreconditionData {
185+ address : string
186+ token : string
187+ min : number
197188}
198189
199190export interface Token {
@@ -268,7 +259,6 @@ export interface GetIntentCallsPayloadParams {
268259 provider ?: string
269260 addressOverrides ?: AddressOverrides
270261 destinationSalt ?: string
271- takerFee ?: TakerFee
272262 slippageTolerance ?: number
273263 tradeType ?: TradeType
274264}
@@ -287,7 +277,6 @@ export interface GetIntentsQuoteParams {
287277 provider ?: string
288278 addressOverrides ?: AddressOverrides
289279 destinationSalt ?: string
290- takerFee ?: TakerFee
291280 slippageTolerance ?: number
292281 tradeType ?: TradeType
293282 exactInputOriginalTokenAmount ?: string
@@ -319,6 +308,7 @@ export interface IntentRequestParams {
319308}
320309
321310export interface IntentCallsPayloads {
311+ id : string
322312 calls : Array < IntentCallsPayload >
323313 preconditions : Array < IntentPrecondition >
324314 metaTxns : Array < MetaTxn >
@@ -417,6 +407,10 @@ export interface API {
417407 version ( headers ?: object , signal ?: AbortSignal ) : Promise < VersionReturn >
418408 runtimeStatus ( headers ?: object , signal ?: AbortSignal ) : Promise < RuntimeStatusReturn >
419409 clock ( headers ?: object , signal ?: AbortSignal ) : Promise < ClockReturn >
410+ /**
411+ * TODO: a lot of overlap with IntentConfig and other stuff..
412+ */
413+ executeIntent ( args : ExecuteIntentArgs , headers ?: object , signal ?: AbortSignal ) : Promise < ExecuteIntentReturn >
420414 /**
421415 * Generates complete intent execution payloads including calls, preconditions, meta transactions, and quotes for cross-chain swaps/transfers.
422416 */
@@ -506,6 +500,13 @@ export interface ClockArgs {}
506500export interface ClockReturn {
507501 serverTime : string
508502}
503+ export interface ExecuteIntentArgs {
504+ intent : CommitIntentConfigParams
505+ }
506+
507+ export interface ExecuteIntentReturn {
508+ config : IntentConfig
509+ }
509510export interface GetIntentCallsPayloadsArgs {
510511 params : GetIntentCallsPayloadParams
511512}
@@ -682,6 +683,21 @@ export class API implements API {
682683 )
683684 }
684685
686+ executeIntent = ( args : ExecuteIntentArgs , headers ?: object , signal ?: AbortSignal ) : Promise < ExecuteIntentReturn > => {
687+ return this . fetch ( this . url ( 'ExecuteIntent' ) , createHTTPRequest ( args , headers , signal ) ) . then (
688+ res => {
689+ return buildResponse ( res ) . then ( _data => {
690+ return {
691+ config : < IntentConfig > _data . config
692+ }
693+ } )
694+ } ,
695+ error => {
696+ throw WebrpcRequestFailedError . new ( { cause : `fetch(): ${ error instanceof Error ? error . message : String ( error ) } ` } )
697+ }
698+ )
699+ }
700+
685701 getIntentCallsPayloads = (
686702 args : GetIntentCallsPayloadsArgs ,
687703 headers ?: object ,
0 commit comments