@augustdigital/sdk 9.0.0 → 9.1.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/sdk.d.ts CHANGED
@@ -15112,6 +15112,30 @@ export declare type ApproveResult =
15112
15112
  kind: 'native';
15113
15113
  };
15114
15114
 
15115
+ /**
15116
+ * Whether an alert would be sent right now.
15117
+ *
15118
+ * Quiet by default outside production, mirroring `analytics`: a partner's Jest
15119
+ * suite or `next dev` session exercising a failing redeem must not page a real
15120
+ * curator. Two gates are needed for that, because they cover different
15121
+ * runtimes — `NODE_ENV` is the Node one, and bundlers strip or stub
15122
+ * `process.env` in the browser, so a locally-served app is recognised by its
15123
+ * hostname instead (CLAUDE.md §5). Without that gate, a browser app run
15124
+ * against mainnet from any loopback or private origin — `localhost`, a
15125
+ * container on `172.20.0.0/16`, `[::1]` — pages a real curator on every
15126
+ * failed redeem. `isLocalhost` in `core/analytics/env` lists the ranges.
15127
+ *
15128
+ * `enabled: true` overrides both — it is the documented way to exercise the
15129
+ * path deliberately, and the SDK's own suite relies on it.
15130
+ *
15131
+ * The env var is read per call (not once at module load) so a consumer that
15132
+ * sets it after import is still honoured, and a test can set and unset it
15133
+ * without re-importing. It deliberately outranks an explicit `enabled: true`:
15134
+ * it is the kill switch, and an operator setting it should not have to find
15135
+ * and edit the construction site to be obeyed.
15136
+ */
15137
+ export declare function areCuratorAlertsEnabled(): boolean;
15138
+
15115
15139
  declare type AsArray<T> = T extends readonly unknown[] ? T : never;
15116
15140
 
15117
15141
  /**
@@ -17530,6 +17554,23 @@ declare type AsArray<T> = T extends readonly unknown[] ? T : never;
17530
17554
  */
17531
17555
  export declare function computeArgShape(args: unknown[]): string[];
17532
17556
 
17557
+ /**
17558
+ * Apply constructor config. Called unconditionally by `AugustBase` so an
17559
+ * instance that omits `curatorAlerts` RESETS to the defaults rather than
17560
+ * inheriting a prior instance's settings — same contract as
17561
+ * `setPublicApiBaseUrl` and `setAttribution`.
17562
+ *
17563
+ * Also the supported opt-out for code that calls the `Stellar` namespace
17564
+ * functions directly without constructing an `AugustSDK` (the testnet flow in
17565
+ * the docs), and the only one that works in a browser, where the env var is
17566
+ * unreadable.
17567
+ *
17568
+ * @param config - `monitoring.curatorAlerts`, or `null` to restore defaults.
17569
+ * @param context - Facts about the reporting instance; omitted entirely by a
17570
+ * caller that only wants to disable reporting.
17571
+ */
17572
+ export declare function configureCuratorAlerts(config: ICuratorAlertsConfig | null, context?: ICuratorAlertsContext): void;
17573
+
17533
17574
  /**
17534
17575
  * Query the vault's `convert_to_shares` to preview how many shares a deposit
17535
17576
  * amount would yield. Returns the raw share amount as a string, or null on
@@ -17627,6 +17668,9 @@ declare type AsArray<T> = T extends readonly unknown[] ? T : never;
17627
17668
  */
17628
17669
  export declare function crossChainVaultRedeem(props: ICrossChainRedeemRequest): Promise<ICrossChainRedeemResult>;
17629
17670
 
17671
+ /** Env equivalent of `monitoring.curatorAlerts.enabled: false`. Node only. */
17672
+ export declare const CURATOR_ALERTS_DISABLE_ENV_VAR = "AUGUST_SDK_DISABLE_CURATOR_ALERTS";
17673
+
17630
17674
  /**
17631
17675
  * Datetime
17632
17676
  */
@@ -19810,6 +19854,19 @@ declare type AsArray<T> = T extends readonly unknown[] ? T : never;
19810
19854
  * `redeem(shares: i128, receiver, owner, operator) -> i128`; divergence
