@enkryptcom/swap 0.0.5 → 0.0.6
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/0x-logo-4HHVI5XS.png +0 -0
- package/dist/1inch-logo-BLRCEBBA.png +0 -0
- package/dist/changelly-logo-MBAOH76M.png +0 -0
- package/dist/index.cjs +3316 -1276
- package/dist/index.d.cts +36 -2
- package/dist/index.d.ts +36 -2
- package/dist/index.js +3297 -1261
- package/dist/jupiter-logo-WOFKE5WI.png +0 -0
- package/dist/okx-logo-NZJOHVVZ.png +0 -0
- package/dist/paraswap-logo-JS3QGXOI.png +0 -0
- package/dist/rango-logo-Y2NIH2UX.png +0 -0
- package/package.json +25 -23
package/dist/index.d.cts
CHANGED
|
@@ -101,11 +101,23 @@ interface SwapOptions {
|
|
|
101
101
|
}
|
|
102
102
|
declare enum ProviderName {
|
|
103
103
|
oneInch = "oneInch",
|
|
104
|
+
oneInchFusion = "oneInchFusion",
|
|
104
105
|
paraswap = "paraswap",
|
|
105
106
|
zerox = "zerox",
|
|
106
107
|
changelly = "changelly",
|
|
107
108
|
rango = "rango",
|
|
108
|
-
jupiter = "jupiter"
|
|
109
|
+
jupiter = "jupiter",
|
|
110
|
+
okx = "okx"
|
|
111
|
+
}
|
|
112
|
+
declare enum ProviderNameProper {
|
|
113
|
+
oneInch = "1inch",
|
|
114
|
+
oneInchFusion = "1inch Fusion",
|
|
115
|
+
paraswap = "ParaSwap",
|
|
116
|
+
zerox = "0x",
|
|
117
|
+
changelly = "Changelly",
|
|
118
|
+
rango = "Rango",
|
|
119
|
+
jupiter = "Jupiter",
|
|
120
|
+
okx = "Okx"
|
|
109
121
|
}
|
|
110
122
|
declare enum TransactionStatus {
|
|
111
123
|
pending = "pending",
|
|
@@ -125,6 +137,10 @@ declare enum TransactionType {
|
|
|
125
137
|
generic = "generic",
|
|
126
138
|
solana = "solana"
|
|
127
139
|
}
|
|
140
|
+
declare enum SwapType {
|
|
141
|
+
regular = "regular",
|
|
142
|
+
rfq = "rfq"
|
|
143
|
+
}
|
|
128
144
|
interface EVMTransaction {
|
|
129
145
|
from: string;
|
|
130
146
|
gasLimit: string;
|
|
@@ -175,6 +191,10 @@ type StatusOptionTransaction = {
|
|
|
175
191
|
hash: string;
|
|
176
192
|
sentAt: number;
|
|
177
193
|
};
|
|
194
|
+
interface RFQOptions {
|
|
195
|
+
[key: string]: any;
|
|
196
|
+
signatures?: string[];
|
|
197
|
+
}
|
|
178
198
|
interface StatusOptions {
|
|
179
199
|
[key: string]: any;
|
|
180
200
|
transactions: StatusOptionTransaction[];
|
|
@@ -183,17 +203,29 @@ interface StatusOptionsResponse {
|
|
|
183
203
|
options: StatusOptions;
|
|
184
204
|
provider: ProviderName;
|
|
185
205
|
}
|
|
206
|
+
interface RFQOptionsResponse {
|
|
207
|
+
options: RFQOptions;
|
|
208
|
+
provider: ProviderName;
|
|
209
|
+
}
|
|
186
210
|
interface ProviderSwapResponse {
|
|
187
211
|
transactions: SwapTransaction[];
|
|
188
212
|
toTokenAmount: BN;
|
|
189
213
|
fromTokenAmount: BN;
|
|
214
|
+
type: SwapType;
|
|
215
|
+
typedMessages?: string[];
|
|
190
216
|
additionalNativeFees: BN;
|
|
191
217
|
provider: ProviderName;
|
|
192
218
|
slippage: string;
|
|
193
219
|
fee: number;
|
|
194
220
|
getStatusObject: (options: StatusOptions) => Promise<StatusOptionsResponse>;
|
|
221
|
+
getRFQObject?: () => Promise<RFQOptionsResponse>;
|
|
195
222
|
}
|
|
196
223
|
|
|
224
|
+
declare const PROVIDER_INFO: Record<ProviderName, {
|
|
225
|
+
name: ProviderNameProper;
|
|
226
|
+
icon: any;
|
|
227
|
+
}>;
|
|
228
|
+
|
|
197
229
|
declare const isSupportedNetwork: (networkName: SupportedNetworkName) => boolean;
|
|
198
230
|
declare const getSupportedNetworks: () => NetworkInfo[];
|
|
199
231
|
declare const getNetworkInfoByName: (networkName: SupportedNetworkName) => NetworkInfo;
|
|
@@ -234,6 +266,7 @@ declare class Swap extends EventEmitter {
|
|
|
234
266
|
private fromTokens;
|
|
235
267
|
private toTokens;
|
|
236
268
|
private walletId;
|
|
269
|
+
private rwaFilterList;
|
|
237
270
|
constructor(options: SwapOptions);
|
|
238
271
|
private init;
|
|
239
272
|
getFromTokens(): FromTokenType;
|
|
@@ -245,7 +278,8 @@ declare class Swap extends EventEmitter {
|
|
|
245
278
|
signal?: AbortSignal;
|
|
246
279
|
}): Promise<ProviderSwapResponse | null>;
|
|
247
280
|
getStatus(options: StatusOptionsResponse): Promise<TransactionStatus | null>;
|
|
281
|
+
submitRFQOrder(options: RFQOptionsResponse): Promise<string>;
|
|
248
282
|
static networkNameToInfo(networkName: SupportedNetworkName): NetworkInfo;
|
|
249
283
|
}
|
|
250
284
|
|
|
251
|
-
export { type EVMTransaction, type GenericTransaction, type NetworkInfo, NetworkType, type ProviderQuoteResponse, type ProviderSwapResponse, type SolanaTransaction, type StatusOptions, type StatusOptionsResponse, SupportedNetworkName, SwapToken, type TokenType, type TokenTypeTo, TransactionStatus, TransactionType, WalletIdentifier, Swap as default, getNetworkInfoByName, getSupportedNetworks, isSupportedNetwork, sortByRank, sortNativeToFront };
|
|
285
|
+
export { type EVMTransaction, type GenericTransaction, type NetworkInfo, NetworkType, PROVIDER_INFO, type ProviderQuoteResponse, type ProviderSwapResponse, type SolanaTransaction, type StatusOptions, type StatusOptionsResponse, SupportedNetworkName, SwapToken, type ToTokenType, type TokenType, type TokenTypeTo, TransactionStatus, TransactionType, WalletIdentifier, Swap as default, getNetworkInfoByName, getSupportedNetworks, isSupportedNetwork, sortByRank, sortNativeToFront };
|
package/dist/index.d.ts
CHANGED
|
@@ -101,11 +101,23 @@ interface SwapOptions {
|
|
|
101
101
|
}
|
|
102
102
|
declare enum ProviderName {
|
|
103
103
|
oneInch = "oneInch",
|
|
104
|
+
oneInchFusion = "oneInchFusion",
|
|
104
105
|
paraswap = "paraswap",
|
|
105
106
|
zerox = "zerox",
|
|
106
107
|
changelly = "changelly",
|
|
107
108
|
rango = "rango",
|
|
108
|
-
jupiter = "jupiter"
|
|
109
|
+
jupiter = "jupiter",
|
|
110
|
+
okx = "okx"
|
|
111
|
+
}
|
|
112
|
+
declare enum ProviderNameProper {
|
|
113
|
+
oneInch = "1inch",
|
|
114
|
+
oneInchFusion = "1inch Fusion",
|
|
115
|
+
paraswap = "ParaSwap",
|
|
116
|
+
zerox = "0x",
|
|
117
|
+
changelly = "Changelly",
|
|
118
|
+
rango = "Rango",
|
|
119
|
+
jupiter = "Jupiter",
|
|
120
|
+
okx = "Okx"
|
|
109
121
|
}
|
|
110
122
|
declare enum TransactionStatus {
|
|
111
123
|
pending = "pending",
|
|
@@ -125,6 +137,10 @@ declare enum TransactionType {
|
|
|
125
137
|
generic = "generic",
|
|
126
138
|
solana = "solana"
|
|
127
139
|
}
|
|
140
|
+
declare enum SwapType {
|
|
141
|
+
regular = "regular",
|
|
142
|
+
rfq = "rfq"
|
|
143
|
+
}
|
|
128
144
|
interface EVMTransaction {
|
|
129
145
|
from: string;
|
|
130
146
|
gasLimit: string;
|
|
@@ -175,6 +191,10 @@ type StatusOptionTransaction = {
|
|
|
175
191
|
hash: string;
|
|
176
192
|
sentAt: number;
|
|
177
193
|
};
|
|
194
|
+
interface RFQOptions {
|
|
195
|
+
[key: string]: any;
|
|
196
|
+
signatures?: string[];
|
|
197
|
+
}
|
|
178
198
|
interface StatusOptions {
|
|
179
199
|
[key: string]: any;
|
|
180
200
|
transactions: StatusOptionTransaction[];
|
|
@@ -183,17 +203,29 @@ interface StatusOptionsResponse {
|
|
|
183
203
|
options: StatusOptions;
|
|
184
204
|
provider: ProviderName;
|
|
185
205
|
}
|
|
206
|
+
interface RFQOptionsResponse {
|
|
207
|
+
options: RFQOptions;
|
|
208
|
+
provider: ProviderName;
|
|
209
|
+
}
|
|
186
210
|
interface ProviderSwapResponse {
|
|
187
211
|
transactions: SwapTransaction[];
|
|
188
212
|
toTokenAmount: BN;
|
|
189
213
|
fromTokenAmount: BN;
|
|
214
|
+
type: SwapType;
|
|
215
|
+
typedMessages?: string[];
|
|
190
216
|
additionalNativeFees: BN;
|
|
191
217
|
provider: ProviderName;
|
|
192
218
|
slippage: string;
|
|
193
219
|
fee: number;
|
|
194
220
|
getStatusObject: (options: StatusOptions) => Promise<StatusOptionsResponse>;
|
|
221
|
+
getRFQObject?: () => Promise<RFQOptionsResponse>;
|
|
195
222
|
}
|
|
196
223
|
|
|
224
|
+
declare const PROVIDER_INFO: Record<ProviderName, {
|
|
225
|
+
name: ProviderNameProper;
|
|
226
|
+
icon: any;
|
|
227
|
+
}>;
|
|
228
|
+
|
|
197
229
|
declare const isSupportedNetwork: (networkName: SupportedNetworkName) => boolean;
|
|
198
230
|
declare const getSupportedNetworks: () => NetworkInfo[];
|
|
199
231
|
declare const getNetworkInfoByName: (networkName: SupportedNetworkName) => NetworkInfo;
|
|
@@ -234,6 +266,7 @@ declare class Swap extends EventEmitter {
|
|
|
234
266
|
private fromTokens;
|
|
235
267
|
private toTokens;
|
|
236
268
|
private walletId;
|
|
269
|
+
private rwaFilterList;
|
|
237
270
|
constructor(options: SwapOptions);
|
|
238
271
|
private init;
|
|
239
272
|
getFromTokens(): FromTokenType;
|
|
@@ -245,7 +278,8 @@ declare class Swap extends EventEmitter {
|
|
|
245
278
|
signal?: AbortSignal;
|
|
246
279
|
}): Promise<ProviderSwapResponse | null>;
|
|
247
280
|
getStatus(options: StatusOptionsResponse): Promise<TransactionStatus | null>;
|
|
281
|
+
submitRFQOrder(options: RFQOptionsResponse): Promise<string>;
|
|
248
282
|
static networkNameToInfo(networkName: SupportedNetworkName): NetworkInfo;
|
|
249
283
|
}
|
|
250
284
|
|
|
251
|
-
export { type EVMTransaction, type GenericTransaction, type NetworkInfo, NetworkType, type ProviderQuoteResponse, type ProviderSwapResponse, type SolanaTransaction, type StatusOptions, type StatusOptionsResponse, SupportedNetworkName, SwapToken, type TokenType, type TokenTypeTo, TransactionStatus, TransactionType, WalletIdentifier, Swap as default, getNetworkInfoByName, getSupportedNetworks, isSupportedNetwork, sortByRank, sortNativeToFront };
|
|
285
|
+
export { type EVMTransaction, type GenericTransaction, type NetworkInfo, NetworkType, PROVIDER_INFO, type ProviderQuoteResponse, type ProviderSwapResponse, type SolanaTransaction, type StatusOptions, type StatusOptionsResponse, SupportedNetworkName, SwapToken, type ToTokenType, type TokenType, type TokenTypeTo, TransactionStatus, TransactionType, WalletIdentifier, Swap as default, getNetworkInfoByName, getSupportedNetworks, isSupportedNetwork, sortByRank, sortNativeToFront };
|