@owney/sdk 0.6.7-beta.2 → 0.6.7-beta.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/index.cjs CHANGED
@@ -709,11 +709,15 @@ var ZyfaiAgent = class {
709
709
  // successful decode is cached forever; failures are NOT cached so a transient
710
710
  // RPC error retries on the next fetch.
711
711
  withdrawAmountCache = /* @__PURE__ */ new Map();
712
- constructor(apiKey, rpcUrls) {
712
+ constructor(apiKey, rpcUrls, referralSource) {
713
713
  this.rpcUrls = rpcUrls ?? DEFAULT_ZYFAI_RPC_URLS;
714
714
  this.sdk = new import_sdk.ZyfaiSDK({
715
715
  apiKey,
716
- rpcUrls: this.rpcUrls
716
+ rpcUrls: this.rpcUrls,
717
+ // Forwarded to /auth/login by the SDK's own SIWE handshake, so
718
+ // attribution survives without the AppKit SIWX config (which carried it
719
+ // via `createOwneySIWX({ referralSource })` when apps used the modal).
720
+ referralSource
717
721
  });
718
722
  this.installAuthCache();
719
723
  }
@@ -1677,6 +1681,7 @@ var OwneySDK = class {
1677
1681
  apiKey;
1678
1682
  zyfaiRpcUrls;
1679
1683
  routingApiBaseUrl;
1684
+ referralSource;
1680
1685
  cachedSponsoredCallback = null;
1681
1686
  cachedWethSponsoredCallback = null;
1682
1687
  initializingAgentsPromise = null;
@@ -1684,6 +1689,7 @@ var OwneySDK = class {
1684
1689
  this.apiKey = config.apiKey;
1685
1690
  this.zyfaiRpcUrls = config.zyfaiRpcUrls;
1686
1691
  this.routingApiBaseUrl = config.routingApiBaseUrl;
1692
+ this.referralSource = config.referralSource;
1687
1693
  }
1688
1694
  /**
1689
1695
  * Establish connection state for all subsequent SDK calls.
@@ -1867,7 +1873,7 @@ var OwneySDK = class {
1867
1873
  }
1868
1874
  createAgent(agentId, key) {
1869
1875
  if (agentId === "zyfai") {
1870
- return new ZyfaiAgent(key, this.zyfaiRpcUrls);
1876
+ return new ZyfaiAgent(key, this.zyfaiRpcUrls, this.referralSource);
1871
1877
  }
1872
1878
  return null;
1873
1879
  }
package/dist/index.d.cts CHANGED
@@ -15,6 +15,12 @@ interface OwneySDKConfig {
15
15
  * e.g. "http://localhost:3000", when testing sponsor changes.
16
16
  */
17
17
  routingApiBaseUrl?: string;
18
+ /**
19
+ * Optional attribution tag forwarded to Zyfai's /auth/login when the SDK
20
+ * authenticates (e.g. "delos"). Replaces the equivalent option on
21
+ * `createOwneySIWX` for apps that don't use the AppKit SIWX modal.
22
+ */
23
+ referralSource?: string;
18
24
  }
19
25
  interface ConnectionState {
20
26
  provider: any;
@@ -313,6 +319,7 @@ declare class OwneySDK {
313
319
  private apiKey;
314
320
  private zyfaiRpcUrls?;
315
321
  private routingApiBaseUrl?;
322
+ private referralSource?;
316
323
  private cachedSponsoredCallback;
317
324
  private cachedWethSponsoredCallback;
318
325
  private initializingAgentsPromise;
package/dist/index.d.ts CHANGED
@@ -15,6 +15,12 @@ interface OwneySDKConfig {
15
15
  * e.g. "http://localhost:3000", when testing sponsor changes.
16
16
  */
17
17
  routingApiBaseUrl?: string;
18
+ /**
19
+ * Optional attribution tag forwarded to Zyfai's /auth/login when the SDK
20
+ * authenticates (e.g. "delos"). Replaces the equivalent option on
21
+ * `createOwneySIWX` for apps that don't use the AppKit SIWX modal.
22
+ */
23
+ referralSource?: string;
18
24
  }
19
25
  interface ConnectionState {
20
26
  provider: any;
@@ -313,6 +319,7 @@ declare class OwneySDK {
313
319
  private apiKey;
314
320
  private zyfaiRpcUrls?;
315
321
  private routingApiBaseUrl?;
322
+ private referralSource?;
316
323
  private cachedSponsoredCallback;
317
324
  private cachedWethSponsoredCallback;
318
325
  private initializingAgentsPromise;
package/dist/index.js CHANGED
@@ -677,11 +677,15 @@ var ZyfaiAgent = class {
677
677
  // successful decode is cached forever; failures are NOT cached so a transient
678
678
  // RPC error retries on the next fetch.
679
679
  withdrawAmountCache = /* @__PURE__ */ new Map();
680
- constructor(apiKey, rpcUrls) {
680
+ constructor(apiKey, rpcUrls, referralSource) {
681
681
  this.rpcUrls = rpcUrls ?? DEFAULT_ZYFAI_RPC_URLS;
682
682
  this.sdk = new ZyfaiSDK({
683
683
  apiKey,
684
- rpcUrls: this.rpcUrls
684
+ rpcUrls: this.rpcUrls,
685
+ // Forwarded to /auth/login by the SDK's own SIWE handshake, so
686
+ // attribution survives without the AppKit SIWX config (which carried it
687
+ // via `createOwneySIWX({ referralSource })` when apps used the modal).
688
+ referralSource
685
689
  });
686
690
  this.installAuthCache();
687
691
  }
@@ -1649,6 +1653,7 @@ var OwneySDK = class {
1649
1653
  apiKey;
1650
1654
  zyfaiRpcUrls;
1651
1655
  routingApiBaseUrl;
1656
+ referralSource;
1652
1657
  cachedSponsoredCallback = null;
1653
1658
  cachedWethSponsoredCallback = null;
1654
1659
  initializingAgentsPromise = null;
@@ -1656,6 +1661,7 @@ var OwneySDK = class {
1656
1661
  this.apiKey = config.apiKey;
1657
1662
  this.zyfaiRpcUrls = config.zyfaiRpcUrls;
1658
1663
  this.routingApiBaseUrl = config.routingApiBaseUrl;
1664
+ this.referralSource = config.referralSource;
1659
1665
  }
1660
1666
  /**
1661
1667
  * Establish connection state for all subsequent SDK calls.
@@ -1839,7 +1845,7 @@ var OwneySDK = class {
1839
1845
  }
1840
1846
  createAgent(agentId, key) {
1841
1847
  if (agentId === "zyfai") {
1842
- return new ZyfaiAgent(key, this.zyfaiRpcUrls);
1848
+ return new ZyfaiAgent(key, this.zyfaiRpcUrls, this.referralSource);
1843
1849
  }
1844
1850
  return null;
1845
1851
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@owney/sdk",
3
- "version": "0.6.7-beta.2",
3
+ "version": "0.6.7-beta.3",
4
4
  "type": "module",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.js",