@moonpay/platform-sdk-core 1.16.0 → 1.18.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/dist/index.cjs CHANGED
@@ -42,6 +42,7 @@ __export(index_exports, {
42
42
  getPaymentMethods: () => getPaymentMethods,
43
43
  getQuote: () => getQuote,
44
44
  getTransaction: () => getTransaction,
45
+ isSecureRandomAvailable: () => isSecureRandomAvailable,
45
46
  isTrustedFrameOrigin: () => isTrustedFrameOrigin,
46
47
  isTrustedFrameUrl: () => isTrustedFrameUrl,
47
48
  listTransactions: () => listTransactions,
@@ -264,6 +265,7 @@ async function simulateBankTransfer(ctx, id, params) {
264
265
  }
265
266
 
266
267
  // src/client.ts
268
+ var import_result4 = require("@moonpay/platform-protocol/result");
267
269
  function createClientCore(options) {
268
270
  const ctx = createClientContext({
269
271
  apiBaseUrl: options.apiBaseUrl
@@ -276,6 +278,10 @@ function createClientCore(options) {
276
278
  return options.frameBaseUrl;
277
279
  },
278
280
  createTransport: options.createTransport,
281
+ getCredentials: () => ctx.accessToken ? (0, import_result4.ok)({ accessToken: ctx.accessToken, clientToken: ctx.clientToken }) : (0, import_result4.err)({
282
+ code: "noActiveSession",
283
+ message: "No active session. Connect a customer (getConnection / connect / setupAuth) before requesting credentials."
284
+ }),
279
285
  getQuote: (params) => getQuote(ctx, params),
280
286
  getAssets: (params) => getAssets(ctx, params),
281
287
  getPaymentMethods: () => getPaymentMethods(ctx),
@@ -1609,6 +1615,9 @@ function generateKeyPair() {
1609
1615
  publicKey: bytesToHex(publicKey)
1610
1616
  };
1611
1617
  }
1618
+ function isSecureRandomAvailable() {
1619
+ return typeof globalThis.crypto?.getRandomValues === "function";
1620
+ }
1612
1621
 
1613
1622
  // src/frames/frame-orchestrator.ts
1614
1623
  var import_protocol = require("@moonpay/platform-protocol/protocol");