19811
19855
  * surfaces as a generic Soroban simulation error.
19812
19856
  *
19857
+ * Side effect on failure: when the *vault* cannot serve the redemption — it
19858
+ * rejected the call, or its ledger state needs restoring — the failure is
19859
+ * reported to that vault's curator. Stellar vaults are instant-redeem only, so
19860
+ * this is the curator's only signal that their depositors cannot get out
19861
+ * (AUGUST-7162). Fire-and-forget and deduped; see
19862
+ * {@link reportRedeemFailure} and {@link REPORTED_BUILD_STAGES}.
19863
+ *
19864
+ * Note this includes a caller-caused rejection such as redeeming more shares
19865
+ * than the wallet holds: the contract trapping is what we can observe, and
19866
+ * telling that apart from a vault-side problem needs the vault's error
19867
+ * taxonomy. A bad address, an unfunded account, and an exhausted RPC failover
19868
+ * are excluded — none of those reached the vault.
19869
+ *
19813
19870
  * @returns Base64-encoded XDR ready for wallet signing; pass the signed
19814
19871
  * XDR to {@link submitStellarTransaction}.
19815
19872
  */
@@ -20409,6 +20466,46 @@ declare type AsArray<T> = T extends readonly unknown[] ? T : never;
20409
20466
  hubOnlyReceipt?: boolean;
20410
20467
  }
20411
20468
 
20469
+ /** Curator-alert reporting. Enabled by default; this is the opt-out. */
20470
+ export declare interface ICuratorAlertsConfig {
20471
+ /**
20472
+ * `false` stops emitting entirely. `true` forces emitting even in an
20473
+ * environment the SDK would otherwise stay quiet in — it bypasses **every**
20474
+ * environment gate: `NODE_ENV` of `development`/`test`, a browser served
20475
+ * from a loopback or private host, and `monitoring.env` other than `PROD`.
20476
+ * It does NOT lift the mainnet-only restriction; only `endpoint` does. A
20477
+ * `DEV` or test
20478
+ * integration that sets it and then fails a mainnet redeem pages a real
20479
+ * curator, so use it only when deliberately exercising the path (pair it
20480
+ * with `endpoint` to aim at a test relay). The only thing that still wins is
20481
+ * the {@link CURATOR_ALERTS_DISABLE_ENV_VAR} kill switch.
20482
+ */
20483
+ enabled?: boolean;
20484
+ /**
20485
+ * Override the relay endpoint. Defaults to
20486
+ * {@link DEFAULT_CURATOR_ALERT_ENDPOINT}. Setting it also lifts the
20487
+ * mainnet-only restriction, so a staging relay can receive testnet failures.
20488
+ */
20489
+ endpoint?: string;
20490
+ }
20491
+
20492
+ /** Ambient facts about the reporting SDK instance, supplied by `AugustBase`. */
20493
+ export declare interface ICuratorAlertsContext {
20494
+ /** Carried on the payload so August can tell partner traffic apart. */
20495
+ appName?: string;
20496
+ /**
20497
+ * `monitoring.env`. Anything other than `'PROD'` keeps the SDK quiet unless
20498
+ * `config.enabled` is explicitly `true`.
20499
+ */
20500
+ environment?: IEnv;
20501
+ /**
20502
+ * Effective base URL of the August public API. Reports follow the API this
20503
+ * instance reads from, so a deployment pointed at a staging backend alerts
20504
+ * staging rather than production.
20505
+ */
20506
+ apiBaseUrl?: string;
20507
+ }
20508
+
20412
20509
  /**
20413
20510
  * On-chain whitelist status of one subaccount linked to a vault, from
20414
20511
  * `GET /curator/vaults/{vault_address}/whitelist` (backend
@@ -20954,6 +21051,27 @@ declare type AsArray<T> = T extends readonly unknown[] ? T : never;
20954
21051
  declare interface IMonitoring extends IWSMonitorHeaders {
20955
21052
  slackWebhookUrl?: string;
20956
21053
  env?: IEnv;
21054
+ /**
21055
+ * Curator notifications for failed vault redemptions. Enabled by default
21056
+ * (opt-out model, like `analytics`).
21057
+ *
21058
+ * Stellar vaults are instant-redeem only, so when a redemption fails the
21059
+ * vault's curator has no other way to learn about it. The SDK relays the
21060
+ * failure to August's notification service, which routes it to that curator's
21061
+ * own channel — no credentials or curator identities are held here.
21062
+ *
21063
+ * Set `enabled: false` (or, in Node, the
21064
+ * `AUGUST_SDK_DISABLE_CURATOR_ALERTS` env var) to stop emitting; set
21065
+ * `endpoint` only to point a non-prod deployment at a test relay. Nothing is
21066
+ * emitted unless `monitoring.env` is `PROD`, `NODE_ENV` is neither
21067
+ * `development` nor `test`, and — in a browser, where `NODE_ENV` is not
21068
+ * readable — the page is not served from localhost.
21069
+ *
21070
+ * `enabled: true` is the one exception: it bypasses all three gates, so a
21071
+ * `DEV` or test integration that sets it can page a real curator. See
21072
+ * {@link ICuratorAlertsConfig}.
21073
+ */
21074
+ curatorAlerts?: ICuratorAlertsConfig;
20957
21075
  }
