Configure Custom Giver
/**
* Object that can be used to send some value to an address
*/
export type AccountGiver = (address: string, value: number) => Promise<void>;// Address of the Giver
const giverAddress = "0:ece57bcc6c530283becbbd8a3b24d3c5987cdddc3c8b7b33be6e4a6312490415";
// Keypair for the Giver
const giverKeys = signerKeys({
public: "2ada2e65ab8eeab09490e3521415f45b6e42df9c760a639bcf53957550b25a16",
secret: "172af540e43a524763dd53b26a066d472a97c4de37d5498170564510608250c3",
});
const giverContract = {
abi: {
"ABI version": 2,
header: ["time", "expire"],
functions: [
{
name: "sendTransaction",
inputs: [
{
"name": "dest",
"type": "address",
},
{
"name": "value",
"type": "uint128",
},
{
"name": "bounce",
"type": "bool",
},
],
outputs: [],
},
{
name: "getMessages",
inputs: [],
outputs: [
{
components: [
{
name: "hash",
type: "uint256",
},
{
name: "expireAt",
type: "uint64",
},
],
name: "messages",
type: "tuple[]",
},
],
},
{
name: "upgrade",
inputs: [
{
name: "newcode",
type: "cell",
},
],
outputs: [],
},
{
name: "constructor",
inputs: [],
outputs: [],
},
],
data: [],
events: [],
},
};Usage examples:
Example 1. Contract deployment
Example 2. Sending some funds from the Giver to a random address
Last updated