@augustdigital/sdk 8.11.0 → 8.13.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/lib/adapters/evm/index.d.ts +17 -1
- package/lib/adapters/evm/index.js +20 -0
- package/lib/core/analytics/method-taxonomy.js +3 -0
- package/lib/core/analytics/version.d.ts +1 -1
- package/lib/core/analytics/version.js +1 -1
- package/lib/core/constants/swap-router.d.ts +46 -4
- package/lib/core/constants/swap-router.js +50 -5
- package/lib/core/constants/web3.d.ts +19 -0
- package/lib/core/constants/web3.js +37 -1
- package/lib/core/helpers/multicall.d.ts +68 -0
- package/lib/core/helpers/multicall.js +103 -0
- package/lib/core/helpers/revert-decode.d.ts +248 -0
- package/lib/core/helpers/revert-decode.js +515 -0
- package/lib/core/helpers/swap-router.d.ts +168 -5
- package/lib/core/helpers/swap-router.js +417 -4
- package/lib/core/helpers/vault-version.d.ts +19 -1
- package/lib/core/helpers/vault-version.js +15 -1
- package/lib/core/helpers/vaults.d.ts +1 -1
- package/lib/core/index.d.ts +2 -0
- package/lib/core/index.js +2 -0
- package/lib/main.d.ts +46 -0
- package/lib/main.js +46 -0
- package/lib/modules/vaults/getters.d.ts +25 -2
- package/lib/modules/vaults/getters.js +41 -11
- package/lib/modules/vaults/main.d.ts +75 -0
- package/lib/modules/vaults/main.js +127 -0
- package/lib/modules/vaults/prefetch.d.ts +65 -0
- package/lib/modules/vaults/prefetch.js +120 -0
- package/lib/sdk.d.ts +7227 -6544
- package/lib/types/subgraph.d.ts +9 -0
- package/lib/types/vaults.d.ts +34 -0
- package/package.json +3 -3
package/lib/types/subgraph.d.ts
CHANGED
|
@@ -12,6 +12,15 @@ export interface ISubgraphUserHistoryItem extends ISubgraphBase {
|
|
|
12
12
|
type: 'withdraw-request' | 'deposit' | 'withdraw-processed';
|
|
13
13
|
decimals?: number;
|
|
14
14
|
isInstant?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Receipt-token (vault share) amount burned, raw base units. Present on
|
|
17
|
+
* withdraw-request rows: an async withdrawal burns shares up front, but the
|
|
18
|
+
* assets ultimately received are only known once the request settles (share
|
|
19
|
+
* price can move). Consumers showing a pending request should surface these
|
|
20
|
+
* shares (the concrete on-chain fact) rather than the request's `assets`
|
|
21
|
+
* preview. Absent on deposits and settled withdraws.
|
|
22
|
+
*/
|
|
23
|
+
shares?: string;
|
|
15
24
|
/**
|
|
16
25
|
* Deposit asset token address, when known. Pre-deposit vaults accept
|
|
17
26
|
* multiple deposit assets with differing decimals (e.g. USDS at 18,
|
package/lib/types/vaults.d.ts
CHANGED
|
@@ -58,6 +58,16 @@ export type IVaultUserHistoryItem = {
|
|
|
58
58
|
* withdraw/redeem rows, where the vault's underlying asset applies.
|
|
59
59
|
*/
|
|
60
60
|
assetIn?: IAddress;
|
|
61
|
+
/**
|
|
62
|
+
* Receipt-token (vault share) amount burned on a withdraw **request**. An
|
|
63
|
+
* async withdrawal burns shares immediately, but the assets received are not
|
|
64
|
+
* known until the request settles (share price can drift), so `amount`'s
|
|
65
|
+
* asset figure is only a preview. UIs rendering a pending request should show
|
|
66
|
+
* these `shares` with the receipt symbol — the concrete on-chain fact — and
|
|
67
|
+
* reserve the asset amount for the settled ("processed") row. Present only on
|
|
68
|
+
* `withdraw-request` items.
|
|
69
|
+
*/
|
|
70
|
+
shares?: INormalizedNumber;
|
|
61
71
|
};
|
|
62
72
|
/**
|
|
63
73
|
* A single reward paired with its backend-provided logo.
|
|
@@ -571,3 +581,27 @@ export interface ISwapRouterDepositOptions extends Omit<ISwapRouterBaseOptions,
|
|
|
571
581
|
*/
|
|
572
582
|
slippageBps?: number;
|
|
573
583
|
}
|
|
584
|
+
/**
|
|
585
|
+
* Options for {@link getSwapRouterDepositResult} — resolves the real,
|
|
586
|
+
* post-execution outcome of a SwapRouter deposit from its mined transaction
|
|
587
|
+
* receipt, rather than the pre-trade quote shown before submission.
|
|
588
|
+
*/
|
|
589
|
+
export interface ISwapRouterDepositResultOptions {
|
|
590
|
+
/** Hash of a mined SwapRouter deposit transaction (e.g. from {@link swapRouterDeposit}). */
|
|
591
|
+
txHash: string;
|
|
592
|
+
/** The vault that was deposited into — isolates its own `Deposit` event from the router's unrelated logs. */
|
|
593
|
+
vault: IAddress;
|
|
594
|
+
}
|
|
595
|
+
/**
|
|
596
|
+
* Real, on-chain outcome of a SwapRouter deposit, decoded from the vault's own
|
|
597
|
+
* `Deposit` event (the SwapRouter contract itself emits no deposit/amount-out
|
|
598
|
+
* event — see {@link getSwapRouterDepositResult}). For a swap deposit this is
|
|
599
|
+
* the actual post-swap amount that reached the vault, which can differ from
|
|
600
|
+
* the pre-trade quote a UI shows before the user submits.
|
|
601
|
+
*/
|
|
602
|
+
export interface ISwapRouterDepositResult {
|
|
603
|
+
/** Raw amount of the vault's reference asset recorded as deposited (reference-asset decimals). */
|
|
604
|
+
amountOut: bigint;
|
|
605
|
+
/** Raw vault shares minted to the receiver (share-token decimals). */
|
|
606
|
+
sharesOut: bigint;
|
|
607
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@augustdigital/sdk",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.13.0",
|
|
4
4
|
"main": "lib/index.js",
|
|
5
5
|
"types": "lib/sdk.d.ts",
|
|
6
6
|
"keywords": [
|
|
@@ -45,10 +45,10 @@
|
|
|
45
45
|
"uuid": "^11.1.0"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
|
-
"@types/jest": "^
|
|
48
|
+
"@types/jest": "^30.0.0",
|
|
49
49
|
"cross-env": "^7.0.3",
|
|
50
50
|
"dotenv": "^16.0.0",
|
|
51
|
-
"jest": "^
|
|
51
|
+
"jest": "^30.4.2",
|
|
52
52
|
"ts-jest": "^29.1.0"
|
|
53
53
|
},
|
|
54
54
|
"peerDependencies": {
|