@swapkit/core 4.6.7 → 5.0.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/CHANGELOG.md +13 -19
- package/dist/types/index.d.ts +37 -38
- package/package.json +6 -8
- package/dist/index.cjs +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,24 +1,18 @@
|
|
|
1
1
|
# @swapkit/core
|
|
2
2
|
|
|
3
|
-
##
|
|
4
|
-
|
|
5
|
-
###
|
|
6
|
-
|
|
7
|
-
- [`
|
|
8
|
-
- [#
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
-
|
|
15
|
-
|
|
16
|
-
## 4.6.5
|
|
17
|
-
|
|
18
|
-
### Patch Changes
|
|
19
|
-
|
|
20
|
-
- [`f90fa82`](https://github.com/swapkit/sdk/commit/f90fa826d1e56dba934ee968ec31a94ae20399fd) Thanks [@towanTG](https://github.com/towanTG)! - Update generated token lists (prod and dev). Remove the hand-maintained hypercore token list and its `hype`/`hypercore` list names — the api serves no HYPE provider, so the documented exception from 4.4.0 is retired and static lists are again 100% provider-generated. (via @swapkit/helpers@4.20.2)
|
|
21
|
-
- [`c3ef809`](https://github.com/swapkit/sdk/commit/c3ef80967cab859310aa7e20e6f0aeb817027bb7) Thanks [@towanTG](https://github.com/towanTG)! - Refresh generated token lists — flashnet now carries the HyperEVM assets (HYPEREVM.HYPE, USDC, USDe, USDT0). The generator drops non-native `HYPE.*` identifiers misfiled by providers: HyperEVM assets belong on `HYPEREVM.*`, and the HYPE (Hypercore) chain keeps only native HYPE. (via @swapkit/helpers@4.20.2)
|
|
3
|
+
## 5.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- [#344](https://github.com/swapkit/sdk/pull/344) [`7f99d74`](https://github.com/swapkit/sdk/commit/7f99d74ec21d58d07b2cccc5b111f8fdae6c7afb) Thanks [@ice-chillios](https://github.com/ice-chillios)! - **ESM-only packages.** CommonJS output (`.cjs`) and `require` export conditions have been removed; every package now ships ESM only (code-splitting stays enabled), with a uniform `{ default, types }` exports shape. `buildPackage` from `@swapkit/tools-builder` no longer emits CJS and the unused `esmOnly` option has been removed.
|
|
8
|
+
- [#249](https://github.com/swapkit/sdk/pull/249) [`41505dc`](https://github.com/swapkit/sdk/commit/41505dc0f4f77dd301cfced063013efb6307b9bb) Thanks [@ice-chillios](https://github.com/ice-chillios)! - Replace `@cosmjs/{amino,crypto,proto-signing,stargate}@0.39.0` with native `@swapkit/cosmos-signer` package. The new signer is ESM-native (no CJS↔ESM-only-noble breakage), uses only `@noble/curves`, `@noble/hashes`, `@scure/{base,bip32,bip39}` + `cosmjs-types` for proto encoders. **No `@cosmjs/*` runtime dependency.** (via @swapkit/toolboxes@5.0.0)
|
|
9
|
+
- [#298](https://github.com/swapkit/sdk/pull/298) [`3017621`](https://github.com/swapkit/sdk/commit/3017621ee5c2da15550036853df74d81f59d6ffb) Thanks [@ice-chillios](https://github.com/ice-chillios)! - Speed up `createTransaction` across toolboxes by removing serial and redundant network round-trips from the build path. Two techniques, both backward-compatible: (via @swapkit/toolboxes@5.0.0)
|
|
10
|
+
- [#360](https://github.com/swapkit/sdk/pull/360) [`d6061d5`](https://github.com/swapkit/sdk/commit/d6061d58367cdf077acf60421a1e8b448363f486) Thanks [@ice-chillios](https://github.com/ice-chillios)! - Add HyperCore `sendAsset` payin support. (via @swapkit/toolboxes@5.0.0)
|
|
11
|
+
- [#295](https://github.com/swapkit/sdk/pull/295) [`fd1d5d7`](https://github.com/swapkit/sdk/commit/fd1d5d7304eda3ff20c53b14d0eb5998fb6b8250) Thanks [@ice-chillios](https://github.com/ice-chillios)! - Remove `ethers` and `@near-js/providers` from `@swapkit/helpers`. EVM address checksum/validation now uses an in-house EIP-55 implementation backed by `@noble/hashes`, ERC-20 symbol decoding reuses the existing dynamic-string ABI decoder, and NEAR token metadata is fetched via JSON-RPC through `RequestClient`. Public behaviour is preserved (ethers-parity semantics, including throw-on-bad-checksum). (via @swapkit/toolboxes@5.0.0)
|
|
12
|
+
- [#295](https://github.com/swapkit/sdk/pull/295) [`fd1d5d7`](https://github.com/swapkit/sdk/commit/fd1d5d7304eda3ff20c53b14d0eb5998fb6b8250) Thanks [@ice-chillios](https://github.com/ice-chillios)! - Consolidate scattered helper utility modules (explorer URLs, validators, widget auth, TNS cost helpers) into grouped homes. Pure internal relocation — the public export surface is unchanged. (via @swapkit/toolboxes@5.0.0)
|
|
13
|
+
- [#353](https://github.com/swapkit/sdk/pull/353) [`2d00760`](https://github.com/swapkit/sdk/commit/2d0076010f56b843295fa814922b46385d3fc52b) Thanks [@towanTG](https://github.com/towanTG)! - Update generated token lists (prod and dev). Remove the hand-maintained hypercore token list and its `hype`/`hypercore` list names — the api serves no HYPE provider, so the documented exception from 4.4.0 is retired and static lists are again 100% provider-generated. (via @swapkit/toolboxes@5.0.0)
|
|
14
|
+
- Update generated token lists. (via @swapkit/toolboxes@5.0.0)
|
|
15
|
+
- [#354](https://github.com/swapkit/sdk/pull/354) [`8d21eef`](https://github.com/swapkit/sdk/commit/8d21eefe8a5379347a6a9b92978b0336e1a155a4) Thanks [@towanTG](https://github.com/towanTG)! - Refresh generated token lists (prod and dev) — dev flashnet now carries the HyperEVM assets (`HYPEREVM.HYPE`, `USDC`, `USDe`, `USDT0`) alongside `HYPE.USDC`. Lists mirror provider output verbatim; no identifiers are filtered. (via @swapkit/toolboxes@5.0.0)
|
|
22
16
|
|
|
23
17
|
## 4.6.4
|
|
24
18
|
|
package/dist/types/index.d.ts
CHANGED
|
@@ -260,15 +260,15 @@ export declare function SwapKit<Plugins extends ReturnType<typeof createPlugin>,
|
|
|
260
260
|
};
|
|
261
261
|
APT: ChainWallet<Chain.Aptos> & {
|
|
262
262
|
broadcastTransaction: ({ senderAuthenticator, transaction, }: {
|
|
263
|
-
senderAuthenticator: Awaited<ReturnType<(transaction: Awaited<ReturnType<({ recipient, assetValue, maxGasAmount, sender: _senderAddress, sweep, }: import("@swapkit/toolboxes/aptos/types").AptosCreateTransactionParams) => Promise<import("@aptos-labs/ts-sdk").SimpleTransaction>>>) => Promise<import("@aptos-labs/ts-sdk").AccountAuthenticator>>>;
|
|
264
|
-
transaction: Awaited<ReturnType<({ recipient, assetValue, maxGasAmount, sender: _senderAddress, sweep, }: import("@swapkit/toolboxes/aptos/types").AptosCreateTransactionParams) => Promise<import("@aptos-labs/ts-sdk").SimpleTransaction>>>;
|
|
263
|
+
senderAuthenticator: Awaited<ReturnType<(transaction: Awaited<ReturnType<({ recipient, assetValue, maxGasAmount, sender: _senderAddress, accountSequenceNumber, gasUnitPrice, sweep, }: import("@swapkit/toolboxes/aptos/types").AptosCreateTransactionParams) => Promise<import("@aptos-labs/ts-sdk").SimpleTransaction>>>) => Promise<import("@aptos-labs/ts-sdk").AccountAuthenticator>>>;
|
|
264
|
+
transaction: Awaited<ReturnType<({ recipient, assetValue, maxGasAmount, sender: _senderAddress, accountSequenceNumber, gasUnitPrice, sweep, }: import("@swapkit/toolboxes/aptos/types").AptosCreateTransactionParams) => Promise<import("@aptos-labs/ts-sdk").SimpleTransaction>>>;
|
|
265
265
|
}) => Promise<string>;
|
|
266
|
-
createTransaction: ({ recipient, assetValue, maxGasAmount, sender: _senderAddress, sweep, }: import("@swapkit/toolboxes/aptos/types").AptosCreateTransactionParams) => Promise<import("@aptos-labs/ts-sdk").SimpleTransaction>;
|
|
266
|
+
createTransaction: ({ recipient, assetValue, maxGasAmount, sender: _senderAddress, accountSequenceNumber, gasUnitPrice, sweep, }: import("@swapkit/toolboxes/aptos/types").AptosCreateTransactionParams) => Promise<import("@aptos-labs/ts-sdk").SimpleTransaction>;
|
|
267
267
|
estimateTransactionFee: (params?: import("@swapkit/toolboxes/aptos/types").AptosCreateTransactionParams) => Promise<AssetValue>;
|
|
268
268
|
getAddress: () => Promise<"" | `0x${string}`>;
|
|
269
269
|
getBalance: (targetAddress?: string) => Promise<AssetValue[]>;
|
|
270
|
-
signAndBroadcastTransaction: (transaction: Awaited<ReturnType<({ recipient, assetValue, maxGasAmount, sender: _senderAddress, sweep, }: import("@swapkit/toolboxes/aptos/types").AptosCreateTransactionParams) => Promise<import("@aptos-labs/ts-sdk").SimpleTransaction>>>) => Promise<string>;
|
|
271
|
-
signTransaction: (transaction: Awaited<ReturnType<({ recipient, assetValue, maxGasAmount, sender: _senderAddress, sweep, }: import("@swapkit/toolboxes/aptos/types").AptosCreateTransactionParams) => Promise<import("@aptos-labs/ts-sdk").SimpleTransaction>>>) => Promise<import("@aptos-labs/ts-sdk").AccountAuthenticator>;
|
|
270
|
+
signAndBroadcastTransaction: (transaction: Awaited<ReturnType<({ recipient, assetValue, maxGasAmount, sender: _senderAddress, accountSequenceNumber, gasUnitPrice, sweep, }: import("@swapkit/toolboxes/aptos/types").AptosCreateTransactionParams) => Promise<import("@aptos-labs/ts-sdk").SimpleTransaction>>>) => Promise<string>;
|
|
271
|
+
signTransaction: (transaction: Awaited<ReturnType<({ recipient, assetValue, maxGasAmount, sender: _senderAddress, accountSequenceNumber, gasUnitPrice, sweep, }: import("@swapkit/toolboxes/aptos/types").AptosCreateTransactionParams) => Promise<import("@aptos-labs/ts-sdk").SimpleTransaction>>>) => Promise<import("@aptos-labs/ts-sdk").AccountAuthenticator>;
|
|
272
272
|
transfer: ({ assetValue, maxGasAmount, recipient, sweep }: import("@swapkit/toolboxes/aptos/types").AptosTransferParams) => Promise<string>;
|
|
273
273
|
validateAddress: typeof import("@swapkit/toolboxes/aptos/toolbox").validateAptosAddress;
|
|
274
274
|
};
|
|
@@ -2145,10 +2145,10 @@ export declare function SwapKit<Plugins extends ReturnType<typeof createPlugin>,
|
|
|
2145
2145
|
validateAddress: typeof import("@swapkit/toolboxes/evm").validateEVMAddress;
|
|
2146
2146
|
};
|
|
2147
2147
|
GAIA: ChainWallet<Chain.Cosmos> & {
|
|
2148
|
-
createPrivateKeyFromPhrase: (phrase: string) => Promise<Uint8Array<
|
|
2148
|
+
createPrivateKeyFromPhrase: (phrase: string) => Promise<Uint8Array<ArrayBuffer>>;
|
|
2149
2149
|
createTransaction: typeof import("@swapkit/toolboxes/cosmos").cosmosCreateTransaction;
|
|
2150
2150
|
fetchFeeRateFromSwapKit: typeof import("@swapkit/toolboxes/cosmos").fetchFeeRateFromSwapKit;
|
|
2151
|
-
getAccount: (address: string) => Promise<import("@
|
|
2151
|
+
getAccount: (address: string) => Promise<import("@swapkit/toolboxes/cosmos").StargateAccount | null>;
|
|
2152
2152
|
getAddress: () => Promise<string | undefined>;
|
|
2153
2153
|
getBalance: (address: string, _potentialScamFilter?: boolean) => Promise<AssetValue[]>;
|
|
2154
2154
|
getBalanceAsDenoms: (address: string) => Promise<{
|
|
@@ -2164,10 +2164,10 @@ export declare function SwapKit<Plugins extends ReturnType<typeof createPlugin>,
|
|
|
2164
2164
|
getSignerFromPhrase: ({ phrase, derivationPath }: {
|
|
2165
2165
|
phrase: string;
|
|
2166
2166
|
derivationPath: import("@swapkit/helpers").DerivationPathArray;
|
|
2167
|
-
}) => Promise<import("@
|
|
2168
|
-
getSignerFromPrivateKey: (privateKey: Uint8Array) => Promise<import("@
|
|
2167
|
+
}) => Promise<import("@swapkit/toolboxes/cosmos").OfflineDirectSigner>;
|
|
2168
|
+
getSignerFromPrivateKey: (privateKey: Uint8Array) => Promise<import("@swapkit/toolboxes/cosmos").OfflineDirectSigner>;
|
|
2169
2169
|
signAndBroadcastTransaction: (transaction: import("@swapkit/helpers").CosmosTransaction) => Promise<string>;
|
|
2170
|
-
signTransaction: (transaction: import("@swapkit/helpers").CosmosTransaction) => Promise<import("
|
|
2170
|
+
signTransaction: (transaction: import("@swapkit/helpers").CosmosTransaction) => Promise<import("@swapkit/toolboxes/cosmos").SignedTx>;
|
|
2171
2171
|
transfer: ({ recipient, assetValue, memo, feeRate, feeOptionKey, sweep, }: GenericTransferParams) => Promise<string>;
|
|
2172
2172
|
validateAddress: (address: string) => boolean;
|
|
2173
2173
|
verifySignature: ({ signature, message, address, }: {
|
|
@@ -2965,10 +2965,10 @@ export declare function SwapKit<Plugins extends ReturnType<typeof createPlugin>,
|
|
|
2965
2965
|
validateAddress: typeof import("@swapkit/toolboxes/evm").validateEVMAddress;
|
|
2966
2966
|
};
|
|
2967
2967
|
HARBOR: ChainWallet<Chain.Harbor> & {
|
|
2968
|
-
createPrivateKeyFromPhrase: (phrase: string) => Promise<Uint8Array<
|
|
2968
|
+
createPrivateKeyFromPhrase: (phrase: string) => Promise<Uint8Array<ArrayBuffer>>;
|
|
2969
2969
|
createTransaction: typeof import("@swapkit/toolboxes/cosmos").cosmosCreateTransaction;
|
|
2970
2970
|
fetchFeeRateFromSwapKit: typeof import("@swapkit/toolboxes/cosmos").fetchFeeRateFromSwapKit;
|
|
2971
|
-
getAccount: (address: string) => Promise<import("@
|
|
2971
|
+
getAccount: (address: string) => Promise<import("@swapkit/toolboxes/cosmos").StargateAccount | null>;
|
|
2972
2972
|
getAddress: () => Promise<string | undefined>;
|
|
2973
2973
|
getBalance: (address: string, _potentialScamFilter?: boolean) => Promise<AssetValue[]>;
|
|
2974
2974
|
getBalanceAsDenoms: (address: string) => Promise<{
|
|
@@ -2984,10 +2984,10 @@ export declare function SwapKit<Plugins extends ReturnType<typeof createPlugin>,
|
|
|
2984
2984
|
getSignerFromPhrase: ({ phrase, derivationPath }: {
|
|
2985
2985
|
phrase: string;
|
|
2986
2986
|
derivationPath: import("@swapkit/helpers").DerivationPathArray;
|
|
2987
|
-
}) => Promise<import("@
|
|
2988
|
-
getSignerFromPrivateKey: (privateKey: Uint8Array) => Promise<import("@
|
|
2987
|
+
}) => Promise<import("@swapkit/toolboxes/cosmos").OfflineDirectSigner>;
|
|
2988
|
+
getSignerFromPrivateKey: (privateKey: Uint8Array) => Promise<import("@swapkit/toolboxes/cosmos").OfflineDirectSigner>;
|
|
2989
2989
|
signAndBroadcastTransaction: (transaction: import("@swapkit/helpers").CosmosTransaction) => Promise<string>;
|
|
2990
|
-
signTransaction: (transaction: import("@swapkit/helpers").CosmosTransaction) => Promise<import("
|
|
2990
|
+
signTransaction: (transaction: import("@swapkit/helpers").CosmosTransaction) => Promise<import("@swapkit/toolboxes/cosmos").SignedTx>;
|
|
2991
2991
|
transfer: ({ recipient, assetValue, memo, feeRate, feeOptionKey, sweep, }: GenericTransferParams) => Promise<string>;
|
|
2992
2992
|
validateAddress: (address: string) => boolean;
|
|
2993
2993
|
verifySignature: ({ signature, message, address, }: {
|
|
@@ -3178,6 +3178,7 @@ export declare function SwapKit<Plugins extends ReturnType<typeof createPlugin>,
|
|
|
3178
3178
|
status?: string;
|
|
3179
3179
|
}>;
|
|
3180
3180
|
createL1ActionRequest: typeof import("@swapkit/toolboxes/hypercore/toolbox").createL1ActionRequest;
|
|
3181
|
+
createSendAssetTransaction: typeof import("@swapkit/toolboxes/hypercore/toolbox").createSendAssetTransaction;
|
|
3181
3182
|
createTransaction: typeof import("@swapkit/toolboxes/hypercore/toolbox").createTransaction;
|
|
3182
3183
|
createUserSignedActionRequest: typeof import("@swapkit/toolboxes/hypercore/toolbox").createUserSignedActionRequest;
|
|
3183
3184
|
estimateTransactionFee: () => AssetValue;
|
|
@@ -3201,31 +3202,24 @@ export declare function SwapKit<Plugins extends ReturnType<typeof createPlugin>,
|
|
|
3201
3202
|
spotClearinghouse: ({ user }: {
|
|
3202
3203
|
user: string;
|
|
3203
3204
|
}) => Promise<{
|
|
3204
|
-
balances?:
|
|
3205
|
-
coin?: string;
|
|
3206
|
-
token?: number | string;
|
|
3207
|
-
total?: string;
|
|
3208
|
-
}[];
|
|
3205
|
+
balances?: import("@swapkit/toolboxes/hypercore/toolbox").HyperliquidSpotBalance[];
|
|
3209
3206
|
spotState?: {
|
|
3210
|
-
balances?:
|
|
3211
|
-
coin?: string;
|
|
3212
|
-
token?: number | string;
|
|
3213
|
-
total?: string;
|
|
3214
|
-
}[];
|
|
3207
|
+
balances?: import("@swapkit/toolboxes/hypercore/toolbox").HyperliquidSpotBalance[];
|
|
3215
3208
|
};
|
|
3216
3209
|
}>;
|
|
3217
3210
|
userFills: ({ aggregateByTime, user }: import("@swapkit/toolboxes/hypercore/types").HyperCoreUserFillsQueryParams) => Promise<import("@swapkit/toolboxes/hypercore/types").HyperCoreFill[]>;
|
|
3218
3211
|
userFillsByTime: ({ aggregateByTime, endTime, startTime, user }: import("@swapkit/toolboxes/hypercore/types").HyperCoreUserFillsByTimeQueryParams) => Promise<import("@swapkit/toolboxes/hypercore/types").HyperCoreFill[]>;
|
|
3219
3212
|
};
|
|
3213
|
+
signAndBroadcastSendAsset: (params: import("@swapkit/toolboxes/hypercore/types").HyperCoreSendAssetPayinParams) => Promise<string>;
|
|
3220
3214
|
signTransaction: (request: import("@swapkit/toolboxes/hypercore/types").HyperCoreUnsignedRequest) => Promise<import("@swapkit/toolboxes/hypercore/types").HyperCoreSignedRequest>;
|
|
3221
3215
|
transfer: ({ sweep, ...params }: import("@swapkit/toolboxes/hypercore/types").HyperCoreTransferParams) => Promise<string>;
|
|
3222
3216
|
validateAddress: typeof import("@swapkit/toolboxes/hypercore/toolbox").validateHyperCoreAddress;
|
|
3223
3217
|
};
|
|
3224
3218
|
KUJI: ChainWallet<Chain.Kujira> & {
|
|
3225
|
-
createPrivateKeyFromPhrase: (phrase: string) => Promise<Uint8Array<
|
|
3219
|
+
createPrivateKeyFromPhrase: (phrase: string) => Promise<Uint8Array<ArrayBuffer>>;
|
|
3226
3220
|
createTransaction: typeof import("@swapkit/toolboxes/cosmos").cosmosCreateTransaction;
|
|
3227
3221
|
fetchFeeRateFromSwapKit: typeof import("@swapkit/toolboxes/cosmos").fetchFeeRateFromSwapKit;
|
|
3228
|
-
getAccount: (address: string) => Promise<import("@
|
|
3222
|
+
getAccount: (address: string) => Promise<import("@swapkit/toolboxes/cosmos").StargateAccount | null>;
|
|
3229
3223
|
getAddress: () => Promise<string | undefined>;
|
|
3230
3224
|
getBalance: (address: string, _potentialScamFilter?: boolean) => Promise<AssetValue[]>;
|
|
3231
3225
|
getBalanceAsDenoms: (address: string) => Promise<{
|
|
@@ -3241,10 +3235,10 @@ export declare function SwapKit<Plugins extends ReturnType<typeof createPlugin>,
|
|
|
3241
3235
|
getSignerFromPhrase: ({ phrase, derivationPath }: {
|
|
3242
3236
|
phrase: string;
|
|
3243
3237
|
derivationPath: import("@swapkit/helpers").DerivationPathArray;
|
|
3244
|
-
}) => Promise<import("@
|
|
3245
|
-
getSignerFromPrivateKey: (privateKey: Uint8Array) => Promise<import("@
|
|
3238
|
+
}) => Promise<import("@swapkit/toolboxes/cosmos").OfflineDirectSigner>;
|
|
3239
|
+
getSignerFromPrivateKey: (privateKey: Uint8Array) => Promise<import("@swapkit/toolboxes/cosmos").OfflineDirectSigner>;
|
|
3246
3240
|
signAndBroadcastTransaction: (transaction: import("@swapkit/helpers").CosmosTransaction) => Promise<string>;
|
|
3247
|
-
signTransaction: (transaction: import("@swapkit/helpers").CosmosTransaction) => Promise<import("
|
|
3241
|
+
signTransaction: (transaction: import("@swapkit/helpers").CosmosTransaction) => Promise<import("@swapkit/toolboxes/cosmos").SignedTx>;
|
|
3248
3242
|
transfer: ({ recipient, assetValue, memo, feeRate, feeOptionKey, sweep, }: GenericTransferParams) => Promise<string>;
|
|
3249
3243
|
validateAddress: (address: string) => boolean;
|
|
3250
3244
|
verifySignature: ({ signature, message, address, }: {
|
|
@@ -3946,10 +3940,10 @@ export declare function SwapKit<Plugins extends ReturnType<typeof createPlugin>,
|
|
|
3946
3940
|
validateAddress: typeof import("@swapkit/toolboxes/near/index").validateNearAddress;
|
|
3947
3941
|
};
|
|
3948
3942
|
NOBLE: ChainWallet<Chain.Noble> & {
|
|
3949
|
-
createPrivateKeyFromPhrase: (phrase: string) => Promise<Uint8Array<
|
|
3943
|
+
createPrivateKeyFromPhrase: (phrase: string) => Promise<Uint8Array<ArrayBuffer>>;
|
|
3950
3944
|
createTransaction: typeof import("@swapkit/toolboxes/cosmos").cosmosCreateTransaction;
|
|
3951
3945
|
fetchFeeRateFromSwapKit: typeof import("@swapkit/toolboxes/cosmos").fetchFeeRateFromSwapKit;
|
|
3952
|
-
getAccount: (address: string) => Promise<import("@
|
|
3946
|
+
getAccount: (address: string) => Promise<import("@swapkit/toolboxes/cosmos").StargateAccount | null>;
|
|
3953
3947
|
getAddress: () => Promise<string | undefined>;
|
|
3954
3948
|
getBalance: (address: string, _potentialScamFilter?: boolean) => Promise<AssetValue[]>;
|
|
3955
3949
|
getBalanceAsDenoms: (address: string) => Promise<{
|
|
@@ -3965,10 +3959,10 @@ export declare function SwapKit<Plugins extends ReturnType<typeof createPlugin>,
|
|
|
3965
3959
|
getSignerFromPhrase: ({ phrase, derivationPath }: {
|
|
3966
3960
|
phrase: string;
|
|
3967
3961
|
derivationPath: import("@swapkit/helpers").DerivationPathArray;
|
|
3968
|
-
}) => Promise<import("@
|
|
3969
|
-
getSignerFromPrivateKey: (privateKey: Uint8Array) => Promise<import("@
|
|
3962
|
+
}) => Promise<import("@swapkit/toolboxes/cosmos").OfflineDirectSigner>;
|
|
3963
|
+
getSignerFromPrivateKey: (privateKey: Uint8Array) => Promise<import("@swapkit/toolboxes/cosmos").OfflineDirectSigner>;
|
|
3970
3964
|
signAndBroadcastTransaction: (transaction: import("@swapkit/helpers").CosmosTransaction) => Promise<string>;
|
|
3971
|
-
signTransaction: (transaction: import("@swapkit/helpers").CosmosTransaction) => Promise<import("
|
|
3965
|
+
signTransaction: (transaction: import("@swapkit/helpers").CosmosTransaction) => Promise<import("@swapkit/toolboxes/cosmos").SignedTx>;
|
|
3972
3966
|
transfer: ({ recipient, assetValue, memo, feeRate, feeOptionKey, sweep, }: GenericTransferParams) => Promise<string>;
|
|
3973
3967
|
validateAddress: (address: string) => boolean;
|
|
3974
3968
|
verifySignature: ({ signature, message, address, }: {
|
|
@@ -4534,7 +4528,7 @@ export declare function SwapKit<Plugins extends ReturnType<typeof createPlugin>,
|
|
|
4534
4528
|
tx_blob: string;
|
|
4535
4529
|
hash: string;
|
|
4536
4530
|
}>;
|
|
4537
|
-
createTransaction: ({ assetValue, recipient, memo, sender, sweep, destinationTag, extendBySeconds, }: {
|
|
4531
|
+
createTransaction: ({ assetValue, recipient, memo, sender, sweep, destinationTag, extendBySeconds, sequence, fee, lastLedgerSequence, }: {
|
|
4538
4532
|
assetValue: AssetValue;
|
|
4539
4533
|
recipient: string;
|
|
4540
4534
|
sender?: string;
|
|
@@ -4542,6 +4536,9 @@ export declare function SwapKit<Plugins extends ReturnType<typeof createPlugin>,
|
|
|
4542
4536
|
sweep?: boolean;
|
|
4543
4537
|
destinationTag?: number;
|
|
4544
4538
|
extendBySeconds?: number;
|
|
4539
|
+
sequence?: number;
|
|
4540
|
+
fee?: string;
|
|
4541
|
+
lastLedgerSequence?: number;
|
|
4545
4542
|
}) => Promise<import("xrpl").Payment>;
|
|
4546
4543
|
disconnect: () => void;
|
|
4547
4544
|
estimateTransactionFee: () => Promise<AssetValue>;
|
|
@@ -4738,7 +4735,7 @@ export declare function SwapKit<Plugins extends ReturnType<typeof createPlugin>,
|
|
|
4738
4735
|
SOL: ChainWallet<Chain.Solana> & {
|
|
4739
4736
|
broadcastTransaction: (transaction: import("@solana/web3.js/lib").Transaction | import("@solana/web3.js/lib").VersionedTransaction) => Promise<string>;
|
|
4740
4737
|
createKeysForPath: typeof import("@swapkit/toolboxes/solana/toolbox").createKeysForPath;
|
|
4741
|
-
createTransaction: ({ recipient, assetValue, memo, isProgramDerivedAddress, sender, sweep, }: import("@swapkit/toolboxes/solana/index").SolanaCreateTransactionParams) => Promise<import("@solana/web3.js/lib").Transaction>;
|
|
4738
|
+
createTransaction: ({ recipient, assetValue, memo, isProgramDerivedAddress, sender, recentBlockhash, sweep, }: import("@swapkit/toolboxes/solana/index").SolanaCreateTransactionParams) => Promise<import("@solana/web3.js/lib").Transaction>;
|
|
4742
4739
|
createTransactionFromInstructions: ({ instructions, }: {
|
|
4743
4740
|
instructions: import("@solana/web3.js/lib").TransactionInstruction[];
|
|
4744
4741
|
isProgramDerivedAddress?: boolean;
|
|
@@ -4999,6 +4996,8 @@ export declare function SwapKit<Plugins extends ReturnType<typeof createPlugin>,
|
|
|
4999
4996
|
broadcastTransaction: (transferCell: import("@ton/core").Cell) => Promise<string>;
|
|
5000
4997
|
createTransaction: ({ sender, sweep, ...params }: GenericTransferParams & {
|
|
5001
4998
|
sender?: string;
|
|
4999
|
+
sweep?: boolean;
|
|
5000
|
+
jettonWalletAddress?: string;
|
|
5002
5001
|
}) => Promise<import("@swapkit/toolboxes/ton/types").TONToolboxTransaction>;
|
|
5003
5002
|
estimateTransactionFee: ({ sender, ...params }: GenericTransferParams & {
|
|
5004
5003
|
sender?: string;
|
|
@@ -5017,7 +5016,7 @@ export declare function SwapKit<Plugins extends ReturnType<typeof createPlugin>,
|
|
|
5017
5016
|
TRON: ChainWallet<Chain.Tron> & {
|
|
5018
5017
|
approve: ({ assetAddress, spenderAddress, amount, from }: import("@swapkit/toolboxes/tron/types").TronApproveParams) => Promise<string>;
|
|
5019
5018
|
broadcastTransaction: typeof import("@swapkit/toolboxes/tron/helpers/trongrid").broadcastTronTransaction;
|
|
5020
|
-
createTransaction: ({ recipient, assetValue, memo, sender, expiration, sweep, }: import("@swapkit/toolboxes/tron/types").TronCreateTransactionParams) => Promise<import("@swapkit/toolboxes/tron/types").TronTransaction>;
|
|
5019
|
+
createTransaction: ({ recipient, assetValue, memo, sender, expiration, sweep, recipientExists: providedRecipientExists, }: import("@swapkit/toolboxes/tron/types").TronCreateTransactionParams) => Promise<import("@swapkit/toolboxes/tron/types").TronTransaction>;
|
|
5021
5020
|
estimateTransactionFee: ({ assetValue, memo, recipient, sender, }: import("@swapkit/toolboxes/tron/types").TronTransferParams & {
|
|
5022
5021
|
sender?: string;
|
|
5023
5022
|
}) => Promise<AssetValue>;
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"author": "swapkit-dev",
|
|
3
3
|
"dependencies": {
|
|
4
|
-
"@swapkit/helpers": "
|
|
5
|
-
"@swapkit/plugins": "
|
|
6
|
-
"@swapkit/toolboxes": "
|
|
7
|
-
"@swapkit/wallet-core": "
|
|
4
|
+
"@swapkit/helpers": "5.0.0",
|
|
5
|
+
"@swapkit/plugins": "5.0.0",
|
|
6
|
+
"@swapkit/toolboxes": "5.0.0",
|
|
7
|
+
"@swapkit/wallet-core": "5.0.0"
|
|
8
8
|
},
|
|
9
9
|
"description": "SwapKit - Core",
|
|
10
10
|
"devDependencies": {
|
|
@@ -13,9 +13,7 @@
|
|
|
13
13
|
"cosmjs-types": "0.11.0",
|
|
14
14
|
"ts-pattern": "5.9.0"
|
|
15
15
|
},
|
|
16
|
-
"exports": {
|
|
17
|
-
".": { "import": "./dist/index.js", "require": "./dist/index.cjs", "types": "./dist/types/index.d.ts" }
|
|
18
|
-
},
|
|
16
|
+
"exports": { ".": { "default": "./dist/index.js", "types": "./dist/types/index.d.ts" } },
|
|
19
17
|
"files": ["dist/", "CHANGELOG.md"],
|
|
20
18
|
"homepage": "https://github.com/swapkit/SwapKit",
|
|
21
19
|
"license": "SEE LICENSE IN LICENSE",
|
|
@@ -36,5 +34,5 @@
|
|
|
36
34
|
"type-check:go": "tsgo"
|
|
37
35
|
},
|
|
38
36
|
"type": "module",
|
|
39
|
-
"version": "
|
|
37
|
+
"version": "5.0.0"
|
|
40
38
|
}
|
package/dist/index.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var{defineProperty:O,getOwnPropertyNames:E,getOwnPropertyDescriptor:jj}=Object,x=Object.prototype.hasOwnProperty;function P(J){return this[J]}var B=(J,L,$)=>{var I=E(L);for(let X of I)if(!x.call(J,X)&&X!=="default")O(J,X,{get:P.bind(L,X),enumerable:!0});if($){for(let X of I)if(!x.call($,X)&&X!=="default")O($,X,{get:P.bind(L,X),enumerable:!0});return $}};var qj=(J)=>{var L=(S??=new WeakMap).get(J),$;if(L)return L;if(L=O({},"__esModule",{value:!0}),J&&typeof J==="object"||typeof J==="function"){for(var I of E(J))if(!x.call(L,I))O(L,I,{get:P.bind(J,I),enumerable:!($=jj(J,I))||$.enumerable})}return S.set(J,L),L},S;var zj=(J)=>J;function Gj(J,L){this[J]=zj.bind(null,L)}var Hj=(J,L)=>{for(var $ in L)O(J,$,{get:L[$],enumerable:!0,configurable:!0,set:Gj.bind(L,$)})};var k={};Hj(k,{resolveRoutePluginName:()=>v,getRouteApprovalAssetValue:()=>V,SwapKit:()=>Lj});module.exports=qj(k);var q=require("@swapkit/helpers"),y=require("@swapkit/helpers/api");B(k,require("@swapkit/helpers"),module.exports);var Jj=[q.ProviderName.FLASHNET,q.ProviderName.MAYAN];function v({pluginName:J,providers:L,useDirectSigning:$}){return L.some((X)=>Jj.includes(X))||$?"swapkit":J||L[0]}function V(J){let L="approvalTx"in J?J.approvalTx:void 0;return L!==void 0&&"txType"in L&&L.txType==="STELLAR"?q.AssetValue.from({asset:J.buyAsset}):q.AssetValue.from({asset:J.sellAsset,value:J.sellAmount})}function Lj({config:J,plugins:L,wallets:$}={}){if(J)q.SKConfig.set(J);let I={},X=Object.entries(L||{}).reduce((j,[G,z])=>{let H=z({getWallet:Y});return j[G]=H,j},{}),W=Object.entries($||{}).reduce((j,[G,z])=>{let H=z.connectWallet({addChain:w});return j[G]=H,j},{});function A(j){let G=j&&X[j],z=Object.values(X).find((Q)=>Q.supportedSwapkitProviders?.includes(j)),H=G||z;if(!H)throw new q.SwapKitError("core_plugin_not_found");return H}function w(j){let G=Y(j.chain),z=j?.balance||G?.balance||[q.AssetValue.from({chain:j.chain})],H={...G,...j,balance:z};return I[j.chain]=H,H}function T({pluginName:j,route:G,useDirectSigning:z}){return A(v({pluginName:j,providers:G.providers,useDirectSigning:z}))}function m({assetValue:j,plugin:G,route:z,spenderAddress:H,type:Q}){if(Q===q.ApproveMode.CheckOnly&&"isAssetValueApproved"in G)return G.isAssetValueApproved({assetValue:j,route:z,spenderAddress:H});if(Q===q.ApproveMode.Approve&&"approveAssetValue"in G)return G.approveAssetValue({assetValue:j,route:z,spenderAddress:H});throw new q.SwapKitError({errorKey:"core_approve_asset_target_invalid",info:{message:`Target ${String(H??z?.providers[0])} cannot be used for approve operation`}})}function b({assetValue:j,type:G="checkOnly",contractAddress:z,route:H}){let Q=j??(H?V(H):void 0);if(!Q)throw new q.SwapKitError("core_approve_asset_target_invalid");let Z=z??H?.meta.approvalAddress,R=H?T({route:H,useDirectSigning:Boolean(Y(Q.chain)?.supportsDirectSigning)}):Z&&X[Z];if(R)return m({assetValue:Q,plugin:R,route:H,spenderAddress:Z,type:G});let f=Q.chain,_=q.EVMChains.includes(f);if(_&&Q.isGasAsset||!_||Q.isSynthetic)return Promise.resolve(G==="checkOnly"?!0:"approved");let U=Y(f),D=G==="checkOnly"?U.isApproved:U.approve;if(!D)throw new q.SwapKitError("core_wallet_connection_not_found");if(!(Q.address&&U.address&&typeof Z==="string"))throw new q.SwapKitError("core_approve_asset_address_or_from_not_found");return D({amount:Q.getBaseValue("bigint"),assetAddress:Q.address,from:U.address,spenderAddress:Z})}function Y(j){return I[j]}function h(){return{...I}}function d(j){return Y(j)?.address||""}function g(j,G){return j instanceof q.AssetValue?b({assetValue:j,contractAddress:G,type:q.ApproveMode.Approve}):b({route:j,type:q.ApproveMode.Approve})}function u(j,G){return j instanceof q.AssetValue?b({assetValue:j,contractAddress:G,type:q.ApproveMode.CheckOnly}):b({route:j,type:q.ApproveMode.CheckOnly})}function K(j){Y(j)?.disconnect?.(),delete I[j]}function c(){for(let j of Object.keys(I))K(j)}function o(j,G){return G?N(j).then(({balance:z})=>z):Y(j)?.balance||[]}async function N(j,G=!0){let z=Y(j);if(!z)throw new q.SwapKitError("core_wallet_connection_not_found");let H=await z.getBalance?.(z.address,G);return z.balance=H||[q.AssetValue.from({chain:j})],z}function p({route:j,pluginName:G,...z}){let H=q.AssetValue.from({asset:j.sellAsset}).chain,Q=Y(H);if(!Q)throw new q.SwapKitError("core_wallet_connection_not_found");let Z=T({pluginName:G,route:j,useDirectSigning:Boolean(Q.supportsDirectSigning&&j.tx)});if("swap"in Z)return Z.swap({...z,route:j});throw new q.SwapKitError("core_plugin_swap_not_found")}function i({assetValue:j,...G}){let z=j.chain;if([q.Chain.Radix].includes(z)||!Y(z))throw new q.SwapKitError("core_wallet_connection_not_found");return Y(z).transfer({...G,assetValue:j})}function n({chain:j,message:G}){let z=Y(j);if(!z)throw new q.SwapKitError("core_wallet_connection_not_found");if("signMessage"in z)return z.signMessage?.(G);throw new q.SwapKitError({errorKey:"core_wallet_sign_message_not_supported",info:{chain:j,wallet:z.walletType}})}function r({chain:j,domain:G,primaryType:z,types:H,value:Q}){let Z=Y(j);if(!Z)throw new q.SwapKitError("core_wallet_connection_not_found");if("signTypedData"in Z&&typeof Z.signTypedData==="function")return Z.signTypedData({domain:G,primaryType:z,types:H,value:Q});throw new q.SwapKitError({errorKey:"core_wallet_sign_typed_data_not_supported",info:{chain:j,wallet:Z.walletType}})}async function s({address:j,chain:G,message:z,signature:H}){if(G!==q.Chain.THORChain)throw new q.SwapKitError({errorKey:"core_verify_message_not_supported",info:{chain:G}});let{getCosmosToolbox:Q}=await import("@swapkit/toolboxes/cosmos");return Q(G).verifySignature({address:j,message:z,signature:H})}async function l({type:j,feeOptionKey:G,params:z}){let{assetValue:H}=z,{chain:Q}=H;if(!Y(Q))throw new q.SwapKitError("core_wallet_connection_not_found");let Z=q.AssetValue.from({chain:Q}),{match:R}=await import("ts-pattern");return await R(Q).returnType().with(...q.EVMChains,(_)=>{let{address:F,...U}=Y(_),D=R(j).with("transfer",()=>U.createTransferTx(z)).with("approve",(a)=>{let{contractAddress:M}=z;return U.createApprovalTx({amount:H.getBaseValue("bigint"),assetAddress:H.address,from:F,spenderAddress:M})}).with("swap",(a)=>{let{route:{providers:[M],tx:e}}=z;if(M&&[q.ProviderName.CHAINFLIP,q.ProviderName.CHAINFLIP_STREAMING].includes(M))return U.createTransferTx({assetValue:H,recipient:F,sender:F});let C=e;return{...C,value:y.parseTransactionValue(C.value)}}).otherwise(()=>{return});if(!D)return Z;return U.estimateTransactionFee({...D,feeOption:G})}).with(...q.CosmosChains,async()=>{let{estimateTransactionFee:_}=await import("@swapkit/toolboxes/cosmos");return _(z)}).with(...q.UTXOChains,(_)=>{let{address:F,...U}=Y(_);return U.estimateTransactionFee({...z,feeOptionKey:G,recipient:F,sender:F})}).with(q.Chain.Tron,q.Chain.Ton,q.Chain.Polkadot,(_)=>{let{address:F,...U}=Y(_);return U.estimateTransactionFee({...z,recipient:F,sender:F})}).with(q.Chain.Aptos,q.Chain.Cardano,q.Chain.Ripple,q.Chain.Stellar,q.Chain.Sui,(_)=>Y(_).estimateTransactionFee()).otherwise(()=>Z)}async function t({address:j,chain:G}){try{let{getAddressValidator:z}=await import("@swapkit/toolboxes");return(await z())({address:j,chain:G})}catch{return!1}}return{...X,...W,approveAssetValue:g,disconnectAll:c,disconnectChain:K,estimateTransactionFee:l,getAddress:d,getAllWallets:h,getBalance:o,getWallet:Y,getWalletWithBalance:N,isAssetValueApproved:u,signMessage:n,signTypedData:r,swap:p,transfer:i,validateAddress:t,verifyMessage:s}}
|