@gauntlet-xyz/sdk 0.0.1 → 1.0.1
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/README.md +4 -107
- package/dist/attribution/erc8021.d.ts +2 -0
- package/dist/attribution/erc8021.js +7 -0
- package/dist/attribution/erc8021.js.map +1 -0
- package/dist/attribution/index.d.ts +16 -0
- package/dist/attribution/index.js +37 -0
- package/dist/attribution/index.js.map +1 -0
- package/dist/client.d.ts +28 -0
- package/dist/client.js +35 -0
- package/dist/client.js.map +1 -0
- package/dist/errors.d.ts +55 -0
- package/dist/errors.js +97 -0
- package/dist/errors.js.map +1 -0
- package/dist/evm/abis/erc20.d.ts +40 -0
- package/dist/evm/abis/erc20.js +30 -0
- package/dist/evm/abis/erc20.js.map +1 -0
- package/dist/evm/abis/erc4626.d.ts +104 -0
- package/dist/evm/abis/erc4626.js +70 -0
- package/dist/evm/abis/erc4626.js.map +1 -0
- package/dist/evm/abis/multiDepositorVault.d.ts +1047 -0
- package/dist/evm/abis/multiDepositorVault.js +587 -0
- package/dist/evm/abis/multiDepositorVault.js.map +1 -0
- package/dist/evm/abis/priceAndFeeCalculator.d.ts +909 -0
- package/dist/evm/abis/priceAndFeeCalculator.js +490 -0
- package/dist/evm/abis/priceAndFeeCalculator.js.map +1 -0
- package/dist/evm/abis/provisioner.d.ts +4983 -0
- package/dist/evm/abis/provisioner.js +2738 -0
- package/dist/evm/abis/provisioner.js.map +1 -0
- package/dist/evm/adapters/aera.d.ts +5 -0
- package/dist/evm/adapters/aera.js +144 -0
- package/dist/evm/adapters/aera.js.map +1 -0
- package/dist/evm/adapters/index.d.ts +2 -0
- package/dist/evm/adapters/index.js +14 -0
- package/dist/evm/adapters/index.js.map +1 -0
- package/dist/evm/adapters/morpho.d.ts +2 -0
- package/dist/evm/adapters/morpho.js +79 -0
- package/dist/evm/adapters/morpho.js.map +1 -0
- package/dist/evm/adapters/types.d.ts +65 -0
- package/dist/evm/adapters/types.js +2 -0
- package/dist/evm/adapters/types.js.map +1 -0
- package/dist/evm/aeraContracts.d.ts +2315 -0
- package/dist/evm/aeraContracts.js +37 -0
- package/dist/evm/aeraContracts.js.map +1 -0
- package/dist/evm/deposit.d.ts +13 -0
- package/dist/evm/deposit.js +66 -0
- package/dist/evm/deposit.js.map +1 -0
- package/dist/evm/index.d.ts +10 -0
- package/dist/evm/index.js +5 -0
- package/dist/evm/index.js.map +1 -0
- package/dist/evm/types.d.ts +27 -0
- package/dist/evm/types.js +2 -0
- package/dist/evm/types.js.map +1 -0
- package/dist/evm/userCurrentBalance.d.ts +16 -0
- package/dist/evm/userCurrentBalance.js +164 -0
- package/dist/evm/userCurrentBalance.js.map +1 -0
- package/dist/evm/vaults.d.ts +30 -0
- package/dist/evm/vaults.js +52 -0
- package/dist/evm/vaults.js.map +1 -0
- package/dist/evm/withdraw.d.ts +24 -0
- package/dist/evm/withdraw.js +51 -0
- package/dist/evm/withdraw.js.map +1 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -0
- package/manifest/vaults.json +435 -1
- package/package.json +1 -1
- package/src/evm/vaults.ts +13 -0
- package/src/index.ts +8 -0
package/README.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
Official Gauntlet SDK for interacting with Gauntlet-managed vaults — deposits, withdrawals, and on-chain attribution.
|
|
4
4
|
|
|
5
|
+
## Documentation
|
|
6
|
+
|
|
7
|
+
Full documentation, guides, and API reference at **[docs.gauntlet.xyz](https://docs.gauntlet.xyz/)**.
|
|
8
|
+
|
|
5
9
|
## Installation
|
|
6
10
|
|
|
7
11
|
```bash
|
|
@@ -11,110 +15,3 @@ yarn add @gauntlet-xyz/sdk viem
|
|
|
11
15
|
```
|
|
12
16
|
|
|
13
17
|
> `viem` is a required peer dependency.
|
|
14
|
-
|
|
15
|
-
## Quick start
|
|
16
|
-
|
|
17
|
-
```ts
|
|
18
|
-
import { GauntletClient } from '@gauntlet-xyz/sdk';
|
|
19
|
-
import { getDepositTx, getWithdrawTx, getVaults, VaultId } from '@gauntlet-xyz/sdk/evm';
|
|
20
|
-
import { createPublicClient, createWalletClient, http } from 'viem';
|
|
21
|
-
import { base } from 'viem/chains';
|
|
22
|
-
import { privateKeyToAccount } from 'viem/accounts';
|
|
23
|
-
|
|
24
|
-
const publicClient = createPublicClient({ chain: base, transport: http() });
|
|
25
|
-
|
|
26
|
-
const wallet = createWalletClient({
|
|
27
|
-
account: privateKeyToAccount('0x...'),
|
|
28
|
-
chain: base,
|
|
29
|
-
transport: http(),
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
const client = new GauntletClient({
|
|
33
|
-
wallet,
|
|
34
|
-
evmClients: {
|
|
35
|
-
[base.id]: publicClient,
|
|
36
|
-
},
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
// List available vaults
|
|
40
|
-
const vaults = await getVaults(client, { chainId: base.id });
|
|
41
|
-
|
|
42
|
-
// Build deposit transaction steps
|
|
43
|
-
const steps = await getDepositTx(client, {
|
|
44
|
-
vaultId: VaultId.BaseUsdcPrime,
|
|
45
|
-
chainId: base.id,
|
|
46
|
-
amount: 1_000_000n, // 1 USDC (6 decimals)
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
// Execute each step with your wallet
|
|
50
|
-
for (const step of steps) {
|
|
51
|
-
await wallet.writeContract(step);
|
|
52
|
-
}
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
## API
|
|
56
|
-
|
|
57
|
-
### `GauntletClient`
|
|
58
|
-
|
|
59
|
-
```ts
|
|
60
|
-
new GauntletClient(config: GauntletClientConfig)
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
| Option | Type | Description |
|
|
64
|
-
|---|---|---|
|
|
65
|
-
| `wallet` | `WalletClient` | Viem wallet client (provides the signer address) |
|
|
66
|
-
| `evmClients` | `Record<number, PublicClient>` | Map of chainId → viem PublicClient |
|
|
67
|
-
| `attributionMode` | `AttributionMode` | `PUBLIC` (default), `ENCODED`, or `PRIVATE` |
|
|
68
|
-
| `builderCode` | `string` | ERC-8021 builder identifier appended to calldata |
|
|
69
|
-
| `apiKey` | `string` | Gauntlet API key (reserved for future use) |
|
|
70
|
-
|
|
71
|
-
### `getVaults(client, filter?)`
|
|
72
|
-
|
|
73
|
-
Returns vaults from the bundled manifest. Optionally filter by `chainId` or `protocol`.
|
|
74
|
-
|
|
75
|
-
### `getDepositTx(client, params)`
|
|
76
|
-
|
|
77
|
-
Returns an array of `EvmTxStep` objects (approve + deposit) ready to pass to `walletClient.writeContract`.
|
|
78
|
-
|
|
79
|
-
| Param | Type | Description |
|
|
80
|
-
|---|---|---|
|
|
81
|
-
| `vaultId` | `string` | Vault identifier from the manifest |
|
|
82
|
-
| `amount` | `bigint` | Amount in supply token base units |
|
|
83
|
-
| `chainId` | `number` | Target chain (defaults to Base) |
|
|
84
|
-
| `depositMode` | `string` | `'sync'` or `'async'`; defaults to the vault's configured mode |
|
|
85
|
-
| `receiver` | `Address` | Recipient of vault shares (defaults to wallet address) |
|
|
86
|
-
|
|
87
|
-
### `getWithdrawTx(client, params)`
|
|
88
|
-
|
|
89
|
-
Returns an array of `EvmTxStep` objects ready to pass to `walletClient.writeContract`. Specify exactly one of `shares`, `amount`, or `entireAmount: true`.
|
|
90
|
-
|
|
91
|
-
| Param | Type | Description |
|
|
92
|
-
|---|---|---|
|
|
93
|
-
| `vaultId` | `string` | Vault identifier from the manifest |
|
|
94
|
-
| `chainId` | `number` | Target chain (defaults to Base) |
|
|
95
|
-
| `receiver` | `Address` | Recipient of withdrawn tokens (defaults to wallet address) |
|
|
96
|
-
| `shares` | `bigint` | Redeem a specific number of vault shares |
|
|
97
|
-
| `amount` | `bigint` | Redeem shares worth a specific token amount |
|
|
98
|
-
| `entireAmount` | `true` | Redeem all shares held by the wallet |
|
|
99
|
-
|
|
100
|
-
## Attribution
|
|
101
|
-
|
|
102
|
-
The SDK supports ERC-8021 builder attribution. Pass a `builderCode` to the client config and it will be appended to transaction calldata automatically under `AttributionMode.PUBLIC` (the default).
|
|
103
|
-
|
|
104
|
-
## Error handling
|
|
105
|
-
|
|
106
|
-
All errors extend `GauntletSDKError` and can be caught by class:
|
|
107
|
-
|
|
108
|
-
```ts
|
|
109
|
-
import { VaultNotFoundError, AccountRequiredError } from '@gauntlet-xyz/sdk';
|
|
110
|
-
|
|
111
|
-
try {
|
|
112
|
-
const steps = await getDepositTx(client, params);
|
|
113
|
-
} catch (e) {
|
|
114
|
-
if (e instanceof VaultNotFoundError) {
|
|
115
|
-
console.error('Unknown vault:', e.vaultId);
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
```
|
|
119
|
-
|
|
120
|
-
Available error classes: `VaultNotFoundError`, `AccountRequiredError`, `RpcNotConfiguredError`, `UnsupportedDepositModeError`, `UnsupportedProtocolError`, `UnsupportedAssetError`, `InvalidWithdrawParamsError`, `ChainMismatchError`, `UnimplementedFeatureError`, `UnitConversionError`.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"erc8021.js","sourceRoot":"","sources":["../../src/attribution/erc8021.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAY,MAAM,MAAM,CAAC;AAEvC,MAAM,cAAc,GAAG,MAAe,CAAC;AAQvC,MAAM,UAAU,iBAAiB,CAAC,WAAmB;IACnD,MAAM,OAAO,GAAG,KAAK,CAAC,WAAW,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAC5C,OAAO,KAAK,cAAc,GAAG,OAAO,EAAS,CAAC;AAChD,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Address, type Hex } from 'viem';
|
|
2
|
+
import { GauntletClient } from '../client';
|
|
3
|
+
import { TxStep } from '../evm/adapters/types';
|
|
4
|
+
export { encodeBuilderCode } from './erc8021';
|
|
5
|
+
export type PreparedPayloadWithAttribution = {
|
|
6
|
+
type: string;
|
|
7
|
+
to: Address;
|
|
8
|
+
data: Hex;
|
|
9
|
+
account?: Address;
|
|
10
|
+
};
|
|
11
|
+
export type PreparedTx = {
|
|
12
|
+
payload: PreparedPayloadWithAttribution;
|
|
13
|
+
tx: TxStep;
|
|
14
|
+
};
|
|
15
|
+
export declare function buildAttribution(client: GauntletClient): Promise<Hex>;
|
|
16
|
+
export declare function encodeTransactionWithAttribution(client: GauntletClient, transaction: TxStep): Promise<PreparedTx>;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { encodeFunctionData } from 'viem';
|
|
2
|
+
import { encodeBuilderCode } from './erc8021';
|
|
3
|
+
import { AttributionMode } from '../client';
|
|
4
|
+
import { UnimplementedFeatureError } from '../errors';
|
|
5
|
+
export { encodeBuilderCode } from './erc8021';
|
|
6
|
+
export async function buildAttribution(client) {
|
|
7
|
+
switch (client.attributionMode) {
|
|
8
|
+
case AttributionMode.PUBLIC:
|
|
9
|
+
return client.builderCode ? encodeBuilderCode(client.builderCode) : '0x';
|
|
10
|
+
case AttributionMode.ENCODED:
|
|
11
|
+
throw new UnimplementedFeatureError('AttributionMode.ENCODED');
|
|
12
|
+
case AttributionMode.PRIVATE:
|
|
13
|
+
throw new UnimplementedFeatureError('AttributionMode.PRIVATE');
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
export async function encodeTransactionWithAttribution(client, transaction) {
|
|
17
|
+
const customAttribution = await buildAttribution(client);
|
|
18
|
+
const encodedTx = encodeFunctionData({
|
|
19
|
+
abi: transaction.abi,
|
|
20
|
+
functionName: transaction.functionName,
|
|
21
|
+
args: transaction.args,
|
|
22
|
+
});
|
|
23
|
+
const encodedTxWithAttribution = `${encodedTx}${customAttribution.replace('0x', '')}`;
|
|
24
|
+
return {
|
|
25
|
+
payload: {
|
|
26
|
+
type: transaction.type,
|
|
27
|
+
account: transaction.account,
|
|
28
|
+
to: transaction.address,
|
|
29
|
+
data: encodedTxWithAttribution,
|
|
30
|
+
},
|
|
31
|
+
tx: {
|
|
32
|
+
...transaction,
|
|
33
|
+
attribution: customAttribution,
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/attribution/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,kBAAkB,EAAY,MAAM,MAAM,CAAC;AAC7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAkB,MAAM,WAAW,CAAC;AAC5D,OAAO,EAAE,yBAAyB,EAAE,MAAM,WAAW,CAAC;AAEtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAsB9C,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,MAAsB;IAC3D,QAAQ,MAAM,CAAC,eAAe,EAAE,CAAC;QAC/B,KAAK,eAAe,CAAC,MAAM;YACzB,OAAO,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,iBAAiB,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QAC3E,KAAK,eAAe,CAAC,OAAO;YAC1B,MAAM,IAAI,yBAAyB,CAAC,yBAAyB,CAAC,CAAC;QACjE,KAAK,eAAe,CAAC,OAAO;YAC1B,MAAM,IAAI,yBAAyB,CAAC,yBAAyB,CAAC,CAAC;IACnE,CAAC;AACH,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,gCAAgC,CACpD,MAAsB,EACtB,WAAmB;IAEnB,MAAM,iBAAiB,GAAG,MAAM,gBAAgB,CAAC,MAAM,CAAC,CAAC;IACzD,MAAM,SAAS,GAAG,kBAAkB,CAAC;QACnC,GAAG,EAAE,WAAW,CAAC,GAAG;QACpB,YAAY,EAAE,WAAW,CAAC,YAAY;QACtC,IAAI,EAAE,WAAW,CAAC,IAAI;KACvB,CAAC,CAAC;IACH,MAAM,wBAAwB,GAAG,GAAG,SAAS,GAAG,iBAAiB,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,EAAS,CAAC;IAC7F,OAAO;QACL,OAAO,EAAE;YACP,IAAI,EAAE,WAAW,CAAC,IAAI;YACtB,OAAO,EAAE,WAAW,CAAC,OAAO;YAC5B,EAAE,EAAE,WAAW,CAAC,OAAO;YACvB,IAAI,EAAE,wBAAwB;SAC/B;QACD,EAAE,EAAE;YACF,GAAG,WAAW;YACd,WAAW,EAAE,iBAAiB;SAC/B;KACF,CAAC;AACJ,CAAC"}
|
package/dist/client.d.ts
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { type PublicClient, type WalletClient } from 'viem';
|
|
2
|
+
import type { VaultManifest } from './evm/types';
|
|
3
|
+
export declare enum AttributionMode {
|
|
4
|
+
PUBLIC = "public",
|
|
5
|
+
ENCODED = "encoded",
|
|
6
|
+
PRIVATE = "private"
|
|
7
|
+
}
|
|
8
|
+
export type ChainId = string | number;
|
|
9
|
+
export interface GauntletClientConfig {
|
|
10
|
+
apiKey?: string;
|
|
11
|
+
evmClients?: Record<ChainId, PublicClient>;
|
|
12
|
+
attributionMode?: AttributionMode;
|
|
13
|
+
builderCode?: string;
|
|
14
|
+
wallet?: WalletClient;
|
|
15
|
+
}
|
|
16
|
+
export declare class GauntletClient {
|
|
17
|
+
readonly apiKey?: string;
|
|
18
|
+
readonly builderCode?: string;
|
|
19
|
+
readonly attributionMode: AttributionMode;
|
|
20
|
+
readonly evmClients: Record<ChainId, PublicClient>;
|
|
21
|
+
readonly wallet?: WalletClient;
|
|
22
|
+
private _manifest;
|
|
23
|
+
constructor(config: GauntletClientConfig);
|
|
24
|
+
get manifest(): Promise<VaultManifest>;
|
|
25
|
+
setManifest(manifest: VaultManifest): void;
|
|
26
|
+
getPublicClient(chainId?: ChainId): PublicClient;
|
|
27
|
+
getSourceId(): Promise<string>;
|
|
28
|
+
}
|
package/dist/client.js
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import bundledManifest from '../manifest/vaults.json';
|
|
2
|
+
import { RpcNotConfiguredError, UnimplementedFeatureError } from './errors';
|
|
3
|
+
import { base } from 'viem/chains';
|
|
4
|
+
export var AttributionMode;
|
|
5
|
+
(function (AttributionMode) {
|
|
6
|
+
AttributionMode["PUBLIC"] = "public";
|
|
7
|
+
AttributionMode["ENCODED"] = "encoded";
|
|
8
|
+
AttributionMode["PRIVATE"] = "private";
|
|
9
|
+
})(AttributionMode || (AttributionMode = {}));
|
|
10
|
+
export class GauntletClient {
|
|
11
|
+
constructor(config) {
|
|
12
|
+
this._manifest = bundledManifest;
|
|
13
|
+
this.apiKey = config.apiKey;
|
|
14
|
+
this.evmClients = config.evmClients ?? {};
|
|
15
|
+
this.attributionMode = config.attributionMode ?? AttributionMode.PUBLIC;
|
|
16
|
+
this.builderCode = config.builderCode;
|
|
17
|
+
this.wallet = config.wallet;
|
|
18
|
+
}
|
|
19
|
+
get manifest() {
|
|
20
|
+
return Promise.resolve(this._manifest);
|
|
21
|
+
}
|
|
22
|
+
setManifest(manifest) {
|
|
23
|
+
this._manifest = manifest;
|
|
24
|
+
}
|
|
25
|
+
getPublicClient(chainId = base.id) {
|
|
26
|
+
const client = this.evmClients[chainId];
|
|
27
|
+
if (!client)
|
|
28
|
+
throw new RpcNotConfiguredError(chainId);
|
|
29
|
+
return client;
|
|
30
|
+
}
|
|
31
|
+
async getSourceId() {
|
|
32
|
+
throw new UnimplementedFeatureError('getSourceId');
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AACA,OAAO,eAAe,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,qBAAqB,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAC;AAE5E,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AASnC,MAAM,CAAN,IAAY,eAIX;AAJD,WAAY,eAAe;IACzB,oCAAiB,CAAA;IACjB,sCAAmB,CAAA;IACnB,sCAAmB,CAAA;AACrB,CAAC,EAJW,eAAe,KAAf,eAAe,QAI1B;AAwCD,MAAM,OAAO,cAAc;IAUzB,YAAY,MAA4B;QAFhC,cAAS,GAAkB,eAAgC,CAAC;QAGlE,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;QAC5B,IAAI,CAAC,UAAU,GAAG,MAAM,CAAC,UAAU,IAAI,EAAE,CAAC;QAC1C,IAAI,CAAC,eAAe,GAAG,MAAM,CAAC,eAAe,IAAI,eAAe,CAAC,MAAM,CAAC;QACxE,IAAI,CAAC,WAAW,GAAG,MAAM,CAAC,WAAW,CAAC;QACtC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;IAC9B,CAAC;IAED,IAAI,QAAQ;QACV,OAAO,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACzC,CAAC;IAED,WAAW,CAAC,QAAuB;QACjC,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;IAC5B,CAAC;IAED,eAAe,CAAC,UAAmB,IAAI,CAAC,EAAE;QACxC,MAAM,MAAM,GAAG,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;QACxC,IAAI,CAAC,MAAM;YAAE,MAAM,IAAI,qBAAqB,CAAC,OAAO,CAAC,CAAC;QACtD,OAAO,MAAM,CAAC;IAChB,CAAC;IAID,KAAK,CAAC,WAAW;QACf,MAAM,IAAI,yBAAyB,CAAC,aAAa,CAAC,CAAC;IACrD,CAAC;CACF"}
|
package/dist/errors.d.ts
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { ChainId } from './client';
|
|
2
|
+
export declare class GauntletSDKError extends Error {
|
|
3
|
+
constructor(message: string);
|
|
4
|
+
}
|
|
5
|
+
export declare class VaultNotFoundError extends GauntletSDKError {
|
|
6
|
+
readonly vaultId: string;
|
|
7
|
+
readonly chainId?: ChainId;
|
|
8
|
+
constructor(vaultId: string, chainId?: ChainId);
|
|
9
|
+
}
|
|
10
|
+
export declare class UnsupportedAssetError extends GauntletSDKError {
|
|
11
|
+
readonly asset: string;
|
|
12
|
+
readonly vaultId: string;
|
|
13
|
+
constructor(asset: string, vaultId: string);
|
|
14
|
+
}
|
|
15
|
+
export declare class ChainMismatchError extends GauntletSDKError {
|
|
16
|
+
readonly expected: string;
|
|
17
|
+
readonly received: string;
|
|
18
|
+
constructor(expected: string, received: string);
|
|
19
|
+
}
|
|
20
|
+
export declare class UnsupportedDepositModeError extends GauntletSDKError {
|
|
21
|
+
readonly vaultId: string;
|
|
22
|
+
readonly requested: 'sync' | 'async';
|
|
23
|
+
readonly available: string;
|
|
24
|
+
constructor(vaultId: string, requested: 'sync' | 'async', available: string);
|
|
25
|
+
}
|
|
26
|
+
export declare class RpcNotConfiguredError extends GauntletSDKError {
|
|
27
|
+
readonly chainId: ChainId;
|
|
28
|
+
constructor(chainId: ChainId);
|
|
29
|
+
}
|
|
30
|
+
export declare class AccountRequiredError extends GauntletSDKError {
|
|
31
|
+
constructor();
|
|
32
|
+
}
|
|
33
|
+
export declare class UnsupportedProtocolError extends GauntletSDKError {
|
|
34
|
+
readonly protocol: string;
|
|
35
|
+
constructor(protocol: string);
|
|
36
|
+
}
|
|
37
|
+
export declare class InvalidWithdrawParamsError extends GauntletSDKError {
|
|
38
|
+
constructor();
|
|
39
|
+
}
|
|
40
|
+
export declare class UnimplementedFeatureError extends GauntletSDKError {
|
|
41
|
+
readonly feature: string;
|
|
42
|
+
constructor(feature: string);
|
|
43
|
+
}
|
|
44
|
+
export declare class UnsupportedFeatureError extends GauntletSDKError {
|
|
45
|
+
readonly feature: string;
|
|
46
|
+
constructor(feature: string);
|
|
47
|
+
}
|
|
48
|
+
export declare class UnitConversionError extends GauntletSDKError {
|
|
49
|
+
readonly vaultAddress: string;
|
|
50
|
+
constructor(vaultAddress: string);
|
|
51
|
+
}
|
|
52
|
+
export declare class InvalidSlippageBPSError extends GauntletSDKError {
|
|
53
|
+
readonly slippage: number;
|
|
54
|
+
constructor(slippage: number);
|
|
55
|
+
}
|
package/dist/errors.js
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
export class GauntletSDKError extends Error {
|
|
2
|
+
constructor(message) {
|
|
3
|
+
super(message);
|
|
4
|
+
this.name = 'GauntletSDKError';
|
|
5
|
+
}
|
|
6
|
+
}
|
|
7
|
+
export class VaultNotFoundError extends GauntletSDKError {
|
|
8
|
+
constructor(vaultId, chainId) {
|
|
9
|
+
const msg = chainId
|
|
10
|
+
? `Vault "${vaultId}" not found on chainId "${chainId}"`
|
|
11
|
+
: `Vault "${vaultId}" not found`;
|
|
12
|
+
super(msg);
|
|
13
|
+
this.name = 'VaultNotFoundError';
|
|
14
|
+
this.vaultId = vaultId;
|
|
15
|
+
this.chainId = chainId;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
export class UnsupportedAssetError extends GauntletSDKError {
|
|
19
|
+
constructor(asset, vaultId) {
|
|
20
|
+
super(`Asset "${asset}" is not supported by vault "${vaultId}"`);
|
|
21
|
+
this.name = 'UnsupportedAssetError';
|
|
22
|
+
this.asset = asset;
|
|
23
|
+
this.vaultId = vaultId;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
export class ChainMismatchError extends GauntletSDKError {
|
|
27
|
+
constructor(expected, received) {
|
|
28
|
+
super(`Chain mismatch: expected "${expected}", received "${received}"`);
|
|
29
|
+
this.name = 'ChainMismatchError';
|
|
30
|
+
this.expected = expected;
|
|
31
|
+
this.received = received;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
export class UnsupportedDepositModeError extends GauntletSDKError {
|
|
35
|
+
constructor(vaultId, requested, available) {
|
|
36
|
+
super(`Vault "${vaultId}" does not support ${requested} deposits (available: ${available})`);
|
|
37
|
+
this.name = 'UnsupportedDepositModeError';
|
|
38
|
+
this.vaultId = vaultId;
|
|
39
|
+
this.requested = requested;
|
|
40
|
+
this.available = available;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
export class RpcNotConfiguredError extends GauntletSDKError {
|
|
44
|
+
constructor(chainId) {
|
|
45
|
+
super(`No client configured for chainId "${chainId}"`);
|
|
46
|
+
this.name = 'RpcNotConfiguredError';
|
|
47
|
+
this.chainId = chainId;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
export class AccountRequiredError extends GauntletSDKError {
|
|
51
|
+
constructor() {
|
|
52
|
+
super('No account specified. Provide a wallet in the client config.');
|
|
53
|
+
this.name = 'AccountRequiredError';
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
export class UnsupportedProtocolError extends GauntletSDKError {
|
|
57
|
+
constructor(protocol) {
|
|
58
|
+
super(`Unsupported protocol: "${protocol}"`);
|
|
59
|
+
this.name = 'UnsupportedProtocolError';
|
|
60
|
+
this.protocol = protocol;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
export class InvalidWithdrawParamsError extends GauntletSDKError {
|
|
64
|
+
constructor() {
|
|
65
|
+
super('Withdraw requires exactly one of: shares, amount, or all');
|
|
66
|
+
this.name = 'InvalidWithdrawParamsError';
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
export class UnimplementedFeatureError extends GauntletSDKError {
|
|
70
|
+
constructor(feature) {
|
|
71
|
+
super(`Feature not yet implemented: "${feature}"`);
|
|
72
|
+
this.name = 'UnimplementedFeatureError';
|
|
73
|
+
this.feature = feature;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
export class UnsupportedFeatureError extends GauntletSDKError {
|
|
77
|
+
constructor(feature) {
|
|
78
|
+
super(`Feature not supported: "${feature}"`);
|
|
79
|
+
this.name = 'UnimplementedFeatureError';
|
|
80
|
+
this.feature = feature;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
export class UnitConversionError extends GauntletSDKError {
|
|
84
|
+
constructor(vaultAddress) {
|
|
85
|
+
super(`Failed to convert token units for vault "${vaultAddress}": fee calculator unavailable`);
|
|
86
|
+
this.name = 'UnitConversionError';
|
|
87
|
+
this.vaultAddress = vaultAddress;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
export class InvalidSlippageBPSError extends GauntletSDKError {
|
|
91
|
+
constructor(slippage) {
|
|
92
|
+
super(`Slippage not in range of 10000-0; argumet passed: ${slippage}`);
|
|
93
|
+
this.name = 'IncorrectArgument';
|
|
94
|
+
this.slippage = slippage;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export declare const erc20Abi: readonly [{
|
|
2
|
+
readonly type: "function";
|
|
3
|
+
readonly name: "approve";
|
|
4
|
+
readonly inputs: readonly [{
|
|
5
|
+
readonly name: "spender";
|
|
6
|
+
readonly type: "address";
|
|
7
|
+
}, {
|
|
8
|
+
readonly name: "amount";
|
|
9
|
+
readonly type: "uint256";
|
|
10
|
+
}];
|
|
11
|
+
readonly outputs: readonly [{
|
|
12
|
+
readonly type: "bool";
|
|
13
|
+
}];
|
|
14
|
+
readonly stateMutability: "nonpayable";
|
|
15
|
+
}, {
|
|
16
|
+
readonly type: "function";
|
|
17
|
+
readonly name: "allowance";
|
|
18
|
+
readonly inputs: readonly [{
|
|
19
|
+
readonly name: "owner";
|
|
20
|
+
readonly type: "address";
|
|
21
|
+
}, {
|
|
22
|
+
readonly name: "spender";
|
|
23
|
+
readonly type: "address";
|
|
24
|
+
}];
|
|
25
|
+
readonly outputs: readonly [{
|
|
26
|
+
readonly type: "uint256";
|
|
27
|
+
}];
|
|
28
|
+
readonly stateMutability: "view";
|
|
29
|
+
}, {
|
|
30
|
+
readonly type: "function";
|
|
31
|
+
readonly name: "balanceOf";
|
|
32
|
+
readonly inputs: readonly [{
|
|
33
|
+
readonly name: "account";
|
|
34
|
+
readonly type: "address";
|
|
35
|
+
}];
|
|
36
|
+
readonly outputs: readonly [{
|
|
37
|
+
readonly type: "uint256";
|
|
38
|
+
}];
|
|
39
|
+
readonly stateMutability: "view";
|
|
40
|
+
}];
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export const erc20Abi = [
|
|
2
|
+
{
|
|
3
|
+
type: 'function',
|
|
4
|
+
name: 'approve',
|
|
5
|
+
inputs: [
|
|
6
|
+
{ name: 'spender', type: 'address' },
|
|
7
|
+
{ name: 'amount', type: 'uint256' },
|
|
8
|
+
],
|
|
9
|
+
outputs: [{ type: 'bool' }],
|
|
10
|
+
stateMutability: 'nonpayable',
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
type: 'function',
|
|
14
|
+
name: 'allowance',
|
|
15
|
+
inputs: [
|
|
16
|
+
{ name: 'owner', type: 'address' },
|
|
17
|
+
{ name: 'spender', type: 'address' },
|
|
18
|
+
],
|
|
19
|
+
outputs: [{ type: 'uint256' }],
|
|
20
|
+
stateMutability: 'view',
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
type: 'function',
|
|
24
|
+
name: 'balanceOf',
|
|
25
|
+
inputs: [{ name: 'account', type: 'address' }],
|
|
26
|
+
outputs: [{ type: 'uint256' }],
|
|
27
|
+
stateMutability: 'view',
|
|
28
|
+
},
|
|
29
|
+
];
|
|
30
|
+
//# sourceMappingURL=erc20.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"erc20.js","sourceRoot":"","sources":["../../../src/evm/abis/erc20.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,QAAQ,GAAG;IACtB;QACE,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,SAAS;QACf,MAAM,EAAE;YACN,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE;YACpC,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE;SACpC;QACD,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;QAC3B,eAAe,EAAE,YAAY;KAC9B;IACD;QACE,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,WAAW;QACjB,MAAM,EAAE;YACN,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE;YAClC,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE;SACrC;QACD,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;QAC9B,eAAe,EAAE,MAAM;KACxB;IACD;QACE,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,WAAW;QACjB,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;QAC9C,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;QAC9B,eAAe,EAAE,MAAM;KACxB;CACO,CAAC"}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
export declare const erc4626Abi: readonly [{
|
|
2
|
+
readonly type: "function";
|
|
3
|
+
readonly name: "deposit";
|
|
4
|
+
readonly inputs: readonly [{
|
|
5
|
+
readonly name: "assets";
|
|
6
|
+
readonly type: "uint256";
|
|
7
|
+
}, {
|
|
8
|
+
readonly name: "receiver";
|
|
9
|
+
readonly type: "address";
|
|
10
|
+
}];
|
|
11
|
+
readonly outputs: readonly [{
|
|
12
|
+
readonly type: "uint256";
|
|
13
|
+
}];
|
|
14
|
+
readonly stateMutability: "nonpayable";
|
|
15
|
+
}, {
|
|
16
|
+
readonly type: "function";
|
|
17
|
+
readonly name: "redeem";
|
|
18
|
+
readonly inputs: readonly [{
|
|
19
|
+
readonly name: "shares";
|
|
20
|
+
readonly type: "uint256";
|
|
21
|
+
}, {
|
|
22
|
+
readonly name: "receiver";
|
|
23
|
+
readonly type: "address";
|
|
24
|
+
}, {
|
|
25
|
+
readonly name: "owner";
|
|
26
|
+
readonly type: "address";
|
|
27
|
+
}];
|
|
28
|
+
readonly outputs: readonly [{
|
|
29
|
+
readonly type: "uint256";
|
|
30
|
+
}];
|
|
31
|
+
readonly stateMutability: "nonpayable";
|
|
32
|
+
}, {
|
|
33
|
+
readonly type: "function";
|
|
34
|
+
readonly name: "convertToShares";
|
|
35
|
+
readonly inputs: readonly [{
|
|
36
|
+
readonly name: "assets";
|
|
37
|
+
readonly type: "uint256";
|
|
38
|
+
}];
|
|
39
|
+
readonly outputs: readonly [{
|
|
40
|
+
readonly type: "uint256";
|
|
41
|
+
}];
|
|
42
|
+
readonly stateMutability: "view";
|
|
43
|
+
}, {
|
|
44
|
+
readonly type: "function";
|
|
45
|
+
readonly name: "convertToAssets";
|
|
46
|
+
readonly inputs: readonly [{
|
|
47
|
+
readonly name: "shares";
|
|
48
|
+
readonly type: "uint256";
|
|
49
|
+
}];
|
|
50
|
+
readonly outputs: readonly [{
|
|
51
|
+
readonly type: "uint256";
|
|
52
|
+
}];
|
|
53
|
+
readonly stateMutability: "view";
|
|
54
|
+
}, {
|
|
55
|
+
readonly type: "function";
|
|
56
|
+
readonly name: "balanceOf";
|
|
57
|
+
readonly inputs: readonly [{
|
|
58
|
+
readonly name: "account";
|
|
59
|
+
readonly type: "address";
|
|
60
|
+
}];
|
|
61
|
+
readonly outputs: readonly [{
|
|
62
|
+
readonly type: "uint256";
|
|
63
|
+
}];
|
|
64
|
+
readonly stateMutability: "view";
|
|
65
|
+
}, {
|
|
66
|
+
readonly type: "function";
|
|
67
|
+
readonly name: "maxDeposit";
|
|
68
|
+
readonly inputs: readonly [{
|
|
69
|
+
readonly name: "receiver";
|
|
70
|
+
readonly type: "address";
|
|
71
|
+
}];
|
|
72
|
+
readonly outputs: readonly [{
|
|
73
|
+
readonly type: "uint256";
|
|
74
|
+
}];
|
|
75
|
+
readonly stateMutability: "view";
|
|
76
|
+
}, {
|
|
77
|
+
readonly type: "function";
|
|
78
|
+
readonly name: "maxRedeem";
|
|
79
|
+
readonly inputs: readonly [{
|
|
80
|
+
readonly name: "owner";
|
|
81
|
+
readonly type: "address";
|
|
82
|
+
}];
|
|
83
|
+
readonly outputs: readonly [{
|
|
84
|
+
readonly type: "uint256";
|
|
85
|
+
}];
|
|
86
|
+
readonly stateMutability: "view";
|
|
87
|
+
}, {
|
|
88
|
+
readonly type: "function";
|
|
89
|
+
readonly name: "withdraw";
|
|
90
|
+
readonly inputs: readonly [{
|
|
91
|
+
readonly name: "assets";
|
|
92
|
+
readonly type: "uint256";
|
|
93
|
+
}, {
|
|
94
|
+
readonly name: "receiver";
|
|
95
|
+
readonly type: "address";
|
|
96
|
+
}, {
|
|
97
|
+
readonly name: "owner";
|
|
98
|
+
readonly type: "address";
|
|
99
|
+
}];
|
|
100
|
+
readonly outputs: readonly [{
|
|
101
|
+
readonly type: "uint256";
|
|
102
|
+
}];
|
|
103
|
+
readonly stateMutability: "nonpayable";
|
|
104
|
+
}];
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
export const erc4626Abi = [
|
|
2
|
+
{
|
|
3
|
+
type: 'function',
|
|
4
|
+
name: 'deposit',
|
|
5
|
+
inputs: [
|
|
6
|
+
{ name: 'assets', type: 'uint256' },
|
|
7
|
+
{ name: 'receiver', type: 'address' },
|
|
8
|
+
],
|
|
9
|
+
outputs: [{ type: 'uint256' }],
|
|
10
|
+
stateMutability: 'nonpayable',
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
type: 'function',
|
|
14
|
+
name: 'redeem',
|
|
15
|
+
inputs: [
|
|
16
|
+
{ name: 'shares', type: 'uint256' },
|
|
17
|
+
{ name: 'receiver', type: 'address' },
|
|
18
|
+
{ name: 'owner', type: 'address' },
|
|
19
|
+
],
|
|
20
|
+
outputs: [{ type: 'uint256' }],
|
|
21
|
+
stateMutability: 'nonpayable',
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
type: 'function',
|
|
25
|
+
name: 'convertToShares',
|
|
26
|
+
inputs: [{ name: 'assets', type: 'uint256' }],
|
|
27
|
+
outputs: [{ type: 'uint256' }],
|
|
28
|
+
stateMutability: 'view',
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
type: 'function',
|
|
32
|
+
name: 'convertToAssets',
|
|
33
|
+
inputs: [{ name: 'shares', type: 'uint256' }],
|
|
34
|
+
outputs: [{ type: 'uint256' }],
|
|
35
|
+
stateMutability: 'view',
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
type: 'function',
|
|
39
|
+
name: 'balanceOf',
|
|
40
|
+
inputs: [{ name: 'account', type: 'address' }],
|
|
41
|
+
outputs: [{ type: 'uint256' }],
|
|
42
|
+
stateMutability: 'view',
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
type: 'function',
|
|
46
|
+
name: 'maxDeposit',
|
|
47
|
+
inputs: [{ name: 'receiver', type: 'address' }],
|
|
48
|
+
outputs: [{ type: 'uint256' }],
|
|
49
|
+
stateMutability: 'view',
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
type: 'function',
|
|
53
|
+
name: 'maxRedeem',
|
|
54
|
+
inputs: [{ name: 'owner', type: 'address' }],
|
|
55
|
+
outputs: [{ type: 'uint256' }],
|
|
56
|
+
stateMutability: 'view',
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
type: 'function',
|
|
60
|
+
name: 'withdraw',
|
|
61
|
+
inputs: [
|
|
62
|
+
{ name: 'assets', type: 'uint256' },
|
|
63
|
+
{ name: 'receiver', type: 'address' },
|
|
64
|
+
{ name: 'owner', type: 'address' },
|
|
65
|
+
],
|
|
66
|
+
outputs: [{ type: 'uint256' }],
|
|
67
|
+
stateMutability: 'nonpayable',
|
|
68
|
+
},
|
|
69
|
+
];
|
|
70
|
+
//# sourceMappingURL=erc4626.js.map
|