@rebilly/instruments 16.115.0 → 16.117.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/CHANGELOG.md CHANGED
@@ -1,6 +1,7 @@
1
- ## [16.115.0](https://github.com/Rebilly/rebilly/compare/instruments/core-v16.114.0...instruments/core-v16.115.0) (2026-05-18)
1
+ ## [16.117.0](https://github.com/Rebilly/rebilly/compare/instruments/core-v16.116.0...instruments/core-v16.117.0) (2026-05-20)
2
2
 
3
3
 
4
4
  ### Features
5
5
 
6
- * **api-metadata, rebilly-js-sdk:** Update resources based on latest api definitions ([#21559](https://github.com/Rebilly/rebilly/issues/21559)) ([7330eab](https://github.com/Rebilly/rebilly/commit/7330eab1f8036adb550c7a091240ae2837a25ee6))
6
+ * **api-metadata, rebilly-js-sdk:** Update resources based on latest api definitions ([#21565](https://github.com/Rebilly/rebilly/issues/21565)) ([58c5b28](https://github.com/Rebilly/rebilly/commit/58c5b285345e8d123233a49580d89a687d7a164e))
7
+ * **instruments:** switch check for requiresSetupTransaction to api feature flag ([#21613](https://github.com/Rebilly/rebilly/issues/21613)) ([de0ba15](https://github.com/Rebilly/rebilly/commit/de0ba154fd6b240d3af8c85bf89738782850ed07))
package/dist/index.js CHANGED
@@ -5299,7 +5299,7 @@ function C$1({ options: e2 }) {
5299
5299
  }
5300
5300
  function o2() {
5301
5301
  const i = {
5302
- "REB-API-CONSUMER": `${["Rebilly", e2.appName, "js-sdk"].filter((g) => g).join("/")}@7330eab`
5302
+ "REB-API-CONSUMER": `${["Rebilly", e2.appName, "js-sdk"].filter((g) => g).join("/")}@f83a53f`
5303
5303
  };
5304
5304
  return e2.apiKey && (i["REB-APIKEY"] = e2.apiKey), i;
5305
5305
  }
@@ -18398,7 +18398,9 @@ const _ReadyToPayFeatureModel = class _ReadyToPayFeatureModel {
18398
18398
  linkToken = "",
18399
18399
  // Klarna fields
18400
18400
  clientToken = "",
18401
- sessionId = ""
18401
+ sessionId = "",
18402
+ // Payout fields
18403
+ requiresSetupTransaction: requiresSetupTransaction2 = false
18402
18404
  } = {}) {
18403
18405
  this.name = name;
18404
18406
  this.expirationTime = expirationTime;
@@ -18412,6 +18414,7 @@ const _ReadyToPayFeatureModel = class _ReadyToPayFeatureModel {
18412
18414
  this.linkToken = linkToken;
18413
18415
  this.clientToken = clientToken;
18414
18416
  this.sessionId = sessionId;
18417
+ this.requiresSetupTransaction = requiresSetupTransaction2;
18415
18418
  }
18416
18419
  };
18417
18420
  _ReadyToPayFeatureModel.FeatureName = {
@@ -23113,7 +23116,6 @@ async function makePayment({ payload }) {
23113
23116
  }
23114
23117
  return fields;
23115
23118
  }
23116
- const PAYOUT_SETUP_REQUIRED_METHODS = ["VegaWallet"];
23117
23119
  async function awaitPayoutSetupApprovalUrl({
23118
23120
  instrument,
23119
23121
  transaction
@@ -23170,7 +23172,7 @@ async function resolvePaymentInstrumentId({
23170
23172
  isExistingInstrument,
23171
23173
  redirectUrl
23172
23174
  }) {
23173
- if (PAYOUT_SETUP_REQUIRED_METHODS.includes(token.method)) {
23175
+ if (requiresSetupTransaction(token)) {
23174
23176
  const redirectField = redirectUrl ? { redirectUrl } : {};
23175
23177
  const { instrument, transaction } = await setupPaymentInstrument(
23176
23178
  isExistingInstrument ? { instrument: token, data: redirectField } : { data: { token: token.id, ...redirectField } }
@@ -23186,6 +23188,13 @@ async function resolvePaymentInstrumentId({
23186
23188
  });
23187
23189
  return id;
23188
23190
  }
23191
+ function requiresSetupTransaction(token) {
23192
+ var _a, _b;
23193
+ const payoutMethod = (_a = state.data.readyToPayout) == null ? void 0 : _a.find(
23194
+ ({ method }) => method === token.method
23195
+ );
23196
+ return ((_b = payoutMethod == null ? void 0 : payoutMethod.feature) == null ? void 0 : _b.requiresSetupTransaction) === true;
23197
+ }
23189
23198
  async function purchase({ payload }) {
23190
23199
  var _a, _b;
23191
23200
  Object.keys(payload).forEach((key) => {