/
types.go
122 lines (114 loc) · 8.7 KB
/
types.go
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
package tx
import "math/big"
// Transaction struct
type Transaction struct {
id []byte // A SHA2-256 hash of the signature
lastTx string // The ID of the last transaction made from the account. If no previous transactions have been made from the address this field is set to an empty string.
owner *big.Int // The modulus of the RSA key pair corresponding to the wallet making the transaction
target string // If making a financial transaction this field contains the wallet address of the recipient base64url encoded. If the transaction is not a financial this field is set to an empty string.
quantity string // If making a financial transaction this field contains the amount in Winston to be sent to the receiving wallet. If the transaction is not financial this field is set to the string "0". 1 AR = 1000000000000 (1e+12) Winston
data []byte // If making an archiving transaction this field contains the data to be archived base64url encoded. If the transaction is not archival this field is set to an empty string.
reward string // This field contains the mining reward for the transaction in Winston.
tags []Tag // Transaction tags
signature []byte // Signature using the RSA-PSS signature scheme using SHA256 as the MGF1 masking algorithm
}
// Transaction struct
type TransactionV2 struct {
id []byte // A SHA2-256 hash of the signature
lastTx string // The ID of the last transaction made from the account. If no previous transactions have been made from the address this field is set to an empty string.
owner *big.Int // The modulus of the RSA key pair corresponding to the wallet making the transaction
target string // If making a financial transaction this field contains the wallet address of the recipient base64url encoded. If the transaction is not a financial this field is set to an empty string.
quantity string // If making a financial transaction this field contains the amount in Winston to be sent to the receiving wallet. If the transaction is not financial this field is set to the string "0". 1 AR = 1000000000000 (1e+12) Winston
data []byte // If making an archiving transaction this field contains the data to be archived base64url encoded. If the transaction is not archival this field is set to an empty string.
reward string // This field contains the mining reward for the transaction in Winston.
tags []Tag // Transaction tags
signature []byte // Signature using the RSA-PSS signature scheme using SHA256 as the MGF1 masking algorithm
format int
dataSize string
dataRoot string
dataTree []interface{}
}
// Transaction struct
type TransactionNew struct {
id []byte // A SHA2-256 hash of the signature
lastTx string // The ID of the last transaction made from the account. If no previous transactions have been made from the address this field is set to an empty string.
owner *big.Int // The modulus of the RSA key pair corresponding to the wallet making the transaction
target string // If making a financial transaction this field contains the wallet address of the recipient base64url encoded. If the transaction is not a financial this field is set to an empty string.
quantity string // If making a financial transaction this field contains the amount in Winston to be sent to the receiving wallet. If the transaction is not financial this field is set to the string "0". 1 AR = 1000000000000 (1e+12) Winston
data []byte // If making an archiving transaction this field contains the data to be archived base64url encoded. If the transaction is not archival this field is set to an empty string.
reward string // This field contains the mining reward for the transaction in Winston.
transType string
signature []byte // Signature using the RSA-PSS signature scheme using SHA256 as the MGF1 masking algorithm
}
// Transaction encoded transaction to send to the arweave client
type transactionJSON struct {
// Id A SHA2-256 hash of the signature, based 64 URL encoded.
ID string `json:"id"`
// LastTx represents the ID of the last transaction made from the same address base64url encoded. If no previous transactions have been made from the address this field is set to an empty string.
LastTx string `json:"last_tx"`
//Owner is the modulus of the RSA key pair corresponding to the wallet making the transaction, base64url encoded.
Owner string `json:"owner"`
// Target if making a financial transaction this field contains the wallet address of the recipient base64url encoded. If the transaction is not a financial this field is set to an empty string.
Target string `json:"target"`
// Quantity If making a financial transaction this field contains the amount in Winston to be sent to the receiving wallet. If the transaction is not financial this field is set to the string "0". 1 AR = 1000000000000 (1e+12) Winston
Quantity string `json:"quantity"`
// Data If making an archiving transaction this field contains the data to be archived base64url encoded. If the transaction is not archival this field is set to an empty string.
Data string `json:"data"`
// Reward This field contains the mining reward for the transaction in Winston.
Reward string `json:"reward"`
// Signature using the RSA-PSS signature scheme using SHA256 as the MGF1 masking algorithm
Signature string `json:"signature"`
// Tags Transaction tags
Tags []Tag `json:"tags"`
}
// Transaction encoded transaction to send to the arweave client
type transactionV2JSON struct {
Format int `json:"format"`
// Id A SHA2-256 hash of the signature, based 64 URL encoded.
ID string `json:"id"`
// LastTx represents the ID of the last transaction made from the same address base64url encoded. If no previous transactions have been made from the address this field is set to an empty string.
LastTx string `json:"last_tx"`
//Owner is the modulus of the RSA key pair corresponding to the wallet making the transaction, base64url encoded.
Owner string `json:"owner"`
// Target if making a financial transaction this field contains the wallet address of the recipient base64url encoded. If the transaction is not a financial this field is set to an empty string.
Target string `json:"target"`
// Quantity If making a financial transaction this field contains the amount in Winston to be sent to the receiving wallet. If the transaction is not financial this field is set to the string "0". 1 AR = 1000000000000 (1e+12) Winston
Quantity string `json:"quantity"`
// Data If making an archiving transaction this field contains the data to be archived base64url encoded. If the transaction is not archival this field is set to an empty string.
Data string `json:"data"`
// Reward This field contains the mining reward for the transaction in Winston.
Reward string `json:"reward"`
// Signature using the RSA-PSS signature scheme using SHA256 as the MGF1 masking algorithm
Signature string `json:"signature"`
// Tags Transaction tags
Tags []Tag `json:"tags"`
DataSize string `json:"data_size"`
DataRoot string `json:"data_root"`
DataTree []interface{} `json:"data_tree"`
}
// Tag contains any tags the user wants to add to the transaction
type Tag struct {
Name string `json:"name"`
Value string `json:"value"`
}
// Transaction encoded transaction to send to the arweave client
type transactionNewJSON struct {
// Id A SHA2-256 hash of the signature, based 64 URL encoded.
ID string `json:"id"`
// LastTx represents the ID of the last transaction made from the same address base64url encoded. If no previous transactions have been made from the address this field is set to an empty string.
LastTx string `json:"last_tx"`
//Owner is the modulus of the RSA key pair corresponding to the wallet making the transaction, base64url encoded.
Owner string `json:"owner"`
// Target if making a financial transaction this field contains the wallet address of the recipient base64url encoded. If the transaction is not a financial this field is set to an empty string.
Target string `json:"target"`
// Quantity If making a financial transaction this field contains the amount in Winston to be sent to the receiving wallet. If the transaction is not financial this field is set to the string "0". 1 AR = 1000000000000 (1e+12) Winston
Quantity string `json:"quantity"`
// Data If making an archiving transaction this field contains the data to be archived base64url encoded. If the transaction is not archival this field is set to an empty string.
Data string `json:"data"`
// Reward This field contains the mining reward for the transaction in Winston.
Reward string `json:"reward"`
// Signature using the RSA-PSS signature scheme using SHA256 as the MGF1 masking algorithm
Signature string `json:"signature"`
// Tags Transaction tags
Type string `json:"type"`
}