-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rpcv05 implement broadcast txn types
- Loading branch information
1 parent
9c36fa6
commit adb111d
Showing
1 changed file
with
47 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
package rpc | ||
|
||
import "github.com/NethermindEth/juno/core/felt" | ||
|
||
type BroadcastTxn interface{} | ||
|
||
var ( | ||
_ BroadcastTxn = BroadcastInvokev0Txn{} | ||
_ BroadcastTxn = BroadcastInvokev1Txn{} | ||
_ BroadcastTxn = BroadcastDeclareV1Txn{} | ||
_ BroadcastTxn = BroadcastDeclareV2Txn{} | ||
_ BroadcastTxn = BroadcastDeployAccountTxn{} | ||
) | ||
|
||
type BroadcastInvokev0Txn struct { | ||
InvokeTxnV0 | ||
} | ||
|
||
type BroadcastInvokev1Txn struct { | ||
InvokeTxnV1 | ||
} | ||
|
||
type BroadcastDeclareV1Txn struct { | ||
Type TransactionType `json:"type"` | ||
// SenderAddress the address of the account contract sending the declaration transaction | ||
SenderAddress *felt.Felt `json:"sender_address"` | ||
MaxFee *felt.Felt `json:"max_fee"` | ||
Version TransactionVersion `json:"version"` | ||
Signature []*felt.Felt `json:"signature"` | ||
Nonce *felt.Felt `json:"nonce"` | ||
DeprecatedContractClass `json:"contract_class"` | ||
} | ||
type BroadcastDeclareV2Txn struct { | ||
Type TransactionType `json:"type"` | ||
// SenderAddress the address of the account contract sending the declaration transaction | ||
SenderAddress *felt.Felt `json:"sender_address"` | ||
CompiledClassHash *felt.Felt `json:"compiled_class_hash"` | ||
MaxFee *felt.Felt `json:"max_fee"` | ||
Version TransactionVersion `json:"version"` | ||
Signature []*felt.Felt `json:"signature"` | ||
Nonce *felt.Felt `json:"nonce"` | ||
ContractClass `json:"contract_class"` | ||
} | ||
|
||
type BroadcastDeployAccountTxn struct { | ||
DeployAccountTxn | ||
} |