@velora-dex/sdk 9.3.0-dev.1 → 9.3.0-dev.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/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/methods/delta/getBridgeInfo.d.ts +2 -1
- package/dist/methods/delta/getBridgeInfo.d.ts.map +1 -1
- package/dist/methods/delta/getDeltaPrice.d.ts +3 -7
- package/dist/methods/delta/getDeltaPrice.d.ts.map +1 -1
- package/dist/methods/delta/helpers/types.d.ts +3 -0
- package/dist/methods/delta/helpers/types.d.ts.map +1 -1
- package/dist/sdk.cjs.development.js +5 -6
- package/dist/sdk.cjs.development.js.map +1 -1
- package/dist/sdk.cjs.production.min.js +1 -1
- package/dist/sdk.cjs.production.min.js.map +1 -1
- package/dist/sdk.esm.js +5 -6
- package/dist/sdk.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +4 -0
- package/src/methods/delta/getBridgeInfo.ts +4 -4
- package/src/methods/delta/getDeltaPrice.ts +8 -6
- package/src/methods/delta/helpers/types.ts +3 -0
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -174,6 +174,7 @@ import {
|
|
|
174
174
|
GetDeltaPriceFunctions,
|
|
175
175
|
DeltaPrice,
|
|
176
176
|
BridgePrice,
|
|
177
|
+
AvailableBridge,
|
|
177
178
|
DeltaPriceParams,
|
|
178
179
|
} from './methods/delta/getDeltaPrice';
|
|
179
180
|
import {
|
|
@@ -194,6 +195,7 @@ import {
|
|
|
194
195
|
constructGetBridgeInfo,
|
|
195
196
|
GetBridgeInfoFunctions,
|
|
196
197
|
BridgeInfo,
|
|
198
|
+
BridgeProtocolResponse,
|
|
197
199
|
} from './methods/delta/getBridgeInfo';
|
|
198
200
|
import {
|
|
199
201
|
constructIsTokenSupportedInDelta,
|
|
@@ -378,6 +380,8 @@ export type {
|
|
|
378
380
|
BridgeStatus,
|
|
379
381
|
Bridge,
|
|
380
382
|
BridgeInfo,
|
|
383
|
+
AvailableBridge,
|
|
384
|
+
BridgeProtocolResponse,
|
|
381
385
|
BuildDeltaOrderDataParams,
|
|
382
386
|
BuildDeltaOrderFunctions,
|
|
383
387
|
SignableDeltaOrderData,
|
|
@@ -19,7 +19,7 @@ type GetBridgeInfoParams = {
|
|
|
19
19
|
};
|
|
20
20
|
|
|
21
21
|
type BridgeInfoQuery = {
|
|
22
|
-
allowBridgeAndSwap?:
|
|
22
|
+
allowBridgeAndSwap?: boolean;
|
|
23
23
|
bridges?: string;
|
|
24
24
|
};
|
|
25
25
|
|
|
@@ -28,9 +28,10 @@ type GetBridgeInfo = (
|
|
|
28
28
|
requestParams?: RequestParameters
|
|
29
29
|
) => Promise<BridgeInfo>;
|
|
30
30
|
|
|
31
|
-
type BridgeProtocolResponse = {
|
|
31
|
+
export type BridgeProtocolResponse = {
|
|
32
32
|
protocol: string;
|
|
33
33
|
displayName: string;
|
|
34
|
+
icon: string; // CDN URL
|
|
34
35
|
};
|
|
35
36
|
|
|
36
37
|
type BridgeProtocolsResponse = {
|
|
@@ -54,11 +55,10 @@ export const constructGetBridgeInfo = ({
|
|
|
54
55
|
|
|
55
56
|
const getBridgeInfo: GetBridgeInfo = async (params = {}, requestParams) => {
|
|
56
57
|
const { allowBridgeAndSwap, bridges } = params;
|
|
57
|
-
const allowBridgeAndSwapString = allowBridgeAndSwap ? 'true' : 'false';
|
|
58
58
|
const bridgesString = bridges ? bridges.join(',') : undefined;
|
|
59
59
|
|
|
60
60
|
const search = constructSearchString<BridgeInfoQuery>({
|
|
61
|
-
allowBridgeAndSwap:
|
|
61
|
+
allowBridgeAndSwap: !!allowBridgeAndSwap,
|
|
62
62
|
bridges: bridgesString,
|
|
63
63
|
});
|
|
64
64
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Prettify } from 'viem';
|
|
1
2
|
import { Bridge } from '../..';
|
|
2
3
|
import { API_URL, SwapSide } from '../../constants';
|
|
3
4
|
import { constructSearchString } from '../../helpers/misc';
|
|
@@ -105,14 +106,15 @@ type AvailableBridgePrice = Pick<
|
|
|
105
106
|
| 'gasCost'
|
|
106
107
|
| 'gasCostUSDBeforeFee'
|
|
107
108
|
| 'gasCostBeforeFee'
|
|
109
|
+
| 'receivedDestAmount'
|
|
110
|
+
| 'receivedDestAmountBeforeFee'
|
|
111
|
+
| 'receivedDestUSD'
|
|
112
|
+
| 'receivedDestUSDBeforeFee'
|
|
108
113
|
>;
|
|
109
114
|
|
|
110
|
-
type AvailableBridge =
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
bridgeInfo: BridgePriceInfo;
|
|
114
|
-
}[];
|
|
115
|
-
};
|
|
115
|
+
export type AvailableBridge = Prettify<
|
|
116
|
+
AvailableBridgePrice & Pick<BridgePrice, 'bridge' | 'bridgeInfo'>
|
|
117
|
+
>;
|
|
116
118
|
|
|
117
119
|
export type BridgePrice = Omit<DeltaPrice, 'bridge'> & {
|
|
118
120
|
// destAmountAfterBridge: string; // became bridgeInfo.destAmountAfterBridge
|