@lifi/sdk 3.8.0-alpha.1 → 3.8.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -5
- package/package.json +6 -6
- package/src/_cjs/core/EVM/EVMStepExecutor.js +3 -1
- package/src/_cjs/core/EVM/EVMStepExecutor.js.map +1 -1
- package/src/_cjs/core/EVM/getAllowance.js +2 -2
- package/src/_cjs/core/EVM/getAllowance.js.map +1 -1
- package/src/_cjs/core/EVM/parseEVMErrors.js +1 -1
- package/src/_cjs/core/EVM/parseEVMErrors.js.map +1 -1
- package/src/_cjs/core/EVM/permits/getNativePermit.js.map +1 -1
- package/src/_cjs/core/EVM/permits/signatureTransfer.js.map +1 -1
- package/src/_cjs/core/EVM/setAllowance.js +2 -2
- package/src/_cjs/core/EVM/setAllowance.js.map +1 -1
- package/src/_cjs/core/EVM/types.js.map +1 -1
- package/src/_cjs/core/Solana/Solana.js +1 -1
- package/src/_cjs/core/Solana/Solana.js.map +1 -1
- package/src/_cjs/core/Solana/SolanaStepExecutor.js.map +1 -1
- package/src/_cjs/core/Solana/parseSolanaErrors.js +1 -1
- package/src/_cjs/core/Solana/parseSolanaErrors.js.map +1 -1
- package/src/_cjs/core/Solana/sendAndConfirmTransaction.js +48 -33
- package/src/_cjs/core/Solana/sendAndConfirmTransaction.js.map +1 -1
- package/src/_cjs/core/Sui/Sui.js +1 -1
- package/src/_cjs/core/Sui/Sui.js.map +1 -1
- package/src/_cjs/core/Sui/SuiStepExecutor.js.map +1 -1
- package/src/_cjs/core/Sui/parseSuiErrors.js +1 -1
- package/src/_cjs/core/Sui/parseSuiErrors.js.map +1 -1
- package/src/_cjs/core/UTXO/UTXO.js +1 -1
- package/src/_cjs/core/UTXO/UTXO.js.map +1 -1
- package/src/_cjs/core/UTXO/UTXOStepExecutor.js +6 -3
- package/src/_cjs/core/UTXO/UTXOStepExecutor.js.map +1 -1
- package/src/_cjs/core/UTXO/getUTXOPublicClient.js +3 -6
- package/src/_cjs/core/UTXO/getUTXOPublicClient.js.map +1 -1
- package/src/_cjs/core/UTXO/parseUTXOErrors.js +1 -1
- package/src/_cjs/core/UTXO/parseUTXOErrors.js.map +1 -1
- package/src/_cjs/core/UTXO/utils.js +13 -0
- package/src/_cjs/core/UTXO/utils.js.map +1 -0
- package/src/_cjs/core/processMessages.js.map +1 -1
- package/src/_cjs/core/waitForTransactionStatus.js.map +1 -1
- package/src/_cjs/errors/httpError.js +9 -10
- package/src/_cjs/errors/httpError.js.map +1 -1
- package/src/_cjs/index.js +44 -44
- package/src/_cjs/index.js.map +1 -1
- package/src/_cjs/request.js +1 -1
- package/src/_cjs/request.js.map +1 -1
- package/src/_cjs/services/api.js +2 -5
- package/src/_cjs/services/api.js.map +1 -1
- package/src/_cjs/utils/convertQuoteToRoute.js +1 -1
- package/src/_cjs/utils/convertQuoteToRoute.js.map +1 -1
- package/src/_cjs/utils/isZeroAddress.js +1 -10
- package/src/_cjs/utils/isZeroAddress.js.map +1 -1
- package/src/_cjs/version.js +1 -1
- package/src/_cjs/version.js.map +1 -1
- package/src/_esm/core/EVM/EVMStepExecutor.js +5 -1
- package/src/_esm/core/EVM/EVMStepExecutor.js.map +1 -1
- package/src/_esm/core/EVM/getAllowance.js +3 -3
- package/src/_esm/core/EVM/getAllowance.js.map +1 -1
- package/src/_esm/core/EVM/parseEVMErrors.js +1 -1
- package/src/_esm/core/EVM/parseEVMErrors.js.map +1 -1
- package/src/_esm/core/EVM/permits/allowanceTransfer.js.map +1 -1
- package/src/_esm/core/EVM/permits/encodePermit2Data.js.map +1 -1
- package/src/_esm/core/EVM/permits/getNativePermit.js.map +1 -1
- package/src/_esm/core/EVM/permits/signatureTransfer.js.map +1 -1
- package/src/_esm/core/EVM/publicClient.js +1 -1
- package/src/_esm/core/EVM/publicClient.js.map +1 -1
- package/src/_esm/core/EVM/setAllowance.js +3 -3
- package/src/_esm/core/EVM/setAllowance.js.map +1 -1
- package/src/_esm/core/EVM/types.js.map +1 -1
- package/src/_esm/core/Solana/KeypairWalletAdapter.js +1 -1
- package/src/_esm/core/Solana/KeypairWalletAdapter.js.map +1 -1
- package/src/_esm/core/Solana/Solana.js +1 -1
- package/src/_esm/core/Solana/Solana.js.map +1 -1
- package/src/_esm/core/Solana/SolanaStepExecutor.js +1 -0
- package/src/_esm/core/Solana/SolanaStepExecutor.js.map +1 -1
- package/src/_esm/core/Solana/parseSolanaErrors.js +1 -1
- package/src/_esm/core/Solana/parseSolanaErrors.js.map +1 -1
- package/src/_esm/core/Solana/sendAndConfirmTransaction.js +53 -33
- package/src/_esm/core/Solana/sendAndConfirmTransaction.js.map +1 -1
- package/src/_esm/core/Sui/Sui.js +1 -1
- package/src/_esm/core/Sui/Sui.js.map +1 -1
- package/src/_esm/core/Sui/SuiStepExecutor.js +1 -0
- package/src/_esm/core/Sui/SuiStepExecutor.js.map +1 -1
- package/src/_esm/core/Sui/parseSuiErrors.js +1 -1
- package/src/_esm/core/Sui/parseSuiErrors.js.map +1 -1
- package/src/_esm/core/UTXO/UTXO.js +1 -1
- package/src/_esm/core/UTXO/UTXO.js.map +1 -1
- package/src/_esm/core/UTXO/UTXOStepExecutor.js +8 -4
- package/src/_esm/core/UTXO/UTXOStepExecutor.js.map +1 -1
- package/src/_esm/core/UTXO/getUTXOPublicClient.js +1 -4
- package/src/_esm/core/UTXO/getUTXOPublicClient.js.map +1 -1
- package/src/_esm/core/UTXO/parseUTXOErrors.js +1 -1
- package/src/_esm/core/UTXO/parseUTXOErrors.js.map +1 -1
- package/src/_esm/core/UTXO/utils.js +10 -0
- package/src/_esm/core/UTXO/utils.js.map +1 -0
- package/src/_esm/core/processMessages.js.map +1 -1
- package/src/_esm/core/waitForTransactionStatus.js.map +1 -1
- package/src/_esm/errors/httpError.js +1 -2
- package/src/_esm/errors/httpError.js.map +1 -1
- package/src/_esm/index.js +15 -15
- package/src/_esm/index.js.map +1 -1
- package/src/_esm/request.js +1 -1
- package/src/_esm/request.js.map +1 -1
- package/src/_esm/services/api.js +2 -5
- package/src/_esm/services/api.js.map +1 -1
- package/src/_esm/utils/convertQuoteToRoute.js +1 -1
- package/src/_esm/utils/convertQuoteToRoute.js.map +1 -1
- package/src/_esm/utils/isZeroAddress.js +0 -9
- package/src/_esm/utils/isZeroAddress.js.map +1 -1
- package/src/_esm/version.js +1 -1
- package/src/_esm/version.js.map +1 -1
- package/src/_types/core/EVM/EVMStepExecutor.d.ts.map +1 -1
- package/src/_types/core/EVM/parseEVMErrors.d.ts.map +1 -1
- package/src/_types/core/EVM/permits/allowanceTransfer.d.ts.map +1 -1
- package/src/_types/core/EVM/permits/encodePermit2Data.d.ts.map +1 -1
- package/src/_types/core/EVM/permits/getNativePermit.d.ts.map +1 -1
- package/src/_types/core/EVM/permits/signatureTransfer.d.ts.map +1 -1
- package/src/_types/core/EVM/types.d.ts +1 -2
- package/src/_types/core/EVM/types.d.ts.map +1 -1
- package/src/_types/core/EVM/waitForBatchTransactionReceipt.d.ts +1 -1
- package/src/_types/core/EVM/waitForBatchTransactionReceipt.d.ts.map +1 -1
- package/src/_types/core/EVM/waitForRelayedTransactionReceipt.d.ts +1 -1
- package/src/_types/core/EVM/waitForRelayedTransactionReceipt.d.ts.map +1 -1
- package/src/_types/core/Solana/KeypairWalletAdapter.d.ts.map +1 -1
- package/src/_types/core/Solana/SolanaStepExecutor.d.ts.map +1 -1
- package/src/_types/core/Solana/parseSolanaErrors.d.ts.map +1 -1
- package/src/_types/core/Solana/sendAndConfirmTransaction.d.ts.map +1 -1
- package/src/_types/core/Sui/SuiStepExecutor.d.ts.map +1 -1
- package/src/_types/core/Sui/parseSuiErrors.d.ts.map +1 -1
- package/src/_types/core/UTXO/UTXO.d.ts.map +1 -1
- package/src/_types/core/UTXO/UTXOStepExecutor.d.ts +1 -1
- package/src/_types/core/UTXO/UTXOStepExecutor.d.ts.map +1 -1
- package/src/_types/core/UTXO/getUTXOPublicClient.d.ts +4 -59
- package/src/_types/core/UTXO/getUTXOPublicClient.d.ts.map +1 -1
- package/src/_types/core/UTXO/parseUTXOErrors.d.ts.map +1 -1
- package/src/_types/core/UTXO/utils.d.ts +3 -0
- package/src/_types/core/UTXO/utils.d.ts.map +1 -0
- package/src/_types/core/processMessages.d.ts +1 -2
- package/src/_types/core/processMessages.d.ts.map +1 -1
- package/src/_types/core/waitForTransactionStatus.d.ts.map +1 -1
- package/src/_types/errors/httpError.d.ts.map +1 -1
- package/src/_types/index.d.ts +21 -21
- package/src/_types/index.d.ts.map +1 -1
- package/src/_types/services/api.d.ts.map +1 -1
- package/src/_types/utils/isZeroAddress.d.ts +0 -1
- package/src/_types/utils/isZeroAddress.d.ts.map +1 -1
- package/src/_types/version.d.ts +1 -1
- package/src/_types/version.d.ts.map +1 -1
- package/src/core/EVM/EVMStepExecutor.ts +5 -1
- package/src/core/EVM/getAllowance.ts +3 -3
- package/src/core/EVM/parseEVMErrors.ts +1 -1
- package/src/core/EVM/permits/allowanceTransfer.ts +1 -1
- package/src/core/EVM/permits/encodePermit2Data.ts +1 -1
- package/src/core/EVM/permits/getNativePermit.ts +1 -2
- package/src/core/EVM/permits/signatureTransfer.ts +1 -1
- package/src/core/EVM/publicClient.ts +1 -1
- package/src/core/EVM/setAllowance.ts +3 -3
- package/src/core/EVM/types.ts +1 -2
- package/src/core/EVM/waitForBatchTransactionReceipt.ts +1 -1
- package/src/core/EVM/waitForRelayedTransactionReceipt.ts +1 -1
- package/src/core/Solana/KeypairWalletAdapter.ts +1 -1
- package/src/core/Solana/Solana.ts +1 -1
- package/src/core/Solana/SolanaStepExecutor.ts +1 -0
- package/src/core/Solana/parseSolanaErrors.ts +1 -1
- package/src/core/Solana/sendAndConfirmTransaction.ts +65 -44
- package/src/core/Sui/Sui.ts +1 -1
- package/src/core/Sui/SuiStepExecutor.ts +2 -1
- package/src/core/Sui/parseSuiErrors.ts +1 -1
- package/src/core/UTXO/UTXO.ts +1 -1
- package/src/core/UTXO/UTXOStepExecutor.ts +11 -5
- package/src/core/UTXO/getUTXOPublicClient.ts +23 -22
- package/src/core/UTXO/parseUTXOErrors.ts +1 -1
- package/src/core/UTXO/utils.ts +10 -0
- package/src/core/processMessages.ts +1 -2
- package/src/core/waitForTransactionStatus.ts +1 -1
- package/src/errors/httpError.ts +1 -2
- package/src/index.ts +46 -40
- package/src/request.ts +1 -1
- package/src/services/api.ts +5 -8
- package/src/utils/convertQuoteToRoute.ts +1 -1
- package/src/utils/isZeroAddress.ts +0 -12
- package/src/version.ts +1 -1
package/src/core/Sui/Sui.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { ChainType } from '@lifi/types'
|
|
2
2
|
import { isValidSuiAddress } from '@mysten/sui/utils'
|
|
3
3
|
import type { StepExecutorOptions } from '../types.js'
|
|
4
|
-
import { SuiStepExecutor } from './SuiStepExecutor.js'
|
|
5
4
|
import { getSuiBalance } from './getSuiBalance.js'
|
|
6
5
|
import { getSuiNSAddress } from './getSuiNSAddress.js'
|
|
6
|
+
import { SuiStepExecutor } from './SuiStepExecutor.js'
|
|
7
7
|
import type { SuiProvider, SuiProviderOptions } from './types.js'
|
|
8
8
|
|
|
9
9
|
export function Sui(options?: SuiProviderOptions): SuiProvider {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
|
-
type WalletWithRequiredFeatures,
|
|
3
2
|
signAndExecuteTransaction,
|
|
3
|
+
type WalletWithRequiredFeatures,
|
|
4
4
|
} from '@mysten/wallet-standard'
|
|
5
5
|
import { config } from '../../config.js'
|
|
6
6
|
import { LiFiErrorCode } from '../../errors/constants.js'
|
|
@@ -65,6 +65,7 @@ export class SuiStepExecutor extends BaseStepExecutor {
|
|
|
65
65
|
|
|
66
66
|
// Create new transaction
|
|
67
67
|
if (!step.transactionRequest) {
|
|
68
|
+
// biome-ignore lint/correctness/noUnusedVariables: destructuring
|
|
68
69
|
const { execution, ...stepBase } = step
|
|
69
70
|
const updatedStep = await getStepTransaction(stepBase)
|
|
70
71
|
const comparedStep = await stepComparison(
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { LiFiStep } from '@lifi/types'
|
|
2
|
-
import { SDKError } from '../../errors/SDKError.js'
|
|
3
2
|
import { BaseError } from '../../errors/baseError.js'
|
|
4
3
|
import { ErrorMessage, LiFiErrorCode } from '../../errors/constants.js'
|
|
5
4
|
import { TransactionError, UnknownError } from '../../errors/errors.js'
|
|
5
|
+
import { SDKError } from '../../errors/SDKError.js'
|
|
6
6
|
import type { Process } from '../types.js'
|
|
7
7
|
|
|
8
8
|
export const parseSuiErrors = async (
|
package/src/core/UTXO/UTXO.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { isUTXOAddress } from '@bigmi/core'
|
|
2
2
|
import { ChainType } from '@lifi/types'
|
|
3
3
|
import type { StepExecutorOptions } from '../types.js'
|
|
4
|
-
import { UTXOStepExecutor } from './UTXOStepExecutor.js'
|
|
5
4
|
import { getUTXOBalance } from './getUTXOBalance.js'
|
|
6
5
|
import type { UTXOProvider, UTXOProviderOptions } from './types.js'
|
|
6
|
+
import { UTXOStepExecutor } from './UTXOStepExecutor.js'
|
|
7
7
|
|
|
8
8
|
export function UTXO(options?: UTXOProviderOptions): UTXOProvider {
|
|
9
9
|
const _options: UTXOProviderOptions = options ?? {}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import { type Client, withTimeout } from '@bigmi/core'
|
|
1
|
+
import type { Client, ReplacementReason } from '@bigmi/core'
|
|
2
|
+
import { signPsbt, waitForTransaction, withTimeout } from '@bigmi/core'
|
|
4
3
|
import { ChainId } from '@lifi/types'
|
|
5
|
-
import {
|
|
4
|
+
import { address, networks, Psbt } from 'bitcoinjs-lib'
|
|
6
5
|
import { config } from '../../config.js'
|
|
7
6
|
import { LiFiErrorCode } from '../../errors/constants.js'
|
|
8
7
|
import { TransactionError } from '../../errors/errors.js'
|
|
@@ -18,6 +17,7 @@ import type {
|
|
|
18
17
|
import { waitForDestinationChainTransaction } from '../waitForDestinationChainTransaction.js'
|
|
19
18
|
import { getUTXOPublicClient } from './getUTXOPublicClient.js'
|
|
20
19
|
import { parseUTXOErrors } from './parseUTXOErrors.js'
|
|
20
|
+
import { isPsbtFinalized } from './utils.js'
|
|
21
21
|
|
|
22
22
|
export interface UTXOStepExecutorOptions extends StepExecutorOptions {
|
|
23
23
|
client: Client
|
|
@@ -82,6 +82,7 @@ export class UTXOStepExecutor extends BaseStepExecutor {
|
|
|
82
82
|
|
|
83
83
|
// Create new transaction
|
|
84
84
|
if (!step.transactionRequest) {
|
|
85
|
+
// biome-ignore lint/correctness/noUnusedVariables: destructuring
|
|
85
86
|
const { execution, ...stepBase } = step
|
|
86
87
|
const updatedStep = await getStepTransaction(stepBase)
|
|
87
88
|
const comparedStep = await stepComparison(
|
|
@@ -183,7 +184,12 @@ export class UTXOStepExecutor extends BaseStepExecutor {
|
|
|
183
184
|
),
|
|
184
185
|
}
|
|
185
186
|
)
|
|
186
|
-
|
|
187
|
+
|
|
188
|
+
const signedPsbt = Psbt.fromHex(signedPsbtHex)
|
|
189
|
+
|
|
190
|
+
if (!isPsbtFinalized(signedPsbt)) {
|
|
191
|
+
signedPsbt.finalizeAllInputs()
|
|
192
|
+
}
|
|
187
193
|
|
|
188
194
|
txHex = signedPsbt.extractTransaction().toHex()
|
|
189
195
|
|
|
@@ -1,11 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
http,
|
|
3
|
-
createClient,
|
|
4
|
-
fallback,
|
|
5
|
-
publicActions,
|
|
6
|
-
rpcSchema,
|
|
7
|
-
walletActions,
|
|
8
|
-
} from '@bigmi/core'
|
|
9
1
|
import type {
|
|
10
2
|
Account,
|
|
11
3
|
Chain,
|
|
@@ -16,30 +8,39 @@ import type {
|
|
|
16
8
|
UTXOSchema,
|
|
17
9
|
WalletActions,
|
|
18
10
|
} from '@bigmi/core'
|
|
19
|
-
import {
|
|
20
|
-
|
|
21
|
-
|
|
11
|
+
import {
|
|
12
|
+
blockchair,
|
|
13
|
+
blockcypher,
|
|
14
|
+
createClient,
|
|
15
|
+
fallback,
|
|
16
|
+
http,
|
|
17
|
+
mempool,
|
|
18
|
+
publicActions,
|
|
19
|
+
rpcSchema,
|
|
20
|
+
walletActions,
|
|
21
|
+
} from '@bigmi/core'
|
|
22
22
|
import { config } from '../../config.js'
|
|
23
23
|
import { getRpcUrls } from '../rpc.js'
|
|
24
24
|
|
|
25
|
+
type PublicClient = Client<
|
|
26
|
+
FallbackTransport<readonly HttpTransport[]>,
|
|
27
|
+
Chain,
|
|
28
|
+
Account | undefined,
|
|
29
|
+
UTXOSchema,
|
|
30
|
+
PublicActions & WalletActions
|
|
31
|
+
>
|
|
32
|
+
|
|
25
33
|
// cached providers
|
|
26
|
-
const publicClients: Record<
|
|
27
|
-
number,
|
|
28
|
-
Client<
|
|
29
|
-
FallbackTransport<readonly HttpTransport[]>,
|
|
30
|
-
Chain,
|
|
31
|
-
Account | undefined,
|
|
32
|
-
UTXOSchema,
|
|
33
|
-
PublicActions & WalletActions
|
|
34
|
-
>
|
|
35
|
-
> = {}
|
|
34
|
+
const publicClients: Record<number, PublicClient> = {}
|
|
36
35
|
|
|
37
36
|
/**
|
|
38
37
|
* Get an instance of a provider for a specific chain
|
|
39
38
|
* @param chainId - Id of the chain the provider is for
|
|
40
39
|
* @returns The public client for the given chain
|
|
41
40
|
*/
|
|
42
|
-
export const getUTXOPublicClient = async (
|
|
41
|
+
export const getUTXOPublicClient = async (
|
|
42
|
+
chainId: number
|
|
43
|
+
): Promise<PublicClient> => {
|
|
43
44
|
if (!publicClients[chainId]) {
|
|
44
45
|
const urls = await getRpcUrls(chainId)
|
|
45
46
|
const fallbackTransports = urls.map((url) =>
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { LiFiStep } from '@lifi/types'
|
|
2
|
-
import { SDKError } from '../../errors/SDKError.js'
|
|
3
2
|
import { BaseError } from '../../errors/baseError.js'
|
|
4
3
|
import { ErrorMessage, LiFiErrorCode } from '../../errors/constants.js'
|
|
5
4
|
import { TransactionError, UnknownError } from '../../errors/errors.js'
|
|
5
|
+
import { SDKError } from '../../errors/SDKError.js'
|
|
6
6
|
import type { Process } from '../types.js'
|
|
7
7
|
|
|
8
8
|
export const parseUTXOErrors = async (
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { StatusMessage, Substatus } from '@lifi/types'
|
|
2
|
-
import type { ProcessStatus } from './types.js'
|
|
3
|
-
import type { ProcessType } from './types.js'
|
|
2
|
+
import type { ProcessStatus, ProcessType } from './types.js'
|
|
4
3
|
|
|
5
4
|
const processMessages: Record<
|
|
6
5
|
ProcessType,
|
|
@@ -2,8 +2,8 @@ import type { FullStatusData, LiFiStep, StatusResponse } from '@lifi/types'
|
|
|
2
2
|
import { ServerError } from '../errors/errors.js'
|
|
3
3
|
import { getStatus } from '../services/api.js'
|
|
4
4
|
import { waitForResult } from '../utils/waitForResult.js'
|
|
5
|
-
import type { StatusManager } from './StatusManager.js'
|
|
6
5
|
import { getSubstatusMessage } from './processMessages.js'
|
|
6
|
+
import type { StatusManager } from './StatusManager.js'
|
|
7
7
|
import type { ProcessType } from './types.js'
|
|
8
8
|
|
|
9
9
|
const TRANSACTION_HASH_OBSERVERS: Record<string, Promise<StatusResponse>> = {}
|
package/src/errors/httpError.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import type { UnavailableRoutes } from '@lifi/types'
|
|
2
2
|
import type { ExtendedRequestInit } from '../types/request.js'
|
|
3
3
|
import { BaseError } from './baseError.js'
|
|
4
|
-
import { LiFiErrorCode } from './constants.js'
|
|
5
|
-
import { ErrorMessage, ErrorName } from './constants.js'
|
|
4
|
+
import { ErrorMessage, ErrorName, LiFiErrorCode } from './constants.js'
|
|
6
5
|
|
|
7
6
|
interface ServerErrorResponseBody {
|
|
8
7
|
code: number
|
package/src/index.ts
CHANGED
|
@@ -2,23 +2,28 @@
|
|
|
2
2
|
// biome-ignore lint/performance/noReExportAll: types
|
|
3
3
|
export * from '@lifi/types'
|
|
4
4
|
export { config } from './config.js'
|
|
5
|
+
export { checkPermitSupport } from './core/EVM/checkPermitSupport.js'
|
|
5
6
|
export { EVM } from './core/EVM/EVM.js'
|
|
6
7
|
export {
|
|
7
8
|
getTokenAllowance,
|
|
8
9
|
getTokenAllowanceMulticall,
|
|
9
10
|
} from './core/EVM/getAllowance.js'
|
|
11
|
+
export { isBatchingSupported } from './core/EVM/isBatchingSupported.js'
|
|
12
|
+
export { getNativePermit } from './core/EVM/permits/getNativePermit.js'
|
|
10
13
|
export {
|
|
11
14
|
revokeTokenApproval,
|
|
12
15
|
setTokenAllowance,
|
|
13
16
|
} from './core/EVM/setAllowance.js'
|
|
14
|
-
export {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
export { checkPermitSupport } from './core/EVM/checkPermitSupport.js'
|
|
19
|
-
export { getNativePermit } from './core/EVM/permits/getNativePermit.js'
|
|
17
|
+
export {
|
|
18
|
+
isGaslessStep,
|
|
19
|
+
isRelayerStep,
|
|
20
|
+
} from './core/EVM/typeguards.js'
|
|
20
21
|
export type { EVMProvider, EVMProviderOptions } from './core/EVM/types.js'
|
|
21
|
-
export {
|
|
22
|
+
export { isEVM } from './core/EVM/types.js'
|
|
23
|
+
export {
|
|
24
|
+
convertExtendedChain,
|
|
25
|
+
isExtendedChain,
|
|
26
|
+
} from './core/EVM/utils.js'
|
|
22
27
|
export {
|
|
23
28
|
executeRoute,
|
|
24
29
|
getActiveRoute,
|
|
@@ -27,6 +32,21 @@ export {
|
|
|
27
32
|
stopRouteExecution,
|
|
28
33
|
updateRouteExecution,
|
|
29
34
|
} from './core/execution.js'
|
|
35
|
+
export { isSVMAddress } from './core/Solana/isSVMAddress.js'
|
|
36
|
+
export {
|
|
37
|
+
KeypairWalletAdapter,
|
|
38
|
+
KeypairWalletName,
|
|
39
|
+
} from './core/Solana/KeypairWalletAdapter.js'
|
|
40
|
+
export { Solana } from './core/Solana/Solana.js'
|
|
41
|
+
export type {
|
|
42
|
+
SolanaProvider,
|
|
43
|
+
SolanaProviderOptions,
|
|
44
|
+
} from './core/Solana/types.js'
|
|
45
|
+
export { isSolana } from './core/Solana/types.js'
|
|
46
|
+
export { StatusManager } from './core/StatusManager.js'
|
|
47
|
+
export { Sui } from './core/Sui/Sui.js'
|
|
48
|
+
export type { SuiProvider, SuiProviderOptions } from './core/Sui/types.js'
|
|
49
|
+
export { isSui } from './core/Sui/types.js'
|
|
30
50
|
export type {
|
|
31
51
|
AcceptExchangeRateUpdateHook,
|
|
32
52
|
AcceptSlippageUpdateHook,
|
|
@@ -54,24 +74,24 @@ export type {
|
|
|
54
74
|
TransactionRequestUpdateHook,
|
|
55
75
|
UpdateRouteHook,
|
|
56
76
|
} from './core/types.js'
|
|
57
|
-
export { isSVMAddress } from './core/Solana/isSVMAddress.js'
|
|
58
|
-
export {
|
|
59
|
-
KeypairWalletAdapter,
|
|
60
|
-
KeypairWalletName,
|
|
61
|
-
} from './core/Solana/KeypairWalletAdapter.js'
|
|
62
|
-
export { Solana } from './core/Solana/Solana.js'
|
|
63
|
-
export { isSolana } from './core/Solana/types.js'
|
|
64
|
-
export type {
|
|
65
|
-
SolanaProvider,
|
|
66
|
-
SolanaProviderOptions,
|
|
67
|
-
} from './core/Solana/types.js'
|
|
68
|
-
export { UTXO } from './core/UTXO/UTXO.js'
|
|
69
|
-
export { isUTXO } from './core/UTXO/types.js'
|
|
70
77
|
export type { UTXOProvider, UTXOProviderOptions } from './core/UTXO/types.js'
|
|
78
|
+
export { isUTXO } from './core/UTXO/types.js'
|
|
79
|
+
export { UTXO } from './core/UTXO/UTXO.js'
|
|
71
80
|
export { createConfig } from './createConfig.js'
|
|
72
|
-
export {
|
|
73
|
-
export {
|
|
74
|
-
export {
|
|
81
|
+
export { BaseError } from './errors/baseError.js'
|
|
82
|
+
export type { ErrorCode } from './errors/constants.js'
|
|
83
|
+
export { ErrorMessage, ErrorName, LiFiErrorCode } from './errors/constants.js'
|
|
84
|
+
export {
|
|
85
|
+
BalanceError,
|
|
86
|
+
ProviderError,
|
|
87
|
+
RPCError,
|
|
88
|
+
ServerError,
|
|
89
|
+
TransactionError,
|
|
90
|
+
UnknownError,
|
|
91
|
+
ValidationError,
|
|
92
|
+
} from './errors/errors.js'
|
|
93
|
+
export { HTTPError } from './errors/httpError.js'
|
|
94
|
+
export { SDKError } from './errors/SDKError.js'
|
|
75
95
|
export {
|
|
76
96
|
getChains,
|
|
77
97
|
getConnections,
|
|
@@ -94,20 +114,6 @@ export {
|
|
|
94
114
|
} from './services/balance.js'
|
|
95
115
|
export { getNameServiceAddress } from './services/getNameServiceAddress.js'
|
|
96
116
|
export type { RPCUrls, SDKBaseConfig, SDKConfig } from './types/internal.js'
|
|
97
|
-
export {
|
|
98
|
-
export {
|
|
99
|
-
export
|
|
100
|
-
export {
|
|
101
|
-
BalanceError,
|
|
102
|
-
ProviderError,
|
|
103
|
-
RPCError,
|
|
104
|
-
ServerError,
|
|
105
|
-
TransactionError,
|
|
106
|
-
UnknownError,
|
|
107
|
-
ValidationError,
|
|
108
|
-
} from './errors/errors.js'
|
|
109
|
-
export { HTTPError } from './errors/httpError.js'
|
|
110
|
-
export { SDKError } from './errors/SDKError.js'
|
|
111
|
-
export { Sui } from './core/Sui/Sui.js'
|
|
112
|
-
export { isSui } from './core/Sui/types.js'
|
|
113
|
-
export type { SuiProvider, SuiProviderOptions } from './core/Sui/types.js'
|
|
117
|
+
export { checkPackageUpdates } from './utils/checkPackageUpdates.js'
|
|
118
|
+
export { convertQuoteToRoute } from './utils/convertQuoteToRoute.js'
|
|
119
|
+
export { fetchTxErrorDetails } from './utils/fetchTxErrorDetails.js'
|
package/src/request.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { config } from './config.js'
|
|
2
|
-
import { SDKError } from './errors/SDKError.js'
|
|
3
2
|
import { ValidationError } from './errors/errors.js'
|
|
4
3
|
import { HTTPError } from './errors/httpError.js'
|
|
4
|
+
import { SDKError } from './errors/SDKError.js'
|
|
5
5
|
import type { ExtendedRequestInit } from './types/request.js'
|
|
6
6
|
import { sleep } from './utils/sleep.js'
|
|
7
7
|
import { version } from './version.js'
|
package/src/services/api.ts
CHANGED
|
@@ -10,15 +10,17 @@ import {
|
|
|
10
10
|
type GasRecommendationRequest,
|
|
11
11
|
type GasRecommendationResponse,
|
|
12
12
|
type GetStatusRequest,
|
|
13
|
+
isContractCallsRequestWithFromAmount,
|
|
14
|
+
isContractCallsRequestWithToAmount,
|
|
13
15
|
type LiFiStep,
|
|
14
16
|
type QuoteRequest,
|
|
17
|
+
type RelayerQuoteResponse,
|
|
15
18
|
type RelayRequest,
|
|
16
19
|
type RelayResponse,
|
|
17
20
|
type RelayResponseData,
|
|
18
21
|
type RelayStatusRequest,
|
|
19
22
|
type RelayStatusResponse,
|
|
20
23
|
type RelayStatusResponseData,
|
|
21
|
-
type RelayerQuoteResponse,
|
|
22
24
|
type RequestOptions,
|
|
23
25
|
type RoutesRequest,
|
|
24
26
|
type RoutesResponse,
|
|
@@ -31,14 +33,12 @@ import {
|
|
|
31
33
|
type ToolsResponse,
|
|
32
34
|
type TransactionAnalyticsRequest,
|
|
33
35
|
type TransactionAnalyticsResponse,
|
|
34
|
-
isContractCallsRequestWithFromAmount,
|
|
35
|
-
isContractCallsRequestWithToAmount,
|
|
36
36
|
} from '@lifi/types'
|
|
37
37
|
import { config } from '../config.js'
|
|
38
|
-
import { SDKError } from '../errors/SDKError.js'
|
|
39
38
|
import { BaseError } from '../errors/baseError.js'
|
|
40
39
|
import { ErrorName } from '../errors/constants.js'
|
|
41
40
|
import { ValidationError } from '../errors/errors.js'
|
|
41
|
+
import { SDKError } from '../errors/SDKError.js'
|
|
42
42
|
import { request } from '../request.js'
|
|
43
43
|
import { isRoutesRequest, isStep } from '../typeguards.js'
|
|
44
44
|
import { withDedupe } from '../utils/withDedupe.js'
|
|
@@ -331,10 +331,7 @@ export const relayTransaction = async (
|
|
|
331
331
|
params: RelayRequest,
|
|
332
332
|
options?: RequestOptions
|
|
333
333
|
): Promise<RelayResponseData> => {
|
|
334
|
-
const requiredParameters: Array<keyof RelayRequest> = [
|
|
335
|
-
'typedData',
|
|
336
|
-
'transactionRequest',
|
|
337
|
-
]
|
|
334
|
+
const requiredParameters: Array<keyof RelayRequest> = ['typedData']
|
|
338
335
|
|
|
339
336
|
for (const requiredParameter of requiredParameters) {
|
|
340
337
|
if (!params[requiredParameter]) {
|
|
@@ -6,15 +6,3 @@ export const isZeroAddress = (address: string): boolean => {
|
|
|
6
6
|
}
|
|
7
7
|
return false
|
|
8
8
|
}
|
|
9
|
-
|
|
10
|
-
export const isNativeTokenAddress = (address: string): boolean => {
|
|
11
|
-
if (
|
|
12
|
-
address === AddressZero ||
|
|
13
|
-
address === AlternativeAddressZero ||
|
|
14
|
-
// CELO native token
|
|
15
|
-
address === '0x471ece3750da237f93b8e339c536989b8978a438'
|
|
16
|
-
) {
|
|
17
|
-
return true
|
|
18
|
-
}
|
|
19
|
-
return false
|
|
20
|
-
}
|
package/src/version.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export const name = '@lifi/sdk'
|
|
2
|
-
export const version = '3.8.0-
|
|
2
|
+
export const version = '3.8.0-beta.1'
|