@augustdigital/sdk 8.10.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/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/sdk.d.ts +85 -6
- package/lib/types/vaults.d.ts +10 -0
- package/lib/types/web3.d.ts +15 -0
- package/package.json +1 -1
|
@@ -25,6 +25,11 @@ const SENSITIVE_KEYS = [
|
|
|
25
25
|
'privateKey',
|
|
26
26
|
'mnemonic',
|
|
27
27
|
'seed',
|
|
28
|
+
// RPC endpoints can carry the API key in the path (e.g. Alchemy `/v2/<key>`),
|
|
29
|
+
// so a `sorobanRpcUrl` / `rpcUrl` argument must never reach telemetry. Matched
|
|
30
|
+
// as a substring, so it also covers `sorobanRpcUrls` and snake_case variants.
|
|
31
|
+
'rpcurl',
|
|
32
|
+
'rpc_url',
|
|
28
33
|
];
|
|
29
34
|
/** Regex patterns applied in order to scrub secrets from free-form strings. */
|
|
30
35
|
const STRING_REDACTION_PATTERNS = [
|
|
@@ -34,6 +39,9 @@ const STRING_REDACTION_PATTERNS = [
|
|
|
34
39
|
'$1[REDACTED]',
|
|
35
40
|
],
|
|
36
41
|
[/(gateway\.thegraph\.com\/api\/)[A-Za-z0-9]{20,}(\/)/g, '$1[REDACTED]$2'],
|
|
42
|
+
// Provider path-embedded API keys (e.g. Alchemy `…/v2/<key>`, Infura `…/v3/<key>`):
|
|
43
|
+
// a 16+ char token right after a `/vN/` segment is a key, not a resource path.
|
|
44
|
+
[/(\/v\d+\/)[A-Za-z0-9_-]{16,}/g, '$1[REDACTED]'],
|
|
37
45
|
[/eyJ[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+/g, '[REDACTED_JWT]'],
|
|
38
46
|
[/\bnpm_[A-Za-z0-9]{30,}\b/g, '[REDACTED_NPM_TOKEN]'],
|
|
39
47
|
// Stop value match at & # so adjacent query params aren't swallowed.
|
|
@@ -172,8 +180,10 @@ function sanitizeArgs(args) {
|
|
|
172
180
|
return;
|
|
173
181
|
}
|
|
174
182
|
if (typeof arg === 'string') {
|
|
175
|
-
//
|
|
176
|
-
|
|
183
|
+
// Scrub embedded secrets, then truncate long strings.
|
|
184
|
+
const scrubbed = sanitizeString(arg);
|
|
185
|
+
sanitized[key] =
|
|
186
|
+
scrubbed.length > 100 ? `${scrubbed.substring(0, 100)}...` : scrubbed;
|
|
177
187
|
return;
|
|
178
188
|
}
|
|
179
189
|
if (typeof arg === 'number' || typeof arg === 'boolean') {
|
|
@@ -214,8 +224,14 @@ function sanitizeObject(obj, depth = 0) {
|
|
|
214
224
|
sanitized[key] = '[REDACTED_HEX]';
|
|
215
225
|
continue;
|
|
216
226
|
}
|
|
227
|
+
// Scrub embedded secrets (API keys in URL paths/queries, bearer tokens,
|
|
228
|
+
// JWTs, …) from free-form values before truncating — key-name matching
|
|
229
|
+
// alone misses a secret carried inside a value under a benign key.
|
|
230
|
+
const scrubbedValue = sanitizeString(value);
|
|
217
231
|
sanitized[key] =
|
|
218
|
-
|
|
232
|
+
scrubbedValue.length > 100
|
|
233
|
+
? `${scrubbedValue.substring(0, 100)}...`
|
|
234
|
+
: scrubbedValue;
|
|
219
235
|
continue;
|
|
220
236
|
}
|
|
221
237
|
if (typeof value === 'number' || typeof value === 'boolean') {
|
package/lib/core/base.class.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ISolanaConfig, IAddress, IChainId, IEnv, IProvidersConfig, IWSMonitorHeaders } from '../types';
|
|
1
|
+
import type { ISolanaConfig, IStellarConfig, IAddress, IChainId, IEnv, IProvidersConfig, IWSMonitorHeaders } from '../types';
|
|
2
2
|
import { type IAnalyticsConfig } from './analytics';
|
|
3
3
|
import { type IVersionCheckConfig } from './version-check';
|
|
4
4
|
interface IKeys {
|
|
@@ -38,6 +38,7 @@ export interface IAugustBase {
|
|
|
38
38
|
appName: string;
|
|
39
39
|
providers?: IProvidersConfig;
|
|
40
40
|
solana?: ISolanaConfig;
|
|
41
|
+
stellar?: IStellarConfig;
|
|
41
42
|
keys: IKeys;
|
|
42
43
|
monitoring?: IMonitoring;
|
|
43
44
|
/** Analytics configuration. Enabled by default (opt-out model). */
|
package/lib/main.js
CHANGED
|
@@ -108,7 +108,12 @@ class AugustSDK extends core_1.AugustBase {
|
|
|
108
108
|
(0, analytics_1.instrumentClass)(this.solana, () => core_1.SPECIAL_CHAINS.solana.chainId);
|
|
109
109
|
}
|
|
110
110
|
this.sui = new sui_1.default();
|
|
111
|
-
|
|
111
|
+
// @stellar: mirror the Solana injection — the consumer may supply a keyed
|
|
112
|
+
// Soroban RPC (e.g. Alchemy) via `baseConfig.stellar`; otherwise the adapter
|
|
113
|
+
// uses its built-in public endpoints. Endpoint is injected, not hardcoded.
|
|
114
|
+
this.stellar = new stellar_1.default(baseConfig.stellar?.network, {
|
|
115
|
+
sorobanRpcUrl: baseConfig.stellar?.rpcUrl,
|
|
116
|
+
});
|
|
112
117
|
this.vaults = new vaults_1.AugustVaults(baseConfig, this.solana, this.sui);
|
|
113
118
|
this.subaccounts = new sub_accounts_1.AugustSubAccounts(baseConfig);
|
|
114
119
|
this.api = new api_1.AugustApi(baseConfig);
|
|
@@ -1058,7 +1058,11 @@ async function getVaultPositions({ vault, wallet, solanaWallet, stellarWallet, o
|
|
|
1058
1058
|
let balance = (0, core_1.toNormalizedBn)(0);
|
|
1059
1059
|
if (stellarWallet && (0, utils_3.isStellarAddress)(stellarWallet)) {
|
|
1060
1060
|
const stellarNetwork = v.stellar_vault_metadata?.network_name ?? 'mainnet';
|
|
1061
|
-
|
|
1061
|
+
// Only use the configured RPC override for its own network.
|
|
1062
|
+
const stellarOverrideRpcUrl = options.stellarRpc?.network === stellarNetwork
|
|
1063
|
+
? options.stellarRpc.rpcUrl
|
|
1064
|
+
: undefined;
|
|
1065
|
+
const position = await StellarGetters.getStellarUserPosition(v.address, stellarWallet, stellarNetwork, stellarOverrideRpcUrl);
|
|
1062
1066
|
if (position && !position.decimalsFromFallback) {
|
|
1063
1067
|
balance = (0, core_1.toNormalizedBn)(BigInt(position.shares), position.decimals);
|
|
1064
1068
|
}
|
|
@@ -23,6 +23,12 @@ export declare class AugustVaults extends AugustBase {
|
|
|
23
23
|
private solanaService;
|
|
24
24
|
private suiService;
|
|
25
25
|
private headers;
|
|
26
|
+
/**
|
|
27
|
+
* Consumer-supplied Soroban RPC override for Stellar vault reads, with the
|
|
28
|
+
* network it was configured for so it's only applied to matching-network
|
|
29
|
+
* vaults (see `IVaultBaseOptions.stellarRpc`).
|
|
30
|
+
*/
|
|
31
|
+
private _stellarRpc?;
|
|
26
32
|
constructor(baseConfig: IAugustBase, solana: SolanaAdapter, sui: SuiAdapter);
|
|
27
33
|
/**
|
|
28
34
|
* @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
|
|
@@ -74,10 +74,23 @@ class AugustVaults extends core_1.AugustBase {
|
|
|
74
74
|
solanaService;
|
|
75
75
|
suiService;
|
|
76
76
|
headers = null;
|
|
77
|
+
/**
|
|
78
|
+
* Consumer-supplied Soroban RPC override for Stellar vault reads, with the
|
|
79
|
+
* network it was configured for so it's only applied to matching-network
|
|
80
|
+
* vaults (see `IVaultBaseOptions.stellarRpc`).
|
|
81
|
+
*/
|
|
82
|
+
_stellarRpc;
|
|
77
83
|
constructor(baseConfig, solana, sui) {
|
|
78
84
|
super(baseConfig);
|
|
79
85
|
this.solanaService = solana;
|
|
80
86
|
this.suiService = sui || new sui_1.default();
|
|
87
|
+
// Network defaults to mainnet, matching the StellarAdapter constructor.
|
|
88
|
+
this._stellarRpc = baseConfig.stellar?.rpcUrl
|
|
89
|
+
? {
|
|
90
|
+
rpcUrl: baseConfig.stellar.rpcUrl,
|
|
91
|
+
network: baseConfig.stellar.network ?? 'mainnet',
|
|
92
|
+
}
|
|
93
|
+
: undefined;
|
|
81
94
|
this.headers = {
|
|
82
95
|
'x-environment': this.monitoring?.['x-environment'],
|
|
83
96
|
'x-user-id': this.monitoring?.['x-user-id'],
|
|
@@ -166,6 +179,7 @@ class AugustVaults extends core_1.AugustBase {
|
|
|
166
179
|
options: {
|
|
167
180
|
rpcUrl,
|
|
168
181
|
solanaService: this.solanaService,
|
|
182
|
+
stellarRpc: this._stellarRpc,
|
|
169
183
|
env: this.monitoring?.env,
|
|
170
184
|
augustKey: this.keys?.august,
|
|
171
185
|
subgraphKey: this.keys?.graph,
|
|
@@ -243,6 +257,7 @@ class AugustVaults extends core_1.AugustBase {
|
|
|
243
257
|
options: {
|
|
244
258
|
rpcUrl: this.providers?.[v.chain],
|
|
245
259
|
solanaService: this.solanaService,
|
|
260
|
+
stellarRpc: this._stellarRpc,
|
|
246
261
|
env: this.monitoring?.env,
|
|
247
262
|
augustKey: this.keys?.august,
|
|
248
263
|
subgraphKey: this.keys?.graph,
|
|
@@ -316,6 +331,7 @@ class AugustVaults extends core_1.AugustBase {
|
|
|
316
331
|
? this.providers?.[chainId]
|
|
317
332
|
: this.activeNetwork?.rpcUrl,
|
|
318
333
|
solanaService: this.solanaService,
|
|
334
|
+
stellarRpc: this._stellarRpc,
|
|
319
335
|
env: this.monitoring?.env,
|
|
320
336
|
augustKey: this.keys?.august,
|
|
321
337
|
subgraphKey: this.keys?.graph,
|
|
@@ -340,6 +356,7 @@ class AugustVaults extends core_1.AugustBase {
|
|
|
340
356
|
? this.providers?.[chainId]
|
|
341
357
|
: this.activeNetwork?.rpcUrl,
|
|
342
358
|
solanaService: this.solanaService,
|
|
359
|
+
stellarRpc: this._stellarRpc,
|
|
343
360
|
env: this.monitoring?.env,
|
|
344
361
|
augustKey: this.keys?.august,
|
|
345
362
|
subgraphKey: this.keys?.graph,
|
|
@@ -385,6 +402,7 @@ class AugustVaults extends core_1.AugustBase {
|
|
|
385
402
|
subgraphKey: this.keys?.graph,
|
|
386
403
|
chainId: chainId,
|
|
387
404
|
solanaService: this.solanaService,
|
|
405
|
+
stellarRpc: this._stellarRpc,
|
|
388
406
|
headers: this.headers,
|
|
389
407
|
});
|
|
390
408
|
return vaultResponse;
|
|
@@ -416,6 +434,7 @@ class AugustVaults extends core_1.AugustBase {
|
|
|
416
434
|
subgraphKey: this.keys?.graph,
|
|
417
435
|
chainId: chainId,
|
|
418
436
|
solanaService: this.solanaService,
|
|
437
|
+
stellarRpc: this._stellarRpc,
|
|
419
438
|
headers: this.headers,
|
|
420
439
|
});
|
|
421
440
|
return vaultResponse;
|
|
@@ -447,6 +466,7 @@ class AugustVaults extends core_1.AugustBase {
|
|
|
447
466
|
? this.providers?.[chainId]
|
|
448
467
|
: this.activeNetwork?.rpcUrl,
|
|
449
468
|
solanaService: this.solanaService,
|
|
469
|
+
stellarRpc: this._stellarRpc,
|
|
450
470
|
env: this.monitoring?.env,
|
|
451
471
|
augustKey: this.keys?.august,
|
|
452
472
|
subgraphKey: this.keys?.graph,
|
|
@@ -527,6 +547,7 @@ class AugustVaults extends core_1.AugustBase {
|
|
|
527
547
|
? this.providers?.[chainId]
|
|
528
548
|
: this.activeNetwork?.rpcUrl,
|
|
529
549
|
solanaService: this.solanaService,
|
|
550
|
+
stellarRpc: this._stellarRpc,
|
|
530
551
|
env: this.monitoring?.env,
|
|
531
552
|
augustKey: this.keys?.august,
|
|
532
553
|
subgraphKey: this.keys?.graph,
|
|
@@ -611,6 +632,7 @@ class AugustVaults extends core_1.AugustBase {
|
|
|
611
632
|
? this.providers?.[chainId]
|
|
612
633
|
: this.activeNetwork?.rpcUrl,
|
|
613
634
|
solanaService: this.solanaService,
|
|
635
|
+
stellarRpc: this._stellarRpc,
|
|
614
636
|
env: this.monitoring?.env,
|
|
615
637
|
augustKey: this.keys?.august,
|
|
616
638
|
subgraphKey: this.keys?.graph,
|
|
@@ -632,6 +654,7 @@ class AugustVaults extends core_1.AugustBase {
|
|
|
632
654
|
options: {
|
|
633
655
|
rpcUrl: this.providers?.[v.chain],
|
|
634
656
|
solanaService: this.solanaService,
|
|
657
|
+
stellarRpc: this._stellarRpc,
|
|
635
658
|
env: this.monitoring?.env,
|
|
636
659
|
augustKey: this.keys?.august,
|
|
637
660
|
subgraphKey: this.keys?.graph,
|
|
@@ -667,6 +690,7 @@ class AugustVaults extends core_1.AugustBase {
|
|
|
667
690
|
options: {
|
|
668
691
|
rpcUrl: this.providers?.[v.chain],
|
|
669
692
|
solanaService: this.solanaService,
|
|
693
|
+
stellarRpc: this._stellarRpc,
|
|
670
694
|
env: this.monitoring?.env,
|
|
671
695
|
augustKey: this.keys?.august,
|
|
672
696
|
subgraphKey: this.keys?.graph,
|
|
@@ -706,6 +730,10 @@ class AugustVaults extends core_1.AugustBase {
|
|
|
706
730
|
chainId: _chainId,
|
|
707
731
|
type: h.type,
|
|
708
732
|
transactionHash: h.transactionHash_,
|
|
733
|
+
// Deposit rows on multi-asset (pre-deposit) vaults carry the actual
|
|
734
|
+
// deposited token address; propagate it so consumers render the right
|
|
735
|
+
// asset symbol instead of guessing the vault's first deposit asset.
|
|
736
|
+
assetIn: h.assetIn,
|
|
709
737
|
}));
|
|
710
738
|
}
|
|
711
739
|
// Helper function to fetch history for a vault
|
|
@@ -826,6 +854,7 @@ class AugustVaults extends core_1.AugustBase {
|
|
|
826
854
|
? this.providers?.[chainId]
|
|
827
855
|
: this.requireActiveNetwork().rpcUrl,
|
|
828
856
|
solanaService: this.solanaService,
|
|
857
|
+
stellarRpc: this._stellarRpc,
|
|
829
858
|
env: this.monitoring?.env,
|
|
830
859
|
augustKey: this.keys?.august,
|
|
831
860
|
subgraphKey: this.keys?.graph,
|
|
@@ -851,6 +880,7 @@ class AugustVaults extends core_1.AugustBase {
|
|
|
851
880
|
? this.providers?.[chainId]
|
|
852
881
|
: this.requireActiveNetwork().rpcUrl,
|
|
853
882
|
solanaService: this.solanaService,
|
|
883
|
+
stellarRpc: this._stellarRpc,
|
|
854
884
|
env: this.monitoring?.env,
|
|
855
885
|
augustKey: this.keys?.august,
|
|
856
886
|
subgraphKey: this.keys?.graph,
|
|
@@ -1033,6 +1063,7 @@ class AugustVaults extends core_1.AugustBase {
|
|
|
1033
1063
|
rpcUrl: rpcUrl,
|
|
1034
1064
|
chainId: resolvedChainId,
|
|
1035
1065
|
solanaService: this.solanaService,
|
|
1066
|
+
stellarRpc: this._stellarRpc,
|
|
1036
1067
|
env: this.monitoring?.env,
|
|
1037
1068
|
augustKey: this.keys?.august,
|
|
1038
1069
|
subgraphKey: this.keys?.graph,
|
|
@@ -1056,6 +1087,7 @@ class AugustVaults extends core_1.AugustBase {
|
|
|
1056
1087
|
options: {
|
|
1057
1088
|
rpcUrl: rpcUrl,
|
|
1058
1089
|
solanaService: this.solanaService,
|
|
1090
|
+
stellarRpc: this._stellarRpc,
|
|
1059
1091
|
env: this.monitoring?.env,
|
|
1060
1092
|
augustKey: this.keys?.august,
|
|
1061
1093
|
subgraphKey: this.keys?.graph,
|
|
@@ -1103,6 +1135,7 @@ class AugustVaults extends core_1.AugustBase {
|
|
|
1103
1135
|
? this.providers?.[chainId]
|
|
1104
1136
|
: rpcUrl || this.requireActiveNetwork().rpcUrl,
|
|
1105
1137
|
solanaService: this.solanaService,
|
|
1138
|
+
stellarRpc: this._stellarRpc,
|
|
1106
1139
|
env: this.monitoring?.env,
|
|
1107
1140
|
augustKey: this.keys?.august,
|
|
1108
1141
|
subgraphKey: this.keys?.graph,
|
|
@@ -1376,6 +1409,7 @@ class AugustVaults extends core_1.AugustBase {
|
|
|
1376
1409
|
options: {
|
|
1377
1410
|
rpcUrl: chainId ? this.providers?.[chainId] : this.activeNetwork.rpcUrl,
|
|
1378
1411
|
solanaService: this.solanaService,
|
|
1412
|
+
stellarRpc: this._stellarRpc,
|
|
1379
1413
|
env: this.monitoring?.env,
|
|
1380
1414
|
augustKey: this.keys?.august,
|
|
1381
1415
|
subgraphKey: this.keys?.graph,
|
|
@@ -1428,6 +1462,7 @@ class AugustVaults extends core_1.AugustBase {
|
|
|
1428
1462
|
options: {
|
|
1429
1463
|
rpcUrl,
|
|
1430
1464
|
solanaService: this.solanaService,
|
|
1465
|
+
stellarRpc: this._stellarRpc,
|
|
1431
1466
|
env: this.monitoring?.env,
|
|
1432
1467
|
augustKey: this.keys?.august,
|
|
1433
1468
|
subgraphKey: this.keys?.graph,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Connection } from '@solana/web3.js';
|
|
2
|
-
import type { IAddress, IEnv, IWSMonitorHeaders } from '../../types';
|
|
2
|
+
import type { IAddress, IEnv, IStellarNetwork, IWSMonitorHeaders } from '../../types';
|
|
3
3
|
/**
|
|
4
4
|
* Structural interface for the Solana adapter surface used by vault operations.
|
|
5
5
|
* Avoids importing the concrete SolanaAdapter class to prevent circular dependencies.
|
|
@@ -40,6 +40,16 @@ export interface IVaultBaseOptions {
|
|
|
40
40
|
subgraphKey?: string;
|
|
41
41
|
chainId?: number;
|
|
42
42
|
solanaService?: ISolanaService;
|
|
43
|
+
/**
|
|
44
|
+
* Optional Soroban RPC override (e.g. a keyed Alchemy URL) for Stellar vault
|
|
45
|
+
* reads, threaded from the SDK's `stellar` config. Carries the network it was
|
|
46
|
+
* configured for so it is only applied to matching-network vaults — a testnet
|
|
47
|
+
* override must not be used for a mainnet read. Unset → built-in endpoints.
|
|
48
|
+
*/
|
|
49
|
+
stellarRpc?: {
|
|
50
|
+
rpcUrl: string;
|
|
51
|
+
network: IStellarNetwork;
|
|
52
|
+
};
|
|
43
53
|
headers?: IWSMonitorHeaders;
|
|
44
54
|
/**
|
|
45
55
|
* Portfolio mode: when true, the per-vault EVM getter does NOT null out a
|
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). */
|
|
@@ -20319,12 +20332,34 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
|
|
|
20319
20332
|
*/
|
|
20320
20333
|
export declare function isSwapRouterEligible(vaultAddress: IAddress): boolean;
|
|
20321
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
|
+
|
|
20322
20351
|
/** Parameters for building an unsigned Stellar vault deposit transaction. */
|
|
20323
20352
|
declare interface IStellarDepositParams {
|
|
20324
20353
|
contractId: string;
|
|
20325
20354
|
amount: string;
|
|
20326
20355
|
senderAddress: string;
|
|
20327
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;
|
|
20328
20363
|
}
|
|
20329
20364
|
|
|
20330
20365
|
export declare type IStellarNetwork = 'mainnet' | 'testnet';
|
|
@@ -20335,6 +20370,12 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
|
|
|
20335
20370
|
shares: string;
|
|
20336
20371
|
receiverAddress: string;
|
|
20337
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;
|
|
20338
20379
|
}
|
|
20339
20380
|
|
|
20340
20381
|
/**
|
|
@@ -21196,6 +21237,16 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
|
|
|
21196
21237
|
subgraphKey?: string;
|
|
21197
21238
|
chainId?: number;
|
|
21198
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
|
+
};
|
|
21199
21250
|
headers?: IWSMonitorHeaders;
|
|
21200
21251
|
/**
|
|
21201
21252
|
* Portfolio mode: when true, the per-vault EVM getter does NOT null out a
|
|
@@ -21447,6 +21498,16 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
|
|
|
21447
21498
|
chainId: number;
|
|
21448
21499
|
type: 'withdraw-request' | 'deposit' | 'withdraw-processed' | 'redeem';
|
|
21449
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;
|
|
21450
21511
|
};
|
|
21451
21512
|
|
|
21452
21513
|
export declare interface IVaultUserLifetimePnl {
|
|
@@ -23705,9 +23766,24 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
|
|
|
23705
23766
|
* // Sign xdr with wallet (e.g. Freighter), then submit via adapter.submitTransaction()
|
|
23706
23767
|
* ```
|
|
23707
23768
|
*/
|
|
23708
|
-
declare class StellarAdapter {
|
|
23769
|
+
export declare class StellarAdapter {
|
|
23709
23770
|
private _network;
|
|
23710
|
-
|
|
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
|
+
});
|
|
23711
23787
|
get network(): IStellarNetwork;
|
|
23712
23788
|
isStellarAddress(address: string): boolean;
|
|
23713
23789
|
getExplorerLink(id: string, type?: 'contract' | 'account' | 'tx'): string;
|
|
@@ -23822,6 +23898,9 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
|
|
|
23822
23898
|
*
|
|
23823
23899
|
* @param signedXdr - Base64-encoded XDR of the signed transaction
|
|
23824
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.
|
|
23825
23904
|
* @returns The transaction hash once the network confirms it as successful
|
|
23826
23905
|
* @throws {@link AugustTimeoutError} when the transaction is not confirmed
|
|
23827
23906
|
* within the poll budget (`MAX_POLL_ATTEMPTS`).
|
|
@@ -23841,7 +23920,7 @@ export declare function depositNative(signer: Signer | Wallet, options: INativeD
|
|
|
23841
23920
|
* }
|
|
23842
23921
|
* ```
|
|
23843
23922
|
*/
|
|
23844
|
-
declare function submitStellarTransaction(signedXdr: string, network: IStellarNetwork): Promise<string>;
|
|
23923
|
+
declare function submitStellarTransaction(signedXdr: string, network: IStellarNetwork, sorobanRpcUrl?: string): Promise<string>;
|
|
23845
23924
|
|
|
23846
23925
|
/**
|
|
23847
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
|
+
}
|