@shapeshiftoss/swapper 17.7.3 → 17.8.0
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/cjs/.tsbuildinfo +1 -1
- package/dist/cjs/constants.js +35 -26
- package/dist/cjs/index.d.ts +1 -0
- package/dist/cjs/index.js +1 -0
- package/dist/cjs/swappers/ArbitrumBridgeSwapper/getTradeQuote/getTradeQuote.test.js +12 -4
- package/dist/cjs/swappers/BebopSwapper/getBebopSolanaTradeRate/getBebopSolanaTradeRate.js +9 -5
- package/dist/cjs/swappers/BebopSwapper/getBebopTradeQuote/getBebopTradeQuote.js +1 -9
- package/dist/cjs/swappers/BebopSwapper/getBebopTradeRate/getBebopTradeRate.js +9 -13
- package/dist/cjs/swappers/BebopSwapper/types.d.ts +64 -78
- package/dist/cjs/swappers/BebopSwapper/utils/fetchFromBebop.d.ts +0 -16
- package/dist/cjs/swappers/BebopSwapper/utils/fetchFromBebop.js +49 -82
- package/dist/cjs/swappers/BobGatewaySwapper/BobGatewaySwapper.d.ts +2 -0
- package/dist/cjs/swappers/BobGatewaySwapper/BobGatewaySwapper.js +8 -0
- package/dist/cjs/swappers/BobGatewaySwapper/endpoints.d.ts +2 -0
- package/dist/cjs/swappers/BobGatewaySwapper/endpoints.js +143 -0
- package/dist/cjs/swappers/BobGatewaySwapper/index.d.ts +3 -0
- package/dist/cjs/swappers/BobGatewaySwapper/index.js +22 -0
- package/dist/cjs/swappers/BobGatewaySwapper/swapperApi/getTradeQuote.d.ts +3 -0
- package/dist/cjs/swappers/BobGatewaySwapper/swapperApi/getTradeQuote.js +90 -0
- package/dist/cjs/swappers/BobGatewaySwapper/swapperApi/getTradeRate.d.ts +3 -0
- package/dist/cjs/swappers/BobGatewaySwapper/swapperApi/getTradeRate.js +73 -0
- package/dist/cjs/swappers/BobGatewaySwapper/types.d.ts +20 -0
- package/dist/cjs/swappers/BobGatewaySwapper/types.js +2 -0
- package/dist/cjs/swappers/BobGatewaySwapper/utils/constants.d.ts +13 -0
- package/dist/cjs/swappers/BobGatewaySwapper/utils/constants.js +31 -0
- package/dist/cjs/swappers/BobGatewaySwapper/utils/helpers.d.ts +49 -0
- package/dist/cjs/swappers/BobGatewaySwapper/utils/helpers.js +314 -0
- package/dist/cjs/swappers/ChainflipSwapper/ChainflipSwapper.js +1 -0
- package/dist/cjs/swappers/ChainflipSwapper/constants.d.ts +1 -1
- package/dist/cjs/swappers/ChainflipSwapper/constants.js +3 -0
- package/dist/cjs/swappers/ChainflipSwapper/endpoints.js +20 -0
- package/dist/cjs/swappers/ChainflipSwapper/types.d.ts +2 -1
- package/dist/cjs/swappers/ChainflipSwapper/types.js +1 -0
- package/dist/cjs/swappers/ChainflipSwapper/utils/getQuoteOrRate.js +23 -3
- package/dist/cjs/swappers/ChainflipSwapper/utils/helpers.d.ts +2 -2
- package/dist/cjs/swappers/ChainflipSwapper/utils/helpers.js +2 -1
- package/dist/cjs/swappers/CowSwapper/utils/helpers/helpers.test.js +3 -3
- package/dist/cjs/swappers/RelaySwapper/constant.js +1 -1
- package/dist/cjs/swappers/SunioSwapper/endpoints.js +19 -36
- package/dist/cjs/swappers/SunioSwapper/utils/buildSwapContractCall.d.ts +6 -0
- package/dist/cjs/swappers/SunioSwapper/utils/buildSwapContractCall.js +33 -0
- package/dist/cjs/swappers/SunioSwapper/utils/buildSwapRouteParameters.js +6 -6
- package/dist/cjs/swappers/SunioSwapper/utils/constants.d.ts +2 -0
- package/dist/cjs/swappers/SunioSwapper/utils/constants.js +7 -1
- package/dist/cjs/swappers/SunioSwapper/utils/estimateSunioNetworkFee.d.ts +12 -0
- package/dist/cjs/swappers/SunioSwapper/utils/estimateSunioNetworkFee.js +78 -0
- package/dist/cjs/swappers/SunioSwapper/utils/getQuoteOrRate.js +16 -74
- package/dist/cjs/swappers/SunioSwapper/utils/getSunioTransactionFees.d.ts +2 -0
- package/dist/cjs/swappers/SunioSwapper/utils/getSunioTransactionFees.js +36 -0
- package/dist/cjs/swappers/utils/helpers/helpers.js +1 -0
- package/dist/cjs/thorchain-utils/getL1RateOrQuote.js +5 -2
- package/dist/cjs/thorchain-utils/getQuote.js +27 -29
- package/dist/cjs/thorchain-utils/tron/getTronTransactionFees.js +8 -5
- package/dist/cjs/thorchain-utils/types.d.ts +1 -1
- package/dist/cjs/types.d.ts +10 -3
- package/dist/cjs/types.js +5 -0
- package/dist/esm/.tsbuildinfo +1 -1
- package/dist/esm/constants.js +9 -0
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/swappers/ArbitrumBridgeSwapper/getTradeQuote/getTradeQuote.test.js +12 -4
- package/dist/esm/swappers/BebopSwapper/getBebopSolanaTradeRate/getBebopSolanaTradeRate.js +10 -6
- package/dist/esm/swappers/BebopSwapper/getBebopTradeQuote/getBebopTradeQuote.js +1 -9
- package/dist/esm/swappers/BebopSwapper/getBebopTradeRate/getBebopTradeRate.js +10 -14
- package/dist/esm/swappers/BebopSwapper/types.d.ts +64 -78
- package/dist/esm/swappers/BebopSwapper/utils/fetchFromBebop.d.ts +0 -16
- package/dist/esm/swappers/BebopSwapper/utils/fetchFromBebop.js +45 -76
- package/dist/esm/swappers/BobGatewaySwapper/BobGatewaySwapper.d.ts +2 -0
- package/dist/esm/swappers/BobGatewaySwapper/BobGatewaySwapper.js +5 -0
- package/dist/esm/swappers/BobGatewaySwapper/endpoints.d.ts +2 -0
- package/dist/esm/swappers/BobGatewaySwapper/endpoints.js +140 -0
- package/dist/esm/swappers/BobGatewaySwapper/index.d.ts +3 -0
- package/dist/esm/swappers/BobGatewaySwapper/index.js +3 -0
- package/dist/esm/swappers/BobGatewaySwapper/swapperApi/getTradeQuote.d.ts +3 -0
- package/dist/esm/swappers/BobGatewaySwapper/swapperApi/getTradeQuote.js +86 -0
- package/dist/esm/swappers/BobGatewaySwapper/swapperApi/getTradeRate.d.ts +3 -0
- package/dist/esm/swappers/BobGatewaySwapper/swapperApi/getTradeRate.js +69 -0
- package/dist/esm/swappers/BobGatewaySwapper/types.d.ts +20 -0
- package/dist/esm/swappers/BobGatewaySwapper/utils/constants.d.ts +13 -0
- package/dist/esm/swappers/BobGatewaySwapper/utils/constants.js +27 -0
- package/dist/esm/swappers/BobGatewaySwapper/utils/helpers.d.ts +49 -0
- package/dist/esm/swappers/BobGatewaySwapper/utils/helpers.js +299 -0
- package/dist/esm/swappers/ChainflipSwapper/ChainflipSwapper.js +2 -1
- package/dist/esm/swappers/ChainflipSwapper/constants.d.ts +1 -1
- package/dist/esm/swappers/ChainflipSwapper/constants.js +4 -1
- package/dist/esm/swappers/ChainflipSwapper/endpoints.js +20 -0
- package/dist/esm/swappers/ChainflipSwapper/types.d.ts +2 -1
- package/dist/esm/swappers/ChainflipSwapper/types.js +1 -0
- package/dist/esm/swappers/ChainflipSwapper/utils/getQuoteOrRate.js +24 -4
- package/dist/esm/swappers/ChainflipSwapper/utils/helpers.d.ts +2 -2
- package/dist/esm/swappers/ChainflipSwapper/utils/helpers.js +2 -1
- package/dist/esm/swappers/CowSwapper/utils/helpers/helpers.test.js +3 -3
- package/dist/esm/swappers/RelaySwapper/constant.js +1 -1
- package/dist/esm/swappers/SunioSwapper/endpoints.js +19 -36
- package/dist/esm/swappers/SunioSwapper/utils/buildSwapContractCall.d.ts +6 -0
- package/dist/esm/swappers/SunioSwapper/utils/buildSwapContractCall.js +29 -0
- package/dist/esm/swappers/SunioSwapper/utils/buildSwapRouteParameters.js +6 -6
- package/dist/esm/swappers/SunioSwapper/utils/constants.d.ts +2 -0
- package/dist/esm/swappers/SunioSwapper/utils/constants.js +6 -0
- package/dist/esm/swappers/SunioSwapper/utils/estimateSunioNetworkFee.d.ts +12 -0
- package/dist/esm/swappers/SunioSwapper/utils/estimateSunioNetworkFee.js +74 -0
- package/dist/esm/swappers/SunioSwapper/utils/getQuoteOrRate.js +16 -74
- package/dist/esm/swappers/SunioSwapper/utils/getSunioTransactionFees.d.ts +2 -0
- package/dist/esm/swappers/SunioSwapper/utils/getSunioTransactionFees.js +32 -0
- package/dist/esm/swappers/utils/helpers/helpers.js +2 -1
- package/dist/esm/thorchain-utils/getL1RateOrQuote.js +5 -2
- package/dist/esm/thorchain-utils/getQuote.js +27 -29
- package/dist/esm/thorchain-utils/tron/getTronTransactionFees.js +8 -5
- package/dist/esm/thorchain-utils/types.d.ts +1 -1
- package/dist/esm/types.d.ts +10 -3
- package/dist/esm/types.js +5 -0
- package/package.json +8 -7
- package/dist/cjs/swappers/SunioSwapper/utils/buildSwapTransaction.d.ts +0 -11
- package/dist/cjs/swappers/SunioSwapper/utils/buildSwapTransaction.js +0 -57
- package/dist/cjs/thorchain-utils/getThresholdedAffiliateBps/getThresholdedAffiliateBps.d.ts +0 -12
- package/dist/cjs/thorchain-utils/getThresholdedAffiliateBps/getThresholdedAffiliateBps.js +0 -47
- package/dist/cjs/thorchain-utils/getThresholdedAffiliateBps/getThresholdedAffiliateBps.test.js +0 -100
- package/dist/esm/swappers/SunioSwapper/utils/buildSwapTransaction.d.ts +0 -11
- package/dist/esm/swappers/SunioSwapper/utils/buildSwapTransaction.js +0 -53
- package/dist/esm/thorchain-utils/getThresholdedAffiliateBps/getThresholdedAffiliateBps.d.ts +0 -12
- package/dist/esm/thorchain-utils/getThresholdedAffiliateBps/getThresholdedAffiliateBps.js +0 -41
- package/dist/esm/thorchain-utils/getThresholdedAffiliateBps/getThresholdedAffiliateBps.test.d.ts +0 -1
- package/dist/esm/thorchain-utils/getThresholdedAffiliateBps/getThresholdedAffiliateBps.test.js +0 -98
- /package/dist/{cjs/thorchain-utils/getThresholdedAffiliateBps/getThresholdedAffiliateBps.test.d.ts → esm/swappers/BobGatewaySwapper/types.js} +0 -0
package/dist/cjs/types.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ import type Polyglot from 'node-polyglot';
|
|
|
11
11
|
import type { InterpolationOptions } from 'node-polyglot';
|
|
12
12
|
import type { Address, Hex } from 'viem';
|
|
13
13
|
import type { AcrossTransactionMetadata } from './swappers/AcrossSwapper/utils/types';
|
|
14
|
+
import type { BobGatewayMetadata } from './swappers/BobGatewaySwapper/types';
|
|
14
15
|
import type { CowMessageToSign } from './swappers/CowSwapper/types';
|
|
15
16
|
import type { DebridgeTransactionMetadata } from './swappers/DebridgeSwapper/utils/types';
|
|
16
17
|
import type { RelayTransactionMetadata } from './swappers/RelaySwapper/utils/types';
|
|
@@ -22,6 +23,7 @@ export type SwapperConfig = {
|
|
|
22
23
|
VITE_THORCHAIN_NODE_URL: string;
|
|
23
24
|
VITE_MAYACHAIN_NODE_URL: string;
|
|
24
25
|
VITE_TRON_NODE_URL: string;
|
|
26
|
+
VITE_TRON_GRID_API_KEY: string;
|
|
25
27
|
VITE_FEATURE_THORCHAINSWAP_LONGTAIL: boolean;
|
|
26
28
|
VITE_FEATURE_THORCHAINSWAP_L1_TO_LONGTAIL: boolean;
|
|
27
29
|
VITE_THORCHAIN_MIDGARD_URL: string;
|
|
@@ -50,6 +52,7 @@ export type SwapperConfig = {
|
|
|
50
52
|
VITE_ACROSS_API_URL: string;
|
|
51
53
|
VITE_ACROSS_INTEGRATOR_ID: string;
|
|
52
54
|
VITE_DEBRIDGE_API_URL: string;
|
|
55
|
+
VITE_BOB_GATEWAY_API_KEY: string;
|
|
53
56
|
};
|
|
54
57
|
export declare enum SwapperName {
|
|
55
58
|
Thorchain = "THORChain",
|
|
@@ -69,7 +72,8 @@ export declare enum SwapperName {
|
|
|
69
72
|
Avnu = "AVNU",
|
|
70
73
|
Stonfi = "STON.fi",
|
|
71
74
|
Across = "Across",
|
|
72
|
-
Debridge = "deBridge"
|
|
75
|
+
Debridge = "deBridge",
|
|
76
|
+
BobGateway = "BOB Gateway"
|
|
73
77
|
}
|
|
74
78
|
export type SwapSource = SwapperName | `${SwapperName} • ${string}`;
|
|
75
79
|
export type SwapErrorRight = {
|
|
@@ -95,7 +99,9 @@ export declare enum TradeQuoteError {
|
|
|
95
99
|
FinalQuoteMaxSlippageExceeded = "FinalQuoteMaxSlippageExceeded",
|
|
96
100
|
FinalQuoteExecutionReverted = "FinalQuoteExecutionReverted",
|
|
97
101
|
Timeout = "Timeout",
|
|
98
|
-
UnknownError = "UnknownError"
|
|
102
|
+
UnknownError = "UnknownError",
|
|
103
|
+
InsufficientFunds = "InsufficientFunds",
|
|
104
|
+
InsufficientFundsUnconfirmed = "InsufficientFundsUnconfirmed"
|
|
99
105
|
}
|
|
100
106
|
export type UtxoFeeData = {
|
|
101
107
|
satsPerByte: string;
|
|
@@ -133,7 +139,6 @@ type CommonTradeInputBase = {
|
|
|
133
139
|
buyAsset: Asset;
|
|
134
140
|
sellAmountIncludingProtocolFeesCryptoBaseUnit: string;
|
|
135
141
|
affiliateBps: string;
|
|
136
|
-
affiliateAddress?: string;
|
|
137
142
|
allowMultiHop: boolean;
|
|
138
143
|
slippageTolerancePercentageDecimal?: string;
|
|
139
144
|
};
|
|
@@ -402,6 +407,7 @@ export type TradeQuoteStep = {
|
|
|
402
407
|
};
|
|
403
408
|
acrossTransactionMetadata?: AcrossTransactionMetadata;
|
|
404
409
|
debridgeTransactionMetadata?: DebridgeTransactionMetadata;
|
|
410
|
+
bobSpecific?: BobGatewayMetadata;
|
|
405
411
|
affiliateFee?: AffiliateFee;
|
|
406
412
|
};
|
|
407
413
|
export type TradeRateStep = Omit<TradeQuoteStep, 'accountNumber'> & {
|
|
@@ -458,6 +464,7 @@ export type SwapperSpecificMetadata = {
|
|
|
458
464
|
relayTransactionMetadata: RelayTransactionMetadata | undefined;
|
|
459
465
|
acrossTransactionMetadata: AcrossTransactionMetadata | undefined;
|
|
460
466
|
debridgeTransactionMetadata: DebridgeTransactionMetadata | undefined;
|
|
467
|
+
bobSpecific?: BobGatewayMetadata;
|
|
461
468
|
relayerExplorerTxLink: string | undefined;
|
|
462
469
|
relayerTxHash: string | undefined;
|
|
463
470
|
stepIndex: SupportedTradeQuoteStepIndex;
|
package/dist/cjs/types.js
CHANGED
|
@@ -21,6 +21,7 @@ var SwapperName;
|
|
|
21
21
|
SwapperName["Stonfi"] = "STON.fi";
|
|
22
22
|
SwapperName["Across"] = "Across";
|
|
23
23
|
SwapperName["Debridge"] = "deBridge";
|
|
24
|
+
SwapperName["BobGateway"] = "BOB Gateway";
|
|
24
25
|
})(SwapperName || (exports.SwapperName = SwapperName = {}));
|
|
25
26
|
var TradeQuoteError;
|
|
26
27
|
(function (TradeQuoteError) {
|
|
@@ -56,6 +57,10 @@ var TradeQuoteError;
|
|
|
56
57
|
TradeQuoteError["Timeout"] = "Timeout";
|
|
57
58
|
// catch-all for unknown issues
|
|
58
59
|
TradeQuoteError["UnknownError"] = "UnknownError";
|
|
60
|
+
// the swapper performed on chain balance checks and determined the user didn't have the funds to perform the swap
|
|
61
|
+
TradeQuoteError["InsufficientFunds"] = "InsufficientFunds";
|
|
62
|
+
// the user's confirmed balance is insufficient — funds may exist but are still confirming on chain (e.g. unconfirmed UTXO deposits)
|
|
63
|
+
TradeQuoteError["InsufficientFundsUnconfirmed"] = "InsufficientFundsUnconfirmed";
|
|
59
64
|
})(TradeQuoteError || (exports.TradeQuoteError = TradeQuoteError = {}));
|
|
60
65
|
var TransactionExecutionState;
|
|
61
66
|
(function (TransactionExecutionState) {
|