JavaScript
Send EVM TX
When you would like to use the SDK to perform an EVM operation, you must first create a transaction object. The different classes of the SDK: DID, RBAC, and Storage all show how an EVM tx is generated.
After receiving an EVM Transaction object back from the class you called, you are then able to use the SDK to send a transaction on behalf of the seed.
sendEvmTx(tx, baseUrl, seed)
Parameter | Type | EVM | Substrate | Description |
---|---|---|---|---|
tx | EvmTransaction | Required | N/A | EVM compatible transaction object returned from specific SDK method. Used to execute the corresponding peaq function. Gives the user the option to manually send the tx using ethers.js, web.js, or to use the sendEvmTx() in the peaq SDK to perform the operation. |
baseUrl | string | Required | N/A | RPC url used to connect to the blockchain. Reference Connecting to peaq for supported RPC urls. |
seed | string | Required | N/A | Ethereum private key linked to the wallet executing the transactions. Allows the backend to perform write transactions on behalf of the user. |