Skip to content

Commit

Permalink
rpcv05 implement broadcast txn types
Browse files Browse the repository at this point in the history
  • Loading branch information
rianhughes committed Oct 13, 2023
1 parent 9c36fa6 commit adb111d
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions rpc/types_broadcast_transaction.go
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
}

0 comments on commit adb111d

Please sign in to comment.