import GatewayUpdater from 'fincontracts-lib/src/fincontract-gateway-updater.js'
GatewayUpdater
GatewayUpdater updates Gateways contained inside Fincontract instance (see Fincontract.rootDescription). The actual traversal and update is done by GatewayVisitor.
Example:
import Fetcher from './fincontract-fetcher';
import GatewayUpdater from './fincontract-gateway-updater';
try {
const fctID = '<32-byte address of blockchain deployed Fincontract>'
const gu = new GatewayUpdater(web3, gateway);
const fetcher = new Fetcher(marketplace);
const f = await fetcher.pullFincontract(fctID);
await gu.updateAllGateways(f.rootDescription);
} catch (err) {
console.log(err);
}
Constructor Summary
Public Constructor | ||
public |
constructor(web3: Web3, gateway: Gateway) Constructs the GatewayUpdater object with a web3 instance connected to an Ethereum node and a Gateway smart contract instance not connected to any address |
Method Summary
Public Methods | ||
public |
updateAllGateways(node: FincNode): Promise<null, Error> |
Public Constructors
public constructor(web3: Web3, gateway: Gateway) source
Constructs the GatewayUpdater object with a web3 instance connected to an Ethereum node and a Gateway smart contract instance not connected to any address