Signing a payment request
We recommend that you use our helper to construct the required signatures as described in Generate signed data however, in case that is not possible, you can follow this guide to do it manually.
🦉
Sign a payment request
Open Recipe
The data you will need to construct your signature is as follows:
Property | Type | Description | Example |
---|---|---|---|
address | String | The user’s address that receives the token/NFT, will also act as a fallback address if a smart contract can't be executed. In case of fallback, we will transfer commodity_amount to this address. | 0x00000000000000000000000000000 00000000001 |
commodity | String | Cryptocurrency which should be sent to the smart contract see Supported coins and blockchains | commodity:'ETH' |
network | String | Network for the cryptocurrency, see Supported coins and blockchains | network: 'ethereum' |
commodity_amount | Number | Amount of cryptocurrency necessary for executing the given smart contract. Precision of 8 decimal places, please round up or you will get 9004 signature error code. | 0.03 (must be less than 8 decimal places) |
sc_address | String | The address of the smart contract. | 0x00000000000000000000000000000 00000000002 |
sc_input_data | String | Input data that will be used for the smart contract execution, in hex format. | 0x40c10f1900000000000000000000000 085f584812fc19c69e4dd586f06df93aa7 bdadd4d000000000000000000000000 000000000000000000000000016345 785d8a0000 |
The generated signature can be passed directly to the widget using the constant that was created. For example:
const wertWidget = new WertWidget({
...signature,
...otherWidgetOptions,
});
Updated 8 months ago