Documentation ¶
Index ¶
- Variables
- func CreateAccountCreationTx(wallet types.Wallet, payer flow.Address, network flow.ChainID) (*flow.Transaction, flow.Address, error)
- type Flow
- func (f Flow) CreateWallet(cwp types.CWParam) (types.Wallet, error)
- func (f Flow) GetAddressFromPrivateKey(privateKey string) (types.Address, error)
- func (f Flow) GetBalance(bp types.BalanceParam) (types.Balance, error)
- func (f Flow) GetTokenBalance(tbp types.TBParam) (types.TokenBalance, error)
- func (f Flow) GetTokenInfo(tip types.TokenInfoParam) (types.TokenInfo, error)
- func (f Flow) GetTxByHash(hp types.HashParam) (types.TransactionByHash, error)
- func (f Flow) SmartContractCall(payload types.SmartContractCallPayload) ([]interface{}, error)
- func (f Flow) Transfer(tp types.TransferParam) (types.TransferData, error)
- func (f Flow) TransferToken(ttp types.TransferTokenParam) (types.TransferData, error)
- func (f Flow) WalletFromMnemonic(wp types.WalletParam) (types.Wallet, error)
Constants ¶
This section is empty.
Variables ¶
var ErrUnsupportedOperation = errors.New("operation not supported for this blockchain")
Functions ¶
func CreateAccountCreationTx ¶
func CreateAccountCreationTx(wallet types.Wallet, payer flow.Address, network flow.ChainID) (*flow.Transaction, flow.Address, error)
CreateAccountCreationTx prepares a transaction to create a new Flow account and calculates the expected address for this account.
Parameters:
- wallet: The Flow wallet containing the public key for the new account.
- payer: The address of the account that will pay for the account creation.
- network: The Flow network (e.g., Mainnet, Testnet) where the account will be created.
Returns:
- A pointer to the prepared transaction (*flow.Transaction).
- The expected address of the new account (flow.Address).
- An error if the transaction preparation or address calculation fails.
Note: This function only prepares the transaction and calculates the expected address. The transaction still needs to be signed and submitted to the blockchain to actually create the account. The actual address may differ if other accounts are created before this transaction is executed.
Types ¶
type Flow ¶
type Flow struct {
Host string
}
func (Flow) GetAddressFromPrivateKey ¶
func (Flow) GetBalance ¶
func (Flow) GetTokenBalance ¶
func (Flow) GetTokenInfo ¶
func (Flow) GetTxByHash ¶
func (Flow) SmartContractCall ¶
func (f Flow) SmartContractCall(payload types.SmartContractCallPayload) ([]interface{}, error)
func (Flow) Transfer ¶
func (f Flow) Transfer(tp types.TransferParam) (types.TransferData, error)
func (Flow) TransferToken ¶
func (f Flow) TransferToken(ttp types.TransferTokenParam) (types.TransferData, error)
func (Flow) WalletFromMnemonic ¶
CreateWalletfromMnemonic generates a Flow wallet from a mnemonic phrase.
This function does not create an on-chain Flow account or address. Instead, it generates a private/public key pair from the mnemonic and prepares the information needed to create an account later...
A key pair alone does not constitute an account or address on Flow. An actual account is created through a separate transaction on the blockchain. Use CreateAccountCreationTx to prepare a transaction for creating an account and to get an expected address for the new account.