@augustdigital/sdk 8.9.0 → 8.11.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/stellar/actions.js +4 -4
- package/lib/adapters/stellar/getters.d.ts +9 -3
- package/lib/adapters/stellar/getters.js +18 -6
- package/lib/adapters/stellar/index.d.ts +17 -2
- package/lib/adapters/stellar/index.js +24 -5
- package/lib/adapters/stellar/soroban.d.ts +89 -2
- package/lib/adapters/stellar/soroban.js +487 -64
- package/lib/adapters/stellar/submit.d.ts +4 -1
- package/lib/adapters/stellar/submit.js +7 -3
- package/lib/adapters/stellar/types.d.ts +12 -0
- package/lib/core/analytics/sanitize.js +19 -3
- package/lib/core/analytics/version.d.ts +1 -1
- package/lib/core/analytics/version.js +1 -1
- package/lib/core/base.class.d.ts +2 -1
- package/lib/core/helpers/chain-error.d.ts +1 -0
- package/lib/core/helpers/chain-error.js +96 -0
- package/lib/main.js +6 -1
- package/lib/modules/vaults/getters.js +5 -1
- package/lib/modules/vaults/main.d.ts +6 -0
- package/lib/modules/vaults/main.js +35 -0
- package/lib/modules/vaults/types.d.ts +11 -1
- package/lib/modules/vaults/write.actions.js +76 -6
- package/lib/sdk.d.ts +87 -6
- package/lib/types/vaults.d.ts +10 -0
- package/lib/types/web3.d.ts +15 -0
- package/package.json +1 -1
package/lib/sdk.d.ts
CHANGED
|
@@ -16257,6 +16257,12 @@ export declare class AugustVaults extends AugustBase {
|
|
|
16257
16257
|
private solanaService;
|
|
16258
16258
|
private suiService;
|
|
16259
16259
|
private headers;
|
|
16260
|
+
/**
|
|
16261
|
+
* Consumer-supplied Soroban RPC override for Stellar vault reads, with the
|
|
16262
|
+
* network it was configured for so it's only applied to matching-network
|
|
16263
|
+
* vaults (see `IVaultBaseOptions.stellarRpc`).
|
|
16264
|
+
*/
|
|
16265
|
+
private _stellarRpc?;
|
|
16260
16266
|
constructor(baseConfig: IAugustBase, solana: SolanaAdapter, sui: SuiAdapter);
|
|
16261
16267
|
/**
|
|
16262
16268
|
* @description deposit underlying token into the specified pool with adapter support. This is for when we cannot pass in a signer in sdk and need to do so as an arg
|
|
@@ -16949,8 +16955,11 @@ export declare function computeArgShape(args: unknown[]): string[];
|
|
|
16949
16955
|
* @param vaultAddress Stellar contract ID (C… address)
|
|
16950
16956
|
* @param rawAmount Deposit amount in the deposit token's smallest unit
|
|
16951
16957
|
* @param network 'mainnet' | 'testnet'
|
|
16958
|
+
* @param sorobanRpcUrl - Optional override Soroban RPC endpoint (e.g. a keyed
|
|
16959
|
+
* Alchemy URL); becomes the primary with the SDK's public endpoints kept as
|
|
16960
|
+
* failover. Omit to use the public endpoints.
|
|
16952
16961
|
*/
|
|
16953
|
-
declare const convertToShares: (vaultAddress: string, rawAmount: string, network?: IStellarNetwork) => Promise<string | null>;
|
|
16962
|
+
declare const convertToShares: (vaultAddress: string, rawAmount: string, network?: IStellarNetwork, sorobanRpcUrl?: string) => Promise<string | null>;
|
|
16954
16963
|
|
|
16955
16964
|
/**
|
|
16956
16965
|
* Create ethers contract instance with address validation.
|
|
@@ -18163,6 +18172,9 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
|
|
|
18163
18172
|
* @param vaultAddress - Stellar vault contract ID (C… address)
|
|
18164
18173
|
* @param walletAddress - User's Stellar account (G… address); validated upfront
|
|
18165
18174
|
* @param network - 'mainnet' | 'testnet' (defaults to 'mainnet')
|
|
18175
|
+
* @param sorobanRpcUrl - Optional override Soroban RPC endpoint (e.g. a keyed
|
|
18176
|
+
* Alchemy URL); becomes the primary with the SDK's public endpoints kept as
|
|
18177
|
+
* failover. Omit to use the public endpoints.
|
|
18166
18178
|
* @returns The position, or `null` if the balance read failed or was unparseable.
|
|
18167
18179
|
* @throws AugustValidationError on an invalid `walletAddress`.
|
|
18168
18180
|
* @example
|
|
@@ -18175,7 +18187,7 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
|
|
|
18175
18187
|
* const human = Number(pos.shares) / 10 ** pos.decimals;
|
|
18176
18188
|
* ```
|
|
18177
18189
|
*/
|
|
18178
|
-
declare const getStellarUserPosition: (vaultAddress: string, walletAddress: string, network?: IStellarNetwork) => Promise<IStellarUserPosition | null>;
|
|
18190
|
+
declare const getStellarUserPosition: (vaultAddress: string, walletAddress: string, network?: IStellarNetwork, sorobanRpcUrl?: string) => Promise<IStellarUserPosition | null>;
|
|
18179
18191
|
|
|
18180
18192
|
/**
|
|
18181
18193
|
* Build a unified IVault from backend + on-chain data for Stellar vaults.
|
|
@@ -18183,7 +18195,7 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
|
|
|
18183
18195
|
* Falls back to backend `latest_reported_tvl` for total assets, or zero
|
|
18184
18196
|
* for total supply, when on-chain queries fail.
|
|
18185
18197
|
*/
|
|
18186
|
-
declare const getStellarVault: (tokenizedVault: ITokenizedVault,
|
|
18198
|
+
declare const getStellarVault: (tokenizedVault: ITokenizedVault, options: IVaultBaseOptions) => Promise<IVault>;
|
|
18187
18199
|
|
|
18188
18200
|
declare function getStructuredLogger(): ILogger | null;
|
|
18189
18201
|
|
|
@@ -18800,6 +18812,7 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
|
|
|
18800
18812
|
appName: string;
|
|
18801
18813
|
providers?: IProvidersConfig;
|
|
18802
18814
|
solana?: ISolanaConfig;
|
|
18815
|
+
stellar?: IStellarConfig;
|
|
18803
18816
|
keys: IKeys;
|
|
18804
18817
|
monitoring?: IMonitoring;
|
|
18805
18818
|
/** Analytics configuration. Enabled by default (opt-out model). */
|
|
@@ -20191,6 +20204,8 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
|
|
|
20191
20204
|
*/
|
|
20192
20205
|
export declare function isHubOnlyReceipt(vault: IAddress): boolean;
|
|
20193
20206
|
|
|
20207
|
+
export declare function isInsufficientFundsError(error: unknown): boolean;
|
|
20208
|
+
|
|
20194
20209
|
/**
|
|
20195
20210
|
* True when `NODE_ENV` is `'development'` or `'test'`. The SDK auto-disables
|
|
20196
20211
|
* analytics in these environments so partners' local dev runs and Jest suites
|
|
@@ -20317,12 +20332,34 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
|
|
|
20317
20332
|
*/
|
|
20318
20333
|
export declare function isSwapRouterEligible(vaultAddress: IAddress): boolean;
|
|
20319
20334
|
|
|
20335
|
+
/**
|
|
20336
|
+
* Stellar-specific configuration for `new AugustSDK({ stellar })`. All
|
|
20337
|
+
* fields are optional — omit it entirely to target Stellar mainnet through the
|
|
20338
|
+
* SDK's built-in public Soroban RPC endpoints.
|
|
20339
|
+
*/
|
|
20340
|
+
export declare interface IStellarConfig {
|
|
20341
|
+
/**
|
|
20342
|
+
* Override Soroban RPC endpoint (e.g. a consumer's keyed Alchemy URL). When
|
|
20343
|
+
* set it becomes the primary, with the SDK's built-in public endpoints kept
|
|
20344
|
+
* behind it as failover. Optional — omit to use the public endpoints.
|
|
20345
|
+
*/
|
|
20346
|
+
rpcUrl?: string;
|
|
20347
|
+
/** Stellar network; defaults to mainnet when omitted. */
|
|
20348
|
+
network?: IStellarNetwork;
|
|
20349
|
+
}
|
|
20350
|
+
|
|
20320
20351
|
/** Parameters for building an unsigned Stellar vault deposit transaction. */
|
|
20321
20352
|
declare interface IStellarDepositParams {
|
|
20322
20353
|
contractId: string;
|
|
20323
20354
|
amount: string;
|
|
20324
20355
|
senderAddress: string;
|
|
20325
20356
|
network: IStellarNetwork;
|
|
20357
|
+
/**
|
|
20358
|
+
* Optional override Soroban RPC endpoint (e.g. a keyed Alchemy URL). When set
|
|
20359
|
+
* it is the primary, with the SDK's public endpoints kept behind it as
|
|
20360
|
+
* failover.
|
|
20361
|
+
*/
|
|
20362
|
+
sorobanRpcUrl?: string;
|
|
20326
20363
|
}
|
|
20327
20364
|
|
|
20328
20365
|
export declare type IStellarNetwork = 'mainnet' | 'testnet';
|
|
@@ -20333,6 +20370,12 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
|
|
|
20333
20370
|
shares: string;
|
|
20334
20371
|
receiverAddress: string;
|
|
20335
20372
|
network: IStellarNetwork;
|
|
20373
|
+
/**
|
|
20374
|
+
* Optional override Soroban RPC endpoint (e.g. a keyed Alchemy URL). When set
|
|
20375
|
+
* it is the primary, with the SDK's public endpoints kept behind it as
|
|
20376
|
+
* failover.
|
|
20377
|
+
*/
|
|
20378
|
+
sorobanRpcUrl?: string;
|
|
20336
20379
|
}
|
|
20337
20380
|
|
|
20338
20381
|
/**
|
|
@@ -21194,6 +21237,16 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
|
|
|
21194
21237
|
subgraphKey?: string;
|
|
21195
21238
|
chainId?: number;
|
|
21196
21239
|
solanaService?: ISolanaService;
|
|
21240
|
+
/**
|
|
21241
|
+
* Optional Soroban RPC override (e.g. a keyed Alchemy URL) for Stellar vault
|
|
21242
|
+
* reads, threaded from the SDK's `stellar` config. Carries the network it was
|
|
21243
|
+
* configured for so it is only applied to matching-network vaults — a testnet
|
|
21244
|
+
* override must not be used for a mainnet read. Unset → built-in endpoints.
|
|
21245
|
+
*/
|
|
21246
|
+
stellarRpc?: {
|
|
21247
|
+
rpcUrl: string;
|
|
21248
|
+
network: IStellarNetwork;
|
|
21249
|
+
};
|
|
21197
21250
|
headers?: IWSMonitorHeaders;
|
|
21198
21251
|
/**
|
|
21199
21252
|
* Portfolio mode: when true, the per-vault EVM getter does NOT null out a
|
|
@@ -21445,6 +21498,16 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
|
|
|
21445
21498
|
chainId: number;
|
|
21446
21499
|
type: 'withdraw-request' | 'deposit' | 'withdraw-processed' | 'redeem';
|
|
21447
21500
|
transactionHash: IAddress;
|
|
21501
|
+
/**
|
|
21502
|
+
* The token address that was actually deposited, when known. Pre-deposit
|
|
21503
|
+
* vaults accept multiple deposit assets (e.g. a sentUSD vault taking RLUSD,
|
|
21504
|
+
* USDC, and USDT), so the vault's own metadata cannot tell a consumer which
|
|
21505
|
+
* asset a given deposit used — only this per-row address can. UIs should
|
|
21506
|
+
* resolve the displayed asset symbol/logo from `assetIn` rather than assuming
|
|
21507
|
+
* the vault's first deposit asset. Absent for single-asset vaults and for
|
|
21508
|
+
* withdraw/redeem rows, where the vault's underlying asset applies.
|
|
21509
|
+
*/
|
|
21510
|
+
assetIn?: IAddress;
|
|
21448
21511
|
};
|
|
21449
21512
|
|
|
21450
21513
|
export declare interface IVaultUserLifetimePnl {
|
|
@@ -23703,9 +23766,24 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
|
|
|
23703
23766
|
* // Sign xdr with wallet (e.g. Freighter), then submit via adapter.submitTransaction()
|
|
23704
23767
|
* ```
|
|
23705
23768
|
*/
|
|
23706
|
-
declare class StellarAdapter {
|
|
23769
|
+
export declare class StellarAdapter {
|
|
23707
23770
|
private _network;
|
|
23708
|
-
|
|
23771
|
+
/**
|
|
23772
|
+
* Optional consumer-supplied Soroban RPC endpoint (e.g. a keyed Alchemy URL).
|
|
23773
|
+
* When set it is the primary, with the SDK's public endpoints as failover.
|
|
23774
|
+
*/
|
|
23775
|
+
private _sorobanRpcUrl?;
|
|
23776
|
+
/**
|
|
23777
|
+
* @param network - Stellar network to operate on; defaults to `'mainnet'`.
|
|
23778
|
+
* @param options - Optional adapter configuration. Its `sorobanRpcUrl` field
|
|
23779
|
+
* overrides the Soroban RPC endpoint (e.g. a keyed Alchemy URL): it becomes
|
|
23780
|
+
* the primary with the SDK's built-in public endpoints kept behind it as
|
|
23781
|
+
* failover, and a per-call `sorobanRpcUrl` (on the deposit/redeem params)
|
|
23782
|
+
* takes precedence over this adapter-level one.
|
|
23783
|
+
*/
|
|
23784
|
+
constructor(network?: IStellarNetwork, options?: {
|
|
23785
|
+
sorobanRpcUrl?: string;
|
|
23786
|
+
});
|
|
23709
23787
|
get network(): IStellarNetwork;
|
|
23710
23788
|
isStellarAddress(address: string): boolean;
|
|
23711
23789
|
getExplorerLink(id: string, type?: 'contract' | 'account' | 'tx'): string;
|
|
@@ -23820,6 +23898,9 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
|
|
|
23820
23898
|
*
|
|
23821
23899
|
* @param signedXdr - Base64-encoded XDR of the signed transaction
|
|
23822
23900
|
* @param network - Stellar network name
|
|
23901
|
+
* @param sorobanRpcUrl - Optional override Soroban RPC endpoint (e.g. a keyed
|
|
23902
|
+
* Alchemy URL); becomes the primary with the SDK's public endpoints kept as
|
|
23903
|
+
* failover. Omit to use the public endpoints.
|
|
23823
23904
|
* @returns The transaction hash once the network confirms it as successful
|
|
23824
23905
|
* @throws {@link AugustTimeoutError} when the transaction is not confirmed
|
|
23825
23906
|
* within the poll budget (`MAX_POLL_ATTEMPTS`).
|
|
@@ -23839,7 +23920,7 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
|
|
|
23839
23920
|
* }
|
|
23840
23921
|
* ```
|
|
23841
23922
|
*/
|
|
23842
|
-
declare function submitStellarTransaction(signedXdr: string, network: IStellarNetwork): Promise<string>;
|
|
23923
|
+
declare function submitStellarTransaction(signedXdr: string, network: IStellarNetwork, sorobanRpcUrl?: string): Promise<string>;
|
|
23843
23924
|
|
|
23844
23925
|
/**
|
|
23845
23926
|
* Sui Adapter for August SDK
|
package/lib/types/vaults.d.ts
CHANGED
|
@@ -48,6 +48,16 @@ export type IVaultUserHistoryItem = {
|
|
|
48
48
|
chainId: number;
|
|
49
49
|
type: 'withdraw-request' | 'deposit' | 'withdraw-processed' | 'redeem';
|
|
50
50
|
transactionHash: IAddress;
|
|
51
|
+
/**
|
|
52
|
+
* The token address that was actually deposited, when known. Pre-deposit
|
|
53
|
+
* vaults accept multiple deposit assets (e.g. a sentUSD vault taking RLUSD,
|
|
54
|
+
* USDC, and USDT), so the vault's own metadata cannot tell a consumer which
|
|
55
|
+
* asset a given deposit used — only this per-row address can. UIs should
|
|
56
|
+
* resolve the displayed asset symbol/logo from `assetIn` rather than assuming
|
|
57
|
+
* the vault's first deposit asset. Absent for single-asset vaults and for
|
|
58
|
+
* withdraw/redeem rows, where the vault's underlying asset applies.
|
|
59
|
+
*/
|
|
60
|
+
assetIn?: IAddress;
|
|
51
61
|
};
|
|
52
62
|
/**
|
|
53
63
|
* A single reward paired with its backend-provided logo.
|
package/lib/types/web3.d.ts
CHANGED
|
@@ -34,3 +34,18 @@ export interface ISolanaConfig {
|
|
|
34
34
|
rpcUrl: string;
|
|
35
35
|
network: ISolanaNetwork;
|
|
36
36
|
}
|
|
37
|
+
/**
|
|
38
|
+
* Stellar-specific configuration for `new AugustSDK({ stellar })`. All
|
|
39
|
+
* fields are optional — omit it entirely to target Stellar mainnet through the
|
|
40
|
+
* SDK's built-in public Soroban RPC endpoints.
|
|
41
|
+
*/
|
|
42
|
+
export interface IStellarConfig {
|
|
43
|
+
/**
|
|
44
|
+
* Override Soroban RPC endpoint (e.g. a consumer's keyed Alchemy URL). When
|
|
45
|
+
* set it becomes the primary, with the SDK's built-in public endpoints kept
|
|
46
|
+
* behind it as failover. Optional — omit to use the public endpoints.
|
|
47
|
+
*/
|
|
48
|
+
rpcUrl?: string;
|
|
49
|
+
/** Stellar network; defaults to mainnet when omitted. */
|
|
50
|
+
network?: IStellarNetwork;
|
|
51
|
+
}
|