Skip to content

Commit

Permalink
feat: contractCalls (#188)
Browse files Browse the repository at this point in the history
* chore: supporting types for hackaton muc

* feat: contractCalls endpoint

* chore: removed pnpm lock
  • Loading branch information
H3xept committed Aug 30, 2023
1 parent 52bf3e4 commit d3515da
Showing 1 changed file with 24 additions and 18 deletions.
42 changes: 24 additions & 18 deletions src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,20 +184,28 @@ export interface QuoteRequest extends ToolConfiguration {
maxPriceImpact?: number // hide routes with price impact greater than or equal to this value
}

export interface ContractCallQuoteRequest extends ToolConfiguration {
export interface ContractCall {
fromAmount: string
fromTokenAddress: string
toContractAddress: string
toContractCallData: string
toContractGasLimit: string
toApprovalAddress?: string
toTokenAddress?: string
}

export interface ContractCallsQuoteRequest extends ToolConfiguration {
fromChain: number | string
fromToken: string
fromAddress: string

toChain: number | string
toToken: string
toAmount: string
toContractAddress: string
toContractCallData: string
toContractGasLimit: string
toApprovalAddress?: string

toFallbackAddress?: string
contractOutputsToken?: string
contractCalls: ContractCall[]

slippage?: number | string
integrator?: string
Expand All @@ -206,27 +214,25 @@ export interface ContractCallQuoteRequest extends ToolConfiguration {
allowDestinationCall?: boolean // (default : true) // destination calls are enabled by default
}

export interface ContractCallQuotesRequest extends ToolConfiguration {
/* @deprecated */
export interface ContractCallQuoteRequest extends ToolConfiguration {
fromChain: number | string
fromToken: string
fromAddress: string

toChain: number | string
toToken: string
toAmount: string
toContractAddress: string
toContractCallData: string
toContractGasLimit: string
toApprovalAddress?: string
toFallbackAddress?: string
toContractCalls: {
sendingAmount: string
sendingToken: string
receivingToken: string
contractAddress: string
approvalAddress?: string
callData: string
gasLimit: string
}[]

order?: Order
contractOutputsToken?: string
slippage?: number | string
integrator?: string
referrer?: string
fee?: number | string
allowDestinationCall?: boolean
}

export interface ConnectionsRequest extends ToolConfiguration {
Expand Down

0 comments on commit d3515da

Please sign in to comment.