UNPKG

@gear-js/api

Version:

A JavaScript library that provides functionality to connect GEAR Component APIs.

28 lines (25 loc) 850 B
'use strict'; /** * Transaction building utilities for Gear-Ethereum bridge operations. * * This class provides methods to create extrinsics for bridge transactions * that can be signed and submitted to the network. */ class GearEthBridgeTransactions { _api; constructor(_api) { this._api = _api; } /** * Extrinsic that inserts message in a bridging queue, * updating queue merkle root at the end of the block. * * @param destination - The Ethereum address to send the message to * @param payload - The message payload data * @returns A submittable extrinsic that can be signed and sent */ sendEthMessage(destination, payload) { return this._api.tx.gearEthBridge.sendEthMessage(destination, payload); } } exports.GearEthBridgeTransactions = GearEthBridgeTransactions;