@stableflow/bridges 3.1.0 → 3.1.1-beta-0b82f1112c-20260722
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 +4 -3
- package/dist/index.d.mts +13 -5
- package/dist/index.d.ts +13 -5
- package/dist/index.js +355 -35
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +354 -37
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -29,9 +29,9 @@ For HTTP-only quote/status without wallet orchestration, [`@stableflow/core`](..
|
|
|
29
29
|
| `ServiceMap` | Per-service `quote` / `send` / `getStatus` implementations |
|
|
30
30
|
| `getQuoteModes` | Helpers to interpret quote shape (OneClick, exact output, etc.) |
|
|
31
31
|
| Utilities | `formatQuoteError`, `addressToBytes32`, `quoteSignature`, `formatNumber` |
|
|
32
|
-
| USDT0 / FraxZero | `USDT0_CONFIG`, `OFT_ABI`, `getHopMsgFee`, `FRAXZERO_MIDDLE_TOKEN_*`, … |
|
|
32
|
+
| USDT0 / FraxZero / CCTP hybrid | `USDT0_CONFIG`, `OFT_ABI`, `getHopMsgFee`, `FRAXZERO_MIDDLE_TOKEN_*`, `CCTP_MIDDLE_TOKEN_CHAIN`, `CCTP_PROXY_RELAY_CONTRACT`, … |
|
|
33
33
|
|
|
34
|
-
Supported `Service` values (from `@stableflow/core`): `oneclick`, `usdt0`, `cctp`, `fraxzero`, composite routes (`usdt0-oneclick`, `oneclick-usdt0`, `fraxzero-oneclick`, `oneclick-fraxzero`), and `native`.
|
|
34
|
+
Supported `Service` values (from `@stableflow/core`): `oneclick`, `usdt0`, `cctp`, `fraxzero`, composite routes (`usdt0-oneclick`, `oneclick-usdt0`, `cctp-oneclick`, `oneclick-cctp`, `fraxzero-oneclick`, `oneclick-fraxzero`), and `native`.
|
|
35
35
|
|
|
36
36
|
See `dist/index.d.ts` after `pnpm build`.
|
|
37
37
|
|
|
@@ -43,9 +43,10 @@ import { EVMWallet } from '@stableflow/wallet-evm';
|
|
|
43
43
|
|
|
44
44
|
const wallet = new EVMWallet(/* provider */);
|
|
45
45
|
|
|
46
|
+
// Token prices are fetched and managed internally by the SDK — do not pass a
|
|
47
|
+
// `prices` map. The `prices` field is deprecated and any value is ignored.
|
|
46
48
|
const results = await BridgeSFA.getAllQuote({
|
|
47
49
|
dry: true, // fast comparison; use dry: false before send
|
|
48
|
-
prices: { ETH: '3000', BNB: '900' },
|
|
49
50
|
fromToken,
|
|
50
51
|
toToken,
|
|
51
52
|
wallet: wallet.wallet,
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as _stableflow_core from '@stableflow/core';
|
|
2
|
-
import { Service, TokenConfig, WalletConfig, CancelablePromise, SubmitDepositTxResponse, TransactionStatus } from '@stableflow/core';
|
|
2
|
+
import { Service, TokenConfig, WalletConfig, OneClickSwapType, CancelablePromise, SubmitDepositTxResponse, TransactionStatus } from '@stableflow/core';
|
|
3
3
|
import Big from 'big.js';
|
|
4
4
|
|
|
5
5
|
declare const ServiceMap: Record<Service, any>;
|
|
@@ -120,7 +120,11 @@ interface GetAllQuoteParams {
|
|
|
120
120
|
singleService?: Service;
|
|
121
121
|
disabledServices?: Service[];
|
|
122
122
|
dry?: boolean;
|
|
123
|
-
|
|
123
|
+
/**
|
|
124
|
+
* @deprecated The SDK now fetches trusted token prices internally. Any value
|
|
125
|
+
* passed here is ignored and overridden by the built-in price source.
|
|
126
|
+
*/
|
|
127
|
+
prices?: Record<string, string>;
|
|
124
128
|
fromToken: TokenConfig;
|
|
125
129
|
toToken: TokenConfig;
|
|
126
130
|
wallet: WalletConfig;
|
|
@@ -141,7 +145,7 @@ interface GetAllQuoteParams {
|
|
|
141
145
|
recipient: string;
|
|
142
146
|
fee: number;
|
|
143
147
|
}[];
|
|
144
|
-
swapType?:
|
|
148
|
+
swapType?: OneClickSwapType;
|
|
145
149
|
isProxy?: boolean;
|
|
146
150
|
};
|
|
147
151
|
}
|
|
@@ -229,7 +233,7 @@ declare const formatQuoteError: (error: any, options: {
|
|
|
229
233
|
serviceType: "oneclick";
|
|
230
234
|
error: string;
|
|
231
235
|
} | {
|
|
232
|
-
serviceType: "usdt0" | "cctp" | "fraxzero" | "fraxzero-oneclick" | "oneclick-fraxzero" | "usdt0-oneclick" | "oneclick-usdt0" | "native";
|
|
236
|
+
serviceType: "usdt0" | "cctp" | "fraxzero" | "fraxzero-oneclick" | "oneclick-fraxzero" | "usdt0-oneclick" | "oneclick-usdt0" | "cctp-oneclick" | "oneclick-cctp" | "native";
|
|
233
237
|
error: any;
|
|
234
238
|
};
|
|
235
239
|
|
|
@@ -320,4 +324,8 @@ declare const OFT_ABI: ({
|
|
|
320
324
|
declare const FRAXZERO_MIDDLE_TOKEN_USDC: _stableflow_core.TokenConfig;
|
|
321
325
|
declare const FRAXZERO_MIDDLE_TOKEN_FRXUSD: _stableflow_core.TokenConfig;
|
|
322
326
|
|
|
323
|
-
|
|
327
|
+
declare const MIDDLE_TOKEN_CHAIN: _stableflow_core.TokenConfig;
|
|
328
|
+
declare const CCTP_PROXY_RELAY_CONTRACT = "0x0da5336C5CEb9d15e7659Ae376CC41d86Edd8802";
|
|
329
|
+
declare const MIDDLE_CHAIN_REFOUND_ADDRESS = "0x654E7B96E1DE0b54E53D9ae8082fC2219E66dAC3";
|
|
330
|
+
|
|
331
|
+
export { BridgeSFA, type BuildTransactionResult, MIDDLE_CHAIN_REFOUND_ADDRESS as CCTP_MIDDLE_CHAIN_REFOUND_ADDRESS, MIDDLE_TOKEN_CHAIN as CCTP_MIDDLE_TOKEN_CHAIN, CCTP_PROXY_RELAY_CONTRACT, DATA_HEX_PROTOBUF_EXTRA, type EvmTxData, FRAXZERO_MIDDLE_TOKEN_FRXUSD, FRAXZERO_MIDDLE_TOKEN_USDC, type GetAllQuoteParams, LZ_RECEIVE_VALUE, OFT_ABI, type PermitSignature, type PermitTypedData, SIGNATURE_SIZE, ServiceMap, USDT0_CONFIG, USDT0_LEGACY_MESH_TRANSFTER_FEE, addressToBytes32, buildApproveTx, buildPermitTypedData, buildSendTx, formatNumber, formatQuoteError, getHopMsgFee, getQuoteModes, quoteSignature };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as _stableflow_core from '@stableflow/core';
|
|
2
|
-
import { Service, TokenConfig, WalletConfig, CancelablePromise, SubmitDepositTxResponse, TransactionStatus } from '@stableflow/core';
|
|
2
|
+
import { Service, TokenConfig, WalletConfig, OneClickSwapType, CancelablePromise, SubmitDepositTxResponse, TransactionStatus } from '@stableflow/core';
|
|
3
3
|
import Big from 'big.js';
|
|
4
4
|
|
|
5
5
|
declare const ServiceMap: Record<Service, any>;
|
|
@@ -120,7 +120,11 @@ interface GetAllQuoteParams {
|
|
|
120
120
|
singleService?: Service;
|
|
121
121
|
disabledServices?: Service[];
|
|
122
122
|
dry?: boolean;
|
|
123
|
-
|
|
123
|
+
/**
|
|
124
|
+
* @deprecated The SDK now fetches trusted token prices internally. Any value
|
|
125
|
+
* passed here is ignored and overridden by the built-in price source.
|
|
126
|
+
*/
|
|
127
|
+
prices?: Record<string, string>;
|
|
124
128
|
fromToken: TokenConfig;
|
|
125
129
|
toToken: TokenConfig;
|
|
126
130
|
wallet: WalletConfig;
|
|
@@ -141,7 +145,7 @@ interface GetAllQuoteParams {
|
|
|
141
145
|
recipient: string;
|
|
142
146
|
fee: number;
|
|
143
147
|
}[];
|
|
144
|
-
swapType?:
|
|
148
|
+
swapType?: OneClickSwapType;
|
|
145
149
|
isProxy?: boolean;
|
|
146
150
|
};
|
|
147
151
|
}
|
|
@@ -229,7 +233,7 @@ declare const formatQuoteError: (error: any, options: {
|
|
|
229
233
|
serviceType: "oneclick";
|
|
230
234
|
error: string;
|
|
231
235
|
} | {
|
|
232
|
-
serviceType: "usdt0" | "cctp" | "fraxzero" | "fraxzero-oneclick" | "oneclick-fraxzero" | "usdt0-oneclick" | "oneclick-usdt0" | "native";
|
|
236
|
+
serviceType: "usdt0" | "cctp" | "fraxzero" | "fraxzero-oneclick" | "oneclick-fraxzero" | "usdt0-oneclick" | "oneclick-usdt0" | "cctp-oneclick" | "oneclick-cctp" | "native";
|
|
233
237
|
error: any;
|
|
234
238
|
};
|
|
235
239
|
|
|
@@ -320,4 +324,8 @@ declare const OFT_ABI: ({
|
|
|
320
324
|
declare const FRAXZERO_MIDDLE_TOKEN_USDC: _stableflow_core.TokenConfig;
|
|
321
325
|
declare const FRAXZERO_MIDDLE_TOKEN_FRXUSD: _stableflow_core.TokenConfig;
|
|
322
326
|
|
|
323
|
-
|
|
327
|
+
declare const MIDDLE_TOKEN_CHAIN: _stableflow_core.TokenConfig;
|
|
328
|
+
declare const CCTP_PROXY_RELAY_CONTRACT = "0x0da5336C5CEb9d15e7659Ae376CC41d86Edd8802";
|
|
329
|
+
declare const MIDDLE_CHAIN_REFOUND_ADDRESS = "0x654E7B96E1DE0b54E53D9ae8082fC2219E66dAC3";
|
|
330
|
+
|
|
331
|
+
export { BridgeSFA, type BuildTransactionResult, MIDDLE_CHAIN_REFOUND_ADDRESS as CCTP_MIDDLE_CHAIN_REFOUND_ADDRESS, MIDDLE_TOKEN_CHAIN as CCTP_MIDDLE_TOKEN_CHAIN, CCTP_PROXY_RELAY_CONTRACT, DATA_HEX_PROTOBUF_EXTRA, type EvmTxData, FRAXZERO_MIDDLE_TOKEN_FRXUSD, FRAXZERO_MIDDLE_TOKEN_USDC, type GetAllQuoteParams, LZ_RECEIVE_VALUE, OFT_ABI, type PermitSignature, type PermitTypedData, SIGNATURE_SIZE, ServiceMap, USDT0_CONFIG, USDT0_LEGACY_MESH_TRANSFTER_FEE, addressToBytes32, buildApproveTx, buildPermitTypedData, buildSendTx, formatNumber, formatQuoteError, getHopMsgFee, getQuoteModes, quoteSignature };
|