@shogun-sdk/intents-sdk 1.2.6-test → 1.2.6-test.2
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/dist/esm/chains.js +1 -1
- package/dist/esm/constants.js.map +1 -1
- package/dist/esm/core/evm/cross-chain-limit-order.js +11 -11
- package/dist/esm/core/evm/cross-chain-limit-order.js.map +1 -1
- package/dist/esm/core/evm/intent-helpers.js +1 -1
- package/dist/esm/core/evm/intent-helpers.js.map +1 -1
- package/dist/esm/core/evm/single-chain-dca-order.js +15 -15
- package/dist/esm/core/evm/single-chain-dca-order.js.map +1 -1
- package/dist/esm/core/evm/single-chain-limit-order.js +12 -12
- package/dist/esm/core/evm/single-chain-limit-order.js.map +1 -1
- package/dist/esm/core/evm/types.js +3 -3
- package/dist/esm/core/solana/client.js +1 -1
- package/dist/esm/core/solana/client.js.map +1 -1
- package/dist/esm/core/solana/dca/single-chain-dca-order.js +8 -9
- package/dist/esm/core/solana/dca/single-chain-dca-order.js.map +1 -1
- package/dist/esm/core/solana/dca/single-chain-limit-order.js +9 -10
- package/dist/esm/core/solana/dca/single-chain-limit-order.js.map +1 -1
- package/dist/esm/core/solana/generated/cross-chain/accounts/adminSingleton.js +1 -3
- package/dist/esm/core/solana/generated/cross-chain/accounts/adminSingleton.js.map +1 -1
- package/dist/esm/core/solana/generated/cross-chain/errors/sourceChainGuard.js.map +1 -1
- package/dist/esm/core/solana/generated/cross-chain/instructions/acceptAdmin.js +4 -1
- package/dist/esm/core/solana/generated/cross-chain/instructions/acceptAdmin.js.map +1 -1
- package/dist/esm/core/solana/generated/cross-chain/instructions/cancelDcaOrder.js +5 -4
- package/dist/esm/core/solana/generated/cross-chain/instructions/cancelDcaOrder.js.map +1 -1
- package/dist/esm/core/solana/generated/cross-chain/instructions/cancelOrder.js +4 -1
- package/dist/esm/core/solana/generated/cross-chain/instructions/cancelOrder.js.map +1 -1
- package/dist/esm/core/solana/generated/cross-chain/instructions/claimTokens.js +4 -1
- package/dist/esm/core/solana/generated/cross-chain/instructions/claimTokens.js.map +1 -1
- package/dist/esm/core/solana/generated/cross-chain/instructions/collectProtocolFees.js +5 -4
- package/dist/esm/core/solana/generated/cross-chain/instructions/collectProtocolFees.js.map +1 -1
- package/dist/esm/core/solana/generated/cross-chain/instructions/createDcaOrder.js +2 -4
- package/dist/esm/core/solana/generated/cross-chain/instructions/createDcaOrder.js.map +1 -1
- package/dist/esm/core/solana/generated/cross-chain/instructions/createGuard.js +3 -5
- package/dist/esm/core/solana/generated/cross-chain/instructions/createGuard.js.map +1 -1
- package/dist/esm/core/solana/generated/cross-chain/instructions/createOrder.js +2 -4
- package/dist/esm/core/solana/generated/cross-chain/instructions/createOrder.js.map +1 -1
- package/dist/esm/core/solana/generated/cross-chain/instructions/initialize.js +6 -5
- package/dist/esm/core/solana/generated/cross-chain/instructions/initialize.js.map +1 -1
- package/dist/esm/core/solana/generated/cross-chain/instructions/preStartOrderExecution.js +5 -4
- package/dist/esm/core/solana/generated/cross-chain/instructions/preStartOrderExecution.js.map +1 -1
- package/dist/esm/core/solana/generated/cross-chain/instructions/setAdmin.js +1 -1
- package/dist/esm/core/solana/generated/cross-chain/instructions/setAdmin.js.map +1 -1
- package/dist/esm/core/solana/generated/cross-chain/instructions/setAuctioneerPubKey.js +4 -14
- package/dist/esm/core/solana/generated/cross-chain/instructions/setAuctioneerPubKey.js.map +1 -1
- package/dist/esm/core/solana/generated/cross-chain/instructions/startOrderExecution.js +5 -4
- package/dist/esm/core/solana/generated/cross-chain/instructions/startOrderExecution.js.map +1 -1
- package/dist/esm/core/solana/generated/cross-chain/instructions/startOrderExecutionAfterSwap.js +1 -3
- package/dist/esm/core/solana/generated/cross-chain/instructions/startOrderExecutionAfterSwap.js.map +1 -1
- package/dist/esm/core/solana/generated/cross-chain/programs/sourceChainGuard.js +1 -1
- package/dist/esm/core/solana/generated/cross-chain/programs/sourceChainGuard.js.map +1 -1
- package/dist/esm/core/solana/generated/cross-chain/shared/index.js +2 -2
- package/dist/esm/core/solana/generated/cross-chain/shared/index.js.map +1 -1
- package/dist/esm/core/solana/generated/cross-chain/types/adminUpdateStarted.js.map +1 -1
- package/dist/esm/core/solana/generated/cross-chain/types/dcaExecutionStarted.js.map +1 -1
- package/dist/esm/core/solana/generated/cross-chain/types/dcaTokenInSwapped.js.map +1 -1
- package/dist/esm/core/solana/generated/cross-chain/types/failedDcaIntervalExecution.js.map +1 -1
- package/dist/esm/core/solana/generated/single-chain/accounts/adminSingleton.js +1 -3
- package/dist/esm/core/solana/generated/single-chain/accounts/adminSingleton.js.map +1 -1
- package/dist/esm/core/solana/generated/single-chain/errors/singleChainGuard.js.map +1 -1
- package/dist/esm/core/solana/generated/single-chain/instructions/acceptAdmin.js +4 -1
- package/dist/esm/core/solana/generated/single-chain/instructions/acceptAdmin.js.map +1 -1
- package/dist/esm/core/solana/generated/single-chain/instructions/cancelDcaOrder.js +5 -4
- package/dist/esm/core/solana/generated/single-chain/instructions/cancelDcaOrder.js.map +1 -1
- package/dist/esm/core/solana/generated/single-chain/instructions/cancelLimitOrder.js +5 -4
- package/dist/esm/core/solana/generated/single-chain/instructions/cancelLimitOrder.js.map +1 -1
- package/dist/esm/core/solana/generated/single-chain/instructions/collectProtocolFees.js +5 -4
- package/dist/esm/core/solana/generated/single-chain/instructions/collectProtocolFees.js.map +1 -1
- package/dist/esm/core/solana/generated/single-chain/instructions/createDcaOrder.js +2 -4
- package/dist/esm/core/solana/generated/single-chain/instructions/createDcaOrder.js.map +1 -1
- package/dist/esm/core/solana/generated/single-chain/instructions/createGuard.js +3 -5
- package/dist/esm/core/solana/generated/single-chain/instructions/createGuard.js.map +1 -1
- package/dist/esm/core/solana/generated/single-chain/instructions/createLimitOrder.js +2 -4
- package/dist/esm/core/solana/generated/single-chain/instructions/createLimitOrder.js.map +1 -1
- package/dist/esm/core/solana/generated/single-chain/instructions/fulfillDcaOrderInterval.js +2 -5
- package/dist/esm/core/solana/generated/single-chain/instructions/fulfillDcaOrderInterval.js.map +1 -1
- package/dist/esm/core/solana/generated/single-chain/instructions/fulfillLimitOrder.js +2 -5
- package/dist/esm/core/solana/generated/single-chain/instructions/fulfillLimitOrder.js.map +1 -1
- package/dist/esm/core/solana/generated/single-chain/instructions/initialize.js +6 -5
- package/dist/esm/core/solana/generated/single-chain/instructions/initialize.js.map +1 -1
- package/dist/esm/core/solana/generated/single-chain/instructions/setAdmin.js +1 -1
- package/dist/esm/core/solana/generated/single-chain/instructions/setAdmin.js.map +1 -1
- package/dist/esm/core/solana/generated/single-chain/instructions/setAuctioneerPubKey.js +4 -14
- package/dist/esm/core/solana/generated/single-chain/instructions/setAuctioneerPubKey.js.map +1 -1
- package/dist/esm/core/solana/generated/single-chain/programs/singleChainGuard.js +1 -1
- package/dist/esm/core/solana/generated/single-chain/programs/singleChainGuard.js.map +1 -1
- package/dist/esm/core/solana/generated/single-chain/shared/index.js +2 -2
- package/dist/esm/core/solana/generated/single-chain/shared/index.js.map +1 -1
- package/dist/esm/core/solana/generated/single-chain/types/adminUpdateStarted.js.map +1 -1
- package/dist/esm/core/solana/generated/single-chain/types/dcaOrderFulfilled.js.map +1 -1
- package/dist/esm/core/solana/generated/single-chain/types/limitOrderCreated.js.map +1 -1
- package/dist/esm/core/solana/generated/single-chain/types/limitOrderFulfilled.js.map +1 -1
- package/dist/esm/core/solana/intent-helpers.js +3 -3
- package/dist/esm/core/solana/intent-helpers.js.map +1 -1
- package/dist/esm/core/solana/utils.js +4 -7
- package/dist/esm/core/solana/utils.js.map +1 -1
- package/dist/esm/core/sui/cross-chain-limit-order.js +1 -3
- package/dist/esm/core/sui/cross-chain-limit-order.js.map +1 -1
- package/dist/esm/core/sui/intent-helpers.js.map +1 -1
- package/dist/esm/core/sui/single-chain-dca-order.js +9 -21
- package/dist/esm/core/sui/single-chain-dca-order.js.map +1 -1
- package/dist/esm/core/sui/single-chain-limit-order.js +10 -24
- package/dist/esm/core/sui/single-chain-limit-order.js.map +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/api.js.map +1 -1
- package/dist/esm/utils/generate-execution-details-hash.js +3 -3
- package/dist/esm/utils/generate-execution-details-hash.js.map +1 -1
- package/dist/esm/utils/quote/aggregator.js +71 -52
- package/dist/esm/utils/quote/aggregator.js.map +1 -1
- package/dist/esm/utils/quote/liquidswap.js +34 -9
- package/dist/esm/utils/quote/liquidswap.js.map +1 -1
- package/dist/esm/utils/quote/stablecoins-tokens.js +31 -9
- package/dist/esm/utils/quote/stablecoins-tokens.js.map +1 -1
- package/dist/types/constants.d.ts.map +1 -1
- package/dist/types/core/evm/cross-chain-limit-order.d.ts +1 -1
- package/dist/types/core/evm/intent-helpers.d.ts.map +1 -1
- package/dist/types/core/evm/single-chain-dca-order.d.ts +2 -2
- package/dist/types/core/evm/single-chain-limit-order.d.ts +2 -2
- package/dist/types/core/evm/types.d.ts +1 -1
- package/dist/types/core/solana/dca/single-chain-dca-order.d.ts +2 -2
- package/dist/types/core/solana/dca/single-chain-dca-order.d.ts.map +1 -1
- package/dist/types/core/solana/dca/single-chain-limit-order.d.ts +1 -1
- package/dist/types/core/solana/dca/single-chain-limit-order.d.ts.map +1 -1
- package/dist/types/core/solana/generated/cross-chain/accounts/adminSingleton.d.ts.map +1 -1
- package/dist/types/core/solana/generated/cross-chain/errors/sourceChainGuard.d.ts.map +1 -1
- package/dist/types/core/solana/generated/cross-chain/instructions/acceptAdmin.d.ts.map +1 -1
- package/dist/types/core/solana/generated/cross-chain/instructions/cancelDcaOrder.d.ts.map +1 -1
- package/dist/types/core/solana/generated/cross-chain/instructions/cancelOrder.d.ts.map +1 -1
- package/dist/types/core/solana/generated/cross-chain/instructions/claimTokens.d.ts.map +1 -1
- package/dist/types/core/solana/generated/cross-chain/instructions/collectProtocolFees.d.ts.map +1 -1
- package/dist/types/core/solana/generated/cross-chain/instructions/createDcaOrder.d.ts.map +1 -1
- package/dist/types/core/solana/generated/cross-chain/instructions/createGuard.d.ts.map +1 -1
- package/dist/types/core/solana/generated/cross-chain/instructions/createOrder.d.ts.map +1 -1
- package/dist/types/core/solana/generated/cross-chain/instructions/initialize.d.ts.map +1 -1
- package/dist/types/core/solana/generated/cross-chain/instructions/preStartOrderExecution.d.ts.map +1 -1
- package/dist/types/core/solana/generated/cross-chain/instructions/setAdmin.d.ts.map +1 -1
- package/dist/types/core/solana/generated/cross-chain/instructions/setAuctioneerPubKey.d.ts.map +1 -1
- package/dist/types/core/solana/generated/cross-chain/instructions/startOrderExecution.d.ts.map +1 -1
- package/dist/types/core/solana/generated/cross-chain/instructions/startOrderExecutionAfterSwap.d.ts.map +1 -1
- package/dist/types/core/solana/generated/cross-chain/programs/sourceChainGuard.d.ts.map +1 -1
- package/dist/types/core/solana/generated/cross-chain/shared/index.d.ts.map +1 -1
- package/dist/types/core/solana/generated/cross-chain/types/adminUpdateStarted.d.ts.map +1 -1
- package/dist/types/core/solana/generated/cross-chain/types/dcaExecutionStarted.d.ts.map +1 -1
- package/dist/types/core/solana/generated/cross-chain/types/dcaTokenInSwapped.d.ts.map +1 -1
- package/dist/types/core/solana/generated/cross-chain/types/failedDcaIntervalExecution.d.ts.map +1 -1
- package/dist/types/core/solana/generated/single-chain/accounts/adminSingleton.d.ts.map +1 -1
- package/dist/types/core/solana/generated/single-chain/errors/singleChainGuard.d.ts.map +1 -1
- package/dist/types/core/solana/generated/single-chain/instructions/acceptAdmin.d.ts.map +1 -1
- package/dist/types/core/solana/generated/single-chain/instructions/cancelDcaOrder.d.ts.map +1 -1
- package/dist/types/core/solana/generated/single-chain/instructions/cancelLimitOrder.d.ts.map +1 -1
- package/dist/types/core/solana/generated/single-chain/instructions/collectProtocolFees.d.ts.map +1 -1
- package/dist/types/core/solana/generated/single-chain/instructions/createDcaOrder.d.ts.map +1 -1
- package/dist/types/core/solana/generated/single-chain/instructions/createGuard.d.ts.map +1 -1
- package/dist/types/core/solana/generated/single-chain/instructions/createLimitOrder.d.ts.map +1 -1
- package/dist/types/core/solana/generated/single-chain/instructions/fulfillDcaOrderInterval.d.ts.map +1 -1
- package/dist/types/core/solana/generated/single-chain/instructions/fulfillLimitOrder.d.ts.map +1 -1
- package/dist/types/core/solana/generated/single-chain/instructions/initialize.d.ts.map +1 -1
- package/dist/types/core/solana/generated/single-chain/instructions/setAdmin.d.ts.map +1 -1
- package/dist/types/core/solana/generated/single-chain/instructions/setAuctioneerPubKey.d.ts.map +1 -1
- package/dist/types/core/solana/generated/single-chain/programs/singleChainGuard.d.ts.map +1 -1
- package/dist/types/core/solana/generated/single-chain/shared/index.d.ts.map +1 -1
- package/dist/types/core/solana/generated/single-chain/types/adminUpdateStarted.d.ts.map +1 -1
- package/dist/types/core/solana/generated/single-chain/types/dcaOrderFulfilled.d.ts.map +1 -1
- package/dist/types/core/solana/generated/single-chain/types/limitOrderCreated.d.ts.map +1 -1
- package/dist/types/core/solana/generated/single-chain/types/limitOrderFulfilled.d.ts.map +1 -1
- package/dist/types/core/solana/intent-helpers.d.ts.map +1 -1
- package/dist/types/core/solana/utils.d.ts.map +1 -1
- package/dist/types/core/sui/cross-chain-limit-order.d.ts.map +1 -1
- package/dist/types/core/sui/intent-helpers.d.ts.map +1 -1
- package/dist/types/core/sui/single-chain-dca-order.d.ts.map +1 -1
- package/dist/types/core/sui/single-chain-limit-order.d.ts.map +1 -1
- package/dist/types/index.d.ts +2 -2
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/types/api.d.ts +10 -1
- package/dist/types/types/api.d.ts.map +1 -1
- package/dist/types/types/intent.d.ts.map +1 -1
- package/dist/types/utils/generate-execution-details-hash.d.ts +1 -1
- package/dist/types/utils/generate-execution-details-hash.d.ts.map +1 -1
- package/dist/types/utils/quote/aggregator.d.ts +0 -2
- package/dist/types/utils/quote/aggregator.d.ts.map +1 -1
- package/dist/types/utils/quote/liquidswap.d.ts +4 -2
- package/dist/types/utils/quote/liquidswap.d.ts.map +1 -1
- package/dist/types/utils/quote/stablecoins-tokens.d.ts +4 -1
- package/dist/types/utils/quote/stablecoins-tokens.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/chains.ts +2 -2
- package/src/constants.ts +5 -5
- package/src/core/evm/cross-chain-limit-order.ts +14 -14
- package/src/core/evm/intent-helpers.ts +14 -8
- package/src/core/evm/single-chain-dca-order.ts +18 -18
- package/src/core/evm/single-chain-limit-order.ts +15 -15
- package/src/core/evm/types.ts +4 -4
- package/src/core/solana/client.ts +1 -1
- package/src/core/solana/dca/single-chain-dca-order.ts +18 -21
- package/src/core/solana/dca/single-chain-limit-order.ts +19 -22
- package/src/core/solana/generated/cross-chain/accounts/adminSingleton.ts +9 -11
- package/src/core/solana/generated/cross-chain/accounts/dcaOrder.ts +8 -8
- package/src/core/solana/generated/cross-chain/accounts/guard.ts +8 -8
- package/src/core/solana/generated/cross-chain/accounts/order.ts +8 -8
- package/src/core/solana/generated/cross-chain/errors/sourceChainGuard.ts +2 -7
- package/src/core/solana/generated/cross-chain/instructions/acceptAdmin.ts +10 -20
- package/src/core/solana/generated/cross-chain/instructions/cancelDcaOrder.ts +13 -31
- package/src/core/solana/generated/cross-chain/instructions/cancelOrder.ts +8 -16
- package/src/core/solana/generated/cross-chain/instructions/claimTokens.ts +9 -19
- package/src/core/solana/generated/cross-chain/instructions/collectProtocolFees.ts +10 -19
- package/src/core/solana/generated/cross-chain/instructions/createDcaOrder.ts +14 -36
- package/src/core/solana/generated/cross-chain/instructions/createGuard.ts +12 -33
- package/src/core/solana/generated/cross-chain/instructions/createOrder.ts +12 -30
- package/src/core/solana/generated/cross-chain/instructions/initialize.ts +14 -29
- package/src/core/solana/generated/cross-chain/instructions/preStartOrderExecution.ts +11 -21
- package/src/core/solana/generated/cross-chain/instructions/setAdmin.ts +8 -23
- package/src/core/solana/generated/cross-chain/instructions/setAuctioneerPubKey.ts +16 -64
- package/src/core/solana/generated/cross-chain/instructions/startOrderExecution.ts +9 -18
- package/src/core/solana/generated/cross-chain/instructions/startOrderExecutionAfterSwap.ts +8 -16
- package/src/core/solana/generated/cross-chain/programs/sourceChainGuard.ts +40 -83
- package/src/core/solana/generated/cross-chain/shared/index.ts +7 -16
- package/src/core/solana/generated/cross-chain/types/adminUpdateStarted.ts +1 -4
- package/src/core/solana/generated/cross-chain/types/dcaExecutionStarted.ts +1 -4
- package/src/core/solana/generated/cross-chain/types/dcaTokenInSwapped.ts +1 -4
- package/src/core/solana/generated/cross-chain/types/failedDcaIntervalExecution.ts +1 -4
- package/src/core/solana/generated/single-chain/accounts/adminSingleton.ts +9 -11
- package/src/core/solana/generated/single-chain/accounts/dcaOrder.ts +8 -8
- package/src/core/solana/generated/single-chain/accounts/guard.ts +8 -8
- package/src/core/solana/generated/single-chain/accounts/limitOrder.ts +8 -8
- package/src/core/solana/generated/single-chain/errors/singleChainGuard.ts +2 -7
- package/src/core/solana/generated/single-chain/instructions/acceptAdmin.ts +10 -20
- package/src/core/solana/generated/single-chain/instructions/cancelDcaOrder.ts +11 -25
- package/src/core/solana/generated/single-chain/instructions/cancelLimitOrder.ts +11 -25
- package/src/core/solana/generated/single-chain/instructions/collectProtocolFees.ts +12 -25
- package/src/core/solana/generated/single-chain/instructions/createDcaOrder.ts +14 -36
- package/src/core/solana/generated/single-chain/instructions/createGuard.ts +15 -42
- package/src/core/solana/generated/single-chain/instructions/createLimitOrder.ts +14 -36
- package/src/core/solana/generated/single-chain/instructions/fulfillDcaOrderInterval.ts +15 -38
- package/src/core/solana/generated/single-chain/instructions/fulfillLimitOrder.ts +15 -41
- package/src/core/solana/generated/single-chain/instructions/initialize.ts +14 -29
- package/src/core/solana/generated/single-chain/instructions/setAdmin.ts +8 -23
- package/src/core/solana/generated/single-chain/instructions/setAuctioneerPubKey.ts +16 -64
- package/src/core/solana/generated/single-chain/programs/singleChainGuard.ts +36 -75
- package/src/core/solana/generated/single-chain/shared/index.ts +7 -16
- package/src/core/solana/generated/single-chain/types/adminUpdateStarted.ts +1 -4
- package/src/core/solana/generated/single-chain/types/dcaOrderFulfilled.ts +1 -4
- package/src/core/solana/generated/single-chain/types/limitOrderCreated.ts +1 -4
- package/src/core/solana/generated/single-chain/types/limitOrderFulfilled.ts +1 -4
- package/src/core/solana/intent-helpers.ts +20 -16
- package/src/core/solana/sdk.ts +1 -1
- package/src/core/solana/utils.ts +16 -19
- package/src/core/sui/cross-chain-limit-order.ts +1 -4
- package/src/core/sui/intent-helpers.ts +16 -25
- package/src/core/sui/order-transaction.ts +1 -1
- package/src/core/sui/single-chain-dca-order.ts +18 -31
- package/src/core/sui/single-chain-limit-order.ts +18 -33
- package/src/index.ts +2 -2
- package/src/types/api.ts +10 -1
- package/src/types/intent.ts +4 -2
- package/src/utils/generate-execution-details-hash.ts +25 -23
- package/src/utils/quote/aggregator.ts +92 -71
- package/src/utils/quote/liquidswap.ts +42 -13
- package/src/utils/quote/stablecoins-tokens.ts +31 -9
- package/dist/esm/core/evm/permit2-signature-transfer.js +0 -15
- package/dist/esm/core/evm/permit2-signature-transfer.js.map +0 -1
- package/dist/types/core/evm/permit2-signature-transfer.d.ts +0 -3
- package/dist/types/core/evm/permit2-signature-transfer.d.ts.map +0 -1
- package/src/core/evm/permit2-signature-transfer.ts +0 -15
|
@@ -2,7 +2,7 @@ import { ChainID, isEvmChain, type SupportedEvmChain } from '../../chains.js';
|
|
|
2
2
|
import { JupiterQuoteProvider } from './jupiter.js';
|
|
3
3
|
import { type QuoteResponse as JupiterQuoteResponse } from '@jup-ag/api';
|
|
4
4
|
import { ParaswapQuoteProvider, type SwapEstimateResult } from './paraswap.js';
|
|
5
|
-
import {
|
|
5
|
+
import { CROSS_CHAIN_STABLES } from './stablecoins-tokens.js';
|
|
6
6
|
import { AftermathQuoteProvider } from './aftermath.js';
|
|
7
7
|
import type { RouterCompleteTradeRoute } from 'aftermath-ts-sdk';
|
|
8
8
|
import { LiquidSwapQuoteProvider, type LiquidSwapQuoteResponse } from './liquidswap.js';
|
|
@@ -52,38 +52,32 @@ export type IntentsQuoteParams = {
|
|
|
52
52
|
};
|
|
53
53
|
|
|
54
54
|
export type QuoteResponseInternal = {
|
|
55
|
-
amountInUsd: number
|
|
56
|
-
estimatedAmountInAsMinStablecoinAmount: bigint
|
|
55
|
+
amountInUsd: number;
|
|
56
|
+
estimatedAmountInAsMinStablecoinAmount: bigint;
|
|
57
57
|
|
|
58
|
-
estimatedAmountOut: bigint
|
|
59
|
-
estimatedAmountOutUsd: number
|
|
58
|
+
estimatedAmountOut: bigint;
|
|
59
|
+
estimatedAmountOutUsd: number;
|
|
60
60
|
|
|
61
|
-
estimatedAmountOutReduced: bigint
|
|
62
|
-
estimatedAmountOutUsdReduced: number
|
|
63
|
-
}
|
|
61
|
+
estimatedAmountOutReduced: bigint;
|
|
62
|
+
estimatedAmountOutUsdReduced: number;
|
|
63
|
+
};
|
|
64
64
|
|
|
65
65
|
// Public response with metadata and derived fields
|
|
66
66
|
export type QuoteResponse = QuoteResponseInternal & {
|
|
67
|
-
|
|
68
|
-
|
|
69
67
|
/** Metadata for source token */
|
|
70
68
|
tokenIn: {
|
|
71
|
-
address: string
|
|
72
|
-
chainId: ChainID
|
|
73
|
-
}
|
|
69
|
+
address: string;
|
|
70
|
+
chainId: ChainID;
|
|
71
|
+
};
|
|
74
72
|
|
|
75
73
|
/** Metadata for destination token */
|
|
76
74
|
tokenOut: {
|
|
77
|
-
address: string
|
|
78
|
-
chainId: ChainID
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
|
|
75
|
+
address: string;
|
|
76
|
+
chainId: ChainID;
|
|
77
|
+
};
|
|
78
|
+
};
|
|
82
79
|
|
|
83
80
|
export class QuoteProvider {
|
|
84
|
-
private static readonly DEFAULT_BRIDGE_TOKEN = 'USDC';
|
|
85
|
-
private static readonly DEFAULT_BRIDGE_TOKEN_DECIMALS = 6;
|
|
86
|
-
|
|
87
81
|
public static async getQuote(params: IntentsQuoteParams): Promise<QuoteResponse> {
|
|
88
82
|
try {
|
|
89
83
|
const quote = await this.getQuoteFromRouters(params);
|
|
@@ -92,12 +86,12 @@ export class QuoteProvider {
|
|
|
92
86
|
...quote,
|
|
93
87
|
tokenIn: {
|
|
94
88
|
address: params.tokenIn,
|
|
95
|
-
chainId: params.sourceChainId
|
|
89
|
+
chainId: params.sourceChainId,
|
|
96
90
|
},
|
|
97
91
|
tokenOut: {
|
|
98
92
|
address: params.tokenOut,
|
|
99
|
-
chainId: params.destChainId
|
|
100
|
-
}
|
|
93
|
+
chainId: params.destChainId,
|
|
94
|
+
},
|
|
101
95
|
};
|
|
102
96
|
} catch (e) {
|
|
103
97
|
console.error('Error getting quote from routers:', e);
|
|
@@ -130,37 +124,38 @@ export class QuoteProvider {
|
|
|
130
124
|
}
|
|
131
125
|
|
|
132
126
|
private static async getQuoteFromRouters(params: IntentsQuoteParams): Promise<QuoteResponseInternal> {
|
|
133
|
-
const
|
|
134
|
-
|
|
135
|
-
const sourceBridgeToken = CROSS_CHAIN_TOKENS[bridgeTokenSymbol]?.[params.sourceChainId] || '';
|
|
136
|
-
const destBridgeToken = CROSS_CHAIN_TOKENS[bridgeTokenSymbol]?.[params.destChainId] || '';
|
|
127
|
+
const sourceStable = getStableForChain(params.sourceChainId);
|
|
128
|
+
const destStable = getStableForChain(params.destChainId);
|
|
137
129
|
|
|
130
|
+
// Step 1: Get quote from tokenIn → bridge stable on source chain ---
|
|
138
131
|
const sourceSingleChainQuoteParams: SingleChainQuoteParams = {
|
|
139
132
|
chainId: params.sourceChainId,
|
|
140
133
|
amount: params.amount,
|
|
141
134
|
tokenIn: params.tokenIn,
|
|
142
|
-
tokenOut:
|
|
135
|
+
tokenOut: sourceStable.address,
|
|
143
136
|
};
|
|
144
137
|
|
|
145
138
|
const sourceQuote = await this.getSingleChainQuote(sourceSingleChainQuoteParams);
|
|
146
139
|
|
|
140
|
+
// Step 2: Normalize stable amount between source and destination ---
|
|
141
|
+
// Adjust for decimal difference between stables (e.g. 6 → 18)
|
|
142
|
+
const normalizedBridgeAmount = BigInt(
|
|
143
|
+
Math.floor((Number(sourceQuote.amountOut) / 10 ** sourceStable.decimals) * 10 ** destStable.decimals),
|
|
144
|
+
);
|
|
145
|
+
|
|
146
|
+
// Step 3: Get quote from dest bridge stable → target token ---
|
|
147
147
|
const destSingleChainQuoteParams: SingleChainQuoteParams = {
|
|
148
148
|
chainId: params.destChainId,
|
|
149
|
-
amount:
|
|
150
|
-
tokenIn:
|
|
149
|
+
amount: normalizedBridgeAmount,
|
|
150
|
+
tokenIn: destStable.address,
|
|
151
151
|
tokenOut: params.tokenOut,
|
|
152
152
|
};
|
|
153
153
|
|
|
154
154
|
const destQuote = await this.getSingleChainQuote(destSingleChainQuoteParams);
|
|
155
155
|
|
|
156
|
-
//
|
|
157
|
-
// const weightedReductionFactor = this.calculateWeightedReductionFactorForUsd(destQuote.amountOutUsd);
|
|
158
|
-
// const weightedReductionFactor = 0.999;
|
|
159
|
-
|
|
160
|
-
const estimatedAmountOutUsdReduced = destQuote.amountOutUsd;
|
|
161
|
-
|
|
156
|
+
// -Step 4: Compute stable min-amount with correct decimals ---
|
|
162
157
|
const estimatedAmountInAsMinStablecoinAmount = BigInt(
|
|
163
|
-
Math.floor(sourceQuote.amountInUsd * 10 **
|
|
158
|
+
Math.floor(sourceQuote.amountInUsd * 10 ** sourceStable.decimals),
|
|
164
159
|
);
|
|
165
160
|
|
|
166
161
|
return {
|
|
@@ -169,16 +164,23 @@ export class QuoteProvider {
|
|
|
169
164
|
amountInUsd: sourceQuote.amountInUsd,
|
|
170
165
|
estimatedAmountInAsMinStablecoinAmount,
|
|
171
166
|
estimatedAmountOutReduced: destQuote.amountOutMin || destQuote.amountOut,
|
|
172
|
-
estimatedAmountOutUsdReduced,
|
|
167
|
+
estimatedAmountOutUsdReduced: destQuote.amountOutUsd,
|
|
173
168
|
};
|
|
174
169
|
}
|
|
175
170
|
|
|
176
171
|
public static async getSingleChainQuote(params: SingleChainQuoteParams): Promise<Quote> {
|
|
172
|
+
// Handle same-token case (self-swap)
|
|
177
173
|
if (compareAddresses(params.tokenIn, params.tokenOut)) {
|
|
178
174
|
let amountUsd = 0;
|
|
179
175
|
|
|
180
|
-
|
|
181
|
-
|
|
176
|
+
// Pick correct stable for this chain
|
|
177
|
+
const stable = getStableForChain(params.chainId);
|
|
178
|
+
const stableAddress = stable.address;
|
|
179
|
+
const stableDecimals = stable.decimals;
|
|
180
|
+
|
|
181
|
+
// If it's the chain's stable token, derive USD value correctly
|
|
182
|
+
if (compareAddresses(params.tokenIn, stableAddress)) {
|
|
183
|
+
amountUsd = Number(params.amount) / 10 ** stableDecimals;
|
|
182
184
|
}
|
|
183
185
|
|
|
184
186
|
return {
|
|
@@ -193,13 +195,14 @@ export class QuoteProvider {
|
|
|
193
195
|
};
|
|
194
196
|
}
|
|
195
197
|
|
|
198
|
+
// Hyperliquid
|
|
196
199
|
if (params.chainId === ChainID.Hyperliquid) {
|
|
197
200
|
const liquidSwapQuote = await QuoteProvider.getLiquidSwapQuote(params);
|
|
198
201
|
return QuoteProvider.transformLiquidSwapQuote(liquidSwapQuote);
|
|
199
202
|
}
|
|
200
203
|
|
|
204
|
+
// Solana (Jupiter / Raydium / Pumpfun)
|
|
201
205
|
if (params.chainId === ChainID.Solana) {
|
|
202
|
-
// Check if provider is explicitly specified
|
|
203
206
|
if (params.provider === 'jupiter') {
|
|
204
207
|
const jupiterQuote = await QuoteProvider.getJupiterQuote(params);
|
|
205
208
|
return QuoteProvider.transformJupiterQuote(jupiterQuote);
|
|
@@ -210,18 +213,12 @@ export class QuoteProvider {
|
|
|
210
213
|
const pumpfunQuote = await QuoteProvider.getPumpFunQuote(params);
|
|
211
214
|
return pumpfunQuote;
|
|
212
215
|
} else {
|
|
213
|
-
// Default: Try Jupiter first, fallback to Raydium and Pump if it fails
|
|
214
216
|
try {
|
|
215
217
|
const jupiterQuote = await QuoteProvider.getJupiterQuote(params);
|
|
216
|
-
if (!jupiterQuote.quote)
|
|
217
|
-
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
const transformedQuote = QuoteProvider.transformJupiterQuote(jupiterQuote);
|
|
221
|
-
return transformedQuote;
|
|
218
|
+
if (!jupiterQuote.quote) throw new Error('Jupiter quote failed');
|
|
219
|
+
return QuoteProvider.transformJupiterQuote(jupiterQuote);
|
|
222
220
|
} catch (error) {
|
|
223
221
|
console.warn('Jupiter quote failed, falling back to Raydium:', error);
|
|
224
|
-
// Try Raydium first, then Pumpfun
|
|
225
222
|
try {
|
|
226
223
|
const raydiumQuote = await QuoteProvider.getRaydiumQuote(params);
|
|
227
224
|
return raydiumQuote;
|
|
@@ -233,11 +230,13 @@ export class QuoteProvider {
|
|
|
233
230
|
}
|
|
234
231
|
}
|
|
235
232
|
|
|
233
|
+
// Sui (Aftermath)
|
|
236
234
|
if (params.chainId === ChainID.Sui) {
|
|
237
235
|
const quote = await QuoteProvider.getAftermathQuote(params);
|
|
238
236
|
return QuoteProvider.transformAftermathQuote({ quote, request: params });
|
|
239
237
|
}
|
|
240
238
|
|
|
239
|
+
// EVM chains (Paraswap)
|
|
241
240
|
if (isEvmChain(params.chainId)) {
|
|
242
241
|
const paraswapQuote = await QuoteProvider.getParaswapQuote(params);
|
|
243
242
|
return QuoteProvider.transformParaswapQuote(paraswapQuote);
|
|
@@ -248,8 +247,8 @@ export class QuoteProvider {
|
|
|
248
247
|
|
|
249
248
|
static transformLiquidSwapQuote(liquidSwapQuote: LiquidSwapQuoteResponse): Quote {
|
|
250
249
|
return {
|
|
251
|
-
amountIn:
|
|
252
|
-
amountOut:
|
|
250
|
+
amountIn: liquidSwapQuote.execution.details.amountIn,
|
|
251
|
+
amountOut: liquidSwapQuote.execution.details.amountOut,
|
|
253
252
|
amountOutUsd: 0,
|
|
254
253
|
amountInUsd: 0,
|
|
255
254
|
slippage: 0,
|
|
@@ -283,7 +282,7 @@ export class QuoteProvider {
|
|
|
283
282
|
return liquidSwapQuoter.getQuote({
|
|
284
283
|
tokenIn: params.tokenIn,
|
|
285
284
|
tokenOut: params.tokenOut,
|
|
286
|
-
amountIn: params.amount
|
|
285
|
+
amountIn: params.amount,
|
|
287
286
|
});
|
|
288
287
|
}
|
|
289
288
|
|
|
@@ -357,14 +356,18 @@ export class QuoteProvider {
|
|
|
357
356
|
quote: RouterCompleteTradeRoute;
|
|
358
357
|
request: SingleChainQuoteParams;
|
|
359
358
|
}): Quote {
|
|
360
|
-
|
|
359
|
+
const chainId = request.chainId;
|
|
360
|
+
const stable = getStableForChain(chainId);
|
|
361
|
+
const stableAddress = stable.address;
|
|
362
|
+
const stableDecimals = stable.decimals;
|
|
361
363
|
|
|
362
|
-
|
|
363
|
-
amountUsd = Number(quote.coinIn.amount) / 10 ** this.DEFAULT_BRIDGE_TOKEN_DECIMALS;
|
|
364
|
-
}
|
|
364
|
+
let amountUsd = 0;
|
|
365
365
|
|
|
366
|
-
if
|
|
367
|
-
|
|
366
|
+
// Determine if input or output token is the stablecoin
|
|
367
|
+
if (compareAddresses(request.tokenIn, stableAddress)) {
|
|
368
|
+
amountUsd = Number(quote.coinIn.amount) / 10 ** stableDecimals;
|
|
369
|
+
} else if (compareAddresses(request.tokenOut, stableAddress)) {
|
|
370
|
+
amountUsd = Number(quote.coinOut.amount) / 10 ** stableDecimals;
|
|
368
371
|
}
|
|
369
372
|
|
|
370
373
|
return {
|
|
@@ -397,15 +400,19 @@ export class QuoteProvider {
|
|
|
397
400
|
const amountOut = Number(quote.outAmount);
|
|
398
401
|
const amountOutMin = Number(quote.otherAmountThreshold);
|
|
399
402
|
|
|
403
|
+
const chainId = ChainID.Solana; // Jupiter runs only on Solana
|
|
404
|
+
const stable = getStableForChain(chainId);
|
|
405
|
+
const stableAddress = stable.address;
|
|
406
|
+
const stableDecimals = stable.decimals;
|
|
407
|
+
|
|
400
408
|
let amountUsd = 0;
|
|
401
409
|
const priceImpact = quote.priceImpactPct ? Number(quote.priceImpactPct) * 100 : 0;
|
|
402
410
|
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
amountUsd = amountIn / 10 ** this.DEFAULT_BRIDGE_TOKEN_DECIMALS;
|
|
411
|
+
// Use stable decimals dynamically for USD conversions
|
|
412
|
+
if (compareAddresses(quote.outputMint, stableAddress)) {
|
|
413
|
+
amountUsd = amountOut / 10 ** stableDecimals;
|
|
414
|
+
} else if (compareAddresses(quote.inputMint, stableAddress)) {
|
|
415
|
+
amountUsd = amountIn / 10 ** stableDecimals;
|
|
409
416
|
}
|
|
410
417
|
|
|
411
418
|
return {
|
|
@@ -425,15 +432,19 @@ export class QuoteProvider {
|
|
|
425
432
|
const amountIn = BigInt(raydiumQuote.data.inAmount);
|
|
426
433
|
const amountOut = BigInt(raydiumQuote.data.outAmount);
|
|
427
434
|
|
|
435
|
+
const chainId = ChainID.Solana; // Raydium runs on Solana
|
|
436
|
+
const stable = getStableForChain(chainId);
|
|
437
|
+
const stableAddress = stable.address;
|
|
438
|
+
const stableDecimals = stable.decimals;
|
|
439
|
+
|
|
428
440
|
let amountUsd = 0;
|
|
429
441
|
const priceImpact = Number(raydiumQuote.data.priceImpactPct) * 100;
|
|
430
442
|
|
|
431
|
-
if (
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
amountUsd = Number(amountIn) / 10 ** this.DEFAULT_BRIDGE_TOKEN_DECIMALS;
|
|
443
|
+
// Determine if the input or output is the stablecoin (USDC/USDT)
|
|
444
|
+
if (compareAddresses(raydiumQuote.data.outputMint, stableAddress)) {
|
|
445
|
+
amountUsd = Number(amountOut) / 10 ** stableDecimals;
|
|
446
|
+
} else if (compareAddresses(raydiumQuote.data.inputMint, stableAddress)) {
|
|
447
|
+
amountUsd = Number(amountIn) / 10 ** stableDecimals;
|
|
437
448
|
}
|
|
438
449
|
|
|
439
450
|
return {
|
|
@@ -449,6 +460,16 @@ export class QuoteProvider {
|
|
|
449
460
|
}
|
|
450
461
|
}
|
|
451
462
|
|
|
463
|
+
function getStableForChain(chainId: ChainID) {
|
|
464
|
+
// Prefer USDC if available, else USDT
|
|
465
|
+
if (CROSS_CHAIN_STABLES.USDC?.[chainId]) {
|
|
466
|
+
return { symbol: 'USDC', ...CROSS_CHAIN_STABLES.USDC[chainId] };
|
|
467
|
+
}
|
|
468
|
+
if (CROSS_CHAIN_STABLES.USDT?.[chainId]) {
|
|
469
|
+
return { symbol: 'USDT', ...CROSS_CHAIN_STABLES.USDT[chainId] };
|
|
470
|
+
}
|
|
471
|
+
throw new Error(`No stablecoin found for chain ${chainId}`);
|
|
472
|
+
}
|
|
452
473
|
function getProviderNameByChainId(chainId: ChainID): RouteProvider {
|
|
453
474
|
switch (chainId) {
|
|
454
475
|
case ChainID.Sui:
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
+
import { formatUnits } from 'viem';
|
|
1
2
|
import { ChainID } from '../../chains.js';
|
|
2
3
|
import { isNativeEvmToken, WRAPPED_ETH_ADDRESSES } from '../../constants.js';
|
|
4
|
+
import { CROSS_CHAIN_STABLES } from './stablecoins-tokens.js';
|
|
3
5
|
|
|
4
6
|
type LiquidSwapQuoteParams = {
|
|
5
7
|
tokenIn: string;
|
|
6
8
|
tokenOut: string;
|
|
7
|
-
amountIn:
|
|
9
|
+
amountIn: bigint;
|
|
8
10
|
};
|
|
9
11
|
|
|
10
12
|
export type LiquidSwapQuoteResponse = {
|
|
@@ -12,31 +14,58 @@ export type LiquidSwapQuoteResponse = {
|
|
|
12
14
|
amountIn: string;
|
|
13
15
|
amountOut: string;
|
|
14
16
|
averagePriceImpact: string;
|
|
17
|
+
execution: any;
|
|
15
18
|
};
|
|
16
19
|
|
|
17
20
|
const LIQUID_SWAP_API_URL = 'https://api.liqd.ag';
|
|
18
21
|
|
|
19
22
|
export class LiquidSwapQuoteProvider {
|
|
20
|
-
public async getQuote(
|
|
21
|
-
const
|
|
23
|
+
public async getQuote(params: LiquidSwapQuoteParams): Promise<LiquidSwapQuoteResponse> {
|
|
24
|
+
const chainId = ChainID.Hyperliquid;
|
|
25
|
+
let tokenIn = params.tokenIn;
|
|
26
|
+
let tokenOut = params.tokenOut;
|
|
22
27
|
|
|
23
|
-
if
|
|
24
|
-
|
|
28
|
+
// 1️ Wrap native tokens if needed
|
|
29
|
+
if (isNativeEvmToken(tokenIn)) {
|
|
30
|
+
tokenIn = WRAPPED_ETH_ADDRESSES[chainId];
|
|
25
31
|
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
params.tokenIn = WRAPPED_ETH_ADDRESSES[ChainID.Hyperliquid];
|
|
32
|
+
if (isNativeEvmToken(tokenOut)) {
|
|
33
|
+
tokenOut = WRAPPED_ETH_ADDRESSES[chainId];
|
|
29
34
|
}
|
|
30
35
|
|
|
31
|
-
|
|
36
|
+
// 2️Detect decimals
|
|
37
|
+
const tokenInDecimals = this.getTokenDecimals(tokenIn, chainId);
|
|
38
|
+
|
|
39
|
+
// 3️ Convert amountIn (wei → human)
|
|
40
|
+
const formattedAmountIn = formatUnits(BigInt(params.amountIn), tokenInDecimals);
|
|
41
|
+
|
|
42
|
+
// 4️ Build request URL — amountIn should still be in base units for API
|
|
43
|
+
const url = `${LIQUID_SWAP_API_URL}/v2/route?tokenIn=${tokenIn}&tokenOut=${tokenOut}&amountIn=${formattedAmountIn}`;
|
|
44
|
+
|
|
32
45
|
const response = await fetch(url);
|
|
46
|
+
if (!response.ok) throw new Error('Failed to fetch quote from LiquidSwap API');
|
|
47
|
+
|
|
48
|
+
const data = await response.json();
|
|
33
49
|
|
|
34
|
-
|
|
35
|
-
|
|
50
|
+
return data;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
private getTokenDecimals(addressOrSymbol: string, chainId: ChainID): number {
|
|
54
|
+
const lower = addressOrSymbol.toLowerCase();
|
|
55
|
+
|
|
56
|
+
// Match by address
|
|
57
|
+
for (const symbol in CROSS_CHAIN_STABLES) {
|
|
58
|
+
const stable = CROSS_CHAIN_STABLES[symbol]?.[chainId];
|
|
59
|
+
if (stable && stable.address.toLowerCase() === lower) {
|
|
60
|
+
return stable.decimals;
|
|
61
|
+
}
|
|
36
62
|
}
|
|
37
63
|
|
|
38
|
-
|
|
64
|
+
// Match by symbol
|
|
65
|
+
const stableBySymbol = CROSS_CHAIN_STABLES[addressOrSymbol.toUpperCase()]?.[chainId];
|
|
66
|
+
if (stableBySymbol?.decimals) return stableBySymbol.decimals;
|
|
39
67
|
|
|
40
|
-
|
|
68
|
+
// Default fallback
|
|
69
|
+
return 18;
|
|
41
70
|
}
|
|
42
71
|
}
|
|
@@ -9,15 +9,37 @@ export type QuoteParams = {
|
|
|
9
9
|
slippageBps?: number;
|
|
10
10
|
};
|
|
11
11
|
|
|
12
|
-
export const
|
|
12
|
+
export const CROSS_CHAIN_STABLES: Record<string, Partial<Record<ChainID, { address: string; decimals: number }>>> = {
|
|
13
13
|
USDC: {
|
|
14
|
-
[ChainID.Solana]:
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
[ChainID.
|
|
19
|
-
|
|
20
|
-
|
|
14
|
+
[ChainID.Solana]: {
|
|
15
|
+
address: 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v',
|
|
16
|
+
decimals: 6,
|
|
17
|
+
},
|
|
18
|
+
[ChainID.Base]: {
|
|
19
|
+
address: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913',
|
|
20
|
+
decimals: 6,
|
|
21
|
+
},
|
|
22
|
+
[ChainID.Arbitrum]: {
|
|
23
|
+
address: '0xaf88d065e77c8cC2239327C5EDb3A432268e5831',
|
|
24
|
+
decimals: 6,
|
|
25
|
+
},
|
|
26
|
+
[ChainID.Optimism]: {
|
|
27
|
+
address: '0x7F5c764cBc14f9669B88837ca1490cCa17c31607',
|
|
28
|
+
decimals: 6,
|
|
29
|
+
},
|
|
30
|
+
[ChainID.Sui]: {
|
|
31
|
+
address: '0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::USDC',
|
|
32
|
+
decimals: 6,
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
USDT: {
|
|
36
|
+
[ChainID.Hyperliquid]: {
|
|
37
|
+
address: '0xb8ce59fc3717ada4c02eadf9682a9e934f625ebb',
|
|
38
|
+
decimals: 6,
|
|
39
|
+
},
|
|
40
|
+
[ChainID.BSC]: {
|
|
41
|
+
address: '0x55d398326f99059ff775485246999027b3197955',
|
|
42
|
+
decimals: 18,
|
|
43
|
+
},
|
|
21
44
|
},
|
|
22
|
-
// Add more tokens as needed
|
|
23
45
|
};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
let SignatureTransfer;
|
|
2
|
-
// Only use createRequire in Node (never in browsers)
|
|
3
|
-
if (typeof process !== "undefined" && process.versions?.node) {
|
|
4
|
-
const { createRequire } = await import("module");
|
|
5
|
-
const require = createRequire(import.meta.url);
|
|
6
|
-
const pkg = require("@uniswap/permit2-sdk");
|
|
7
|
-
SignatureTransfer = pkg.SignatureTransfer;
|
|
8
|
-
}
|
|
9
|
-
else {
|
|
10
|
-
// Fallback for Vite / Vue / browser builds
|
|
11
|
-
const pkg = await import("@uniswap/permit2-sdk");
|
|
12
|
-
SignatureTransfer = pkg.SignatureTransfer;
|
|
13
|
-
}
|
|
14
|
-
export { SignatureTransfer };
|
|
15
|
-
//# sourceMappingURL=permit2-signature-transfer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"permit2-signature-transfer.js","sourceRoot":"","sources":["../../../../src/core/evm/permit2-signature-transfer.ts"],"names":[],"mappings":"AAAA,IAAI,iBAAsB,CAAA;AAE1B,qDAAqD;AACrD,IAAI,OAAO,OAAO,KAAK,WAAW,IAAI,OAAO,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC7D,MAAM,EAAE,aAAa,EAAE,GAAG,MAAM,MAAM,CAAC,QAAQ,CAAC,CAAA;IAChD,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;IAC9C,MAAM,GAAG,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAAA;IAC3C,iBAAiB,GAAG,GAAG,CAAC,iBAAiB,CAAA;AAC3C,CAAC;KAAM,CAAC;IACN,2CAA2C;IAC3C,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,sBAAsB,CAAC,CAAA;IAChD,iBAAiB,GAAI,GAAW,CAAC,iBAAiB,CAAA;AACpD,CAAC;AAED,OAAO,EAAE,iBAAiB,EAAE,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"permit2-signature-transfer.d.ts","sourceRoot":"","sources":["../../../../src/core/evm/permit2-signature-transfer.ts"],"names":[],"mappings":"AAAA,QAAA,IAAI,iBAAiB,EAAE,GAAG,CAAA;AAc1B,OAAO,EAAE,iBAAiB,EAAE,CAAA"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
let SignatureTransfer: any
|
|
2
|
-
|
|
3
|
-
// Only use createRequire in Node (never in browsers)
|
|
4
|
-
if (typeof process !== "undefined" && process.versions?.node) {
|
|
5
|
-
const { createRequire } = await import("module")
|
|
6
|
-
const require = createRequire(import.meta.url)
|
|
7
|
-
const pkg = require("@uniswap/permit2-sdk")
|
|
8
|
-
SignatureTransfer = pkg.SignatureTransfer
|
|
9
|
-
} else {
|
|
10
|
-
// Fallback for Vite / Vue / browser builds
|
|
11
|
-
const pkg = await import("@uniswap/permit2-sdk")
|
|
12
|
-
SignatureTransfer = (pkg as any).SignatureTransfer
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export { SignatureTransfer }
|