20958
21076
 
20959
21077
  /* Excluded from this release type: IMulticall3Request */
@@ -26112,10 +26230,22 @@ declare type AsArray<T> = T extends readonly unknown[] ? T : never;
26112
26230
  vaultDeposit(params: Omit<IStellarDepositParams, 'network'>): Promise<string>;
26113
26231
  /**
26114
26232
  * Build an unsigned redeem transaction for a Stellar vault.
26233
+ *
26234
+ * Side effect on failure: a redemption the vault cannot serve is reported to
26235
+ * that vault's curator, since Stellar vaults are instant-redeem only and this
26236
+ * is the curator's only signal. Fire-and-forget — it never delays or alters
26237
+ * the error you receive. On by default in production; see
26238
+ * `monitoring.curatorAlerts` and the Curator Notifications section of the
26239
+ * Stellar Actions guide for exactly what is sent and how to opt out.
26240
+ *
26115
26241
  * @returns Base64-encoded XDR of the unsigned transaction.
26116
26242
  */
26117
26243
  vaultRedeem(params: Omit<IStellarRedeemParams, 'network'>): Promise<string>;
26118
26244
  /**
26245
+ * Side effect: a submitted transaction that the network reports as a failed
26246
+ * `redeem` operation is reported to that vault's curator, on the same
26247
+ * fire-and-forget terms as {@link StellarAdapter.vaultRedeem}.
26248
+ *
26119
26249
  * Submit a signed Soroban transaction and poll until the network confirms it.
26120
26250
  *
26121
26251
  * Submits on the network this adapter was constructed with, so `signedXdr`
@@ -26227,6 +26357,14 @@ declare type AsArray<T> = T extends readonly unknown[] ? T : never;
26227
26357
  * plus, when the result XDR decodes, a `resultCode` string holding the
26228
26358
  * transaction-level reason (e.g. `"txBadSeq"`, `"txTooLate"`); `resultCode`
26229
26359
  * is `undefined` when the code cannot be decoded.
26360
+ *
26361
+ * Side effect: a transaction whose `resultCode` is `txFailed` — the operation
26362
+ * itself ran and failed — and whose envelope shows a vault `redeem` is relayed
26363
+ * to that vault's curator (fire-and-forget, deduped — see
26364
+ * {@link reportRedeemFailure}). Nothing else alerts: an RPC-rejected
26365
+ * broadcast is a retryable race, a poll timeout is indeterminate (the
26366
+ * transaction may yet succeed), and any other result code means the redeem
26367
+ * never executed.
26230
26368
  * @example
26231
26369
  * ```ts
26232
26370
  * try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@augustdigital/sdk",
3
- "version": "9.0.0",
3
+ "version": "9.1.0",
4
4
  "main": "lib/index.js",
5
5
  "types": "lib/sdk.d.ts",
6
6
  "keywords": [