Skip to content

Commit

Permalink
rpcv05 implement broadcast txn types (#437)
Browse files Browse the repository at this point in the history
* rpcv05 implement broadcast txn types

* fix properties of broadcasted declare transactions

---------

Co-authored-by: Carmen Cabrera <[email protected]>
Co-authored-by: Carmen Irene Cabrera Rodríguez <[email protected]>
  • Loading branch information
3 people authored Oct 26, 2023
1 parent d623521 commit 3dc638d
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 NumAsHex `json:"version"`
Signature []*felt.Felt `json:"signature"`
Nonce *felt.Felt `json:"nonce"`
ContractClass 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 NumAsHex `json:"version"`
Signature []*felt.Felt `json:"signature"`
Nonce *felt.Felt `json:"nonce"`
ContractClass ContractClass `json:"contract_class"`
}

type BroadcastDeployAccountTxn struct {
DeployAccountTxn
}

0 comments on commit 3dc638d

Please sign in to comment.