-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdiagram.json
96 lines (96 loc) · 2.8 KB
/
diagram.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
{
"sendEther": [
{
"functionName": "Connect to an Ethereum client",
"functionCall": "ethclient.Dial",
"arguments": [
"http://localhost:8545"
],
"return": "client",
"errorHandling": "log.Fatal"
},
{
"functionName": "Get the private key for the sender",
"functionCall": "crypto.HexToECDSA",
"arguments": [
"7275b963ffc4603c02d3481ed99755b82a26702c0a90a3408ac02c12c082ddb7"
],
"return": "privateKey",
"errorHandling": "log.Fatal"
},
{
"functionName": "Get the recipient's address",
"functionCall": "common.HexToAddress",
"arguments": [
"0xD92373D4BB00e93FaF91fD127492763d289e9487"
],
"return": "toAddress"
},
{
"functionName": "Get the suggested gas price",
"functionCall": "client.SuggestGasPrice",
"arguments": [],
"return": "gasPrice",
"errorHandling": "log.Fatal"
},
{
"functionName": "Get the nonce for the sender",
"functionCall": "client.PendingNonceAt",
"arguments": [
"fromAddress"
],
"return": "nonce",
"errorHandling": "return err"
},
{
"functionName": "Create the transaction",
"functionCall": "types.NewTransaction",
"arguments": [
"nonce",
"toAddress",
"value",
"gasLimit",
"gasPrice",
null
],
"return": "tx"
},
{
"functionName": "Get the chain ID",
"functionCall": "new(big.Int).SetInt64",
"arguments": [
1337
],
"return": "chainID"
},
{
"functionName": "Sign the transaction",
"functionCall": "types.SignTx",
"arguments": [
"tx",
"types.NewEIP155Signer(chainID)",
"privateKey"
],
"return": "signedTx",
"errorHandling": "return err"
},
{
"functionName": "Send the transaction",
"functionCall": "client.SendTransaction",
"arguments": [
"signedTx"
],
"return": null,
"errorHandling": "return err"
},
{
"functionName": "Print the transaction hash",
"functionCall": "fmt.Printf",
"arguments": [
"Transaction hash: 0x%x\n",
"signedTx.Hash()"
],
"return": null
}
]
}