@notifi-network/fusion-sdk 0.0.6 → 0.0.7

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.
@@ -23,7 +23,7 @@ export class FusionEvmRpcWrapper {
23
23
  this.contextId = contextId;
24
24
  // Only use insecure connection for local development
25
25
  // Check DEFAULT_EVM_ADDRESS if it contains "localhost", and if so, use insecure connection
26
- this.client = new FusionEvmRpcClient(DEFAULT_EVM_ADDRESS, DEFAULT_EVM_ADDRESS.startsWith("localhost") ? credentials.createInsecure() : credentials.createSsl());
26
+ this.client = new FusionEvmRpcClient(DEFAULT_EVM_ADDRESS, DEFAULT_EVM_ADDRESS.startsWith("localhost") || process.env.GRPC_INSECURE === "true" ? credentials.createInsecure() : credentials.createSsl());
27
27
  }
28
28
  /**
29
29
  * Executes an Ethereum call operation.
@@ -75,7 +75,7 @@ export class FusionSuiRpcWrapper {
75
75
  */
76
76
  constructor(contextId) {
77
77
  this.contextId = contextId;
78
- this.client = new FusionSuiRpcClient(DEFAULT_SUI_ADDRESS, DEFAULT_SUI_ADDRESS.startsWith("localhost") ? credentials.createInsecure() : credentials.createSsl());
78
+ this.client = new FusionSuiRpcClient(DEFAULT_SUI_ADDRESS, DEFAULT_SUI_ADDRESS.startsWith("localhost") || process.env.GRPC_INSECURE === "true" ? credentials.createInsecure() : credentials.createSsl());
79
79
  }
80
80
  /**
81
81
  * Retrieves the account balance for a Sui address.
@@ -145,7 +145,7 @@ export class FusionSolanaRpcWrapper {
145
145
  */
146
146
  constructor(contextId) {
147
147
  this.contextId = contextId;
148
- this.client = new FusionSolanaRpcClient(DEFAULT_SOLANA_ADDRESS, DEFAULT_SOLANA_ADDRESS.startsWith("localhost") ? credentials.createInsecure() : credentials.createSsl());
148
+ this.client = new FusionSolanaRpcClient(DEFAULT_SOLANA_ADDRESS, DEFAULT_SOLANA_ADDRESS.startsWith("localhost") || process.env.GRPC_INSECURE === "true" ? credentials.createInsecure() : credentials.createSsl());
149
149
  }
150
150
  /**
151
151
  * Retrieves the balance for a Solana address.
@@ -14,7 +14,7 @@ export class FetchProxyWrapper {
14
14
  constructor(contextId) {
15
15
  this.contextId = contextId;
16
16
  const address = process.env.FUSION_FETCH_PROXY_ADDRESS || "localhost:50051";
17
- this.client = new FusionFetchProxyClient(address, address.startsWith("localhost") ? credentials.createInsecure() : credentials.createSsl());
17
+ this.client = new FusionFetchProxyClient(address, address.startsWith("localhost") || process.env.GRPC_INSECURE === "true" ? credentials.createInsecure() : credentials.createSsl());
18
18
  }
19
19
  /**
20
20
  * Performs an HTTP request using the Fetch Proxy service.
@@ -15,7 +15,7 @@ export class PersistentStorageWrapper {
15
15
  */
16
16
  constructor(contextId) {
17
17
  this.contextId = contextId;
18
- this.client = new FusionPersistentStorageClient(DEFAULT_PERSISTENT_STORAGE_ADDRESS, DEFAULT_PERSISTENT_STORAGE_ADDRESS.startsWith("localhost") ? credentials.createInsecure() : credentials.createSsl());
18
+ this.client = new FusionPersistentStorageClient(DEFAULT_PERSISTENT_STORAGE_ADDRESS, DEFAULT_PERSISTENT_STORAGE_ADDRESS.startsWith("localhost") || process.env.GRPC_INSECURE === "true" ? credentials.createInsecure() : credentials.createSsl());
19
19
  }
20
20
  /**
21
21
  * Stores a string value in persistent storage.
@@ -85,7 +85,7 @@ export class EphemeralStorageWrapper {
85
85
  */
86
86
  constructor(contextId) {
87
87
  this.contextId = contextId;
88
- this.client = new FusionEphemeralStorageClient(DEFAULT_EPHEMERAL_STORAGE_ADDRESS, DEFAULT_EPHEMERAL_STORAGE_ADDRESS.startsWith("localhost") ? credentials.createInsecure() : credentials.createSsl());
88
+ this.client = new FusionEphemeralStorageClient(DEFAULT_EPHEMERAL_STORAGE_ADDRESS, DEFAULT_EPHEMERAL_STORAGE_ADDRESS.startsWith("localhost") || process.env.GRPC_INSECURE === "true" ? credentials.createInsecure() : credentials.createSsl());
89
89
  }
90
90
  /**
91
91
  * Stores a string value in ephemeral storage.
@@ -16,7 +16,7 @@ export class SubscriptionsWrapper {
16
16
  */
17
17
  constructor(contextId) {
18
18
  this.contextId = contextId;
19
- this.client = new FusionSubscriptionsClient(DEFAULT_ADDRESS, DEFAULT_ADDRESS.startsWith("localhost") ? credentials.createInsecure() : credentials.createSsl());
19
+ this.client = new FusionSubscriptionsClient(DEFAULT_ADDRESS, DEFAULT_ADDRESS.startsWith("localhost") || process.env.GRPC_INSECURE === "true" ? credentials.createInsecure() : credentials.createSsl());
20
20
  }
21
21
  /**
22
22
  * Retrieves subscription data.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@notifi-network/fusion-sdk",
3
- "version": "0.0.6",
3
+ "version": "0.0.7",
4
4
  "description": "SDK utils for Notifi Fusion parser development. This includes types and helpers for accessing ephemeral/persistent storage, RPCs for different chains, and other utilities.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",