@swapkit/core 1.0.0-rc.99 → 1.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.
Files changed (45) hide show
  1. package/dist/index.js +3 -0
  2. package/dist/index.js.map +12 -0
  3. package/package.json +23 -44
  4. package/src/__tests__/helpers.test.ts +65 -0
  5. package/src/client.ts +415 -0
  6. package/src/helpers/explorerUrls.ts +44 -0
  7. package/src/index.ts +6 -4
  8. package/src/types.ts +44 -0
  9. package/LICENSE +0 -201
  10. package/dist/index.cjs +0 -3
  11. package/dist/index.cjs.map +0 -1
  12. package/dist/index.d.ts +0 -230
  13. package/dist/index.es.js +0 -9119
  14. package/dist/index.es.js.map +0 -1
  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 -76
  20. package/src/aggregator/contracts/pancakeV2.ts +0 -145
  21. package/src/aggregator/contracts/pangolin.ts +0 -120
  22. package/src/aggregator/contracts/routers/index.ts +0 -58
  23. package/src/aggregator/contracts/routers/kyber.ts +0 -402
  24. package/src/aggregator/contracts/routers/oneinch.ts +0 -2188
  25. package/src/aggregator/contracts/routers/pancakeswap.ts +0 -340
  26. package/src/aggregator/contracts/routers/pangolin.ts +0 -340
  27. package/src/aggregator/contracts/routers/sushiswap.ts +0 -340
  28. package/src/aggregator/contracts/routers/traderJoe.ts +0 -340
  29. package/src/aggregator/contracts/routers/uniswapv2.ts +0 -340
  30. package/src/aggregator/contracts/routers/uniswapv3.ts +0 -254
  31. package/src/aggregator/contracts/routers/woofi.ts +0 -171
  32. package/src/aggregator/contracts/sushiswap.ts +0 -120
  33. package/src/aggregator/contracts/traderJoe.ts +0 -120
  34. package/src/aggregator/contracts/uniswapV2.ts +0 -120
  35. package/src/aggregator/contracts/uniswapV2Leg.ts +0 -128
  36. package/src/aggregator/contracts/uniswapV3_100.ts +0 -128
  37. package/src/aggregator/contracts/uniswapV3_10000.ts +0 -128
  38. package/src/aggregator/contracts/uniswapV3_3000.ts +0 -128
  39. package/src/aggregator/contracts/uniswapV3_500.ts +0 -128
  40. package/src/aggregator/getSwapParams.ts +0 -70
  41. package/src/client/__tests__/helpers.test.ts +0 -77
  42. package/src/client/explorerUrls.ts +0 -61
  43. package/src/client/index.ts +0 -769
  44. package/src/client/thornode.ts +0 -31
  45. package/src/client/types.ts +0 -115
