@notifi-network/fusion-sdk 0.0.4 → 0.0.5
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.
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { FusionPersistentStorageClient, FusionEphemeralStorageClient } from "../protos_gen/services/storage_manager/v1/storage_manager.js";
|
|
2
2
|
import { Metadata, credentials } from "@grpc/grpc-js";
|
|
3
|
-
const
|
|
3
|
+
const DEFAULT_EPHEMERAL_STORAGE_ADDRESS = process.env.EPHEMERAL_STORAGE_ADDRESS || "localhost:50052";
|
|
4
|
+
const DEFAULT_PERSISTENT_STORAGE_ADDRESS = process.env.PERSISTENT_STORAGE_ADDRESS || "localhost:50053";
|
|
4
5
|
/**
|
|
5
6
|
* Class for interacting with the Fusion Persistent Storage service.
|
|
6
7
|
* Provides methods to perform CRUD operations on persistent storage.
|
|
@@ -14,7 +15,7 @@ export class PersistentStorageWrapper {
|
|
|
14
15
|
*/
|
|
15
16
|
constructor(contextId) {
|
|
16
17
|
this.contextId = contextId;
|
|
17
|
-
this.client = new FusionPersistentStorageClient(
|
|
18
|
+
this.client = new FusionPersistentStorageClient(DEFAULT_PERSISTENT_STORAGE_ADDRESS, DEFAULT_PERSISTENT_STORAGE_ADDRESS.startsWith("localhost") ? credentials.createInsecure() : credentials.createSsl());
|
|
18
19
|
}
|
|
19
20
|
/**
|
|
20
21
|
* Stores a string value in persistent storage.
|
|
@@ -84,7 +85,7 @@ export class EphemeralStorageWrapper {
|
|
|
84
85
|
*/
|
|
85
86
|
constructor(contextId) {
|
|
86
87
|
this.contextId = contextId;
|
|
87
|
-
this.client = new FusionEphemeralStorageClient(
|
|
88
|
+
this.client = new FusionEphemeralStorageClient(DEFAULT_EPHEMERAL_STORAGE_ADDRESS, DEFAULT_EPHEMERAL_STORAGE_ADDRESS.startsWith("localhost") ? credentials.createInsecure() : credentials.createSsl());
|
|
88
89
|
}
|
|
89
90
|
/**
|
|
90
91
|
* Stores a string value in ephemeral storage.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FusionSubscriptionsClient } from "../protos_gen/services/subscription_manager/v1/subscription_manager.js";
|
|
2
2
|
import { Metadata, credentials } from "@grpc/grpc-js";
|
|
3
|
-
const DEFAULT_ADDRESS = process.env.SUBSCRIPTION_MANAGER_ADDRESS || "localhost:
|
|
3
|
+
const DEFAULT_ADDRESS = process.env.SUBSCRIPTION_MANAGER_ADDRESS || "localhost:50056";
|
|
4
4
|
/**
|
|
5
5
|
* Class for interacting with the Fusion Subscriptions service.
|
|
6
6
|
* Provides methods to manage and retrieve subscription data.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@notifi-network/fusion-sdk",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.5",
|
|
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",
|