@goequitize/rwa-token-sdk
Version:
SDK for creating and managing RWA token transactions with compliance features
48 lines (47 loc) • 1.38 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.EquitizeSDK = void 0;
const ethers_1 = require("ethers");
const token_1 = require("./modules/token");
/**
* Main SDK class for interacting with blockchain
*/
class EquitizeSDK {
/**
* Create a new instance of the SDK
* @param config The SDK configuration options
*/
constructor(config) {
this.provider = new ethers_1.ethers.JsonRpcProvider(config.rpcUrl);
this.chainId = config.chainId;
this.apiKey = config.apiKey;
// Initialize modules
this.token = new token_1.TokenModule(this.provider, this.chainId);
}
/**
* Get the current provider instance
* @returns The JsonRpcProvider instance
*/
getProvider() {
return this.provider;
}
/**
* Get the configured chain ID
* @returns The chain ID
*/
getChainId() {
return this.chainId;
}
/**
* Change the network provider
* @param rpcUrl New JSON-RPC URL
* @param chainId New chain ID
*/
setNetwork(rpcUrl, chainId) {
this.provider = new ethers_1.ethers.JsonRpcProvider(rpcUrl);
this.chainId = chainId;
// Reinitialize modules with new provider
this.token = new token_1.TokenModule(this.provider, this.chainId);
}
}
exports.EquitizeSDK = EquitizeSDK;