@notifi-network/fusion-sdk 0.0.6 → 0.0.8
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,5 +1,4 @@
|
|
|
1
1
|
import { EthCallRequest, EthCallResponse, GetAccountBalanceRequest, GetAccountBalanceResponse, BcmGetSuiAccountBalanceRequest, BcmGetSuiAccountBalanceResponse, BcmRunSuiTransactionCallRequest, BcmRunSuiTransactionCallResponse, BcmGetSuiObjectRequest, BcmGetSuiObjectResponse, BcmGetSolanaBalanceRequest, BcmGetSolanaBalanceResponse, BcmGetSolanaAccountInfoRequest, BcmGetSolanaAccountInfoResponse, BcmGetSolanaSlotRequest, BcmGetSolanaSlotResponse } from "../protos_gen/services/blockchain_manager/v1/blockchain_manager.js";
|
|
2
|
-
import { BlockchainType } from "../protos_gen/notifi/common/v1/types.js";
|
|
3
2
|
/**
|
|
4
3
|
* Class for interacting with the Fusion EVM RPC service.
|
|
5
4
|
* Provides methods to perform Ethereum-specific blockchain operations.
|
|
@@ -7,10 +6,6 @@ import { BlockchainType } from "../protos_gen/notifi/common/v1/types.js";
|
|
|
7
6
|
export declare class FusionEvmRpcWrapper {
|
|
8
7
|
private client;
|
|
9
8
|
private contextId;
|
|
10
|
-
/**
|
|
11
|
-
* Expose BlockchainType enum for external usage.
|
|
12
|
-
*/
|
|
13
|
-
static BlockchainType: typeof BlockchainType;
|
|
14
9
|
/**
|
|
15
10
|
* Creates an instance of FusionEvmRpc.
|
|
16
11
|
* @param contextId - The context ID for the gRPC requests.
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { FusionEvmRpcClient, FusionSuiRpcClient, FusionSolanaRpcClient } from "../protos_gen/services/blockchain_manager/v1/blockchain_manager.js";
|
|
2
2
|
import { Metadata, credentials } from "@grpc/grpc-js";
|
|
3
|
-
import { BlockchainType } from "../protos_gen/notifi/common/v1/types.js";
|
|
4
3
|
const DEFAULT_EVM_ADDRESS = process.env.EVM_RPC_ADDRESS || "localhost:50054";
|
|
5
4
|
const DEFAULT_SOLANA_ADDRESS = process.env.SOLANA_RPC_ADDRESS || "localhost:50055";
|
|
6
5
|
const DEFAULT_SUI_ADDRESS = process.env.SUI_RPC_ADDRESS || "localhost:50057";
|
|
@@ -11,10 +10,6 @@ const DEFAULT_SUI_ADDRESS = process.env.SUI_RPC_ADDRESS || "localhost:50057";
|
|
|
11
10
|
export class FusionEvmRpcWrapper {
|
|
12
11
|
client;
|
|
13
12
|
contextId;
|
|
14
|
-
/**
|
|
15
|
-
* Expose BlockchainType enum for external usage.
|
|
16
|
-
*/
|
|
17
|
-
static BlockchainType = BlockchainType;
|
|
18
13
|
/**
|
|
19
14
|
* Creates an instance of FusionEvmRpc.
|
|
20
15
|
* @param contextId - The context ID for the gRPC requests.
|
|
@@ -23,7 +18,7 @@ export class FusionEvmRpcWrapper {
|
|
|
23
18
|
this.contextId = contextId;
|
|
24
19
|
// Only use insecure connection for local development
|
|
25
20
|
// 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());
|
|
21
|
+
this.client = new FusionEvmRpcClient(DEFAULT_EVM_ADDRESS, DEFAULT_EVM_ADDRESS.startsWith("localhost") || process.env.GRPC_INSECURE === "true" ? credentials.createInsecure() : credentials.createSsl());
|
|
27
22
|
}
|
|
28
23
|
/**
|
|
29
24
|
* Executes an Ethereum call operation.
|
|
@@ -75,7 +70,7 @@ export class FusionSuiRpcWrapper {
|
|
|
75
70
|
*/
|
|
76
71
|
constructor(contextId) {
|
|
77
72
|
this.contextId = contextId;
|
|
78
|
-
this.client = new FusionSuiRpcClient(DEFAULT_SUI_ADDRESS, DEFAULT_SUI_ADDRESS.startsWith("localhost") ? credentials.createInsecure() : credentials.createSsl());
|
|
73
|
+
this.client = new FusionSuiRpcClient(DEFAULT_SUI_ADDRESS, DEFAULT_SUI_ADDRESS.startsWith("localhost") || process.env.GRPC_INSECURE === "true" ? credentials.createInsecure() : credentials.createSsl());
|
|
79
74
|
}
|
|
80
75
|
/**
|
|
81
76
|
* Retrieves the account balance for a Sui address.
|
|
@@ -145,7 +140,7 @@ export class FusionSolanaRpcWrapper {
|
|
|
145
140
|
*/
|
|
146
141
|
constructor(contextId) {
|
|
147
142
|
this.contextId = contextId;
|
|
148
|
-
this.client = new FusionSolanaRpcClient(DEFAULT_SOLANA_ADDRESS, DEFAULT_SOLANA_ADDRESS.startsWith("localhost") ? credentials.createInsecure() : credentials.createSsl());
|
|
143
|
+
this.client = new FusionSolanaRpcClient(DEFAULT_SOLANA_ADDRESS, DEFAULT_SOLANA_ADDRESS.startsWith("localhost") || process.env.GRPC_INSECURE === "true" ? credentials.createInsecure() : credentials.createSsl());
|
|
149
144
|
}
|
|
150
145
|
/**
|
|
151
146
|
* 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.
|
|
3
|
+
"version": "0.0.8",
|
|
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",
|