-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add utilities function to near lake framework
- Loading branch information
Himitsuko
committed
Nov 30, 2022
1 parent
d0b54b9
commit 6141582
Showing
2 changed files
with
50 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,24 @@ | ||
package types | ||
|
||
type TransactionAction string | ||
|
||
const ( | ||
FunctionCallAction = "FunctionCall" | ||
TransferAction = "Transfer" | ||
) | ||
|
||
type SignedTransactionView struct { | ||
SignerId string `json:"signer_id"` | ||
PublicKey string `json:"public_key"` | ||
Nonce uint64 `json:"nonce"` | ||
ReceiverId string `json:"receiver_id"` | ||
Actions []map[string]interface{} `json:"actions"` | ||
Signature string `json:"signature"` | ||
Hash string `json:"hash"` | ||
SignerId string `json:"signer_id"` | ||
PublicKey string `json:"public_key"` | ||
Nonce uint64 `json:"nonce"` | ||
ReceiverId string `json:"receiver_id"` | ||
Actions []interface{} `json:"actions"` | ||
Signature string `json:"signature"` | ||
Hash string `json:"hash"` | ||
} | ||
|
||
func (s SignedTransactionView) LoopActions(f func(interface{})) { | ||
for _, action := range s.Actions { | ||
f(action) | ||
} | ||
} |