@swapkit/core 4.4.29 → 4.4.30
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/types/index.d.ts +7 -189
- package/package.json +5 -5
package/dist/types/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AssetValue, Chain, type ChainWallet, type ConditionalAssetValueReturn, type FeeOption, type GenericTransferParams,
|
|
2
|
-
import type { QuoteResponseRoute } from "@swapkit/helpers/api";
|
|
1
|
+
import { AssetValue, Chain, type ChainWallet, type ConditionalAssetValueReturn, type FeeOption, type GenericTransferParams, type SKConfigState, type SwapParams } from "@swapkit/helpers";
|
|
2
|
+
import type { QuoteResponseRoute, SwapRouteV2Response } from "@swapkit/helpers/api";
|
|
3
3
|
import type { createPlugin } from "@swapkit/plugins";
|
|
4
4
|
import type { FullWallet } from "@swapkit/toolboxes";
|
|
5
5
|
import type { EVMCreateTransactionParams, EVMTransferParams, TypedDataField } from "@swapkit/toolboxes/evm";
|
|
@@ -9,6 +9,7 @@ export type SwapKitParams<P, W> = {
|
|
|
9
9
|
plugins?: P;
|
|
10
10
|
wallets?: W;
|
|
11
11
|
};
|
|
12
|
+
type SwapRoute = QuoteResponseRoute | SwapRouteV2Response;
|
|
12
13
|
export declare function SwapKit<Plugins extends ReturnType<typeof createPlugin>, Wallets extends ReturnType<typeof createWallet>>({ config, plugins, wallets }?: {
|
|
13
14
|
config?: SKConfigState;
|
|
14
15
|
plugins?: Plugins;
|
|
@@ -17,7 +18,7 @@ export declare function SwapKit<Plugins extends ReturnType<typeof createPlugin>,
|
|
|
17
18
|
approveAssetValue: (assetValue: AssetValue, contractAddress: string | keyof Plugins) => Promise<string>;
|
|
18
19
|
disconnectAll: () => void;
|
|
19
20
|
disconnectChain: <T_1 extends Chain>(chain: T_1) => void;
|
|
20
|
-
estimateTransactionFee: <P extends keyof Plugins, T_1 extends "
|
|
21
|
+
estimateTransactionFee: <P extends keyof Plugins, T_1 extends "swap" | "transfer" | "approve">({ type, feeOptionKey, params, }: {
|
|
21
22
|
type: T_1;
|
|
22
23
|
params: {
|
|
23
24
|
transfer: EVMTransferParams | (GenericTransferParams & {
|
|
@@ -28,191 +29,7 @@ export declare function SwapKit<Plugins extends ReturnType<typeof createPlugin>,
|
|
|
28
29
|
contractAddress: string;
|
|
29
30
|
feeOptionKey?: FeeOption;
|
|
30
31
|
};
|
|
31
|
-
swap: import("@swapkit/helpers").GenericSwapParams<{
|
|
32
|
-
buyAsset: string;
|
|
33
|
-
expectedBuyAmount: string;
|
|
34
|
-
expectedBuyAmountMaxSlippage: string;
|
|
35
|
-
fees: {
|
|
36
|
-
amount: string;
|
|
37
|
-
asset: string;
|
|
38
|
-
chain: string;
|
|
39
|
-
protocol: PluginNameEnum;
|
|
40
|
-
type: import("@swapkit/helpers").FeeTypeEnum;
|
|
41
|
-
}[];
|
|
42
|
-
legs: {
|
|
43
|
-
buyAmount: string;
|
|
44
|
-
buyAmountMaxSlippage: string;
|
|
45
|
-
buyAsset: string;
|
|
46
|
-
provider: PluginNameEnum;
|
|
47
|
-
sellAmount: string;
|
|
48
|
-
sellAsset: string;
|
|
49
|
-
fees?: {
|
|
50
|
-
amount: string;
|
|
51
|
-
asset: string;
|
|
52
|
-
chain: string;
|
|
53
|
-
protocol: PluginNameEnum;
|
|
54
|
-
type: import("@swapkit/helpers").FeeTypeEnum;
|
|
55
|
-
}[] | undefined;
|
|
56
|
-
}[];
|
|
57
|
-
meta: {
|
|
58
|
-
tags: import("@swapkit/helpers").PriorityLabel[];
|
|
59
|
-
assets?: {
|
|
60
|
-
asset: string;
|
|
61
|
-
image: string;
|
|
62
|
-
price: number;
|
|
63
|
-
}[] | undefined;
|
|
64
|
-
maxStreamingQuantity?: number | undefined;
|
|
65
|
-
streamingInterval?: number | undefined;
|
|
66
|
-
affiliate?: string | undefined;
|
|
67
|
-
affiliateFee?: string | undefined;
|
|
68
|
-
approvalAddress?: string | undefined;
|
|
69
|
-
chainflip?: {
|
|
70
|
-
destinationAddress: string;
|
|
71
|
-
buyAsset: {
|
|
72
|
-
asset: string;
|
|
73
|
-
chain: string;
|
|
74
|
-
};
|
|
75
|
-
sellAsset: {
|
|
76
|
-
asset: string;
|
|
77
|
-
chain: string;
|
|
78
|
-
};
|
|
79
|
-
affiliateFees?: {
|
|
80
|
-
brokerAddress: string;
|
|
81
|
-
feeBps: number;
|
|
82
|
-
}[] | undefined;
|
|
83
|
-
brokerCommissionBps?: number | undefined;
|
|
84
|
-
channelMetadata?: {
|
|
85
|
-
cfParameters?: string | undefined;
|
|
86
|
-
gasBudget?: string | undefined;
|
|
87
|
-
message?: string | undefined;
|
|
88
|
-
} | undefined;
|
|
89
|
-
dcaParameters?: {
|
|
90
|
-
chunkInterval?: number | undefined;
|
|
91
|
-
numberOfChunks?: number | undefined;
|
|
92
|
-
} | undefined;
|
|
93
|
-
maxBoostFeeBps?: number | undefined;
|
|
94
|
-
refundParameters?: {
|
|
95
|
-
minPrice?: string | undefined;
|
|
96
|
-
refundAddress?: string | undefined;
|
|
97
|
-
retryDuration?: number | undefined;
|
|
98
|
-
} | undefined;
|
|
99
|
-
} | undefined;
|
|
100
|
-
garden?: {
|
|
101
|
-
destinationAddress: string;
|
|
102
|
-
buyAsset: string;
|
|
103
|
-
sellAmount: string;
|
|
104
|
-
sellAsset: string;
|
|
105
|
-
slippage: number;
|
|
106
|
-
sourceAddress: string;
|
|
107
|
-
affiliateFees?: {
|
|
108
|
-
feeBps: number;
|
|
109
|
-
nearId: string;
|
|
110
|
-
} | undefined;
|
|
111
|
-
} | undefined;
|
|
112
|
-
near?: {
|
|
113
|
-
destinationAddress: string;
|
|
114
|
-
buyAsset: string;
|
|
115
|
-
sellAmount: string;
|
|
116
|
-
sellAsset: string;
|
|
117
|
-
slippage: number;
|
|
118
|
-
sourceAddress: string;
|
|
119
|
-
affiliateFees?: {
|
|
120
|
-
feeBps: number;
|
|
121
|
-
nearId: string;
|
|
122
|
-
} | undefined;
|
|
123
|
-
} | undefined;
|
|
124
|
-
priceImpact?: number | undefined;
|
|
125
|
-
referrer?: string | undefined;
|
|
126
|
-
txType?: import("@swapkit/helpers").RouteQuoteTxType | undefined;
|
|
127
|
-
};
|
|
128
|
-
providers: PluginNameEnum[];
|
|
129
|
-
routeId: string;
|
|
130
|
-
sellAmount: string;
|
|
131
|
-
sellAsset: string;
|
|
132
|
-
totalSlippageBps: number;
|
|
133
|
-
warnings: {
|
|
134
|
-
code: import("@swapkit/helpers").WarningCodeEnum;
|
|
135
|
-
display: string;
|
|
136
|
-
tooltip?: string | undefined;
|
|
137
|
-
}[];
|
|
138
|
-
destinationAddress?: string | undefined;
|
|
139
|
-
estimatedTime?: {
|
|
140
|
-
total: number;
|
|
141
|
-
inbound?: number | undefined;
|
|
142
|
-
outbound?: number | undefined;
|
|
143
|
-
swap?: number | undefined;
|
|
144
|
-
} | undefined;
|
|
145
|
-
expiration?: string | undefined;
|
|
146
|
-
inboundAddress?: string | undefined;
|
|
147
|
-
memo?: string | undefined;
|
|
148
|
-
sourceAddress?: string | undefined;
|
|
149
|
-
targetAddress?: string | undefined;
|
|
150
|
-
tx?: string | {
|
|
151
|
-
data: string;
|
|
152
|
-
from: string;
|
|
153
|
-
to: string;
|
|
154
|
-
value: string;
|
|
155
|
-
} | {
|
|
156
|
-
accountNumber: number;
|
|
157
|
-
chainId: import("@swapkit/types").ChainId;
|
|
158
|
-
fee: {
|
|
159
|
-
amount: {
|
|
160
|
-
amount: string;
|
|
161
|
-
denom: string;
|
|
162
|
-
}[];
|
|
163
|
-
gas: string;
|
|
164
|
-
};
|
|
165
|
-
memo: string;
|
|
166
|
-
msgs: {
|
|
167
|
-
typeUrl: string;
|
|
168
|
-
value: {
|
|
169
|
-
amount: {
|
|
170
|
-
amount: string;
|
|
171
|
-
denom: string;
|
|
172
|
-
}[];
|
|
173
|
-
fromAddress: string;
|
|
174
|
-
toAddress: string;
|
|
175
|
-
} | {
|
|
176
|
-
coins: {
|
|
177
|
-
amount: string;
|
|
178
|
-
asset: {
|
|
179
|
-
chain: string;
|
|
180
|
-
symbol: string;
|
|
181
|
-
synth: boolean;
|
|
182
|
-
ticker: string;
|
|
183
|
-
};
|
|
184
|
-
}[];
|
|
185
|
-
memo: string;
|
|
186
|
-
signer: string;
|
|
187
|
-
};
|
|
188
|
-
}[];
|
|
189
|
-
sequence: number;
|
|
190
|
-
} | {
|
|
191
|
-
raw_data: {
|
|
192
|
-
[x: string]: unknown;
|
|
193
|
-
contract: any;
|
|
194
|
-
expiration: number;
|
|
195
|
-
ref_block_bytes: string;
|
|
196
|
-
ref_block_hash: string;
|
|
197
|
-
timestamp: number;
|
|
198
|
-
data?: string | undefined;
|
|
199
|
-
fee_limit?: number | undefined;
|
|
200
|
-
};
|
|
201
|
-
raw_data_hex: string;
|
|
202
|
-
txID: string;
|
|
203
|
-
visible: boolean;
|
|
204
|
-
} | {
|
|
205
|
-
calldata: string[];
|
|
206
|
-
contractAddress: string;
|
|
207
|
-
entrypoint: string;
|
|
208
|
-
}[] | {
|
|
209
|
-
address: string;
|
|
210
|
-
amount: string;
|
|
211
|
-
payload?: string | undefined;
|
|
212
|
-
stateInit?: string | undefined;
|
|
213
|
-
}[] | undefined;
|
|
214
|
-
txType?: import("@swapkit/helpers").RouteQuoteTxType | undefined;
|
|
215
|
-
}> & {
|
|
32
|
+
swap: import("@swapkit/helpers").GenericSwapParams<SwapRoute> & {
|
|
216
33
|
pluginName?: P | undefined;
|
|
217
34
|
useApiTx?: boolean;
|
|
218
35
|
} & {
|
|
@@ -2123,6 +1940,7 @@ export declare function SwapKit<Plugins extends ReturnType<typeof createPlugin>,
|
|
|
2123
1940
|
SPARK: never;
|
|
2124
1941
|
XLM: ChainWallet<Chain.Stellar> & {
|
|
2125
1942
|
broadcastTransaction: (signedTransaction: {
|
|
1943
|
+
hash?: () => Buffer;
|
|
2126
1944
|
toXDR: () => string;
|
|
2127
1945
|
}) => Promise<string>;
|
|
2128
1946
|
createTransaction: ({ recipient, assetValue, memo, sender }: import("@swapkit/toolboxes/stellar/types").StellarCreateTransactionParams) => Promise<import("@stellar/stellar-sdk").Transaction<import("@stellar/stellar-sdk").Memo<import("@stellar/stellar-sdk").MemoType>, import("@stellar/stellar-sdk").Operation[]>>;
|
|
@@ -2440,7 +2258,7 @@ export declare function SwapKit<Plugins extends ReturnType<typeof createPlugin>,
|
|
|
2440
2258
|
types: Record<string, TypedDataField[]>;
|
|
2441
2259
|
value: Record<string, unknown>;
|
|
2442
2260
|
}) => Promise<string>;
|
|
2443
|
-
swap: <T_1 extends keyof Plugins>({ route, pluginName, ...rest }: SwapParams<T_1,
|
|
2261
|
+
swap: <T_1 extends keyof Plugins>({ route, pluginName, ...rest }: SwapParams<T_1, SwapRoute>) => any;
|
|
2444
2262
|
transfer: ({ assetValue, ...params }: GenericTransferParams | EVMTransferParams) => Promise<string>;
|
|
2445
2263
|
validateAddress: ({ address, chain }: {
|
|
2446
2264
|
address: string;
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"author": "swapkit-dev",
|
|
3
3
|
"dependencies": {
|
|
4
|
-
"@swapkit/helpers": "4.13.
|
|
5
|
-
"@swapkit/plugins": "4.6.
|
|
6
|
-
"@swapkit/toolboxes": "4.16.
|
|
7
|
-
"@swapkit/wallet-core": "4.3.
|
|
4
|
+
"@swapkit/helpers": "4.13.12",
|
|
5
|
+
"@swapkit/plugins": "4.6.44",
|
|
6
|
+
"@swapkit/toolboxes": "4.16.1",
|
|
7
|
+
"@swapkit/wallet-core": "4.3.3"
|
|
8
8
|
},
|
|
9
9
|
"description": "SwapKit - Core",
|
|
10
10
|
"devDependencies": { "@stricahq/typhonjs": "3.1.0", "cosmjs-types": "0.11.0", "ts-pattern": "5.9.0" },
|
|
@@ -26,5 +26,5 @@
|
|
|
26
26
|
"type-check:go": "tsgo"
|
|
27
27
|
},
|
|
28
28
|
"type": "module",
|
|
29
|
-
"version": "4.4.
|
|
29
|
+
"version": "4.4.30"
|
|
30
30
|
}
|