@trustware/sdk-staging 1.1.16-staging.1 → 1.1.16-staging.3

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/dist/core.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- export { R as RouteDeclineCode, a as RouteError, b as RouteErrorCode, c as RouteErrorFacts, d as RouteFailureCode, e as RouteProviderOutcome, T as Trustware, f as TrustwareCore, g as assertRouteDeliversValue, h as formatMinimum, i as isRouteError, j as isValueDestroying, p as parseRouteError, r as routeNetUsd } from './core-EpQvLUSx.cjs';
1
+ export { R as RouteDeclineCode, a as RouteError, b as RouteErrorCode, c as RouteErrorFacts, d as RouteFailureCode, e as RouteProviderOutcome, f as RouteRejectionCode, T as Trustware, g as TrustwareCore, h as assertRouteDeliversValue, i as formatMinimum, j as isRouteError, k as isValueDestroying, p as parseRouteError, r as routeNetUsd } from './core-Bp73X3Mp.cjs';
2
2
  export { B as BuildRouteBody, m as BuildRouteResponse, a5 as assertValidPostHook } from './manager-BN0KXjcN.cjs';
3
3
  import './blockchain-DmCPxnxr.cjs';
4
4
  import './types-DEUb5IZA.cjs';
package/dist/core.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { R as RouteDeclineCode, a as RouteError, b as RouteErrorCode, c as RouteErrorFacts, d as RouteFailureCode, e as RouteProviderOutcome, T as Trustware, f as TrustwareCore, g as assertRouteDeliversValue, h as formatMinimum, i as isRouteError, j as isValueDestroying, p as parseRouteError, r as routeNetUsd } from './core-BZYVv-Vo.js';
1
+ export { R as RouteDeclineCode, a as RouteError, b as RouteErrorCode, c as RouteErrorFacts, d as RouteFailureCode, e as RouteProviderOutcome, f as RouteRejectionCode, T as Trustware, g as TrustwareCore, h as assertRouteDeliversValue, i as formatMinimum, j as isRouteError, k as isValueDestroying, p as parseRouteError, r as routeNetUsd } from './core-B31ElTB8.js';
2
2
  export { B as BuildRouteBody, m as BuildRouteResponse, a5 as assertValidPostHook } from './manager-BmzflCbY.js';
3
3
  import './blockchain-DmCPxnxr.js';
4
4
  import './types-CMmx0S4U.js';
