Documentation ¶
Index ¶
- Constants
- Variables
- func SetupLocalStarknetNode(t *testing.T) string
- func TestKeys(t *testing.T, count int) (rawkeys [][]byte)
- type AccountStore
- type Config
- type KeystoreAdapter
- type StarkTXM
- type Tx
- type TxManager
- type TxStore
- func (s *TxStore) AddUnconfirmed(nonce *felt.Felt, hash string, call starknetrpc.FunctionCall, ...) error
- func (s *TxStore) Confirm(nonce *felt.Felt, hash string) error
- func (s *TxStore) GetNextNonce() *felt.Felt
- func (s *TxStore) GetUnconfirmed() []*UnconfirmedTx
- func (s *TxStore) InflightCount() int
- func (s *TxStore) SetNextNonce(newNextNonce *felt.Felt) []*UnconfirmedTx
- type UnconfirmedTx
Constants ¶
View Source
const FeeMargin uint32 = 115
View Source
const (
MaxQueueLen = 1000
)
View Source
const RPCNonceErrMsg = "Invalid transaction nonce"
Variables ¶
View Source
var ErrBadAdapterEncoding = errors.New("failed to decode raw signature as adapter signature")
View Source
var ( // seed = 0 keys for starknet-devnet PrivateKeys0Seed = []string{ "0xe3e70682c2094cac629f6fbed82c07cd", "0xf728b4fa42485e3a0a5d2f346baa9455", "0xeb1167b367a9c3787c65c1e582e2e662", "0xf7c1bd874da5e709d4713d60c8a70639", "0xe443df789558867f5ba91faf7a024204", "0x23a7711a8133287637ebdcd9e87a1613", "0x1846d424c17c627923c6612f48268673", "0xfcbd04c340212ef7cca5a5a19e4d6e3c", "0xb4862b21fb97d43588561712e8e5216a", "0x259f4329e6f4590b9a164106cf6a659e", } )
Functions ¶
func SetupLocalStarknetNode ¶
SetupLocalStarknetNode sets up a local starknet node via cli, and returns the url
Types ¶
type AccountStore ¶
type AccountStore struct {
// contains filtered or unexported fields
}
func NewAccountStore ¶
func NewAccountStore() *AccountStore
func (*AccountStore) CreateTxStore ¶
func (*AccountStore) GetAllUnconfirmed ¶
func (c *AccountStore) GetAllUnconfirmed() map[string][]*UnconfirmedTx
func (*AccountStore) GetTotalInflightCount ¶
func (c *AccountStore) GetTotalInflightCount() int
func (*AccountStore) GetTxStore ¶
func (c *AccountStore) GetTxStore(accountAddress *felt.Felt) *TxStore
GetTxStore returns the TxStore for the provided account.
type KeystoreAdapter ¶
type KeystoreAdapter interface { starknetaccount.Keystore Loopp() loop.Keystore }
KeystoreAdapter is a starknet-specific adaption layer to translate between the generic Loop Keystore (bytes) and the type specific caigo Keystore (big.Int)
func NewKeystoreAdapter ¶
func NewKeystoreAdapter(lk loop.Keystore) KeystoreAdapter
NewKeystoreAdapter instantiates the KeystoreAdapter interface The implementation requires that the given [looppKs] produces a signature loop.Keystore.Sign that is []byte representation of adapters.Signature Callers are responsible for ensuring that the given LOOPp Keystore encodes signatures correctly.
type TxStore ¶
type TxStore struct {
// contains filtered or unexported fields
}
TxStore tracks broadcast & unconfirmed txs per account address per chain id
func NewTxStore ¶
func (*TxStore) AddUnconfirmed ¶
func (s *TxStore) AddUnconfirmed(nonce *felt.Felt, hash string, call starknetrpc.FunctionCall, publicKey *felt.Felt) error
func (*TxStore) GetNextNonce ¶
func (*TxStore) GetUnconfirmed ¶
func (s *TxStore) GetUnconfirmed() []*UnconfirmedTx
func (*TxStore) InflightCount ¶
func (*TxStore) SetNextNonce ¶
func (s *TxStore) SetNextNonce(newNextNonce *felt.Felt) []*UnconfirmedTx
type UnconfirmedTx ¶
type UnconfirmedTx struct { Hash string PublicKey *felt.Felt Nonce *felt.Felt Call starknetrpc.FunctionCall }
Click to show internal directories.
Click to hide internal directories.