Skip to content

Commit

Permalink
chore: bump packages
Browse files Browse the repository at this point in the history
  • Loading branch information
chybisov committed Sep 10, 2024
1 parent 4013f05 commit 8d75eb7
Show file tree
Hide file tree
Showing 3 changed files with 385 additions and 338 deletions.
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,14 @@
]
},
"dependencies": {
"@lifi/types": "^15.3.0",
"@lifi/types": "^15.9.0",
"@solana/wallet-adapter-base": "^0.9.23",
"@solana/web3.js": "^1.95.3",
"viem": "^2.20.0"
"viem": "^2.21.4"
},
"devDependencies": {
"@commitlint/cli": "^19.4.0",
"@commitlint/config-conventional": "^19.2.2",
"@commitlint/cli": "^19.4.1",
"@commitlint/config-conventional": "^19.4.1",
"@types/fs-extra": "^11.0.4",
"@types/ws": "^8.5.12",
"@typescript-eslint/eslint-plugin": "^7.18.0",
Expand All @@ -113,14 +113,14 @@
"eslint-plugin-prettier": "^5.2.1",
"fs-extra": "^11.2.0",
"husky": "^9.1.5",
"lint-staged": "^15.2.9",
"lint-staged": "^15.2.10",
"madge": "^8.0.0",
"msw": "^2.3.5",
"msw": "^2.4.4",
"pinst": "^3.0.0",
"prettier": "^3.3.3",
"standard-version": "^9.5.0",
"ts-node": "^10.9.2",
"typescript": "^5.5.4",
"typescript": "^5.6.2",
"vitest": "^2.0.5"
},
"peerDependencies": {
Expand Down
67 changes: 39 additions & 28 deletions src/services/api.ts
Original file line number Diff line number Diff line change
@@ -1,34 +1,36 @@
import type {
ChainId,
ChainKey,
ChainsRequest,
ChainsResponse,
ConnectionsRequest,
ConnectionsResponse,
ContractCallsQuoteRequest,
ExtendedChain,
GasRecommendationRequest,
GasRecommendationResponse,
GetStatusRequest,
LiFiStep,
QuoteRequest,
RequestOptions,
RoutesRequest,
RoutesResponse,
StatusResponse,
Token,
TokensRequest,
TokensResponse,
ToolsRequest,
ToolsResponse,
TransactionAnalyticsRequest,
TransactionAnalyticsResponse,
import {
isContractCallsRequestWithFromAmount,
isContractCallsRequestWithToAmount,
type ChainId,
type ChainKey,
type ChainsRequest,
type ChainsResponse,
type ConnectionsRequest,
type ConnectionsResponse,
type ContractCallsQuoteRequest,
type ExtendedChain,
type GasRecommendationRequest,
type GasRecommendationResponse,
type GetStatusRequest,
type LiFiStep,
type QuoteRequest,
type RequestOptions,
type RoutesRequest,
type RoutesResponse,
type StatusResponse,
type Token,
type TokensRequest,
type TokensResponse,
type ToolsRequest,
type ToolsResponse,
type TransactionAnalyticsRequest,
type TransactionAnalyticsResponse,
} from '@lifi/types'
import { config } from '../config.js'
import { request } from '../request.js'
import { isRoutesRequest, isStep } from '../typeguards.js'
import { ValidationError } from '../errors/errors.js'
import { SDKError } from '../errors/SDKError.js'
import { request } from '../request.js'
import { isRoutesRequest, isStep } from '../typeguards.js'
/**
* Fetch information about a Token
* @param chain - Id or key of the chain that contains the token
Expand Down Expand Up @@ -139,7 +141,6 @@ export const getContractCallsQuote = async (
'fromAddress',
'toChain',
'toToken',
'toAmount',
'contractCalls',
]
requiredParameters.forEach((requiredParameter) => {
Expand All @@ -151,6 +152,16 @@ export const getContractCallsQuote = async (
)
}
})
if (
!isContractCallsRequestWithFromAmount(params) ||
!isContractCallsRequestWithToAmount(params)
) {
throw new SDKError(
new ValidationError(
`Required parameter "fromAmount" or "toAmount" is missing.`
)
)
}
const _config = config.get()
// apply defaults
// option.order is not used in this endpoint
Expand Down
Loading

0 comments on commit 8d75eb7

Please sign in to comment.