package/dist/core.mjs CHANGED
@@ -61,7 +61,7 @@ var init_constants = __esm({
61
61
  "src/constants.ts"() {
62
62
  "use strict";
63
63
  SDK_NAME = "@trustware/sdk";
64
- SDK_VERSION = "1.1.16-staging.1";
64
+ SDK_VERSION = "1.1.16-staging.3";
65
65
  API_ROOT = "https://bv-staging-api.trustware.io";
66
66
  API_PREFIX = "/api";
67
67
  WALLETCONNECT_PROJECT_ID = "72ea74c400f5111d43aea638d7d83a24";
@@ -4083,10 +4083,12 @@ function routeErrorFromResponse(status, body, fallbackMessage) {
4083
4083
  }
4084
4084
  function parseRouteError(raw) {
4085
4085
  if (isRouteError(raw) && raw.providers.length > 0) {
4086
+ const rejected = raw.providers.some((p) => p.outcome === "rejected");
4086
4087
  return {
4087
4088
  codes: providerCodes(raw.providers),
4088
4089
  providers: raw.providers,
4089
- allDeclined: raw.providers.every((p) => p.outcome !== "failed"),
4090
+ allDeclined: !rejected && raw.providers.every((p) => p.outcome !== "failed"),
4091
+ rejected,
4090
4092
  minimum: firstMinimum(raw.providers.map((p) => p.message))
4091
4093
  };
4092
4094
  }
@@ -4101,6 +4103,7 @@ function parseRouteError(raw) {
4101
4103
  codes,
4102
4104
  providers: [],
4103
4105
  allDeclined: !codes.some((code) => failureCodes.includes(code)),
4106
+ rejected: false,
4104
4107
  minimum: firstMinimum([text])
4105
4108
  };
4106
4109
  }
@@ -4150,7 +4153,7 @@ function formatMinimum(minimum) {
4150
4153
  if (minimum.symbol.toUpperCase() === "USD") return `$${minimum.amount}`;
4151
4154
  return `${minimum.amount} ${minimum.symbol}`;
4152
4155
  }
4153
- var RouteDeclineCode, RouteFailureCode, RouteErrorCode, ALL_PROVIDER_CODES, RouteError, MAX_ROUTE_ERROR_TEXT, ROUTE_SUMMARIES;
4156
+ var RouteDeclineCode, RouteFailureCode, RouteRejectionCode, RouteErrorCode, ALL_PROVIDER_CODES, RouteError, MAX_ROUTE_ERROR_TEXT, ROUTE_SUMMARIES;
4154
4157
  var init_routeError = __esm({
4155
4158
  "src/core/routeError.ts"() {
4156
4159
  "use strict";
@@ -4172,18 +4175,25 @@ var init_routeError = __esm({
4172
4175
  Timeout: "timeout",
4173
4176
  ProviderError: "provider_error"
4174
4177
  };
4178
+ RouteRejectionCode = {
4179
+ InvalidAddress: "invalid_address"
4180
+ };
4175
4181
  RouteErrorCode = {
4176
4182
  /** Every provider declined: a negative result, returned as 404. */
4177
4183
  NoRouteAvailable: "no_route_available",
4178
4184
  /** At least one provider failed, so "unroutable" cannot be claimed: 502. */
4179
4185
  ProvidersFailed: "providers_failed",
4186
+ /** The caller's address cannot be valid on its chain; no provider was
4187
+ * asked. Returned as 400. Fix the request rather than retry it. */
4188
+ InvalidAddress: "invalid_address",
4180
4189
  /** A route came back but the SDK refused it: its fees exceed its output.
4181
4190
  * Reached client-side, so `status` is 0. */
4182
4191
  FeesExceedOutput: "fees_exceed_output"
4183
4192
  };
4184
4193
  ALL_PROVIDER_CODES = [
4185
4194
  ...Object.values(RouteDeclineCode),
4186
- ...Object.values(RouteFailureCode)
4195
+ ...Object.values(RouteFailureCode),
4196
+ ...Object.values(RouteRejectionCode)
4187
4197
  ];
4188
4198
  RouteError = class extends Error {
4189
4199
  constructor(params) {
@@ -4197,6 +4207,10 @@ var init_routeError = __esm({
4197
4207
  get isNoRouteAvailable() {
4198
4208
  return this.code === RouteErrorCode.NoRouteAvailable || this.status === 404;
4199
4209
  }
4210
+ /** True when the caller's address was rejected — nothing to retry, fix the request. */
4211
+ get isInvalidAddress() {
4212
+ return this.code === RouteErrorCode.InvalidAddress;
4213
+ }
4200
4214
  /** The distinct provider codes, e.g. ["amount_too_low", "no_routes"]. */
4201
4215
  get providerCodes() {
4202
4216
  return providerCodes(this.providers);
@@ -4626,37 +4640,42 @@ var init_popularChains = __esm({
4626
4640
  name: "Ethereum",
4627
4641
  chainId: 1
4628
4642
  },
4629
- {
4630
- name: "BSC",
4631
- chainId: 56
4632
- },
4633
4643
  {
4634
4644
  name: "Solana"
4635
4645
  },
4636
4646
  {
4637
- name: "Tron"
4647
+ name: "Base",
4648
+ chainId: 8453
4638
4649
  },
4639
4650
  {
4640
- name: "Bitcoin"
4651
+ name: "BSC",
4652
+ chainId: 56
4641
4653
  },
4642
4654
  {
4643
- name: "Base",
4644
- chainId: 8453
4655
+ name: "Tron"
4645
4656
  },
4646
4657
  {
4647
- name: "Hyperliquid L1"
4658
+ name: "Bitcoin"
4648
4659
  },
4649
4660
  {
4650
- name: "Provenance"
4661
+ name: "Hyperliquid L1"
4651
4662
  },
4652
4663
  {
4653
4664
  name: "Arbitrum",
4654
4665
  chainId: 42161
4655
4666
  },
4667
+ {
4668
+ name: "Monad",
4669
+ chainId: 143
4670
+ },
4656
4671
  {
4657
4672
  name: "Polygon",
4658
4673
  chainId: 137
4659
4674
  },
4675
+ {
4676
+ name: "Robinhood Chain",
4677
+ chainId: 4663
4678
+ },
4660
4679
  {
4661
4680
  name: "Plasma",
4662
4681
  chainId: 9745
@@ -4668,10 +4687,6 @@ var init_popularChains = __esm({
4668
4687
  {
4669
4688
  name: "Sui"
4670
4689
  },
4671
- {
4672
- name: "Monad",
4673
- chainId: 143
4674
- },
4675
4690
  {
4676
4691
  name: "OP Mainnet",
4677
4692
  chainId: 10
@@ -4684,18 +4699,13 @@ var init_popularChains = __esm({
4684
4699
  name: "Stellar"
4685
4700
  },
4686
4701
  {
4687
- name: "Starknet"
4702
+ name: "Anubis"
4688
4703
  },
4689
4704
  {
4690
- name: "Near"
4691
- },
4692
- {
4693
- name: "Mantle",
4694
- chainId: 5e3
4705
+ name: "Provenance"
4695
4706
  },
4696
4707
  {
4697
- name: "Movement",
4698
- chainId: 3073
4708
+ name: "Starknet"
4699
4709
  },
4700
4710
  {
4701
4711
  name: "Ink",
@@ -4705,31 +4715,35 @@ var init_popularChains = __esm({
4705
4715
  name: "Flare"
4706
4716
  },
4707
4717
  {
4708
- name: "Aptos"
4718
+ name: "X Layer"
4709
4719
  },
4710
4720
  {
4711
- name: "MegaETH",
4712
- chainId: 4326
4721
+ name: "Near"
4713
4722
  },
4714
4723
  {
4715
- name: "Rootstock",
4716
- chainId: 30
4724
+ name: "Gnosis",
4725
+ chainId: 100
4726
+ },
4727
+ {
4728
+ name: "Mantle",
4729
+ chainId: 5e3
4717
4730
  },
4718
4731
  {
4719
- name: "dYdX"
4732
+ name: "Stacks"
4720
4733
  },
4721
4734
  {
4722
- name: "Cardano"
4735
+ name: "Morph"
4723
4736
  },
4724
4737
  {
4725
- name: "Stacks"
4738
+ name: "Rootstock",
4739
+ chainId: 30
4726
4740
  },
4727
4741
  {
4728
- name: "X Layer"
4742
+ name: "Mixin"
4729
4743
  }
4730
4744
  ],
4731
4745
  popularLimit: 8,
4732
- updatedAt: "2026-06-19",
4746
+ updatedAt: "2026-09-02",
4733
4747
  source: "https://api.llama.fi/v2/chains \u2014 sorted by TVL"
4734
4748
  };
4735
4749
  }
@@ -7323,6 +7337,7 @@ export {
7323
7337
  RouteError,
7324
7338
  RouteErrorCode,
7325
7339
  RouteFailureCode,
7340
+ RouteRejectionCode,
7326
7341
  Trustware,
7327
7342
  assertRouteDeliversValue,
7328
7343
  assertValidPostHook,