I'm not totally familiar with what is absolutely required. Hence I recommend looking at components like SendToAddress.js to find out.
type === "trade" => It's a Planet A "trade" transaction
const testReceipt = {
to: "0x901442E4dEeC484E9B2EFDb2bA20FCb19880D9A3",
from: "0x51Ff1fab76079d20418d1c74DA65653FfE3fD0aa",
type: "trade",
profit: 20, // in USD/USG
emission: 25 // in tons of CO2
}
this.setReceipt(testReceipt);
this.changeView("receipt");
type === "lock" => It's a Planet A "plant a tree" transaction
Documentation
It's very simple my dude. The property
type
on a receipt determines which receipt view is shown to the user. There's threetype
s.type === error
=> Something went wrongNote that we broke compatibility with the old way of displaying receipts!
no
type
in the receipt object => It's a normal Ethereum value transaction (ETH, ERC20, ERC721)Austin then always passes these parameters:
I'm not totally familiar with what is absolutely required. Hence I recommend looking at components like SendToAddress.js to find out.
type === "trade"
=> It's a Planet A "trade" transactiontype === "lock"
=> It's a Planet A "plant a tree" transaction[TODO]