@@ -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,115 +0,0 @@
1
- import type { AssetValue, QuoteRoute, SwapKitNumber } from '@swapkit/helpers';
2
- import type {
3
- BinanceToolbox,
4
- DepositParam,
5
- GaiaToolbox,
6
- KujiraToolbox,
7
- ThorchainToolboxType,
8
- } from '@swapkit/toolbox-cosmos';
9
- import type {
10
- ARBToolbox,
11
- AVAXToolbox,
12
- BSCToolbox,
13
- ETHToolbox,
14
- MATICToolbox,
15
- OPToolbox,
16
- } from '@swapkit/toolbox-evm';
17
- import type { ChainflipToolbox, PolkadotToolbox } from '@swapkit/toolbox-substrate';
18
- import type {
19
- BCHToolbox,
20
- BTCToolbox,
21
- DASHToolbox,
22
- DOGEToolbox,
23
- LTCToolbox,
24
- } from '@swapkit/toolbox-utxo';
25
- import type { Chain, FeeOption, WalletOption } from '@swapkit/types';
26
-
27
- type BaseWalletMethods = {
28
- getAddress: () => Promise<string> | string;
29
- };
30
-
31
- export type CoreTxParams = {
32
- assetValue: AssetValue;
33
- recipient: string;
34
- memo?: string;
35
- feeOptionKey?: FeeOption;
36
- feeRate?: number;
37
- data?: string;
38
- from?: string;
39
- expiration?: number;
40
- };
41
-
42
- export type AddLiquidityTxns = {
43
- runeTx?: string;
44
- assetTx?: string;
45
- };
46
-
47
- export type UpgradeParams = {
48
- runeAmount: SwapKitNumber;
49
- recipient: string;
50
- };
51
-
52
- export type ChainWallet = {
53
- address: string;
54
- balance: AssetValue[];
55
- walletType: WalletOption;
56
- };
57
-
58
- export type Wallet = Record<Chain, ChainWallet | null>;
59
-
60
- export type ThorchainWallet = BaseWalletMethods &
61
- ThorchainToolboxType & {
62
- transfer: (params: CoreTxParams) => Promise<string>;
63
- deposit: (params: DepositParam) => Promise<string>;
64
- };
65
-
66
- export type CosmosBasedWallet<T extends typeof BinanceToolbox | typeof GaiaToolbox> =
67
- BaseWalletMethods &
68
- ReturnType<T> & {
69
- transfer: (params: CoreTxParams) => Promise<string>;
70
- };
71
-
72
- export type SubstrateBasedWallet<T extends typeof PolkadotToolbox | typeof ChainflipToolbox> =
73
- Awaited<ReturnType<T>>;
74
-
75
- export type EVMWallet<
76
- T extends typeof AVAXToolbox | typeof BSCToolbox | typeof ETHToolbox | typeof OPToolbox,
77
- > = BaseWalletMethods &
78
- ReturnType<T> & {
79
- transfer: (params: CoreTxParams) => Promise<string>;
80
- };
81
-
82
- export type UTXOWallet<
83
- T extends typeof BCHToolbox | typeof BTCToolbox | typeof DOGEToolbox | typeof LTCToolbox,
84
- > = BaseWalletMethods &
85
- ReturnType<T> & {
86
- transfer: (prams: CoreTxParams) => Promise<string>;
87
- };
88
-
89
- export type WalletMethods = {
90
- [Chain.Arbitrum]: EVMWallet<typeof ARBToolbox> | null;
91
- [Chain.Avalanche]: EVMWallet<typeof AVAXToolbox> | null;
92
- [Chain.BinanceSmartChain]: EVMWallet<typeof BSCToolbox> | null;
93
- [Chain.Binance]: CosmosBasedWallet<typeof BinanceToolbox> | null;
94
- [Chain.BitcoinCash]: UTXOWallet<typeof BCHToolbox> | null;
95
- [Chain.Bitcoin]: UTXOWallet<typeof BTCToolbox> | null;
96
- [Chain.Chainflip]: SubstrateBasedWallet<typeof ChainflipToolbox> | null;
97
- [Chain.Cosmos]: CosmosBasedWallet<typeof GaiaToolbox> | null;
98
- [Chain.Dash]: UTXOWallet<typeof DASHToolbox> | null;
99
- [Chain.Dogecoin]: UTXOWallet<typeof DOGEToolbox> | null;
100
- [Chain.Ethereum]: EVMWallet<typeof ETHToolbox> | null;
101
- [Chain.Kujira]: CosmosBasedWallet<typeof KujiraToolbox> | null;
102
- [Chain.Litecoin]: UTXOWallet<typeof LTCToolbox> | null;
103
- [Chain.Maya]: ThorchainWallet | null;
104
- [Chain.Optimism]: EVMWallet<typeof OPToolbox> | null;
105
- [Chain.Polkadot]: SubstrateBasedWallet<typeof PolkadotToolbox> | null;
106
- [Chain.Polygon]: EVMWallet<typeof MATICToolbox> | null;
107
- [Chain.THORChain]: ThorchainWallet | null;
108
- };
109
-
110
- export type SwapParams = {
111
- recipient: string;
112
- streamSwap?: boolean;
113
- route: QuoteRoute;
114
- feeOptionKey: FeeOption;
115
- };