@augustdigital/sdk 8.17.0 → 8.19.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.js +4 -2
- package/lib/adapters/stellar/soroban.d.ts +8 -3
- package/lib/adapters/stellar/soroban.js +9 -4
- package/lib/core/analytics/constants.d.ts +1 -1
- package/lib/core/analytics/constants.js +1 -1
- package/lib/core/analytics/version.d.ts +1 -1
- package/lib/core/analytics/version.js +1 -1
- package/lib/core/attribution.d.ts +111 -0
- package/lib/core/attribution.js +142 -0
- package/lib/core/base.class.d.ts +17 -1
- package/lib/core/base.class.js +6 -1
- package/lib/core/fetcher.js +10 -1
- package/lib/core/helpers/chain-error.d.ts +140 -0
- package/lib/core/helpers/chain-error.js +412 -0
- package/lib/core/helpers/signer.d.ts +21 -0
- package/lib/core/helpers/signer.js +52 -0
- package/lib/core/helpers/web3.d.ts +152 -2
- package/lib/core/helpers/web3.js +307 -45
- package/lib/core/index.d.ts +1 -0
- package/lib/core/index.js +1 -0
- package/lib/evm/methods/crossChainVault.js +4 -0
- package/lib/modules/vaults/getters.js +6 -2
- package/lib/modules/vaults/write.actions.d.ts +41 -1
- package/lib/modules/vaults/write.actions.js +302 -86
- package/lib/sdk.d.ts +438 -3
- package/lib/services/subgraph/vaults.js +85 -14
- package/package.json +1 -1
|
@@ -2133,8 +2133,10 @@ async function getVaultUserLifetimePnl({ vault, wallet, options, }) {
|
|
|
2133
2133
|
});
|
|
2134
2134
|
let sharePriceRaw = BigInt(0);
|
|
2135
2135
|
try {
|
|
2136
|
+
// Retried on transport blips only (bounded, no fallback); a vault that
|
|
2137
|
+
// genuinely has no `lpTokenAddress()` still throws into the catch below.
|
|
2136
2138
|
const lpTokenAddress = version === 'evm-2'
|
|
2137
|
-
?
|
|
2139
|
+
? await (0, core_1.getReceiptTokenAddressOrThrow)(provider, vault, 'getVaultUserLifetimePnl:receiptToken')
|
|
2138
2140
|
: vault;
|
|
2139
2141
|
let currentShares = BigInt(0);
|
|
2140
2142
|
if (version === 'evm-2') {
|
|
@@ -2648,7 +2650,9 @@ async function getPreviewRedemption({ vault, sharesAmount, options, }) {
|
|
|
2648
2650
|
abi: TokenizedVaultV2_1.ABI_TOKENIZED_VAULT_V2,
|
|
2649
2651
|
provider,
|
|
2650
2652
|
});
|
|
2651
|
-
|
|
2653
|
+
// Retried on transport blips only (bounded, no fallback); a misroute
|
|
2654
|
+
// still surfaces the original error.
|
|
2655
|
+
const lpTokenAddress = await (0, core_1.getReceiptTokenAddressOrThrow)(provider, vault, 'getPreviewRedemption:receiptToken');
|
|
2652
2656
|
const lpTokenContract = (0, core_1.createContract)({
|
|
2653
2657
|
address: lpTokenAddress,
|
|
2654
2658
|
abi: abis_1.ABI_LENDING_POOL_V2,
|
|
@@ -81,7 +81,47 @@ export declare function resolveSpender(args: {
|
|
|
81
81
|
export declare function validateAmountPrecision(amount: string | bigint | number): void;
|
|
82
82
|
/** @internal */
|
|
83
83
|
export declare function isNonceParsing(error: unknown): boolean;
|
|
84
|
-
/**
|
|
84
|
+
/**
|
|
85
|
+
* Await a broadcast transaction's receipt, surviving both malformed-nonce RPCs
|
|
86
|
+
* and transient transport faults while still reporting genuine on-chain
|
|
87
|
+
* failures.
|
|
88
|
+
*
|
|
89
|
+
* `tx.wait()` is tried first because it preserves ethers' replacement-tx
|
|
90
|
+
* detection and revert checks. Two recoverable failure modes are handled:
|
|
91
|
+
*
|
|
92
|
+
* 1. **Malformed nonce** ({@link isNonceParsing}) — Monad-style RPCs return
|
|
93
|
+
* `nonce: "undefined"` on the pending tx and ethers throws while parsing.
|
|
94
|
+
* One direct `provider.waitForTransaction()` recovers it (unchanged
|
|
95
|
+
* behaviour).
|
|
96
|
+
* 2. **Transient transport fault** ({@link isRetryableRpcError}) — the provider
|
|
97
|
+
* hiccups while polling `eth_getTransactionReceipt` and ethers surfaces
|
|
98
|
+
* `could not coalesce error (… "code": -32603 …)`. This used to propagate
|
|
99
|
+
* and make every write path report a **successfully mined** transaction as
|
|
100
|
+
* failed, driving users to retry into `ERC20InsufficientBalance`. The hash
|
|
101
|
+
* is already on the wire and receipt polling is idempotent, so we re-poll
|
|
102
|
+
* with bounded exponential backoff instead of rethrowing.
|
|
103
|
+
*
|
|
104
|
+
* Everything else — notably a real revert — is rethrown untouched.
|
|
105
|
+
*
|
|
106
|
+
* Every error this function throws is stamped by {@link markBroadcast}: by the
|
|
107
|
+
* time `tx.wait()` can fail, the transaction is already on the wire, so the
|
|
108
|
+
* caller must never report it as "never sent". See
|
|
109
|
+
* {@link localTxBroadcastContext} for how that reaches
|
|
110
|
+
* `AugustSDKError.context`.
|
|
111
|
+
*
|
|
112
|
+
* @param tx - The broadcast transaction response to await.
|
|
113
|
+
* @returns The mined receipt (never `null` on the fallback paths; `tx.wait()`
|
|
114
|
+
* itself may return `null` when the caller configured 0 confirmations).
|
|
115
|
+
* @throws {Error} `Transaction <hash> reverted on-chain` when the receipt
|
|
116
|
+
* reports `status === 0`. Marked `confirmationUnknown: false` — the chain
|
|
117
|
+
* answered.
|
|
118
|
+
* @throws {Error} `Transaction <hash> was not confirmed within <n>s` when the
|
|
119
|
+
* overall wait times out with no receipt. Marked
|
|
120
|
+
* `confirmationUnknown: true`.
|
|
121
|
+
* @throws The underlying transport error once receipt-poll retries are
|
|
122
|
+
* exhausted, marked `confirmationUnknown: true`.
|
|
123
|
+
* @internal
|
|
124
|
+
*/
|
|
85
125
|
export declare function safeWaitForTx(tx: TransactionResponse): Promise<import("ethers").TransactionReceipt>;
|
|
86
126
|
/**
|
|
87
127
|
* Wraps an ethers contract call that returns a TransactionResponse.
|