@swapkit/core 1.0.0-rc.17 → 1.0.0-rc.171

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.
Files changed (35) hide show
  1. package/dist/index.js +3 -0
  2. package/dist/index.js.map +12 -0
  3. package/package.json +28 -49
  4. package/src/__tests__/helpers.test.ts +65 -0
  5. package/src/client.ts +457 -0
  6. package/src/helpers/explorerUrls.ts +45 -0
  7. package/src/index.ts +6 -4
  8. package/src/types.ts +44 -0
  9. package/LICENSE +0 -201
  10. package/dist/index-9e36735e.cjs +0 -1
  11. package/dist/index-cf1865cd.js +0 -649
  12. package/dist/index.cjs +0 -2
  13. package/dist/index.d.ts +0 -216
  14. package/dist/index.es.js +0 -4181
  15. package/src/aggregator/contracts/avaxGeneric.ts +0 -92
  16. package/src/aggregator/contracts/avaxWoofi.ts +0 -145
  17. package/src/aggregator/contracts/bscGeneric.ts +0 -106
  18. package/src/aggregator/contracts/ethGeneric.ts +0 -92
  19. package/src/aggregator/contracts/index.ts +0 -74
  20. package/src/aggregator/contracts/pancakeV2.ts +0 -145
  21. package/src/aggregator/contracts/pangolin.ts +0 -120
  22. package/src/aggregator/contracts/sushiswap.ts +0 -120
  23. package/src/aggregator/contracts/traderJoe.ts +0 -120
  24. package/src/aggregator/contracts/uniswapV2.ts +0 -120
  25. package/src/aggregator/contracts/uniswapV2Leg.ts +0 -128
  26. package/src/aggregator/contracts/uniswapV3_100.ts +0 -128
  27. package/src/aggregator/contracts/uniswapV3_10000.ts +0 -128
  28. package/src/aggregator/contracts/uniswapV3_3000.ts +0 -128
  29. package/src/aggregator/contracts/uniswapV3_500.ts +0 -128
  30. package/src/aggregator/getSwapParams.ts +0 -70
  31. package/src/client/__tests__/helpers.test.ts +0 -69
  32. package/src/client/explorerUrls.ts +0 -62
  33. package/src/client/index.ts +0 -699
  34. package/src/client/thornode.ts +0 -31
  35. package/src/client/types.ts +0 -103
