@velora-dex/sdk 8.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/LICENSE +7 -0
- package/README.md +494 -0
- package/dist/constants.d.ts +7 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/examples/customFetcher.d.ts +3 -0
- package/dist/examples/customFetcher.d.ts.map +1 -0
- package/dist/examples/delta.d.ts +2 -0
- package/dist/examples/delta.d.ts.map +1 -0
- package/dist/examples/ethersV6.d.ts +2 -0
- package/dist/examples/ethersV6.d.ts.map +1 -0
- package/dist/examples/limitOrders_all.d.ts +2 -0
- package/dist/examples/limitOrders_all.d.ts.map +1 -0
- package/dist/examples/limitOrders_partial.d.ts +2 -0
- package/dist/examples/limitOrders_partial.d.ts.map +1 -0
- package/dist/examples/limitOrders_postOrder.d.ts +2 -0
- package/dist/examples/limitOrders_postOrder.d.ts.map +1 -0
- package/dist/examples/partial.d.ts +2 -0
- package/dist/examples/partial.d.ts.map +1 -0
- package/dist/examples/quote.d.ts +2 -0
- package/dist/examples/quote.d.ts.map +1 -0
- package/dist/examples/sdk.d.ts +2 -0
- package/dist/examples/sdk.d.ts.map +1 -0
- package/dist/examples/simple.d.ts +2 -0
- package/dist/examples/simple.d.ts.map +1 -0
- package/dist/examples/simpleQuote.d.ts +2 -0
- package/dist/examples/simpleQuote.d.ts.map +1 -0
- package/dist/examples/viem.d.ts +2 -0
- package/dist/examples/viem.d.ts.map +1 -0
- package/dist/examples/wagmi.d.ts +43 -0
- package/dist/examples/wagmi.d.ts.map +1 -0
- package/dist/examples/web3.d.ts +2 -0
- package/dist/examples/web3.d.ts.map +1 -0
- package/dist/gas.d.ts +8 -0
- package/dist/gas.d.ts.map +1 -0
- package/dist/helpers/approve.d.ts +8 -0
- package/dist/helpers/approve.d.ts.map +1 -0
- package/dist/helpers/fetchers/axios.d.ts +5 -0
- package/dist/helpers/fetchers/axios.d.ts.map +1 -0
- package/dist/helpers/fetchers/fetch.d.ts +5 -0
- package/dist/helpers/fetchers/fetch.d.ts.map +1 -0
- package/dist/helpers/index.d.ts +13 -0
- package/dist/helpers/index.d.ts.map +1 -0
- package/dist/helpers/misc.d.ts +48 -0
- package/dist/helpers/misc.d.ts.map +1 -0
- package/dist/helpers/providers/ethers.d.ts +10 -0
- package/dist/helpers/providers/ethers.d.ts.map +1 -0
- package/dist/helpers/providers/ethersV6.d.ts +8 -0
- package/dist/helpers/providers/ethersV6.d.ts.map +1 -0
- package/dist/helpers/providers/helpers.d.ts +3 -0
- package/dist/helpers/providers/helpers.d.ts.map +1 -0
- package/dist/helpers/providers/viem.d.ts +23 -0
- package/dist/helpers/providers/viem.d.ts.map +1 -0
- package/dist/helpers/providers/web3.d.ts +9 -0
- package/dist/helpers/providers/web3.d.ts.map +1 -0
- package/dist/helpers/token.d.ts +38 -0
- package/dist/helpers/token.d.ts.map +1 -0
- package/dist/index.d.ts +64 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +8 -0
- package/dist/methods/common/orders/buildOrderData.d.ts +27 -0
- package/dist/methods/common/orders/buildOrderData.d.ts.map +1 -0
- package/dist/methods/common/orders/encoding.d.ts +23 -0
- package/dist/methods/common/orders/encoding.d.ts.map +1 -0
- package/dist/methods/common/orders/misc.d.ts +27 -0
- package/dist/methods/common/orders/misc.d.ts.map +1 -0
- package/dist/methods/common/orders/signature.d.ts +9 -0
- package/dist/methods/common/orders/signature.d.ts.map +1 -0
- package/dist/methods/common/orders/types.d.ts +8 -0
- package/dist/methods/common/orders/types.d.ts.map +1 -0
- package/dist/methods/delta/approveForDelta.d.ts +8 -0
- package/dist/methods/delta/approveForDelta.d.ts.map +1 -0
- package/dist/methods/delta/buildCrosschainOrderBridge.d.ts +23 -0
- package/dist/methods/delta/buildCrosschainOrderBridge.d.ts.map +1 -0
- package/dist/methods/delta/buildDeltaOrder.d.ts +49 -0
- package/dist/methods/delta/buildDeltaOrder.d.ts.map +1 -0
- package/dist/methods/delta/getBridgeInfo.d.ts +9 -0
- package/dist/methods/delta/getBridgeInfo.d.ts.map +1 -0
- package/dist/methods/delta/getDeltaContract.d.ts +9 -0
- package/dist/methods/delta/getDeltaContract.d.ts.map +1 -0
- package/dist/methods/delta/getDeltaOrders.d.ts +22 -0
- package/dist/methods/delta/getDeltaOrders.d.ts.map +1 -0
- package/dist/methods/delta/getDeltaPrice.d.ts +58 -0
- package/dist/methods/delta/getDeltaPrice.d.ts.map +1 -0
- package/dist/methods/delta/getMulticallHandlers.d.ts +9 -0
- package/dist/methods/delta/getMulticallHandlers.d.ts.map +1 -0
- package/dist/methods/delta/getPartnerFee.d.ts +16 -0
- package/dist/methods/delta/getPartnerFee.d.ts.map +1 -0
- package/dist/methods/delta/helpers/across.d.ts +22 -0
- package/dist/methods/delta/helpers/across.d.ts.map +1 -0
- package/dist/methods/delta/helpers/buildDeltaOrderData.d.ts +35 -0
- package/dist/methods/delta/helpers/buildDeltaOrderData.d.ts.map +1 -0
- package/dist/methods/delta/helpers/composePermit.d.ts +5 -0
- package/dist/methods/delta/helpers/composePermit.d.ts.map +1 -0
- package/dist/methods/delta/helpers/misc.d.ts +3 -0
- package/dist/methods/delta/helpers/misc.d.ts.map +1 -0
- package/dist/methods/delta/helpers/types.d.ts +96 -0
- package/dist/methods/delta/helpers/types.d.ts.map +1 -0
- package/dist/methods/delta/index.d.ts +28 -0
- package/dist/methods/delta/index.d.ts.map +1 -0
- package/dist/methods/delta/isTokenSupportedInDelta.d.ts +8 -0
- package/dist/methods/delta/isTokenSupportedInDelta.d.ts.map +1 -0
- package/dist/methods/delta/postDeltaOrder.d.ts +23 -0
- package/dist/methods/delta/postDeltaOrder.d.ts.map +1 -0
- package/dist/methods/delta/signDeltaOrder.d.ts +12 -0
- package/dist/methods/delta/signDeltaOrder.d.ts.map +1 -0
- package/dist/methods/limitOrders/approveForOrder.d.ts +12 -0
- package/dist/methods/limitOrders/approveForOrder.d.ts.map +1 -0
- package/dist/methods/limitOrders/buildOrder.d.ts +11 -0
- package/dist/methods/limitOrders/buildOrder.d.ts.map +1 -0
- package/dist/methods/limitOrders/cancelOrder.d.ts +9 -0
- package/dist/methods/limitOrders/cancelOrder.d.ts.map +1 -0
- package/dist/methods/limitOrders/fillOrderDirectly.d.ts +30 -0
- package/dist/methods/limitOrders/fillOrderDirectly.d.ts.map +1 -0
- package/dist/methods/limitOrders/getOrders.d.ts +39 -0
- package/dist/methods/limitOrders/getOrders.d.ts.map +1 -0
- package/dist/methods/limitOrders/getOrdersContract.d.ts +8 -0
- package/dist/methods/limitOrders/getOrdersContract.d.ts.map +1 -0
- package/dist/methods/limitOrders/helpers/buildOrderData.d.ts +43 -0
- package/dist/methods/limitOrders/helpers/buildOrderData.d.ts.map +1 -0
- package/dist/methods/limitOrders/helpers/misc.d.ts +9 -0
- package/dist/methods/limitOrders/helpers/misc.d.ts.map +1 -0
- package/dist/methods/limitOrders/helpers/types.d.ts +49 -0
- package/dist/methods/limitOrders/helpers/types.d.ts.map +1 -0
- package/dist/methods/limitOrders/index.d.ts +30 -0
- package/dist/methods/limitOrders/index.d.ts.map +1 -0
- package/dist/methods/limitOrders/postOrder.d.ts +10 -0
- package/dist/methods/limitOrders/postOrder.d.ts.map +1 -0
- package/dist/methods/limitOrders/signOrder.d.ts +7 -0
- package/dist/methods/limitOrders/signOrder.d.ts.map +1 -0
- package/dist/methods/limitOrders/transaction.d.ts +23 -0
- package/dist/methods/limitOrders/transaction.d.ts.map +1 -0
- package/dist/methods/nftOrders/approveForOrder.d.ts +12 -0
- package/dist/methods/nftOrders/approveForOrder.d.ts.map +1 -0
- package/dist/methods/nftOrders/buildOrder.d.ts +11 -0
- package/dist/methods/nftOrders/buildOrder.d.ts.map +1 -0
- package/dist/methods/nftOrders/cancelOrder.d.ts +8 -0
- package/dist/methods/nftOrders/cancelOrder.d.ts.map +1 -0
- package/dist/methods/nftOrders/getOrders.d.ts +18 -0
- package/dist/methods/nftOrders/getOrders.d.ts.map +1 -0
- package/dist/methods/nftOrders/getOrdersContract.d.ts +8 -0
- package/dist/methods/nftOrders/getOrdersContract.d.ts.map +1 -0
- package/dist/methods/nftOrders/helpers/buildOrderData.d.ts +52 -0
- package/dist/methods/nftOrders/helpers/buildOrderData.d.ts.map +1 -0
- package/dist/methods/nftOrders/helpers/misc.d.ts +13 -0
- package/dist/methods/nftOrders/helpers/misc.d.ts.map +1 -0
- package/dist/methods/nftOrders/helpers/types.d.ts +39 -0
- package/dist/methods/nftOrders/helpers/types.d.ts.map +1 -0
- package/dist/methods/nftOrders/index.d.ts +23 -0
- package/dist/methods/nftOrders/index.d.ts.map +1 -0
- package/dist/methods/nftOrders/postOrder.d.ts +10 -0
- package/dist/methods/nftOrders/postOrder.d.ts.map +1 -0
- package/dist/methods/nftOrders/signOrder.d.ts +7 -0
- package/dist/methods/nftOrders/signOrder.d.ts.map +1 -0
- package/dist/methods/nftOrders/transaction.d.ts +23 -0
- package/dist/methods/nftOrders/transaction.d.ts.map +1 -0
- package/dist/methods/quote/getQuote.d.ts +51 -0
- package/dist/methods/quote/getQuote.d.ts.map +1 -0
- package/dist/methods/swap/adapters.d.ts +8 -0
- package/dist/methods/swap/adapters.d.ts.map +1 -0
- package/dist/methods/swap/approve.d.ts +10 -0
- package/dist/methods/swap/approve.d.ts.map +1 -0
- package/dist/methods/swap/balance.d.ts +23 -0
- package/dist/methods/swap/balance.d.ts.map +1 -0
- package/dist/methods/swap/helpers/normalizeRateOptions.d.ts +12 -0
- package/dist/methods/swap/helpers/normalizeRateOptions.d.ts.map +1 -0
- package/dist/methods/swap/index.d.ts +13 -0
- package/dist/methods/swap/index.d.ts.map +1 -0
- package/dist/methods/swap/rates.d.ts +52 -0
- package/dist/methods/swap/rates.d.ts.map +1 -0
- package/dist/methods/swap/spender.d.ts +21 -0
- package/dist/methods/swap/spender.d.ts.map +1 -0
- package/dist/methods/swap/swapTx.d.ts +158 -0
- package/dist/methods/swap/swapTx.d.ts.map +1 -0
- package/dist/methods/swap/token.d.ts +8 -0
- package/dist/methods/swap/token.d.ts.map +1 -0
- package/dist/methods/swap/transaction.d.ts +115 -0
- package/dist/methods/swap/transaction.d.ts.map +1 -0
- package/dist/sdk/full.d.ts +17 -0
- package/dist/sdk/full.d.ts.map +1 -0
- package/dist/sdk/partial.d.ts +31 -0
- package/dist/sdk/partial.d.ts.map +1 -0
- package/dist/sdk/simple.d.ts +75 -0
- package/dist/sdk/simple.d.ts.map +1 -0
- package/dist/sdk.cjs.development.js +5182 -0
- package/dist/sdk.cjs.development.js.map +1 -0
- package/dist/sdk.cjs.production.min.js +2 -0
- package/dist/sdk.cjs.production.min.js.map +1 -0
- package/dist/sdk.esm.js +5102 -0
- package/dist/sdk.esm.js.map +1 -0
- package/dist/types.d.ts +161 -0
- package/dist/types.d.ts.map +1 -0
- package/docs/DELTA.md +207 -0
- package/package.json +126 -0
- package/src/constants.ts +16 -0
- package/src/examples/customFetcher.ts +44 -0
- package/src/examples/delta.ts +127 -0
- package/src/examples/ethersV6.ts +38 -0
- package/src/examples/limitOrders_all.ts +135 -0
- package/src/examples/limitOrders_partial.ts +171 -0
- package/src/examples/limitOrders_postOrder.ts +77 -0
- package/src/examples/partial.ts +34 -0
- package/src/examples/quote.ts +205 -0
- package/src/examples/sdk.ts +39 -0
- package/src/examples/simple.ts +44 -0
- package/src/examples/simpleQuote.ts +98 -0
- package/src/examples/viem.ts +120 -0
- package/src/examples/wagmi.ts +68 -0
- package/src/examples/web3.ts +32 -0
- package/src/gas.ts +7 -0
- package/src/helpers/approve.ts +60 -0
- package/src/helpers/fetchers/axios.ts +34 -0
- package/src/helpers/fetchers/fetch.ts +67 -0
- package/src/helpers/index.ts +27 -0
- package/src/helpers/misc.ts +160 -0
- package/src/helpers/providers/ethers.ts +192 -0
- package/src/helpers/providers/ethersV6.ts +121 -0
- package/src/helpers/providers/helpers.ts +36 -0
- package/src/helpers/providers/viem.ts +205 -0
- package/src/helpers/providers/web3.ts +154 -0
- package/src/helpers/token.ts +75 -0
- package/src/index.ts +425 -0
- package/src/methods/common/orders/buildOrderData.ts +29 -0
- package/src/methods/common/orders/encoding.ts +216 -0
- package/src/methods/common/orders/misc.ts +86 -0
- package/src/methods/common/orders/signature.ts +68 -0
- package/src/methods/common/orders/types.ts +13 -0
- package/src/methods/delta/approveForDelta.ts +38 -0
- package/src/methods/delta/buildCrosschainOrderBridge.ts +84 -0
- package/src/methods/delta/buildDeltaOrder.ts +192 -0
- package/src/methods/delta/getBridgeInfo.ts +38 -0
- package/src/methods/delta/getDeltaContract.ts +29 -0
- package/src/methods/delta/getDeltaOrders.ts +102 -0
- package/src/methods/delta/getDeltaPrice.ts +122 -0
- package/src/methods/delta/getMulticallHandlers.ts +44 -0
- package/src/methods/delta/getPartnerFee.ts +58 -0
- package/src/methods/delta/helpers/across.ts +255 -0
- package/src/methods/delta/helpers/buildDeltaOrderData.ts +153 -0
- package/src/methods/delta/helpers/composePermit.ts +76 -0
- package/src/methods/delta/helpers/misc.ts +32 -0
- package/src/methods/delta/helpers/types.ts +110 -0
- package/src/methods/delta/index.ts +146 -0
- package/src/methods/delta/isTokenSupportedInDelta.ts +54 -0
- package/src/methods/delta/postDeltaOrder.ts +50 -0
- package/src/methods/delta/signDeltaOrder.ts +41 -0
- package/src/methods/limitOrders/approveForOrder.ts +36 -0
- package/src/methods/limitOrders/buildOrder.ts +56 -0
- package/src/methods/limitOrders/cancelOrder.ts +111 -0
- package/src/methods/limitOrders/fillOrderDirectly.ts +277 -0
- package/src/methods/limitOrders/getOrders.ts +151 -0
- package/src/methods/limitOrders/getOrdersContract.ts +20 -0
- package/src/methods/limitOrders/helpers/buildOrderData.ts +121 -0
- package/src/methods/limitOrders/helpers/misc.ts +64 -0
- package/src/methods/limitOrders/helpers/types.ts +70 -0
- package/src/methods/limitOrders/index.ts +154 -0
- package/src/methods/limitOrders/postOrder.ts +74 -0
- package/src/methods/limitOrders/signOrder.ts +29 -0
- package/src/methods/limitOrders/transaction.ts +231 -0
- package/src/methods/nftOrders/approveForOrder.ts +79 -0
- package/src/methods/nftOrders/buildOrder.ts +52 -0
- package/src/methods/nftOrders/cancelOrder.ts +23 -0
- package/src/methods/nftOrders/getOrders.ts +84 -0
- package/src/methods/nftOrders/getOrdersContract.ts +24 -0
- package/src/methods/nftOrders/helpers/buildOrderData.ts +131 -0
- package/src/methods/nftOrders/helpers/misc.ts +92 -0
- package/src/methods/nftOrders/helpers/types.ts +50 -0
- package/src/methods/nftOrders/index.ts +139 -0
- package/src/methods/nftOrders/postOrder.ts +71 -0
- package/src/methods/nftOrders/signOrder.ts +29 -0
- package/src/methods/nftOrders/transaction.ts +234 -0
- package/src/methods/quote/getQuote.ts +131 -0
- package/src/methods/swap/adapters.ts +49 -0
- package/src/methods/swap/approve.ts +51 -0
- package/src/methods/swap/balance.ts +147 -0
- package/src/methods/swap/helpers/normalizeRateOptions.ts +55 -0
- package/src/methods/swap/index.ts +38 -0
- package/src/methods/swap/rates.ts +276 -0
- package/src/methods/swap/spender.ts +76 -0
- package/src/methods/swap/swapTx.ts +266 -0
- package/src/methods/swap/token.ts +35 -0
- package/src/methods/swap/transaction.ts +310 -0
- package/src/sdk/full.ts +54 -0
- package/src/sdk/partial.ts +107 -0
- package/src/sdk/simple.ts +429 -0
- package/src/types.ts +240 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
The software and documentation available in this repository (the "Software") is protected by copyright law and accessible pursuant to the license set forth below. Copyright © 2020 ParaSwap Network. All rights reserved.
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person or organization obtaining the Software (the "Licensee") to privately study, review, and analyze the Software. Licensee shall not use the Software for any other purpose. Licensee shall not modify, transfer, assign, share, or sub-license the Software or any derivative works of the Software.
|
|
4
|
+
|
|
5
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE, AND NON-INFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT, OR OTHERWISE, ARISING FROM, OUT OF, OR IN CONNECTION WITH THE SOFTWARE.
|
|
6
|
+
|
|
7
|
+
BY USING THE SOFTWARE, THE LICENSEE ACCEPTS THE TERMS OF USE AND PRIVACY POLICY https://github.com/paraswap/paraswap-terms-of-use/blob/master/paraswap-terms-of-use.pdf
|
package/README.md
ADDED
|
@@ -0,0 +1,494 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<a href="https://www.velora.xyz/">
|
|
3
|
+
<picture>
|
|
4
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://cdn.paraswap.io/brand/velora_banner_dark.svg">
|
|
5
|
+
<img width=350 src="https://cdn.paraswap.io/brand/velora_banner_light.svg">
|
|
6
|
+
</picture>
|
|
7
|
+
</a>
|
|
8
|
+
</p>
|
|
9
|
+
|
|
10
|
+
# SDK for the Velora API
|
|
11
|
+
|
|
12
|
+
Refer to the documentation of the Velora API: https://developers.velora.xyz/
|
|
13
|
+
|
|
14
|
+
## Features
|
|
15
|
+
**Versatility**: works with [web3](https://www.npmjs.com/package/web3), [ethers](https://www.npmjs.com/package/ethers) or [viem](https://viem.sh/) without direct dependency
|
|
16
|
+
|
|
17
|
+
**Canonical**: bring only the functions you actually need
|
|
18
|
+
|
|
19
|
+
**Lightweight**: 10KB Gzipped for the minimal variant
|
|
20
|
+
|
|
21
|
+
## Installing Velora SDK
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
yarn add @velora-dex/sdk
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Using Velora SDK
|
|
28
|
+
|
|
29
|
+
There are multiple ways to use Velora SDK, ranging from a simple construct-and-use approach to a fully composable _bring what you need_ approach which allows for advanced tree-shaking and minimizes bundle size.
|
|
30
|
+
|
|
31
|
+
You can see some examples in [/src/examples](src/examples) directory.
|
|
32
|
+
|
|
33
|
+
### Simple SDK
|
|
34
|
+
|
|
35
|
+
Can be created by providing `chainId` and either `axios` or `window.fetch` (or alternative `fetch` implementation), and an optional `version` (`'5'` or `'6.2'`) parameter that corresponds to the API version SDK will be making requests to. The resulting SDK will be able to use all methods that query the API.
|
|
36
|
+
|
|
37
|
+
```ts
|
|
38
|
+
import { constructSimpleSDK } from '@velora-dex/sdk';
|
|
39
|
+
import axios from 'axios';
|
|
40
|
+
|
|
41
|
+
// construct minimal SDK with fetcher only
|
|
42
|
+
const minSDK = constructSimpleSDK({chainId: 1, axios});
|
|
43
|
+
// or
|
|
44
|
+
const minSDK = constructSimpleSDK({chainId: 1, fetch: window.fetch, version: '5'});
|
|
45
|
+
|
|
46
|
+
const ETH = '0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee';
|
|
47
|
+
const DAI = '0x6B175474E89094C44Da98b954EedeAC495271d0F';
|
|
48
|
+
|
|
49
|
+
async function swapExample() {
|
|
50
|
+
// or any other signer/provider
|
|
51
|
+
const signer: JsonRpcSigner = ethers.Wallet.fromMnemonic('__your_mnemonic__');
|
|
52
|
+
const senderAddress = signer.address;
|
|
53
|
+
|
|
54
|
+
const priceRoute = await minSDK.swap.getRate({
|
|
55
|
+
srcToken: ETH,
|
|
56
|
+
destToken: DAI,
|
|
57
|
+
amount: srcAmount,
|
|
58
|
+
userAddress: senderAddress,
|
|
59
|
+
side: SwapSide.SELL,
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
const txParams = await minSDK.swap.buildTx(
|
|
63
|
+
{
|
|
64
|
+
srcToken,
|
|
65
|
+
destToken,
|
|
66
|
+
srcAmount,
|
|
67
|
+
destAmount,
|
|
68
|
+
priceRoute,
|
|
69
|
+
userAddress: senderAddress,
|
|
70
|
+
partner: referrer,
|
|
71
|
+
}
|
|
72
|
+
);
|
|
73
|
+
|
|
74
|
+
const transaction = {
|
|
75
|
+
...txParams,
|
|
76
|
+
gasPrice: '0x' + new BigNumber(txParams.gasPrice).toString(16),
|
|
77
|
+
gasLimit: '0x' + new BigNumber(5000000).toString(16),
|
|
78
|
+
value: '0x' + new BigNumber(txParams.value).toString(16),
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
const txr = await signer.sendTransaction(transaction);
|
|
82
|
+
}
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
If optional `providerOptions` is provided as the second parameter, then the resulting SDK will also be able to approve Tokens for swap, sign Orders, etc.
|
|
86
|
+
|
|
87
|
+
```ts
|
|
88
|
+
// with ethers@5
|
|
89
|
+
const providerOptionsEtherV5 = {
|
|
90
|
+
ethersProviderOrSigner: provider, // JsonRpcProvider
|
|
91
|
+
EthersContract: ethers.Contract,
|
|
92
|
+
account: senderAddress,
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
// with ethers@6
|
|
96
|
+
const providerOptionsEtherV6 = {
|
|
97
|
+
ethersV6ProviderOrSigner: provider, // JsonRpcProvider
|
|
98
|
+
EthersV6Contract: ethers.Contract,
|
|
99
|
+
account: senderAddress,
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
// or with viem (from wagmi or standalone)
|
|
103
|
+
const providerOptionsViem = {
|
|
104
|
+
viemClient, // made with createWalletClient()
|
|
105
|
+
account: senderAddress,
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
// or with web3.js
|
|
109
|
+
const providerOptionsWeb3 = {
|
|
110
|
+
web3, // new Web3(...) instance
|
|
111
|
+
account: senderAddress,
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
const sdk = constructSimpleSDK({chainId: 1, axios}, providerOptionsEtherV5);
|
|
115
|
+
|
|
116
|
+
// approve token through sdk
|
|
117
|
+
const txHash = await sdk.approveToken(amountInWei, DAI);
|
|
118
|
+
|
|
119
|
+
// await tx somehow
|
|
120
|
+
await provider.waitForTransaction(txHash);
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
### Full SDK
|
|
124
|
+
```typescript
|
|
125
|
+
import { constructFullSDK, constructAxiosFetcher, constructEthersContractCaller } from '@velora-dex/sdk';
|
|
126
|
+
|
|
127
|
+
const signer = ethers.Wallet.fromMnmemonic('__your_mnemonic__'); // or any other signer/provider
|
|
128
|
+
const account = '__signer_address__';
|
|
129
|
+
|
|
130
|
+
const contractCaller = constructEthersContractCaller({
|
|
131
|
+
ethersProviderOrSigner: signer,
|
|
132
|
+
EthersContract: ethers.Contract,
|
|
133
|
+
}, account); // alternatively constructViemContractCaller or constructWeb3ContractCaller
|
|
134
|
+
const fetcher = constructAxiosFetcher(axios); // alternatively constructFetchFetcher
|
|
135
|
+
|
|
136
|
+
const sdk = constructFullSDK({
|
|
137
|
+
chainId: 1,
|
|
138
|
+
fetcher,
|
|
139
|
+
contractCaller,
|
|
140
|
+
});
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
### Partial SDK
|
|
144
|
+
For bundle-size savvy developers, you can construct a lightweight version of the SDK and bring only the functions you need.
|
|
145
|
+
|
|
146
|
+
e.g. for only getting rates and allowances:
|
|
147
|
+
|
|
148
|
+
```typescript
|
|
149
|
+
import { constructPartialSDK, constructFetchFetcher, constructGetRate, constructGetBalances } from '@velora-dex/sdk';
|
|
150
|
+
|
|
151
|
+
const fetcher = constructFetchFetcher(window.fetch);
|
|
152
|
+
|
|
153
|
+
const sdk = constructPartialSDK({
|
|
154
|
+
chainId: 1,
|
|
155
|
+
fetcher,
|
|
156
|
+
}, constructGetRate, constructGetBalances);
|
|
157
|
+
|
|
158
|
+
const priceRoute = await sdk.getRate(params);
|
|
159
|
+
const allowance = await sdk.getAllowance(userAddress, tokenAddress);
|
|
160
|
+
```
|
|
161
|
+
--------------
|
|
162
|
+
|
|
163
|
+
### Basic usage
|
|
164
|
+
|
|
165
|
+
The easiest way to make a trade is to rely on Quote method that communicates with [/quote API endpoint](https://developers.velora.xyz/api/velora-api/velora-delta-api/retrieve-delta-price-with-fallback-to-market)
|
|
166
|
+
|
|
167
|
+
```typescript
|
|
168
|
+
import axios from 'axios';
|
|
169
|
+
import { ethers } from 'ethersV5';
|
|
170
|
+
import { constructSimpleSDK } from '@velora-dex/sdk';
|
|
171
|
+
|
|
172
|
+
const ethersProvider = new ethers.providers.Web3Provider(window.ethereum);
|
|
173
|
+
|
|
174
|
+
const accounts = await ethersProvider.listAccounts();
|
|
175
|
+
const account = accounts[0]!;
|
|
176
|
+
const signer = ethersProvider.getSigner(account);
|
|
177
|
+
|
|
178
|
+
const simpleSDK = constructSimpleSDK(
|
|
179
|
+
{ chainId: 1, axios },
|
|
180
|
+
{
|
|
181
|
+
ethersProviderOrSigner: signer,
|
|
182
|
+
EthersContract: ethers.Contract,
|
|
183
|
+
account,
|
|
184
|
+
}
|
|
185
|
+
);
|
|
186
|
+
|
|
187
|
+
const amount = '1000000000000'; // wei
|
|
188
|
+
const Token1 = '0x1234...'
|
|
189
|
+
const Token2 = '0xabcde...'
|
|
190
|
+
|
|
191
|
+
const quote = await simpleSDK.quote.getQuote({
|
|
192
|
+
srcToken: Token1, // Native token (ETH) is only supported in mode: 'market'
|
|
193
|
+
destToken: Token2,
|
|
194
|
+
amount,
|
|
195
|
+
userAddress: account,
|
|
196
|
+
srcDecimals: 18,
|
|
197
|
+
destDecimals: 18,
|
|
198
|
+
mode: 'all', // Delta quote if possible, with fallback to Market price
|
|
199
|
+
side: 'SELL', // Delta mode only supports side: SELL currenly
|
|
200
|
+
// partner: "..." // if available
|
|
201
|
+
});
|
|
202
|
+
|
|
203
|
+
if ('delta' in quote) {
|
|
204
|
+
const deltaPrice = quote.delta;
|
|
205
|
+
|
|
206
|
+
const DeltaContract = await simpleSDK.delta.getDeltaContract();
|
|
207
|
+
|
|
208
|
+
// or sign a Permit1 or Permit2 TransferFrom for DeltaContract
|
|
209
|
+
await simpleSDK.delta.approveTokenForDelta(amount, Token1);
|
|
210
|
+
|
|
211
|
+
const slippagePercent = 0.5;
|
|
212
|
+
const destAmountAfterSlippage = BigInt(
|
|
213
|
+
// get rid of exponential notation
|
|
214
|
+
|
|
215
|
+
+(+deltaPrice.destAmount * (1 - slippagePercent / 100)).toFixed(0)
|
|
216
|
+
// get rid of decimals
|
|
217
|
+
).toString(10);
|
|
218
|
+
|
|
219
|
+
const deltaAuction = await simpleSDK.delta.submitDeltaOrder({
|
|
220
|
+
deltaPrice,
|
|
221
|
+
owner: account,
|
|
222
|
+
// beneficiary: anotherAccount, // if need to send the output destToken to another account
|
|
223
|
+
// permit: "0x1234...", // if signed a Permit1 or Permit2 TransferFrom for DeltaContract
|
|
224
|
+
srcToken: Token1,
|
|
225
|
+
destToken: Token2,
|
|
226
|
+
srcAmount: amount,
|
|
227
|
+
destAmount: destAmountAfterSlippage, // minimum acceptable destAmount
|
|
228
|
+
});
|
|
229
|
+
|
|
230
|
+
// poll if necessary
|
|
231
|
+
const auction = await simpleSDK.delta.getDeltaOrderById(deltaAuction.id);
|
|
232
|
+
if (auction?.status === 'EXECUTED') {
|
|
233
|
+
console.log('Auction was executed');
|
|
234
|
+
}
|
|
235
|
+
} else {
|
|
236
|
+
console.log(
|
|
237
|
+
`Delta Quote failed: ${quote.fallbackReason.errorType} - ${quote.fallbackReason.details}`
|
|
238
|
+
);
|
|
239
|
+
const priceRoute = quote.market;
|
|
240
|
+
|
|
241
|
+
const TokenTransferProxy = await simpleSDK.swap.getSpender();
|
|
242
|
+
|
|
243
|
+
// or sign a Permit1 or Permit2 TransferFrom for TokenTransferProxy
|
|
244
|
+
const approveTxHash = simpleSDK.swap.approveToken(amount, Token1);
|
|
245
|
+
|
|
246
|
+
const txParams = await simpleSDK.swap.buildTx({
|
|
247
|
+
srcToken: Token1,
|
|
248
|
+
destToken: Token2,
|
|
249
|
+
srcAmount: amount,
|
|
250
|
+
slippage: 250, // 2.5%
|
|
251
|
+
priceRoute,
|
|
252
|
+
userAddress: account,
|
|
253
|
+
// partner: '...' // if available
|
|
254
|
+
});
|
|
255
|
+
|
|
256
|
+
const swapTx = await signer.sendTransaction(txParams);
|
|
257
|
+
}
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
### Delta Order handling
|
|
261
|
+
|
|
262
|
+
#### A more detailed overview of the Trade Flow, Delta Order variant.
|
|
263
|
+
|
|
264
|
+
**Velora Delta** is an intent-based protocol that enables a Velora user to make gasless swaps where multiple agents compete to execute the trade at the best price possible.
|
|
265
|
+
This way the user doesn't need to make a transaction themselve but only to sign a Delta Order.
|
|
266
|
+
|
|
267
|
+
(For **Crosschain Delta Orders** refer to a separate documentation page [DELTA.md](./docs/DELTA.md#crosschain-delta-orders) )
|
|
268
|
+
|
|
269
|
+
After getting **deltaPrice** from **/quote** endpoint, there are additional steps to sign the Order and wait for its execution.
|
|
270
|
+
|
|
271
|
+
### 1. Get deltaPrice from /quote
|
|
272
|
+
|
|
273
|
+
```ts
|
|
274
|
+
const amount = '1000000000000'; // wei
|
|
275
|
+
const Token1 = '0x1234...'
|
|
276
|
+
const Token2 = '0xabcde...'
|
|
277
|
+
|
|
278
|
+
const quote = await simpleSDK.quote.getQuote({
|
|
279
|
+
srcToken: Token1, // Native token (ETH) is only supported in mode: 'market'
|
|
280
|
+
destToken: Token2,
|
|
281
|
+
amount,
|
|
282
|
+
userAddress: account,
|
|
283
|
+
srcDecimals: 18,
|
|
284
|
+
destDecimals: 18,
|
|
285
|
+
mode: 'delta' // or mode: 'all'
|
|
286
|
+
// partner: "..." // if available
|
|
287
|
+
})
|
|
288
|
+
|
|
289
|
+
// if used mode: 'all'
|
|
290
|
+
if ('delta' in quote) {
|
|
291
|
+
const deltaPrice = quote.delta;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
// if used mode: 'delta'
|
|
295
|
+
const deltaPrice = quote.delta;
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
|
|
299
|
+
### 2. Approve srcToken for DeltaContract
|
|
300
|
+
|
|
301
|
+
```ts
|
|
302
|
+
const approveTxHash = await simpleSDK.delta.approveTokenForDelta(amount, Token1);
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
Alternatively sign Permit (DAI or Permit1) or Permit2 TransferFrom with DeltaContract as the verifyingContract
|
|
306
|
+
|
|
307
|
+
```ts
|
|
308
|
+
const DeltaContract = await simpleSDK.delta.getDeltaContract();
|
|
309
|
+
|
|
310
|
+
// values depend on the Permit type and the srcToken
|
|
311
|
+
const signature = await signer._signTypedData(domain, types, message);
|
|
312
|
+
```
|
|
313
|
+
|
|
314
|
+
See more on accepted Permit variants in [Velora documentation](https://developers.velora.xyz/api/velora-api/velora-delta-api/build-a-delta-order-to-sign#supported-permits)
|
|
315
|
+
|
|
316
|
+
|
|
317
|
+
### 3. Sign and submit a Delta Order
|
|
318
|
+
|
|
319
|
+
```ts
|
|
320
|
+
// calculate acceptable destAmount
|
|
321
|
+
const slippagePercent = 0.5;
|
|
322
|
+
const destAmountAfterSlippage = (
|
|
323
|
+
+deltaPrice.destAmount *
|
|
324
|
+
(1 - slippagePercent / 100)
|
|
325
|
+
).toString(10);
|
|
326
|
+
|
|
327
|
+
const signableOrderData = await simpleSDK.delta.buildDeltaOrder({
|
|
328
|
+
deltaPrice,
|
|
329
|
+
owner: account,
|
|
330
|
+
// beneficiary: anotherAccount, // if need to send the output destToken to another account
|
|
331
|
+
// permit: "0x1234...", // if signed a Permit1 or Permit2 TransferFrom for DeltaContract
|
|
332
|
+
srcToken: Token1,
|
|
333
|
+
destToken: Token2,
|
|
334
|
+
srcAmount: amount,
|
|
335
|
+
destAmount: destAmountAfterSlippage, // minimum acceptable destAmount
|
|
336
|
+
// partner: "..." // if available
|
|
337
|
+
});
|
|
338
|
+
|
|
339
|
+
const signature = await simpleSDK.delta.signDeltaOrder(signableOrderData);
|
|
340
|
+
|
|
341
|
+
const deltaAuction = await simpleSDK.delta.postDeltaOrder({
|
|
342
|
+
// partner: "..." // if available
|
|
343
|
+
// partiallyFillabel: true, // allow the Order to be partially filled as opposed to fill-or-kill
|
|
344
|
+
order: signableOrderData.data,
|
|
345
|
+
signature,
|
|
346
|
+
});
|
|
347
|
+
```
|
|
348
|
+
|
|
349
|
+
#### 3.a.
|
|
350
|
+
|
|
351
|
+
As an option the `buildDeltaOrder + signDeltaOrder + postDeltaOrder` can be combined into one SDK call with the following code
|
|
352
|
+
|
|
353
|
+
```ts
|
|
354
|
+
const deltaAuction = await simpleSDK.delta.submitDeltaOrder({
|
|
355
|
+
deltaPrice,
|
|
356
|
+
owner: account,
|
|
357
|
+
// beneficiary: anotherAccount, // if need to send output destToken to another account
|
|
358
|
+
// permit: "0x1234...", // if signed a Permit1 or Permit2 TransferFrom for DeltaContract
|
|
359
|
+
// partiallyFillabel: true, // allow the Order to be partially filled as opposed to fill-or-kill
|
|
360
|
+
srcToken: Token1,
|
|
361
|
+
destToken: Token2,
|
|
362
|
+
srcAmount: amount,
|
|
363
|
+
destAmount: destAmountAfterSlippage, // minimum acceptable destAmount
|
|
364
|
+
});
|
|
365
|
+
```
|
|
366
|
+
|
|
367
|
+
This allows to simplify the flow at the expense of control over the Order signing.
|
|
368
|
+
|
|
369
|
+
#### 3.b adding partner fee
|
|
370
|
+
|
|
371
|
+
A portion of destToken will be collected as a partner fee if `partner` parameter is provided to `buildDeltaOrder` (and `submitDeltaOrder`). The `partnerFee` itself is `deltaPrice.partnerFee`
|
|
372
|
+
|
|
373
|
+
To examine the default partnerFee parameters (`{partnerAddress: Address, partnerFee: number, takeSurplus: boolean}`), you can call `getPartnerFee` method. These parameters are then encoded in Order.partnerAndFee field.
|
|
374
|
+
|
|
375
|
+
```ts
|
|
376
|
+
const partnerFeeResponse = await simpleSDK.delta.getPartnerFee({ partner });
|
|
377
|
+
```
|
|
378
|
+
|
|
379
|
+
Alternatively, you can supply your own partnerFee parameters that will be encoded in Order.partnerAndFee field
|
|
380
|
+
|
|
381
|
+
```ts
|
|
382
|
+
const signableOrderData = await simpleSDK.delta.buildDeltaOrder({
|
|
383
|
+
deltaPrice,
|
|
384
|
+
owner: account,
|
|
385
|
+
// beneficiary: anotherAccount, // if need to send the output destToken to another account
|
|
386
|
+
// permit: "0x1234...", // if signed a Permit1 or Permit2 TransferFrom for DeltaContract
|
|
387
|
+
// partiallyFillabel: true, // allow the Order to be partially filled as opposed to fill-or-kill
|
|
388
|
+
srcToken: Token1,
|
|
389
|
+
destToken: Token2,
|
|
390
|
+
srcAmount: amount,
|
|
391
|
+
destAmount: destAmountAfterSlippage, // minimum acceptable destAmount
|
|
392
|
+
partnerAddress: '0x1234...',
|
|
393
|
+
partnerFee: 0.12,
|
|
394
|
+
takeSurplus: true,
|
|
395
|
+
});
|
|
396
|
+
```
|
|
397
|
+
|
|
398
|
+
### 4. Wait for Delta Order execution
|
|
399
|
+
|
|
400
|
+
```ts
|
|
401
|
+
// poll if necessary
|
|
402
|
+
const auction = await simpleSDK.delta.getDeltaOrderById(deltaAuction.id);
|
|
403
|
+
if (auction?.status === 'EXECUTED') {
|
|
404
|
+
console.log('Auction was executed');
|
|
405
|
+
}
|
|
406
|
+
```
|
|
407
|
+
|
|
408
|
+
#### A more detailed example of Delta Order usage can be found in [examples/delta](./src/examples/delta.ts)
|
|
409
|
+
|
|
410
|
+
For more Delta protocol usage, and **Crosschain Delta Orders**, refer to [DELTA.md](./docs/DELTA.md)
|
|
411
|
+
|
|
412
|
+
------------
|
|
413
|
+
|
|
414
|
+
### Market Swap handling
|
|
415
|
+
|
|
416
|
+
#### A more detailed overview of the Trade Flow, Market variant.
|
|
417
|
+
|
|
418
|
+
Unlike the Delta Order, a Market swap requires the user themselves to submit a Swap transaction
|
|
419
|
+
|
|
420
|
+
### 1. Get Market priceRoute from /quote
|
|
421
|
+
|
|
422
|
+
```ts
|
|
423
|
+
const amount = '1000000000000'; // wei
|
|
424
|
+
const Token1 = '0x1234...'
|
|
425
|
+
const Token2 = '0xabcde...'
|
|
426
|
+
|
|
427
|
+
const quote = await simpleSDK.quote.getQuote({
|
|
428
|
+
srcToken: Token1, // Native token (ETH) is only supported in mode: 'market'
|
|
429
|
+
destToken: Token2,
|
|
430
|
+
amount,
|
|
431
|
+
userAddress: account,
|
|
432
|
+
srcDecimals: 18,
|
|
433
|
+
destDecimals: 18,
|
|
434
|
+
mode: 'market'
|
|
435
|
+
// partner: "..." // if available
|
|
436
|
+
})
|
|
437
|
+
|
|
438
|
+
// if used mode: 'all'
|
|
439
|
+
if ('market' in quote) {
|
|
440
|
+
const priceRoute = quote.market;
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
// if used mode: 'market'
|
|
444
|
+
const priceRoute = quote.market;
|
|
445
|
+
```
|
|
446
|
+
|
|
447
|
+
|
|
448
|
+
### 2. Approve srcToken for TokenTransferProxy
|
|
449
|
+
|
|
450
|
+
```ts
|
|
451
|
+
const approveTxHash = simpleSDK.swap.approveToken(amount, DAI_TOKEN);
|
|
452
|
+
```
|
|
453
|
+
|
|
454
|
+
Alternatively sign Permit (DAI or Permit1) or Permit2 TransferFrom with TokenTransferProxy as the verifyingContract
|
|
455
|
+
|
|
456
|
+
```ts
|
|
457
|
+
const TokenTransferProxy = await simpleSDK.swap.getSpender();
|
|
458
|
+
|
|
459
|
+
// values depend on the Permit type and the srcToken
|
|
460
|
+
const signature = await signer._signTypedData(domain, types, message);
|
|
461
|
+
```
|
|
462
|
+
|
|
463
|
+
See more on accepted Permit variants in [Velora documentation](https://developers.velora.xyz/api/velora-api/velora-market-api/build-parameters-for-transaction)
|
|
464
|
+
|
|
465
|
+
|
|
466
|
+
### 3. Send Swap transaction
|
|
467
|
+
|
|
468
|
+
```ts
|
|
469
|
+
const txParams = await simpleSDK.swap.buildTx({
|
|
470
|
+
srcToken: Token1,
|
|
471
|
+
destToken: Token2,
|
|
472
|
+
srcAmount: amount,
|
|
473
|
+
slippage: 250, // 2.5%
|
|
474
|
+
// can pass `destAmount` (adjusted for slippage) instead of `slippage`
|
|
475
|
+
priceRoute,
|
|
476
|
+
userAddress: account,
|
|
477
|
+
// partner: '...' // if available
|
|
478
|
+
// receiver: '0x123ae...' // if need to send the output destToken to another account
|
|
479
|
+
});
|
|
480
|
+
|
|
481
|
+
const swapTxHash = await signer.sendTransaction(txParams);
|
|
482
|
+
```
|
|
483
|
+
|
|
484
|
+
#### See more details on `buildTx` parameters in [Velora documentation](https://developers.velora.xyz/api/velora-api/velora-market-api/build-parameters-for-transaction)
|
|
485
|
+
|
|
486
|
+
------------------------
|
|
487
|
+
|
|
488
|
+
|
|
489
|
+
Refer to [SDK API documentation](docs/md/modules.md) for detailed documentation on the methods provided in this SDK.
|
|
490
|
+
|
|
491
|
+
## Tests
|
|
492
|
+
|
|
493
|
+
To run `yarn test` it is necessary to provide `PROVIDER_URL=<mainnet_rpc_url>` environment variable.
|
|
494
|
+
If it is necessary to run tests against a different API endpoint, provide `API_URL=url_to_API` environment variable.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { EnumerateLiteral } from './types';
|
|
2
|
+
import type { ContractMethod } from '@paraswap/core';
|
|
3
|
+
export { SwapSide, ContractMethod, ContractMethodV5, ContractMethodV6, } from '@paraswap/core';
|
|
4
|
+
export type ContractMethodByName = EnumerateLiteral<typeof ContractMethod>;
|
|
5
|
+
export declare const API_URL = "https://api.paraswap.io";
|
|
6
|
+
export declare const DEFAULT_VERSION = "6.2";
|
|
7
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAc,MAAM,SAAS,CAAC;AAEvD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAErD,OAAO,EACL,QAAQ,EACR,cAAc,EACd,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,gBAAgB,CAAC;AAGxB,MAAM,MAAM,oBAAoB,GAAG,gBAAgB,CAAC,OAAO,cAAc,CAAC,CAAC;AAE3E,eAAO,MAAM,OAAO,4BAA4B,CAAC;AACjD,eAAO,MAAM,eAAe,QAA6B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"customFetcher.d.ts","sourceRoot":"","sources":["../../src/examples/customFetcher.ts"],"names":[],"mappings":"AACA,OAAO,EAAsB,eAAe,EAAE,MAAM,KAAK,CAAC;AAmB1D,eAAO,MAAM,iBAAiB,QAAO,eAoBlC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delta.d.ts","sourceRoot":"","sources":["../../src/examples/delta.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ethersV6.d.ts","sourceRoot":"","sources":["../../src/examples/ethersV6.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"limitOrders_all.d.ts","sourceRoot":"","sources":["../../src/examples/limitOrders_all.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"limitOrders_partial.d.ts","sourceRoot":"","sources":["../../src/examples/limitOrders_partial.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"limitOrders_postOrder.d.ts","sourceRoot":"","sources":["../../src/examples/limitOrders_postOrder.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"partial.d.ts","sourceRoot":"","sources":["../../src/examples/partial.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"quote.d.ts","sourceRoot":"","sources":["../../src/examples/quote.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sdk.d.ts","sourceRoot":"","sources":["../../src/examples/sdk.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"simple.d.ts","sourceRoot":"","sources":["../../src/examples/simple.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"simpleQuote.d.ts","sourceRoot":"","sources":["../../src/examples/simpleQuote.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"viem.d.ts","sourceRoot":"","sources":["../../src/examples/viem.ts"],"names":[],"mappings":"AAKA,OAAO,aAAa,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export declare const config: import("@wagmi/core").Config<readonly [{
|
|
2
|
+
blockExplorers: {
|
|
3
|
+
readonly default: {
|
|
4
|
+
readonly name: "Etherscan";
|
|
5
|
+
readonly url: "https://etherscan.io";
|
|
6
|
+
readonly apiUrl: "https://api.etherscan.io/api";
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
contracts: {
|
|
10
|
+
readonly ensRegistry: {
|
|
11
|
+
readonly address: "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e";
|
|
12
|
+
};
|
|
13
|
+
readonly ensUniversalResolver: {
|
|
14
|
+
readonly address: "0xce01f8eee7E479C928F8919abD53E553a36CeF67";
|
|
15
|
+
readonly blockCreated: 19258213;
|
|
16
|
+
};
|
|
17
|
+
readonly multicall3: {
|
|
18
|
+
readonly address: "0xca11bde05977b3631167028862be2a173976ca11";
|
|
19
|
+
readonly blockCreated: 14353601;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
id: 1;
|
|
23
|
+
name: "Ethereum";
|
|
24
|
+
nativeCurrency: {
|
|
25
|
+
readonly name: "Ether";
|
|
26
|
+
readonly symbol: "ETH";
|
|
27
|
+
readonly decimals: 18;
|
|
28
|
+
};
|
|
29
|
+
rpcUrls: {
|
|
30
|
+
readonly default: {
|
|
31
|
+
readonly http: readonly ["https://cloudflare-eth.com"];
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
sourceId?: number | undefined;
|
|
35
|
+
testnet?: boolean | undefined;
|
|
36
|
+
custom?: Record<string, unknown> | undefined;
|
|
37
|
+
fees?: import("viem").ChainFees<undefined> | undefined;
|
|
38
|
+
formatters?: undefined;
|
|
39
|
+
serializers?: import("viem").ChainSerializers<undefined, import("viem").TransactionSerializable> | undefined;
|
|
40
|
+
}], {
|
|
41
|
+
1: import("viem").HttpTransport;
|
|
42
|
+
}>;
|
|
43
|
+
//# sourceMappingURL=wagmi.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wagmi.d.ts","sourceRoot":"","sources":["../../src/examples/wagmi.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAuBe,MAE5B;;yBACuB,MAAgB,qCAElC,MACJ;;;EAvBL,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"web3.d.ts","sourceRoot":"","sources":["../../src/examples/web3.ts"],"names":[],"mappings":""}
|