WertWidget Smart Contract Signing Helper
Installation
npm i @wert-io/widget-sc-signer
or
yarn add @wert-io/widget-sc-signer
Usage
const { signSmartContractData } = require('@wert-io/widget-sc-signer');
or
import { signSmartContractData } from '@wert-io/widget-sc-signer';
const signedData = signSmartContractData(options, privateKey);
Function signSmartContractData returns the given options object with an addition of a "signature" property. You can pass the result directly to WertWidget initializer:
const wertWidget = new WertWidget({
...signedData,
...otherWidgetOptions,
});
Options
Property | Required | Type | Description |
---|---|---|---|
address | required | String | User’s address that will act as a fallback address if a smart contract can't be executed. In case of fallback, Wert will transfer commodity_amount to this address |
commodity | required | String | List of supported currencies |
network | optional | String | List of supported currencies |
commodity_amount | required | Number | An amount of crypto necessary for executing the given smart contract |
sc_address | required | String | The address of the smart contract |
sc_input_data | required | String | Data that will be used for smart contract execution, in the hex format |
Private key
Was given to you during your registration in the Wert system as a partner. If you don't have one, contact us.