npm package: @pioneer-platform/swapkit-core
Description: THORSwap Lib swapkit-core
Author: thorswap
Latest version: 3.0.2

# @pioneer-platform/swapkit-core

## Install:

```bash
pnpm add @pioneer-platform/swapkit-core
```

### SwapKitCore API:

| method                       | description                                         | requires package                                              |
| ---------------------------- | --------------------------------------------------- | ------------------------------------------------------------- |
| `addLiquidity`               | trigger LP add transaction                          | [@pioneer-platform/toolbox-cosmos](../toolboxes/toolbox-cosmos)   |
| `addSavings`                 | trigger tc add saver transaction                    | [@pioneer-platform/toolbox-cosmos](../toolboxes/toolbox-cosmos)   |
| `approveAssetForContract`    | trigger asset approve for contract transaction      |                                                               |
| `approveAsset`               | trigger asset approve transaction                   |                                                               |
| `bond`                       | trigger bond transaction                            | [@pioneer-platform/toolbox-cosmos](../toolboxes/toolbox-cosmos)   |
| `closeLoan`                  | trigger close loan transaction                      | [@pioneer-platform/toolbox-cosmos](../toolboxes/toolbox-cosmos)   |
| `connectEVMWallet`           | connect to EVM wallet                               | [@pioneer-platform/evm-web3-wallets](../wallets/evm-web3-wallets) |
| `connectKeplr`               | connect to Keplr wallet                             | [@pioneer-platform/keplr](../wallets/keplr)                       |
| `connectKeystore`            | connect to Keystore wallet                          | [@pioneer-platform/keystore](../wallets/keystore)                 |
| `connectLedger`              | connect to Ledger wallet                            | [@pioneer-platform/ledger](../wallets/ledger)                     |
| `connectXDEFI`               | connect to XDEFI wallet                             | [@pioneer-platform/xdefi](../wallets/xdefi)                       |
| `createLiquidity`            | trigger create LP pool transaction                  | [@pioneer-platform/toolbox-cosmos](../toolboxes/toolbox-cosmos)   |
| `deposit`                    | trigger TC router depositWithExpiry transaction     | [@pioneer-platform/toolbox-cosmos](../toolboxes/toolbox-cosmos)   |
| `disconnectChain`            | disconnect wallet from swapKit                      |                                                               |
| `extend`                     | extend SwapKitCore with wallets & config variables  |                                                               |
| `getAddress`                 | get wallet address by chain                         |                                                               |
| `getExplorerAddressUrl`      | get explorer address url                            |                                                               |
| `getExplorerTxUrl`           | get explorer tx url                                 |                                                               |
| `getWalletByChain`           | fetch wallet data by chain                          |                                                               |
| `getWallet`                  | get wallet methods by chain                         |                                                               |
| `isAssetApprovedForContract` | check if asset is approved for contract             |                                                               |
| `isAssetApproved`            | check if asset is approved on tc router             |                                                               |
| `leave`                      | trigger leave transaction                           | [@pioneer-platform/toolbox-cosmos](../toolboxes/toolbox-cosmos)   |
| `openLoan`                   | trigger open loan transaction                       | [@pioneer-platform/toolbox-cosmos](../toolboxes/toolbox-cosmos)   |
| `registerThorname`           | trigger register thorname transaction               | [@pioneer-platform/toolbox-cosmos](../toolboxes/toolbox-cosmos)   |
| `swap`                       | trigger swap transaction on given route & quoteMode |                                                               |
| `transfer`                   | trigger wallet transfer/send                        | [@pioneer-platform/toolbox-cosmos](../toolboxes/toolbox-cosmos)   |
| `unbond`                     | trigger unbond transaction                          | [@pioneer-platform/toolbox-cosmos](../toolboxes/toolbox-cosmos)   |
| `upgrade`                    | trigger upgrade transaction                         | [@pioneer-platform/toolbox-cosmos](../toolboxes/toolbox-cosmos)   |
| `validateAddress`            | validate address per chain restrictions             |                                                               |
| `withdrawSavings`            | trigger tc withdraw saver transaction               | [@pioneer-platform/toolbox-cosmos](../toolboxes/toolbox-cosmos)   |
| `withdraw`                   | trigger LP withdraw transaction                     | [@pioneer-platform/toolbox-cosmos](../toolboxes/toolbox-cosmos)   |

### SwapKitCore class properties:

| property           | description                                                                                          |
| ------------------ | ---------------------------------------------------------------------------------------------------- |
| `connectedChains`  | connected chains data after usage of `connectX` method (address, empty balance, walletType)          |
| `connectedWallets` | connected wallets method after usage of `connectX` method [check available wallets](../../#packages) |