@@ -1,31 +0,0 @@
1
- import { RequestClient } from '@swapkit/helpers';
2
- import type { Chain } from '@swapkit/types';
3
- import { ApiUrl } from '@swapkit/types';
4
-
5
- type InboundAddressData = {
6
- address: string;
7
- chain: Chain;
8
- chain_lp_actions_paused: boolean;
9
- chain_trading_paused: boolean;
10
- dust_threshold: string;
11
- gas_rate: string;
12
- gas_rate_units: string;
13
- global_trading_paused: boolean;
14
- halted: boolean;
15
- outbound_fee: string;
16
- outbound_tx_size: string;
17
- pub_key: string;
18
- router: string;
19
- }[];
20
-
21
- export const getInboundData = (stagenet: boolean) => {
22
- const baseUrl = stagenet ? ApiUrl.ThornodeStagenet : ApiUrl.ThornodeMainnet;
23
-
24
- return RequestClient.get<InboundAddressData>(`${baseUrl}/thorchain/inbound_addresses`);
25
- };
26
-
27
- export const getMimirData = (stagenet: boolean) => {
28
- const baseUrl = stagenet ? ApiUrl.ThornodeStagenet : ApiUrl.ThornodeMainnet;
29
-
30
- return RequestClient.get<Record<string, number>>(`${baseUrl}/thorchain/mimir`);
31
- };
@@ -1,103 +0,0 @@
1
- import type { QuoteRoute } from '@swapkit/api';
2
- import type { AssetValue, SwapKitNumber } from '@swapkit/helpers';
3
- import type {
4
- BinanceToolbox,
5
- DepositParam,
6
- GaiaToolbox,
7
- KujiraToolbox,
8
- ThorchainToolboxType,
9
- } from '@swapkit/toolbox-cosmos';
10
- import type {
11
- ARBToolbox,
12
- AVAXToolbox,
13
- BSCToolbox,
14
- ETHToolbox,
15
- MATICToolbox,
16
- OPToolbox,
17
- } from '@swapkit/toolbox-evm';
18
- import type { BCHToolbox, BTCToolbox, DOGEToolbox, LTCToolbox } from '@swapkit/toolbox-utxo';
19
- import type { Chain, FeeOption, WalletOption } from '@swapkit/types';
20
-
21
- type BaseWalletMethods = {
22
- getAddress: () => Promise<string> | string;
23
- };
24
-
25
- export type CoreTxParams = {
26
- assetValue: AssetValue;
27
- recipient: string;
28
- memo?: string;
29
- feeOptionKey?: FeeOption;
30
- feeRate?: number;
31
- data?: string;
32
- from?: string;
33
- expiration?: number;
34
- };
35
-
36
- export type AddLiquidityTxns = {
37
- runeTx?: string;
38
- assetTx?: string;
39
- };
40
-
41
- export type UpgradeParams = {
42
- runeAmount: SwapKitNumber;
43
- recipient: string;
44
- };
45
-
46
- export type ChainWallet = {
47
- address: string;
48
- balance: AssetValue[];
49
- walletType: WalletOption;
50
- };
51
-
52
- export type Wallet = Record<Chain, ChainWallet | null>;
53
-
54
- export type ThorchainWallet = BaseWalletMethods &
55
- ThorchainToolboxType & {
56
- transfer: (params: CoreTxParams) => Promise<string>;
57
- deposit: (params: DepositParam) => Promise<string>;
58
- };
59
-
60
- export type CosmosBasedWallet<T extends typeof BinanceToolbox | typeof GaiaToolbox> =
61
- BaseWalletMethods &
62
- ReturnType<T> & {
63
- transfer: (params: CoreTxParams) => Promise<string>;
64
- };
65
-
66
- export type EVMWallet<
67
- T extends typeof AVAXToolbox | typeof BSCToolbox | typeof ETHToolbox | typeof OPToolbox,
68
- > = BaseWalletMethods &
69
- ReturnType<T> & {
70
- transfer: (params: CoreTxParams) => Promise<string>;
71
- };
72
-
73
- export type UTXOWallet<
74
- T extends typeof BCHToolbox | typeof BTCToolbox | typeof DOGEToolbox | typeof LTCToolbox,
75
- > = BaseWalletMethods &
76
- ReturnType<T> & {
77
- transfer: (prams: CoreTxParams) => Promise<string>;
78
- };
79
-
80
- export type WalletMethods = {
81
- [Chain.Arbitrum]: EVMWallet<typeof ARBToolbox> | null;
82
- [Chain.Avalanche]: EVMWallet<typeof AVAXToolbox> | null;
83
- [Chain.BinanceSmartChain]: EVMWallet<typeof BSCToolbox> | null;
84
- [Chain.Binance]: CosmosBasedWallet<typeof BinanceToolbox> | null;
85
- [Chain.BitcoinCash]: UTXOWallet<typeof BCHToolbox> | null;
86
- [Chain.Bitcoin]: UTXOWallet<typeof BTCToolbox> | null;
87
- [Chain.Cosmos]: CosmosBasedWallet<typeof GaiaToolbox> | null;
88
- [Chain.Dogecoin]: UTXOWallet<typeof DOGEToolbox> | null;
89
- [Chain.Ethereum]: EVMWallet<typeof ETHToolbox> | null;
90
- [Chain.Kujira]: CosmosBasedWallet<typeof KujiraToolbox> | null;
91
- [Chain.Litecoin]: UTXOWallet<typeof LTCToolbox> | null;
92
- [Chain.Maya]: ThorchainWallet | null;
93
- [Chain.Optimism]: EVMWallet<typeof OPToolbox> | null;
94
- [Chain.Polygon]: EVMWallet<typeof MATICToolbox> | null;
95
- [Chain.THORChain]: ThorchainWallet | null;
96
- };
97
-
98
- export type SwapParams = {
99
- recipient: string;
100
- streamSwap?: boolean;
101
- route: QuoteRoute;
102
- feeOptionKey: FeeOption;
103
- };