@zyfai/sdk 0.2.15 → 0.2.16
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.d.mts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +4 -2
- package/dist/index.mjs +4 -2
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -14,6 +14,7 @@ interface RpcUrlsConfig {
|
|
|
14
14
|
interface SDKConfig {
|
|
15
15
|
apiKey: string;
|
|
16
16
|
rpcUrls?: RpcUrlsConfig;
|
|
17
|
+
referralSource?: string;
|
|
17
18
|
}
|
|
18
19
|
interface DeploySafeResponse {
|
|
19
20
|
success: boolean;
|
|
@@ -531,6 +532,7 @@ declare class ZyfaiSDK {
|
|
|
531
532
|
private currentProvider;
|
|
532
533
|
private currentChainId;
|
|
533
534
|
private rpcUrls?;
|
|
535
|
+
private referralSource?;
|
|
534
536
|
constructor(config: SDKConfig | string);
|
|
535
537
|
/**
|
|
536
538
|
* Authenticate user with SIWE (Sign-In with Ethereum) & JWT token
|
package/dist/index.d.ts
CHANGED
|
@@ -14,6 +14,7 @@ interface RpcUrlsConfig {
|
|
|
14
14
|
interface SDKConfig {
|
|
15
15
|
apiKey: string;
|
|
16
16
|
rpcUrls?: RpcUrlsConfig;
|
|
17
|
+
referralSource?: string;
|
|
17
18
|
}
|
|
18
19
|
interface DeploySafeResponse {
|
|
19
20
|
success: boolean;
|
|
@@ -531,6 +532,7 @@ declare class ZyfaiSDK {
|
|
|
531
532
|
private currentProvider;
|
|
532
533
|
private currentChainId;
|
|
533
534
|
private rpcUrls?;
|
|
535
|
+
private referralSource?;
|
|
534
536
|
constructor(config: SDKConfig | string);
|
|
535
537
|
/**
|
|
536
538
|
* Authenticate user with SIWE (Sign-In with Ethereum) & JWT token
|
package/dist/index.js
CHANGED
|
@@ -685,12 +685,13 @@ var _ZyfaiSDK = class _ZyfaiSDK {
|
|
|
685
685
|
this.currentProvider = null;
|
|
686
686
|
this.currentChainId = null;
|
|
687
687
|
const sdkConfig = typeof config === "string" ? { apiKey: config } : config;
|
|
688
|
-
const { apiKey, rpcUrls } = sdkConfig;
|
|
688
|
+
const { apiKey, rpcUrls, referralSource } = sdkConfig;
|
|
689
689
|
if (!apiKey) {
|
|
690
690
|
throw new Error("API key is required");
|
|
691
691
|
}
|
|
692
692
|
this.httpClient = new HttpClient(apiKey);
|
|
693
693
|
this.rpcUrls = rpcUrls;
|
|
694
|
+
this.referralSource = referralSource;
|
|
694
695
|
}
|
|
695
696
|
/**
|
|
696
697
|
* Authenticate user with SIWE (Sign-In with Ethereum) & JWT token
|
|
@@ -738,7 +739,8 @@ var _ZyfaiSDK = class _ZyfaiSDK {
|
|
|
738
739
|
ENDPOINTS.AUTH_LOGIN,
|
|
739
740
|
{
|
|
740
741
|
message: messageObj,
|
|
741
|
-
signature
|
|
742
|
+
signature,
|
|
743
|
+
referralSource: this.referralSource
|
|
742
744
|
},
|
|
743
745
|
// Set Origin header in Node.js to match message.uri (required by backend validation)
|
|
744
746
|
isNodeJs ? {
|
package/dist/index.mjs
CHANGED
|
@@ -663,12 +663,13 @@ var _ZyfaiSDK = class _ZyfaiSDK {
|
|
|
663
663
|
this.currentProvider = null;
|
|
664
664
|
this.currentChainId = null;
|
|
665
665
|
const sdkConfig = typeof config === "string" ? { apiKey: config } : config;
|
|
666
|
-
const { apiKey, rpcUrls } = sdkConfig;
|
|
666
|
+
const { apiKey, rpcUrls, referralSource } = sdkConfig;
|
|
667
667
|
if (!apiKey) {
|
|
668
668
|
throw new Error("API key is required");
|
|
669
669
|
}
|
|
670
670
|
this.httpClient = new HttpClient(apiKey);
|
|
671
671
|
this.rpcUrls = rpcUrls;
|
|
672
|
+
this.referralSource = referralSource;
|
|
672
673
|
}
|
|
673
674
|
/**
|
|
674
675
|
* Authenticate user with SIWE (Sign-In with Ethereum) & JWT token
|
|
@@ -716,7 +717,8 @@ var _ZyfaiSDK = class _ZyfaiSDK {
|
|
|
716
717
|
ENDPOINTS.AUTH_LOGIN,
|
|
717
718
|
{
|
|
718
719
|
message: messageObj,
|
|
719
|
-
signature
|
|
720
|
+
signature,
|
|
721
|
+
referralSource: this.referralSource
|
|
720
722
|
},
|
|
721
723
|
// Set Origin header in Node.js to match message.uri (required by backend validation)
|
|
722
724
|
isNodeJs ? {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zyfai/sdk",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.16",
|
|
4
4
|
"description": "TypeScript SDK for Zyfai Yield Optimization Engine - Deploy Safe smart wallets, manage session keys, and interact with DeFi protocols",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|