Documentation ¶
Index ¶
- Constants
- func GetNonce(rpcUrl, accountId string, pubKey ed25519.PublicKey) (uint64, []byte, error)
- func SendTx(rpcUrl string, transaction []byte) ([]byte, error)
- type Action
- type AddKey
- type CreateAccount
- type DeleteAccount
- type DeleteKey
- type DeployContract
- type FunctionCall
- type KeyPairFunc
- type NamedKeyPairFunc
- type NamedPubKeyFunc
- type NearTransaction
- func (tx *NearTransaction) AddFunctionCall(method string, encodedArgs []byte, gas uint64, deposit *big.Int) *NearTransaction
- func (tx *NearTransaction) Error() error
- func (tx *NearTransaction) Send(rpc RPCURL, nonceSource NonceFunc) ([]byte, error)
- func (tx *NearTransaction) Sign(nonceSource NonceFunc) ([]byte, error)
- type Network
- type NonceFunc
- type PublicKey
- type RPCError
- type RPCURL
- type Signature
- type SignedTransaction
- type Signer
- type Stake
- type Transaction
- type Transfer
Constants ¶
View Source
const ( MaxGas = 300_000_000_000_000 ED25519KeyType = 0 )
View Source
const ( CreateContractEnum = iota DeployContractEnum FunctionCallEnum TransferEnum StakeEnum AddKeyEnum DeleteKeyEnum DeleteAccountEnum )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Action ¶
type Action struct { Enum borsh.Enum `borsh_enum:"true"` CreateAccount CreateAccount DeployContract DeployContract FunctionCall FunctionCall Transfer Transfer Stake Stake AddKey AddKey DeleteKey DeleteKey DeleteAccount DeleteAccount }
type CreateAccount ¶
type CreateAccount struct{}
type DeleteAccount ¶
type DeleteAccount struct{}
type DeployContract ¶
type DeployContract struct{}
type FunctionCall ¶
type KeyPairFunc ¶
type KeyPairFunc func(signer string) (keyPairFunc NamedKeyPairFunc, err error)
type NamedKeyPairFunc ¶
type NamedKeyPairFunc func() (signerName string, publicKey ed25519.PublicKey, privateKey ed25519.PrivateKey)
type NamedPubKeyFunc ¶
type NearTransaction ¶
type NearTransaction struct { ETX SignedTransaction // contains filtered or unexported fields }
func NewTransaction ¶
func NewTransaction(signer, receiver string, signerKeyPair KeyPairFunc) *NearTransaction
NewTransaction creates a new NearTransaction sent by "signer" to "receiver". "signerKeyPair" returns the signer's keypair.
func (*NearTransaction) AddFunctionCall ¶
func (tx *NearTransaction) AddFunctionCall(method string, encodedArgs []byte, gas uint64, deposit *big.Int) *NearTransaction
AddFunctionCall adds a function call to "method" with "encodedArgs" as argument. Only "method" is required to be not nil.
func (*NearTransaction) Error ¶
func (tx *NearTransaction) Error() error
type Network ¶
type Network string
func (Network) FileSigner ¶
func (network Network) FileSigner(signer string) (keypairFunc NamedKeyPairFunc, err error)
type NonceFunc ¶
type NonceFunc func(signer NamedPubKeyFunc) (nonce uint64, blockHash []byte, err error)
type RPCError ¶
type RPCError struct { RPCError *struct { Name string `json:"name"` Cause struct { Info map[string]interface{} `json:"info"` Name string `json:"name"` } `json:"cause"` Code int64 `json:"code"` Message string `json:"message"` Data struct { TxExecutionError map[string]interface{} } `json:"data"` } `json:"error"` }
type RPCURL ¶
type RPCURL string
type SignedTransaction ¶
type SignedTransaction struct { Transaction Transaction Signature Signature }
type Signer ¶
type Transaction ¶
Click to show internal directories.
Click to hide internal directories.