fio

package module
v1.0.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 13, 2021 License: MIT Imports: 32 Imported by: 23

README

FIO-GO

Gosec

Library for interacting with the FIO network using the go language.

Breaking Changes

In 1.0.0 and later eos-go has been imported, this is to facilitate ECC changes needed for FIO and to ensure API stability. Updating existing code using eos-go dependencies should only require:

import (
	"github.com/eoscanada/eos-go"
	"github.com/eoscanada/eos-go/ecc"
)

becomes:

import (
	"github.com/fioprotocol/fio-go/eos"
	"github.com/fioprotocol/fio-go/eos/ecc"
)

Example

This demonstrates using the library to send FIO tokens from one account to another:

package main

import (
	"encoding/json"
	"fmt"
	"github.com/fioprotocol/fio-go"
	"log"
)

func main() {
	const (
		url = `https://testnet.fioprotocol.io`
		wif = `5JP1fUXwPxuKuNryh5BEsFhZqnh59yVtpHqHxMMTmtjcni48bqC`
		to  = `FIO6G9pXXM92Gy5eMwNquGULoCj3ZStwPLPdEb9mVXyEHqWN7HSuA`
	)

	fatal := func(e error) {
		if e != nil {
			log.Fatal(e)
		}
	}

	// connect to the network, using credentials
	account, api, _, err := fio.NewWifConnect(wif, url)
	fatal(err)

	// send ᵮ1.00
	resp, err := api.SignPushActions(fio.NewTransferTokensPubKey(account.Actor, to, fio.Tokens(1.0)))
	fatal(err)

	// print the result
	j, err := json.MarshalIndent(resp, "", "  ")
	fatal(err)
	fmt.Println(string(j))
}

Documentation

Index

Constants

View Source
const (
	ChainIdMainnet = `21dcae42c0182200e93f954a074011f9048a7624c6fe81d3c9541a614a88bd1c`
	ChainIdTestnet = `b20901380af44ef59c5918439a1f9a41d83669020319a80574b804a5f95cbd7e`
)
View Source
const (
	CompressionNone = eos.CompressionType(iota)
	CompressionZlib
)

copy over CompressionTypes to reduce need additional imports

View Source
const (
	ProducerToLastProduced uint8 = iota
	ProducerToLastImplied
)
View Source
const (
	FeeAddNft               = "add_nft"
	FeeAddPubAddress        = "add_pub_address"
	FeeAuthDelete           = "auth_delete"
	FeeAuthLink             = "auth_link"
	FeeAuthUpdate           = "auth_update"
	FeeBundleVote           = "submit_bundled_transaction"
	FeeBurnAddress          = "burn_fio_address"
	FeeCancelFundsRequest   = "cancel_funds_request"
	FeeMsigApprove          = "msig_approve"
	FeeMsigCancel           = "msig_cancel"
	FeeMsigExec             = "msig_exec"
	FeeMsigInvalidate       = "msig_invalidate"
	FeeMsigPropose          = "msig_propose"
	FeeMsigUnapprove        = "msig_unapprove"
	FeeNewFundsRequest      = "new_funds_request"
	FeeProxyVote            = "proxy_vote"
	FeeRecordObtData        = "record_obt_data"
	FeeRegisterFioAddress   = "register_fio_address"
	FeeRegisterFioDomain    = "register_fio_domain"
	FeeRegisterProducer     = "register_producer"
	FeeRegisterProxy        = "register_proxy"
	FeeRejectFundsRequest   = "reject_funds_request"
	FeeRemoveAllAddresses   = "remove_pub_addresses"
	FeeRemoveAllNfts        = "remove_all_nfts"
	FeeRemovePubAddress     = "remove_pub_address"
	FeeRemoveNft            = "remove_nft"
	FeeRenewFioAddress      = "renew_fio_address"
	FeeRenewFioDomain       = "renew_fio_domain"
	FeeSetDomainPub         = "set_fio_domain_public"
	FeeSubmitFeeMult        = "submit_fee_multiplier"
	FeeSubmitFeeVote        = "submit_fee_ratios"
	FeeTransferAddress      = "transfer_fio_address"
	FeeTransferDom          = "transfer_fio_domain"
	FeeTransferLockedTokens = "transfer_locked_tokens"
	FeeTransferTokensPubKey = "transfer_tokens_pub_key"
	FeeUnregisterProducer   = "unregister_producer"
	FeeUnregisterProxy      = "unregister_proxy"
	FeeVoteProducer         = "vote_producer"
)
View Source
const (
	LockedFounder  uint32 = iota + 1 // founder tokens: cannot vote until unlocked, can use for fees.
	LockedMember                     // foundation member (wallets/exchanges) incentives: if inhibit unlocking is set, cannot be used, votable until 2nd unlock or if uninhibited.
	LockedPresale                    // presale tokens, can vote while locked
	LockedGiveaway                   // foundation tokens used for giveaways, can only be used to register addresses
)
View Source
const (
	CanVoteNone int32 = iota
	CanVoteAll
)
View Source
const FioSymbol = "ᵮ"
View Source
const ObtAbiJson = `` /* 1439-byte string literal not displayed */

ObtAbiJson defines the ABI format for OBT requests. There are two variations used in fio-go, one that has optional fields (obtAbiJsonOmit) which is private, and one that does not. The variations are tried in sequence to help with compatibility with different wallet implementations. Under normal circumstances, ObtAbiJson is the correct choice.

Variables

View Source
var (
	LockedInitial              = 90 * 24 * 60  // initial minutes before first unlock period
	LockedInitialPct   float64 = 0.06          // percentage unlocked after first period
	LockedIncrement            = 180 * 24 * 60 // each additional unlock period, 2nd unlock = LockedInitial + LockedIncrement, 3rd = LockedInitial + (2 * LockedIncrement), etc
	LockedIncrementPct float64 = 0.188         // percent unlocked each additional period: 1st = 6%, 2nd = 24.8% etc.
	LockedPeriods              = 6             // number of unlock periods
)

set as variables to allow override on development nets

Functions

func ActorFromPub

func ActorFromPub(pubKey string) (eos.AccountName, error)

ActorFromPub calculates the FIO Actor (EOS Account) from a public key

func AddressHash

func AddressHash(s string) string

AddressHash calculates the hash used as index 5 in the fio.address fionames table from the domain name. This is an alias to I128Hash, example of query for `test@fiotestnet`:

{
  "code": "fio.address",
  "scope": "fio.address",
  "table": "fionames",
  "lower_bound": "0xeb0816aeb936141ebec9a4a76c64df58",
  "upper_bound": "0xeb0816aeb936141ebec9a4a76c64df58",
  "key_type": "i128",
  "index_position": "5",
  "json": true
}

func CurrentTpid

func CurrentTpid() string

func DomainNameHash

func DomainNameHash(s string) string

DomainNameHash calculates the hash used as index 4 in the fio.address domains table from the domain name. This is an alias to I128Hash. Example for domain `fio`:

{
  "code": "fio.address",
  "scope": "fio.address",
  "table": "domains",
  "lower_bound": "0x8d9d3bd8a6fb22345ce8fa3c416a28e5",
  "upper_bound": "0x8d9d3bd8a6fb22345ce8fa3c416a28e5",
  "key_type": "i128",
  "index_position": "4",
  "json": true
}

func EciesDecrypt

func EciesDecrypt(recipient *Account, senderPub string, message string) (decrypted []byte, err error)

EciesDecrypt is the inverse of EciesEncrypt, using the recipient's private key and sender's public instead.

func EciesEncrypt

func EciesEncrypt(sender *Account, recipentPub string, plainText []byte, iv []byte) (content string, err error)

EciesEncrypt implements the encryption format used in the content field of OBT requests.

The plaintext is PKCS#7 padded before being encrypted -- returned output is base64.

Key derivation, and message format:

A DH shared secret is created using ECIES (derives a key based on the curves of the public and private keys.) This secret is hashed *twice* using sha512, and the first 32 bytes of the hash is used to encrypt the message using AES-256 cbc, and the second half is used to create an outer sha256 hmac.

The 16 byte IV is prepended to the output, resulting in the message format of:

IV + Ciphertext + HMAC

See https://github.com/fioprotocol/fiojs/blob/master/docs/message_encryption.md for more information.

func EciesSecret

func EciesSecret(private *Account, public string) (secret []byte, hash *[64]byte, err error)

EciesSecret derives the ecies pre-shared key from a private and public key. The 'secret' returned is the actual secret, the 'hash' returned is what is actually used in the OBT implementation, allowing the secret to be stretched into two keys, one for encryption and one for message authentication.

func GetMaxFee

func GetMaxFee(name string) (fioTokens float64)

GetMaxFee looks up a fee from the map, this is based on the values in the fiofees table, and does not take into account any bundled transactions for the user, use GetFee() for that.

func GetMaxFeeByAction

func GetMaxFeeByAction(name string) (fioTokens float64)

GetMaxFeeByAction allows getting a fee given the contract action name instead of the API endpoint name.

func GetRefBlockFor

func GetRefBlockFor(blocknum uint32, id string) (refBlockNum uint32, refBlockPrefix uint32, err error)

GetRefBlockFor calculates the Reference for an arbitrary block and ID

func I128Hash

func I128Hash(s string) string

I128Hash hashes a string to an i128 database value, often used as an index for a string in a table. It is the most-significant 16 bytes in big-endian of a sha1 hash of the provided string, returned as a hex-string

func MaxFeesJson

func MaxFeesJson() []byte

MaxFeesJson provides a JSON representation of the current fee map

func MaxFeesUpdated

func MaxFeesUpdated() bool

MaxFeesUpdated checks if the fee map has been updated, or if using the default (possibly wrong) values

func NewConnection

func NewConnection(keyBag *eos.KeyBag, url string) (*API, *TxOptions, error)

NewConnection sets up the API interface for interacting with the FIO API

func NewTransaction

func NewTransaction(actions []*Action, txOpts *TxOptions) *eos.Transaction

NewTransaction wraps eos.NewTransaction

func NewWifConnect

func NewWifConnect(wif string, url string) (account *Account, api *API, opts *TxOptions, err error)

NewWifConnect adds convenience by setting everything up, given a WIF and URL

func SetTpid

func SetTpid(walletAddress string) (ok bool)

SetTpid will set a package variable that will include the provided TPID in all of the calls that support it. This only needs to be called once. By default it is empty, and is recommended for wallet providers or other service providers to set at initialization via SetTpid to get rewards.

func Tokens

func Tokens(tokens float64) uint64

Tokens is a convenience function for converting from a float for human readability. Example 1 FIO Token: Tokens(1.0) == uint64(1000000000)

func UpdateMaxFees

func UpdateMaxFees(api *API) bool

UpdateMaxFees refreshes the maxFees map from the on-chain table. This is automatically called by NewConnection if fees are not already up-to-date.

Deprecated use api.RefreshFees instead

Types

type API

type API struct {
	*eos.API
}

API struct allows extending the eos.API with FIO-specific functions

func (*API) AllABIs

func (api *API) AllABIs() (map[eos.AccountName]*eos.ABI, error)

AllABIs returns a map of every ABI available. This is only possible in FIO because there are a small number of contracts that exist.

func (*API) AvailCheck

func (api *API) AvailCheck(addressOrDomain string) (available bool, err error)

AvailCheck responds with true if a domain or FIO address is available to be registered

func (*API) GetActionsUniq deprecated

func (api *API) GetActionsUniq(actor eos.AccountName, offset int64, pos int64) ([]*eos.ActionTrace, error)

GetActionsUniq strips the results of GetActions of duplicate traces, this can occur with certain transactions that may have multiple actors involved and the same trace is presented more than once but associated with a different actor. This will give preference to the trace referencing the actor queried if possible.

Deprecated: a new endpoint that handles de-duplication will make this function irrelevant.

func (*API) GetAllPublic added in v1.0.1

func (api *API) GetAllPublic(fioAddress Address) ([]TokenPubAddr, error)

GetAllPublic fetches all public addresses for an address.

func (*API) GetAllowedActions added in v1.0.2

func (api *API) GetAllowedActions(offset uint32, limit uint32) (allowed *AllowedActionsResp, err error)

GetAllowedActions fetches the list of allowed actions from get_actions

func (*API) GetApprovals

func (api *API) GetApprovals(scope Name, limit int) (more bool, info []*MsigApprovalsInfo, err error)

GetApprovals returns a list of approvals for an account

func (*API) GetBalance

func (api *API) GetBalance(account eos.AccountName) (float64, error)

GetBalance gets an account's balance

func (*API) GetBlockByNum

func (api *API) GetBlockByNum(num uint32) (out *eos.BlockResp, err error)

func (*API) GetBlockHeaderState

func (api *API) GetBlockHeaderState(numOrId interface{}) (*BlockHeaderState, error)

GetBlockHeaderState returns the details for a reversible block. If the block is irreversible the api will return an error.

func (*API) GetBpJson

func (api *API) GetBpJson(producer eos.AccountName) (*BpJson, error)

GetBpJson attempts to retrieve the bp.json file for a producer based on the URL in the eosio.producers table. It intentionally rejects URLs that are an IP address, or resolve to a private IP address to reduce the risk of SSRF attacks, note however this check is not comprehensive, and is not risk free.

func (*API) GetBundleRemaining added in v1.0.1

func (api *API) GetBundleRemaining(a Address) (remaining int, err error)

GetBundleRemaining reports on how many free bundled tx remain for an Address

func (*API) GetCancelledRequests

func (api *API) GetCancelledRequests(pubkey string, limit uint32, offset uint32) (cancelled *CancelledRequests, err error)

func (*API) GetCirculatingSupply added in v1.0.2

func (api *API) GetCirculatingSupply() (circulating uint64, minted uint64, locked uint64, err error)

GetCirculatingSupply returns the number of spendable tokens based on current supply - genesis locks - locked tokens this is a very busy call, requiring multiple requests to calculate the result, and it is recommended to cache the output if needed frequently.

func (*API) GetCurrentBlock

func (api *API) GetCurrentBlock() (blockNum uint32)

GetCurrentBlock provides the current head block number

func (*API) GetDomainOwner

func (api *API) GetDomainOwner(domain string) (actor *eos.AccountName, err error)

GetDomainOwner finds the account that is the owner of a domain

func (*API) GetExpiredOffset added in v1.0.5

func (api *API) GetExpiredOffset(descending bool) (int64, error)

GetExpiredOffset finds the first FIO domain in the fio.address::domains table, and returns the index for that domain.

func (*API) GetFee

func (api *API) GetFee(fioAddress string, endPoint string) (fee uint64, err error)

GetFee calls the API endpoint to calculate a fee for a FIO address, taking bundled transactions into account. It is an API member function because it is neither tied to the current user, and is not a signed tx. To get the actual fee schedule for an transaction use GetMaxFee() or GetMaxFeeByAction()

func (*API) GetFioAccount

func (api *API) GetFioAccount(actor string) (*AccountResp, error)

GetFioAccount gets information about an account, it should be used instead of GetAccount due to differences in public key formatting in eos vs fio packages.

func (*API) GetFioAddresses

func (api *API) GetFioAddresses(pubKey string, offset uint32, limit uint32) (addresses *FioNames, err error)

GetFioAddresses queries for the FIO Addresses owned by a Public Key. It offers paging which makes it preferable to GetFioNames which may not provide the full set of results because of (silent, without error) database query timeout issues. offset and limit must both be positive numbers. The returned uint32 specifies how many more results are available.

func (*API) GetFioBalance added in v1.0.2

func (api *API) GetFioBalance(pubkey string) (fiobalance *GetFioBalanceResp, err error)

GetFioBalance is the preferred way to get an account's balance, it will include the number of available tokens in the case that an account holds locked/staked tokens.

func (*API) GetFioDomains

func (api *API) GetFioDomains(pubKey string, offset uint32, limit uint32) (domains *FioNames, err error)

GetFioDomains queries for the domains owned by a Public Key. It offers paging which makes it preferable to GetFioNames which may not provide the full set of results because of (silent, without error) database query timeout issues. offset and limit must both be positive numbers. The returned uint32 specifies how many more results are available.

func (*API) GetFioNames

func (api *API) GetFioNames(pubKey string) (names FioNames, found bool, err error)

GetFioNames provides a list of domains and addresses for a public key

func (*API) GetFioNamesForActor

func (api *API) GetFioNamesForActor(actor string) (names FioNames, found bool, err error)

GetFioNamesForActor searches the accountmap table to get a public key, then searches for fio names or domains belonging to the associated public key

func (*API) GetFioProducers

func (api *API) GetFioProducers() (fioProducers *Producers, err error)

GetFioProducers retrieves the producer table. The producers table is a little different on FIO, use this instead of the GetProducers call from eos-go TODO: it defaults to a limit of 1,000 ... may want to rethink this as a default

func (*API) GetFioRequest

func (api *API) GetFioRequest(requestId uint64) (request *FundsReqTableResp, err error)

GetFioRequest gets a single FIO request using a table lookup, this is more efficient than using the API endpoint because that requires knowing the offset of the request and the id. The downside is that this returns a slightly different struct.

func (*API) GetFioRequestStatus

func (api *API) GetFioRequestStatus(requestId uint64) (hasResponse bool, request *FundsRequestStatusResp, err error)

GetFioRequestStatus gets a record from the fioreqstss, which is useful for getting the recordobt response to a request. This only applies to recordobt that was in response to a request, the recordobts table stores records not tied to an existing request.

func (*API) GetGenesisLockedTokens added in v1.0.2

func (api *API) GetGenesisLockedTokens(accountOrPubkey string) (hasLocked bool, locked *GenesisLockedTokens, err error)

GetGenesisLockedTokens gives details about the locked tokens for a specific account

func (*API) GetLockedBpRewards added in v1.0.2

func (api *API) GetLockedBpRewards() (locked uint64, err error)

GetLockedBpRewards gets the unpaid rewards for block producers: Fees collected for FIO Address/Domain registration are not immediately distributed, but rather locked and distributed evenly every day over a period of one year

func (*API) GetMaxActions

func (api *API) GetMaxActions(account eos.AccountName) (highest uint32, err error)

GetMaxActions returns the highest account_action_sequence from the get_actions endpoint. This is needed because paging only works with positive offsets.

func (*API) GetNftsContract added in v1.0.5

func (api *API) GetNftsContract(chaincode, contractAddress, tokenid string, offset uint32, limit uint32) (nfts *NftResponse, err error)

GetNftsContract fetches the list of NFTs for a contract address

func (*API) GetNftsFioAddress added in v1.0.5

func (api *API) GetNftsFioAddress(fioAddress string, offset uint32, limit uint32) (nfts *NftResponse, err error)

GetNftsFioAddress fetches the list of NFTs for a FIO address

func (*API) GetNftsHash added in v1.0.5

func (api *API) GetNftsHash(hash string, offset uint32, limit uint32) (nfts *NftResponse, err error)

GetNftsHash fetches the list of NFTs for a specific NFT Hash

func (*API) GetPendingFioRequests

func (api *API) GetPendingFioRequests(pubKey string, limit int, offset int) (pendingRequests PendingFioRequestsResponse, hasPending bool, err error)

GetPendingFioRequests looks for pending requests

func (*API) GetProducerSchedule

func (api *API) GetProducerSchedule() (*ProducerSchedule, error)

func (*API) GetProposalTransaction

func (api *API) GetProposalTransaction(proposalAuthor eos.AccountName, proposalName eos.Name) (*MsigProposal, error)

GetProposalTransaction will lookup a specific proposal

func (*API) GetProposals

func (api *API) GetProposals(offset int, limit int) (more bool, scopes map[string]int, err error)

GetProposals fetches the proposal list from eosio.msig returning a map of scopes, with a count for each

func (*API) GetPublic added in v1.0.1

func (api *API) GetPublic(fioAddress Address, chain string, token string) (address PubAddress, found bool, err error)

GetPublic is an alias to PubAddressLookup to correct the confusing name for the lookup.

func (*API) GetRefBlock

func (api *API) GetRefBlock() (refBlockNum uint32, refBlockPrefix uint32, err error)

GetRefBlock calculates a the block reference for the last irreversible block

func (*API) GetSentFioRequests

func (api *API) GetSentFioRequests(pubKey string, limit int, offset int) (sentRequests PendingFioRequestsResponse, hasSent bool, err error)

GetSentFioRequests looks for sent requests

func (*API) GetSupportedApis

func (api *API) GetSupportedApis() (onlySafe bool, apis []string, err error)

GetSupportedApis queries the /v1/chain/get_supported_apis endpoint for available API calls, which can assist in determining what api plugins are enabled. The onlySafe bool returned will be false if either the producer or network plugins are enabled, which can lead to denial of service attacks.

func (*API) GetTableByScopeMore

func (api *API) GetTableByScopeMore(request eos.GetTableByScopeRequest) (*eos.GetTableByScopeResp, error)

GetTableByScopeMore handles responses that have either a bool or a string as the more response.

func (*API) GetTableRowsOrder

func (api *API) GetTableRowsOrder(gtro GetTableRowsOrderRequest) (*eos.GetTableRowsResp, error)

GetTableRowsOrder duplicates eos.GetTableRows but adds a Reverse flag

func (*API) GetTotalGenesisLockTokens added in v1.0.2

func (api *API) GetTotalGenesisLockTokens() (total uint64, founder uint64, member uint64, presale uint64, giveaway uint64, err error)

GetTotalGenesisLockTokens tallies the remaining locked tokens based upon the values in the lockedtokens table

func (*API) GetTotalLockTokens added in v1.0.2

func (api *API) GetTotalLockTokens() (uint64, error)

GetTotalLockTokens provides the total number of (FIP6) locked tokens by iterating through the locktokens table.

func (*API) GetTransaction

func (api *API) GetTransaction(id eos.Checksum256) (*eos.TransactionResp, error)

GetTransaction duplicates eos-go's GetTransaction. TODO: is this redundant? Can it be removed?

func (*API) GetVotes

func (api *API) GetVotes(account string) (votedFor []string, err error)

GetVotes returns a slice of an account's current votes

func (*API) HasHistory

func (api *API) HasHistory() bool

HasHistory looks at available APIs and returns true if /v1/history/* exists.

func (*API) HistGetBlockTxids

func (api *API) HistGetBlockTxids(blockNum uint32) (*BlockTxidsResp, error)

HistGetBlockTxids retrieves the txid for all transactions that occurred in a block from the v1 history plugin.

func (*API) NewSignedMsigPropose

func (api *API) NewSignedMsigPropose(proposalName Name, approvers []string, actions []*Action, expires time.Duration, signer *Account, txOpt *TxOptions) (*eos.PackedTransaction, error)

NewSignedMsigPropose simplifies the process of building an MsigPropose by packing and signing the slice of Actions provided into a TX and then wrapping that into a signed transaction ready to be submitted.

func (*API) NewValidTransferLockedTokens added in v1.0.2

func (api *API) NewValidTransferLockedTokens(actor eos.AccountName, recipientPubKey string, canVote bool, periods []LockPeriods, amount uint64) (*Action, error)

NewValidTransferLockedTokens is the same as NewTransferLockedTokens, but adds checks to ensure the account does not exist, and the periods are legit

func (*API) PubAddressLookup

func (api *API) PubAddressLookup(fioAddress Address, chain string, token string) (address PubAddress, found bool, err error)

PubAddressLookup finds a public address for a user, given a currency key

pubAddress, ok, err := api.PubAddressLookup(fio.Address("alice:fio", "BTC")

func (*API) PushEndpointRaw

func (api *API) PushEndpointRaw(endpoint string, body interface{}) (out json.RawMessage, err error)

PushEndpointRaw is adapted from eos-go call() function in api.go to allow overriding the endpoint for a push-transaction the endpoint provided should be the full path to the endpoint such as "/v1/chain/push_transaction"

func (*API) RefreshFees added in v1.0.1

func (api *API) RefreshFees() bool

RefreshFees refreshes the maxFees map from the on-chain table. This is automatically called by NewConnection if fees are not already up-to-date.

func (*API) SignPushActions

func (api *API) SignPushActions(a ...*Action) (out *eos.PushTransactionFullResp, err error)

SignPushActions will create a transaction, fill it with default values, sign it and submit it to the chain. It is the highest level function on top of the `/v1/chain/push_transaction` endpoint. Overridden from eos-go to make it unnecessary to use .ToEos() casting on actions.

type Account

type Account struct {
	KeyBag    *eos.KeyBag
	PubKey    string
	Actor     eos.AccountName
	Addresses []FioName
	Domains   []FioName
}

Account holds the information for an account, it differs from a regular EOS account in that the account name (Actor) is derived from the public key, and a FIO public key has a different prefix

func NewAccountFromWif

func NewAccountFromWif(wif string) (*Account, error)

NewAccountFromWif builds an Account given a private key string. Note: this is an ephemeral, in-memory, account which has no relation to keosd, and is not persistent.

func NewRandomAccount

func NewRandomAccount() (*Account, error)

NewRandomAccount creates a new account with a random key.

func (*Account) GetNames

func (a *Account) GetNames(api *API) (addresses int, domains int, err error)

GetNames retrieves the FIO addresses and names owned by an account, and populates the Account struct

type AccountResp

type AccountResp struct {
	AccountName            eos.AccountName          `json:"account_name"`
	Privileged             bool                     `json:"privileged"`
	LastCodeUpdate         eos.JSONTime             `json:"last_code_update"`
	Created                eos.JSONTime             `json:"created"`
	CoreLiquidBalance      eos.Asset                `json:"core_liquid_balance"`
	RAMQuota               eos.Int64                `json:"ram_quota"`
	RAMUsage               eos.Int64                `json:"ram_usage"`
	NetWeight              eos.Int64                `json:"net_weight"`
	CPUWeight              eos.Int64                `json:"cpu_weight"`
	NetLimit               eos.AccountResourceLimit `json:"net_limit"`
	CPULimit               eos.AccountResourceLimit `json:"cpu_limit"`
	Permissions            []Permission             `json:"permissions"`
	TotalResources         eos.TotalResources       `json:"total_resources"`
	SelfDelegatedBandwidth eos.DelegatedBandwidth   `json:"self_delegated_bandwidth"`
	RefundRequest          *eos.RefundRequest       `json:"refund_request"`
	VoterInfo              eos.VoterInfo            `json:"voter_info"`
}

AccountResp duplicates the eos.AccountResp accounting for differences in public key format

type Action

type Action struct {
	Account       eos.AccountName       `json:"account"`
	Name          eos.ActionName        `json:"name"`
	Authorization []eos.PermissionLevel `json:"authorization,omitempty"`
	eos.ActionData
}

Action struct duplicates eos.Action

func MustNewAddNft added in v1.0.5

func MustNewAddNft(fioAddress string, nfts []NftToAdd, actor eos.AccountName) *Action

MustNewAddNft panics on error

func MustNewBurnAddress added in v1.0.2

func MustNewBurnAddress(actor eos.AccountName, address Address, tpid string) (action *Action)

func MustNewRegAddress

func MustNewRegAddress(actor eos.AccountName, address Address, ownerPubKey string) (action *Action)

MustNewRegAddress panics on a bad address, but allows embedding because it only returns one value

func MustNewRegProducer

func MustNewRegProducer(fioAddress string, fioPubKey string, url string, location ProducerLocation, actor eos.AccountName) *Action

func MustNewRemNft added in v1.0.5

func MustNewRemNft(fioAddress string, nfts []NftToDelete, actor eos.AccountName) *Action

MustNewRemNft creates an action or panics

func NewAction

func NewAction(contract eos.AccountName, name eos.ActionName, actor eos.AccountName, actionData interface{}) *Action

NewAction creates an Action for FIO contract calls, assumes the permission is "active"

func NewActionWithPermission

func NewActionWithPermission(contract eos.AccountName, name eos.ActionName, actor eos.AccountName, permission string, actionData interface{}) *Action

NewActionWithPermission allows building an action and specifying the permission

func NewAddAction added in v1.0.2

func NewAddAction(contract eos.AccountName, newAction eos.ActionName, actor eos.AccountName) (action *Action)

func NewAddAddress

func NewAddAddress(actor eos.AccountName, fioAddress Address, token string, chain string, publicAddress string) (action *Action, ok bool)

NewAddAddress adds a single public address

func NewAddAddresses

func NewAddAddresses(actor eos.AccountName, fioAddress Address, addrs []TokenPubAddr) (action *Action, ok bool)

NewAddAddresses adds multiple public addresses at a time

func NewAddNft added in v1.0.5

func NewAddNft(fioAddress string, nfts []NftToAdd, actor eos.AccountName) (*Action, error)

NewAddNft creates an AddNft fio.Action

func NewBpClaim

func NewBpClaim(fioAddress string, actor eos.AccountName) *Action

func NewBundleVote

func NewBundleVote(transactions int64, actor eos.AccountName) *Action

func NewBurnAddress added in v1.0.2

func NewBurnAddress(actor eos.AccountName, address Address, tpid string) (action *Action, ok bool)

func NewBurnExpired deprecated

func NewBurnExpired(actor eos.AccountName) *Action

NewBurnExpired will return a burnexpired action. It has been updated to return a BurnExpiredRange action as of the 3.1.x release. It didn't work before, and this prevents a breaking change in existing clients but will not work.

Deprecated: this is essentially a noop, use GetExpiredOffset to find the offset, and provide it to NewBurnExpiredRange

func NewBurnExpiredRange added in v1.0.5

func NewBurnExpiredRange(offset int64, limit int32, actor eos.AccountName) *Action

NewBurnExpiredRange will return a burnexpired action. The offset should be the first ID in the domains table that is expired. The GetExpiredOffset helper makes this easier.

offset, err := api.GetExpiredOffset(false)
if err != nil {
    ...
}
_, err = api.SignPushActions(fio.NewBurnExpiredRange(offset, 15, acc.Actor))
if err != nil {
    ...
}

func NewBurnNfts added in v1.0.5

func NewBurnNfts(actor eos.AccountName) *Action

func NewCancelFndReq

func NewCancelFndReq(actor eos.AccountName, requestId uint64) *Action

NewCancelFndReq builds the action to cancel a request that is pending by the payee

func NewComputeFees added in v1.0.1

func NewComputeFees(actor eos.AccountName) *Action

func NewExpDomain deprecated

func NewExpDomain(actor eos.AccountName, domain string) *Action

NewExpDomain is used by a test contract and not available on mainnet

Deprecated: only used in development environments

func NewFundsReq

func NewFundsReq(actor eos.AccountName, payerFio string, payeeFio string, content string) *Action

NewFundsReq builds the action for providing the result of a off-chain transaction

func NewMsigApprove

func NewMsigApprove(proposer eos.AccountName, proposal eos.Name, actor eos.AccountName, proposalHash eos.Checksum256) *Action

func NewMsigCancel

func NewMsigCancel(proposer eos.AccountName, proposal eos.Name, actor eos.AccountName) *Action

func NewMsigExec

func NewMsigExec(proposer eos.AccountName, proposal eos.Name, fee uint64, actor eos.AccountName) *Action

func NewMsigPropose

func NewMsigPropose(proposer eos.AccountName, proposal eos.Name, signers []*PermissionLevel, signedTx *eos.SignedTransaction) *Action

NewMsigPropose is provided for consistency, but it will make more sense to use NewSignedMsigPropose to build *simple* multisig proposals since it abstracts several steps.

func NewMsigUnapprove

func NewMsigUnapprove(proposer eos.AccountName, proposal eos.Name, actor eos.AccountName) *Action

func NewPayTpidRewards

func NewPayTpidRewards(actor eos.AccountName) *Action

func NewRecordSend

func NewRecordSend(actor eos.AccountName, reqId string, payer string, payee string, content string) *Action

NewRecordSend builds the action for providing the result of a off-chain transaction

func NewRegAddress

func NewRegAddress(actor eos.AccountName, address Address, ownerPubKey string) (action *Action, ok bool)

func NewRegDomain

func NewRegDomain(actor eos.AccountName, domain string, ownerPubKey string) *Action

func NewRegProducer

func NewRegProducer(fioAddress string, fioPubKey string, url string, location ProducerLocation, actor eos.AccountName) (*Action, error)

func NewRegProxy

func NewRegProxy(fioAddress string, actor eos.AccountName) *Action

func NewRejectFndReq

func NewRejectFndReq(actor eos.AccountName, requestId string) *Action

NewRejectFndReq builds the action to reject a request

func NewRemAction added in v1.0.2

func NewRemAction(action eos.ActionName, actor eos.AccountName) *Action

NewRemAction is an alias for NewRemoveAction

func NewRemAllNft added in v1.0.5

func NewRemAllNft(fioAddress string, actor eos.AccountName) *Action

NewRemAllNft builds an action for RemAllNft

func NewRemNft added in v1.0.5

func NewRemNft(fioAddress string, nfts []NftToDelete, actor eos.AccountName) (*Action, error)

NewRemNft creates an action for removing NFT mappings

func NewRemoveAction added in v1.0.2

func NewRemoveAction(action eos.ActionName, actor eos.AccountName) *Action

func NewRemoveAddrReq

func NewRemoveAddrReq(fioAddress Address, toRemove []TokenPubAddr, actor eos.AccountName) (remove *Action, err error)

NewRemoveAddrReq allows removal of public token/chain addresses

func NewRemoveAllAddrReq

func NewRemoveAllAddrReq(fioAddress Address, actor eos.AccountName) (remove *Action, err error)

NewRemoveAllAddrReq allows removal of ALL public token/chain addresses

func NewRenewAddress

func NewRenewAddress(actor eos.AccountName, address string) *Action

func NewRenewDomain

func NewRenewDomain(actor eos.AccountName, domain string) *Action

func NewRewardsPaid

func NewRewardsPaid(actor eos.AccountName, tpid string) *Action

func NewSetDomainPub

func NewSetDomainPub(actor eos.AccountName, domain string, public bool) *Action

func NewSetFeeMult added in v1.0.1

func NewSetFeeMult(multiplier float64, actor eos.AccountName) *Action

func NewSetFeeVote

func NewSetFeeVote(ratios []*FeeValue, actor eos.AccountName) *Action

func NewTransfer

func NewTransfer(actor eos.AccountName, recipient eos.AccountName, amount uint64) *Action

NewTransfer is unlikely to be called, this is a privileged action

deprecated: internal action, user cannot call.

func NewTransferAddress

func NewTransferAddress(actor eos.AccountName, address Address, newOwnerPubKey string) *Action

func NewTransferDom

func NewTransferDom(actor eos.AccountName, domain string, newOwnerPubKey string) *Action

func NewTransferLockedTokens added in v1.0.2

func NewTransferLockedTokens(actor eos.AccountName, recipientPubKey string, canVote bool, periods []LockPeriods, amount uint64) *Action

NewTransferLockedTokens creates an action used to transfer locked tokens to an account. This must be a new account, and cannot have existing tokens or addresses.

func NewTransferTokensPubKey

func NewTransferTokensPubKey(actor eos.AccountName, recipientPubKey string, amount uint64) *Action

NewTransferTokensPubKey builds an eos.Action for sending FIO tokens

func NewUnRegProducer

func NewUnRegProducer(fioAddress string, actor eos.AccountName) *Action

func NewUpdateAuthSimple

func NewUpdateAuthSimple(account eos.AccountName, actors []string, threshold uint32) *Action

NewUpdateAuthSimple just takes a list of accounts and a threshold. Nothing fancy, most basic EOS msig account.

func NewUpdateBounty

func NewUpdateBounty(actor eos.AccountName, amount uint64) *Action

func NewUpdateTpid

func NewUpdateTpid(actor eos.AccountName, tpid string, amount uint64) *Action

func NewVoteProducer

func NewVoteProducer(producers []string, actor eos.AccountName, fioAddress string) *Action

NewVoteProducer creates a VoteProducer action: note - fioAddress is optional as of FIP-009

func NewVoteProxy

func NewVoteProxy(proxy string, fioAddress string, actor eos.AccountName) *Action

NewVoteProxy creates a VoteProxy action: note - fioAddress is optional as of FIP-009

func NewWrapExecute

func NewWrapExecute(actor eos.AccountName, executor eos.AccountName, trx *eos.Transaction) *Action

func (Action) ToEos

func (act Action) ToEos() *eos.Action

type AddAction added in v1.0.2

type AddAction struct {
	Action   eos.ActionName  `json:"action"`
	Contract eos.AccountName `json:"contract"`
	Actor    eos.AccountName `json:"actor"`
}

AddAction adds a contract action to the list of allowed actions, this is part of the underlying permissions system in FIO that limits general smart-contract functionality. This is a privileged action and will require an MSIG as a system account and block producer approval.

type AddAddress

type AddAddress struct {
	FioAddress      string          `json:"fio_address"`
	PublicAddresses []TokenPubAddr  `json:"public_addresses"`
	MaxFee          uint64          `json:"max_fee"`
	Actor           eos.AccountName `json:"actor"`
	Tpid            string          `json:"tpid"`
}

AddAddress allows a public address of the specific blockchain type to be added to the FIO Address, so that it can be returned using /pub_address_lookup

When adding addresses, only 5 can be added in a single call, and an account is limited to 100 public addresses total.

type AddNft added in v1.0.5

type AddNft struct {
	FioAddress string          `json:"fio_address"`
	Nfts       []NftToAdd      `json:"nfts"`
	MaxFee     uint64          `json:"max_fee"`
	Actor      eos.AccountName `json:"actor"`
	Tpid       string          `json:"tpid"`
}

AddNft is used to add an array of NFTs (max 3 per tx).

type Address

type Address string

Address is a FIO address, which should be formatted as 'name@domain'

func (Address) Valid

func (a Address) Valid() (ok bool)

Valid checks for the correct fio.Address formatting

Rules:
  Min: 3
  Max: 64
  Characters allowed: ASCII a-z0-9 - (dash) @ (ampersat)
  Characters required:
     only one @ and at least one a-z0-9 on either side of @.
     a-z0-9 is required on either side of any dash
  Case-insensitive

type AllowedAction added in v1.0.2

type AllowedAction struct {
	Action         eos.ActionName     `json:"action"`
	Contract       eos.AccountName    `json:"contract"`
	BlockTimeStamp eos.BlockTimestamp `json:"block_time_stamp"` // unixtime value
}

AllowedAction is an account::action that is allowed to execute by eosio

type AllowedActionsResp added in v1.0.2

type AllowedActionsResp struct {
	Actions []AllowedAction `json:"actions"`
	More    uint32          `json:"more"`
}

AllowedActionsResp holds the response from a get_actions API call, adds 'Allowed' prefix to avoid a conflict with eos libraries caused by an unfortunate choice in endpoint naming

type Authority

type Authority struct {
	Threshold uint32                      `json:"threshold"`
	Keys      []KeyWeight                 `json:"keys,omitempty"`
	Accounts  []eos.PermissionLevelWeight `json:"accounts,omitempty"`
	Waits     []eos.WaitWeight            `json:"waits,omitempty"`
}

Authority duplicates the eos.Authority accounting for differences in public key format

type AvailCheckReq

type AvailCheckReq struct {
	FioName string `json:"fio_name"`
}

type AvailCheckResp

type AvailCheckResp struct {
	IsRegistered uint8 `json:"is_registered"`
}

type BlockHeaderState

type BlockHeaderState struct {
	BlockNum                  uint32            `json:"block_num"`
	ProposedIrrBlock          uint32            `json:"dpos_proposed_irreversible_blocknum"`
	IrrBlock                  uint32            `json:"dpos_irreversible_blocknum"`
	ActiveSchedule            *Schedule         `json:"active_schedule"`
	BlockrootMerkle           BlockrootMerkle   `json:"blockroot_merkle"`
	ProducerToLastProduced    []json.RawMessage `json:"producer_to_last_produced"` // array of arrays with mixed types, access via member func
	ProducerToLastImpliedIrb  []json.RawMessage `json:"producer_to_last_implied_irb"`
	BlockSigningKey           ecc.PublicKey     `json:"block_signing_key"`
	ConfirmCount              []int             `json:"confirm_count"`
	Id                        eos.Checksum256   `json:"id"`
	Header                    *eos.BlockHeader  `json:"header"`
	PendingSchedule           *PendingSchedule  `json:"pending_schedule"`
	ActivatedProtocolFeatures protocolFeatures  `json:"activated_protocol_features"`
}

BlockHeaderState holds information about reversible blocks.

func (*BlockHeaderState) ProducerToLast

func (bhs *BlockHeaderState) ProducerToLast(producedOrImplied uint8) (found bool, last []*ProducerToLast)

ProducerToLast extracts a slice of ProducerToLast structs from a BlockHeaderState, this contains either the last block that the producer signed, or the last irreversible block. This is useful for seeing if a producer is missing rounds, or is responsible for double-signed blocks causing forks.

type BlockHeaderStateReq

type BlockHeaderStateReq struct {
	BlockNumOrId interface{} `json:"block_num_or_id"` // can be checksum or uint32
}

type BlockTxidsResp

type BlockTxidsResp struct {
	Ids                   []eos.Checksum256 `json:"ids"`
	LastIrreversibleBlock uint32            `json:"last_irreversible_block"`
}

BlockTxidsResp contains a list of transactions in a block.

type BlockrootMerkle

type BlockrootMerkle struct {
	ActiveNodes []eos.Checksum256 `json:"_active_nodes"`
	NodeCount   uint32            `json:"_node_count"`
}

type BpClaim

type BpClaim struct {
	FioAddress string          `json:"fio_address"`
	Actor      eos.AccountName `json:"actor"`
}

BpClaim requests payout for a block producer

type BpJson

type BpJson struct {
	ProducerAccountName string       `json:"producer_account_name"`
	Org                 BpJsonOrg    `json:"org"`
	Nodes               []BpJsonNode `json:"nodes"`
	BpJsonUrl           string       `json:"bp_json_url"`
}

type BpJsonLocation

type BpJsonLocation struct {
	Name      string  `json:"name"`
	Country   string  `json:"country"`
	Latitude  float32 `json:"latitude"`
	Longitude float32 `json:"longitude"`
}

type BpJsonNode

type BpJsonNode struct {
	Location     BpJsonLocation `json:"location"`
	NodeType     interface{}    `json:"node_type,omitempty"`
	P2pEndpoint  string         `json:"p2p_endpoint,omitempty"`
	BnetEndpoint string         `json:"bnet_endpoint,omitempty"`
	ApiEndpoint  string         `json:"api_endpoint,omitempty"`
	SslEndpoint  string         `json:"ssl_endpoint,omitempty"`
}

type BpJsonOrg

type BpJsonOrg struct {
	CandidateName       string `json:"candidate_name"`
	Website             string `json:"website"`
	CodeOfConduct       string `json:"code_of_conduct"`
	OwnershipDisclosure string `json:"ownership_disclosure"`
	Email               string `json:"email"`
	Branding            struct {
		Logo256  string `json:"logo_256"`
		Logo1024 string `json:"logo_1024"`
		LogoSvg  string `json:"logo_svg"`
	} `json:"branding"`
	Location BpJsonLocation `json:"location"`
	Social   BpJsonSocial   `json:"social"`
}

type BpJsonSocial

type BpJsonSocial struct {
	Steemit  string `json:"steemit"`
	Twitter  string `json:"twitter"`
	Youtube  string `json:"youtube"`
	Facebook string `json:"facebook"`
	Github   string `json:"github"`
	Reddit   string `json:"reddit"`
	Keybase  string `json:"keybase"`
	Telegram string `json:"telegram"`
	Wechat   string `json:"wechat"`
}

type BundleVote

type BundleVote struct {
	BundledTransactions int64  `json:"bundled_transactions"`
	Actor               string `json:"actor"`
	MaxFee              uint64 `json:"max_fee"`
}

BundleVote is used by block producers to vote for the number of free transactions included when registering or renewing a FIO address

type BundleVoter

type BundleVoter struct {
	BlockProducerName eos.AccountName `json:"block_producer_name"`
	BundleVoteNumber  int64           `json:"bundlevotenumber"`
	LastVoteTimestamp uint64          `json:"lastvotetimestamp"`
}

BundleVoter (table query response) holds information about the block producer voting for the number of free bundled transactions for new or renewed addresses as stored in the fio.fee bundlevotes table.

type BurnAddress added in v1.0.2

type BurnAddress struct {
	FioAddress Address         `json:"fio_address"`
	Actor      eos.AccountName `json:"actor"`
	Tpid       string          `json:"tpid"`
	MaxFee     uint64          `json:"max_fee"`
}

BurnAddress will destroy an address owned by an account

type BurnExpired deprecated

type BurnExpired struct{}

BurnExpired is intended to be called by block producers to remove expired domains or addresses from RAM

Deprecated: as of the 2.5.x contracts release this will not work, use BurnExpiredRange instead

type BurnExpiredRange added in v1.0.5

type BurnExpiredRange struct {
	Offset int64 `json:"offset"`
	Limit  int32 `json:"limit"`
}

BurnExpiredRange is intended to be called by block producers to remove expired domains or addresses from RAM

type BurnNfts added in v1.0.5

type BurnNfts struct {
	Actor eos.AccountName `json:"actor"`
}

BurnNfts is intended to be called by block producers to remove expired NFT mappings from RAM

type CancelFndReq

type CancelFndReq struct {
	FioRequestId string `json:"fio_request_id"`
	MaxFee       uint64 `json:"max_fee"`
	Actor        string `json:"actor"`
	Tpid         string `json:"tpid"`
}

CancelFndReq allows cancelling a previously sent request

type CancelledRequest

type CancelledRequest struct {
	FioRequestId uint64 `json:"fio_request_id"`
	FundsReq
}

type CancelledRequests

type CancelledRequests struct {
	Requests []CancelledRequest `json:"requests"`
	More     uint32             `json:"more"`
}

type ChainsJson added in v1.0.3

type ChainsJson struct {
	Chains map[string]string `json:"chains"`
}

type ComputeFees added in v1.0.1

type ComputeFees struct{}

ComputeFees calculates fees based upon votes and multipliers, and updates the fiofees table. calling the fio.fee::computefees endpoint will return an error if there is no work.

type CreateFee

type CreateFee struct {
	EndPoint  string `json:"end_point"`
	Type      int64  `json:"type"`
	SufAmount int64  `json:"suf_amount"`
}

CreateFee is a privileged action that adds a new fee record in the fiofees table

type DomainResp

type DomainResp struct {
	Name       string           `json:"name"`
	IsPublic   uint8            `json:"is_public"`
	Expiration int64            `json:"expiration"`
	Account    *eos.AccountName `json:"account,omitempty"`
}

DomainResp holds the table query lookup result for a domain

type ExpDomain deprecated

type ExpDomain struct {
	Actor  eos.AccountName `json:"actor"`
	Domain string          `json:"domain"`
}

ExpDomain is used by a test contract and not available on mainnet

Deprecated: only used in development environments

type FeeValue

type FeeValue struct {
	EndPoint string `json:"end_point"`
	Value    int64  `json:"value"`
}

FeeValue is used by block producers to vote on the base cost (before multiplier) for a fee

func GetMaxFees added in v1.0.1

func GetMaxFees() []FeeValue

GetMaxFees gets the current max fees as a slice of FeeValue

type FeeValueTs added in v1.0.2

type FeeValueTs struct {
	EndPoint  string `json:"end_point"`
	Value     int64  `json:"value"`
	TimeStamp uint64 `json:"timestamp"`
}

type FeeVote deprecated

type FeeVote struct {
	Id                uint64          `json:"id"`
	BlockProducerName eos.AccountName `json:"block_producer_name"`
	EndPoint          string          `json:"end_point"`
	EndPointHash      eos.Uint128     `json:"end_point_hash"`
	SufAmount         uint64          `json:"suf_amount"`
	LastVoteTimestamp uint64          `json:"lastvotetimestamp"`
}

FeeVote (table query response) holds fee vote information from the fio.fee feevotes table

Deprecated: replaced by FeeVote2

type FeeVote2 added in v1.0.2

type FeeVote2 struct {
	Id                uint64          `json:"id"`
	BlockProducerName eos.AccountName `json:"block_producer_name"`
	FeeVotes          []FeeValueTs    `json:"feevotes"`
	LastVoteTimestamp uint64          `json:"lastvotetimestamp"`
}

FeeVote2 (query response) is the new voting table format

type FeeVoter

type FeeVoter struct {
	BlockProducerName eos.AccountName `json:"block_producer_name"`
	FeeMultiplier     float64         `json:"fee_multiplier"`
	LastVoteTimestamp uint64          `json:"lastvotetimestamp"`
}

FeeVoter (table query response) holds information about the block producer performing a multiplier vote as stored in the fio.fee feevoters table

type FioFee

type FioFee struct {
	FeeId        uint64      `json:"fee_id"`
	EndPoint     string      `json:"end_point"`
	EndPointHash eos.Uint128 `json:"end_point_hash"`
	Type         uint64      `json:"type"`
	SufAmount    uint64      `json:"suf_amount"`
	VotesPending eos.Bool    `json:"votes_pending"`
}

FioFee (table query response) holds the details of an action's fee stored in the fio.fee fiofees table.

type FioName

type FioName struct {
	FioDomain  string `json:"fio_domain,omitifempty"`
	FioAddress string `json:"fio_address,omitifempty"`
	Expiration string `json:"expiration"`
	IsPublic   int    `json:"is_public,omitifempty"`
}

FioName holds information for either an address or a domain

type FioNames

type FioNames struct {
	FioDomains   []FioName `json:"fio_domains,omitifempty"`
	FioAddresses []FioName `json:"fio_addresses,omitifempty"`
	Message      string    `json:"message,omitifempty"`
	More         uint32    `json:"more,omitifempty"`
}

FioNames holds the response when getting fio names or addresses for an account

type FundsReq

type FundsReq struct {
	PayerFioAddress string `json:"payer_fio_address"`
	PayeeFioAddress string `json:"payee_fio_address"`
	Content         string `json:"content"`
	MaxFee          uint64 `json:"max_fee"`
	Actor           string `json:"actor"`
	Tpid            string `json:"tpid"`
}

FundsReq is a request sent from one user to another requesting funds

type FundsReqTableResp

type FundsReqTableResp struct {
	FioRequestId    uint64    `json:"fio_request_id"`
	Content         string    `json:"content"`
	TimeStamp       int64     `json:"time_stamp"`
	PayerFioAddress string    `json:"payer_fio_addr"`
	PayerKey        string    `json:"payer_key"`
	PayeeFioAddress string    `json:"payee_fio_addr"`
	PayeeKey        string    `json:"payee_key"`
	Time            time.Time `json:"time"`

	// additional fields indicating if the FIO address does not match the public key, which may indicate the address
	// was transferred after the request was sent.
	PayeeMismatch bool `json:"payee_mismatch"`
	PayerMismatch bool `json:"payer_mismatch"`
}

FundsReqTableResp has the most useful fields of what is stored in the fioreqctxts table. It is slightly different than what is sent from the API endpoint, but is useful when a specific request needs to be retrieved.

type FundsRequestStatusResp

type FundsRequestStatusResp struct {
	Id           uint64 `json:"id"`
	FioRequestId uint64 `json:"fio_request_id"`
	Status       uint64 `json:"status"`
	Metadata     string `json:"metadata"`
	TimeStamp    uint64 `json:"time_stamp"`
}

type FundsResp

type FundsResp struct {
	PayerFioAddress string `json:"payer_fio_address"`
	PayeeFioAddress string `json:"payee_fio_address"`
	Content         string `json:"content"`
	MaxFee          uint64 `json:"max_fee"`
	Actor           string `json:"actor"`
	Tpid            string `json:"tpid"`
	FioRequestId    uint64 `json:"fio_request_id,omitempty"`
}

FundsResp is a request sent from one user to another requesting funds, it includes the fio_request_id, so should be used when querying against the API endpoint

type GenesisLockedTokens added in v1.0.2

type GenesisLockedTokens struct {
	Name                  eos.AccountName `json:"owner"`
	TotalGrantAmount      uint64          `json:"total_grant_amount"`
	UnlockedPeriodCount   uint32          `json:"unlocked_period_count"`
	GrantType             uint32          `json:"grant_type"`
	InhibitUnlocking      uint32          `json:"inhibit_unlocking"`
	RemainingLockedAmount uint64          `json:"remaining_locked_amount"` // Do not trust on-chain value, only calculated on activity.
	Timestamp             uint32          `json:"timestamp"`
}

GenesisLockedTokens holds information about tokens that were locked at chain genesis.

func (*GenesisLockedTokens) ActualRemaining added in v1.0.2

func (g *GenesisLockedTokens) ActualRemaining() (tokens uint64, err error)

ActualRemaining calculates the outstanding locked tokens, this is needed because RemainingLockedAmount is only updated when an account spends or receives tokens. This should be subtracted from the current balance to calculate available tokens.

type GetFeeRequest

type GetFeeRequest struct {
	FioAddress string `json:"fio_address"`
	EndPoint   string `json:"end_point"`
}

type GetFeeResponse

type GetFeeResponse struct {
	Fee uint64 `json:"fee"`
}

type GetFioBalanceResp added in v1.0.2

type GetFioBalanceResp struct {
	Balance   uint64 `json:"balance"`
	Available uint64 `json:"available"`
}

type GetTableRowsOrderRequest

type GetTableRowsOrderRequest struct {
	Code       string `json:"code"` // Contract "code" account where table lives
	Scope      string `json:"scope"`
	Table      string `json:"table"`
	LowerBound string `json:"lower_bound,omitempty"`
	UpperBound string `json:"upper_bound,omitempty"`
	Limit      uint32 `json:"limit,omitempty"`          // defaults to 10 => chain_plugin.hpp:struct get_table_rows_params
	KeyType    string `json:"key_type,omitempty"`       // The key type of --index, primary only supports (i64), all others support (i64, i128, i256, float64, float128, ripemd160, sha256). Special type 'name' indicates an account name.
	Index      string `json:"index_position,omitempty"` // Index number, 1 - primary (first), 2 - secondary index (in order defined by multi_index), 3 - third index, etc. Number or name of index can be specified, e.g. 'secondary' or '2'.
	EncodeType string `json:"encode_type,omitempty"`    // The encoding type of key_type (i64 , i128 , float64, float128) only support decimal encoding e.g. 'dec'" "i256 - supports both 'dec' and 'hex', ripemd160 and sha256 is 'hex' only
	JSON       bool   `json:"json"`                     // JSON output if true, binary if false
	Reverse    bool   `json:"reverse"`                  // Sort order
}

GetTableRowsOrderRequest extends eos.GetTableRowsRequest by adding a reverse field for sorting on index, not sure if it is something unique to FIO or missing for eos-go, but is very handy for limiting searches.

type KeyWeight

type KeyWeight struct {
	PublicKey ecc.PublicKey `json:"key"`
	Weight    uint16        `json:"weight"` // weight_type
}

KeyWeight duplicates the eos.KeyWeight accounting for differences in public key format

type LockPeriods added in v1.0.2

type LockPeriods struct {
	Duration uint64  `json:"duration"`
	Percent  float64 `json:"percent"`
}

LockPeriods specifies how long a portion of the locked tokens will be locked by seconds and percentage, a slice of these is provided when locking tokens and must total 100%. It's also important to know that when staking tokens only certain durations will be valid, see https://github.com/fioprotocol/fips/blob/master/fip-0021.md

type LockTokensResp added in v1.0.2

type LockTokensResp struct {
	Id                  uint32          `json:"id"`
	OwnerAccount        eos.AccountName `json:"owner_account"`
	LockAmount          uint64          `json:"lock_amount"`
	PayoutsPerformed    uint32          `json:"payouts_performed"`
	CanVote             int32           `json:"can_vote"`
	Periods             []*LockPeriods  `json:"periods"`
	RemainingLockAmount uint64          `json:"remaining_lock_amount"`
	TimeStamp           int64           `json:"time_stamp"`
}

type MsigAction

type MsigAction struct {
	Account       eos.Name        `json:"account"`
	Name          eos.Name        `json:"name"`
	Authorization PermissionLevel `json:"authorization"`
	Data          []byte          `json:"data"`
}

type MsigApproval

type MsigApproval struct {
	Level PermissionLevel `json:"level"`
	Time  eos.JSONTime    `json:"time"`
}

type MsigApprovalsInfo

type MsigApprovalsInfo struct {
	Version            uint8          `json:"version"`
	ProposalName       eos.Name       `json:"proposal_name"`
	RequestedApprovals []MsigApproval `json:"requested_approvals"`
	ProvidedApprovals  []MsigApproval `json:"provided_approvals"`
}

func (MsigApprovalsInfo) HasApproved

func (info MsigApprovalsInfo) HasApproved(actor eos.AccountName) bool

HasApproved checks if an account has provided a signature

func (MsigApprovalsInfo) HasRequested

func (info MsigApprovalsInfo) HasRequested(actor eos.AccountName) bool

HasRequested checks if an account is on the list of requested signatures

type MsigApprove

type MsigApprove struct {
	Proposer     eos.AccountName `json:"proposer"`
	ProposalName eos.Name        `json:"proposal_name"`
	Level        PermissionLevel `json:"level"`
	MaxFee       uint64          `json:"max_fee"`
	ProposalHash eos.Checksum256 `json:"proposal_hash"`
}

MsigApprove approves a multi-sig proposal

type MsigCancel

type MsigCancel struct {
	Proposer     eos.AccountName `json:"proposer"`
	ProposalName eos.Name        `json:"proposal_name"`
	Canceler     eos.AccountName `json:"canceler"`
	MaxFee       uint64          `json:"max_fee"`
}

MsigCancel withdraws a proposal, must be performed by the account that proposed the transaction

type MsigExec

type MsigExec struct {
	Proposer     eos.AccountName `json:"proposer"`
	ProposalName eos.Name        `json:"proposal_name"`
	MaxFee       uint64          `json:"max_fee"`
	Executer     eos.AccountName `json:"executer"`
}

MsigExec will attempt to execute a proposed transaction

type MsigExtension

type MsigExtension struct {
	Type uint16 `json:"type"`
	Data []byte `json:"data"`
}

TODO: not sure if this is needed

type MsigInvalidate

type MsigInvalidate struct {
	Name   eos.Name `json:"name"`
	MaxFee uint64   `json:"max_fee"`
}

MsigInvalidate is used to remove all approvals and proposals for an account

type MsigInvalidation

type MsigInvalidation struct {
	Account              eos.Name      `json:"account"`
	LastInvalidationTime eos.TimePoint `json:"last_invalidation_time"`
}

type MsigOldApprovalsInfo

type MsigOldApprovalsInfo struct {
	ProposalName       eos.Name          `json:"proposal_name"`
	RequestedApprovals []PermissionLevel `json:"requested_approvals"`
	ProvidedApprovals  []PermissionLevel `json:"provided_approvals"`
}

type MsigProposal

type MsigProposal struct {
	ProposalName      eos.Name         `json:"proposal_name"`
	PackedTransaction *eos.Transaction `json:"packed_transaction"`
	ProposalHash      eos.Checksum256  `json:"proposal_hash"`
}

MsigProposal is a query response for getting details of a proposed transaction

type MsigPropose

type MsigPropose struct {
	Proposer     eos.AccountName        `json:"proposer"`
	ProposalName eos.Name               `json:"proposal_name"`
	Requested    []*PermissionLevel     `json:"requested"`
	MaxFee       uint64                 `json:"max_fee"`
	Trx          *eos.SignedTransaction `json:"trx"`
}

MsigPropose is a new proposal

type MsigTransaction

type MsigTransaction struct {
	ContextFreeActions    []*Action   `json:"context_free_actions"`
	Actions               []*Action   `json:"actions"`
	TransactionExtensions []*MsigExec `json:"transaction_extensions"`
}

this also looks potentially incorrect:

type MsigTransactionHeader

type MsigTransactionHeader eos.TransactionHeader

MsigTransactionHeader is an alias for consistent naming

type MsigUnapprove

type MsigUnapprove struct {
	Proposer     eos.AccountName `json:"proposer"`
	ProposalName eos.Name        `json:"proposal_name"`
	Level        PermissionLevel `json:"level"`
	MaxFee       uint64          `json:"max_fee"`
}

MsigUnapprove withdraws an existing approval for an account

type MsigWrappedPropose

type MsigWrappedPropose struct {
	Proposer     eos.AccountName    `json:"proposer"`
	ProposalName eos.Name           `json:"proposal_name"`
	Requested    []*PermissionLevel `json:"requested"`
	MaxFee       uint64             `json:"max_fee"`
	Trx          *eos.Transaction   `json:"trx"`
}

type Name

type Name eos.Name

Name wraps eos.Name for convenience and less imports for client

func (Name) ToEos

func (n Name) ToEos() eos.Name

type Nft added in v1.0.5

type Nft struct {
	ChainCode       string `json:"chain_code,omitempty"`
	ContractAddress string `json:"contract_address,omitempty"`
	TokenId         string `json:"token_id,omitempty"`
	Url             string `json:"url,omitempty"`
	Hash            string `json:"hash,omitempty"`
	Metadata        string `json:"metadata,omitempty"`
}

type NftResponse added in v1.0.5

type NftResponse struct {
	Nfts []Nft  `json:"nfts"`
	More uint32 `json:"more"`
}

type NftToAdd added in v1.0.5

type NftToAdd struct {
	ChainCode       string      `json:"chain_code"`
	ContractAddress string      `json:"contract_address"`
	TokenId         string      `json:"token_id"`
	Url             string      `json:"url"`
	Hash            string      `json:"hash"`
	Metadata        interface{} `json:"metadata"` // because this may change, it is an interface
}

NftToAdd represents a single NFT. There are validity constraints:

chain_code:        Min chars: 1, Max chars: 10, Characters allowed: ASCII a-z0-9, Case-insensitive
contract_address:  Min chars: 1, Max chars: 128
token_id:          Token ID of NFT. May be left blank if not applicable. Max 64 characters.
url:               URL of NFT asset, e.g. media url. May be left blank if not applicable. Max 128 characters.
hash:              SHA-256 hash of NFT asset, e.g. media url. May be left blank if not applicable. Max 64 characters.
metadata:          Serialized json, max. 64 chars. May be left empty.

type NftToDelete added in v1.0.5

type NftToDelete struct {
	ChainCode       string `json:"chain_code"`
	ContractAddress string `json:"contract_address"`
	TokenId         string `json:"token_id"`
}

NftToDelete is an individual NFT that should be removed from existing mappings, used by RemNft, The server will validate:

chain_code:       Min chars: 1, Max chars: 10, Characters allowed: ASCII a-z0-9, Case-insensitive
contract_address: Min chars: 1, Max chars: 128
token_id:         Token ID of NFT. May be left blank if not applicable. Max 64 characters.

type ObtContentResult

type ObtContentResult struct {
	Type    ObtType
	Request *ObtRequestContent
	Record  *ObtRecordContent
}

func DecryptContent

func DecryptContent(to *Account, fromPubKey string, encrypted string, obtType ObtType) (*ObtContentResult, error)

DecryptContent provides a new populated ObtContentResult struct given an encrypted content payload

func (ObtContentResult) ToJson

func (c ObtContentResult) ToJson() ([]byte, error)

type ObtRecordContent

type ObtRecordContent struct {
	PayerPublicAddress string `json:"payer_public_address"`
	PayeePublicAddress string `json:"payee_public_address"`
	Amount             string `json:"amount"`
	ChainCode          string `json:"chain_code"`
	TokenCode          string `json:"token_code"`
	Status             string `json:"status"`
	ObtId              string `json:"obt_id"`
	Memo               string `json:"memo"`
	Hash               string `json:"hash"`
	OfflineUrl         string `json:"offline_url"`
}

func (ObtRecordContent) Encrypt

func (rec ObtRecordContent) Encrypt(from *Account, toPubKey string) (content string, err error)

Encrypt serializes and encrypts the 'content' field for OBT requests

type ObtRequestContent

type ObtRequestContent struct {
	PayeePublicAddress string `json:"payee_public_address"`
	Amount             string `json:"amount"`
	ChainCode          string `json:"chain_code"`
	TokenCode          string `json:"token_code"`
	Memo               string `json:"memo"`
	Hash               string `json:"hash"`
	OfflineUrl         string `json:"offline_url"`
}

ObtRequestContent holds details for requesting funds

func (ObtRequestContent) Encrypt

func (req ObtRequestContent) Encrypt(from *Account, toPubKey string) (content string, err error)

Encrypt serializes and encrypts the 'content' field for OBT requests

type ObtType

type ObtType uint8
const (
	ObtInvalidType ObtType = iota
	ObtRequestType
	ObtResponseType
)

func (ObtType) String

func (o ObtType) String() string

type PayTpidRewards

type PayTpidRewards struct {
	Actor eos.AccountName `json:"actor"`
}

PayTpidRewards is used for wallets "technology provided id" to claim incentive rewards

type PendingFioRequestsResponse

type PendingFioRequestsResponse struct {
	Requests []RequestStatus `json:"requests"`
	More     int             `json:"more"`
}

type PendingSchedule

type PendingSchedule struct {
	ScheduleLibNum uint32          `json:"schedule_lib_num"`
	ScheduleHash   eos.Checksum256 `json:"schedule_hash"`
	Schedule       *Schedule
}

type Permission

type Permission struct {
	PermName     string    `json:"perm_name"`
	Parent       string    `json:"parent"`
	RequiredAuth Authority `json:"required_auth"`
}

Permission duplicates the eos.Permission accounting for differences in public key format

type PermissionLevel

type PermissionLevel eos.PermissionLevel

PermissionLevel wraps eos-go's type to add member functions

func NewPermissionLevel

func NewPermissionLevel(account eos.AccountName) *PermissionLevel

func NewPermissionLevelSlice

func NewPermissionLevelSlice(accounts []string) []*PermissionLevel

NewPermissionLevelSlice is a convenience function for quickly building a slice of active permissions

func (PermissionLevel) ToEos

func (pl PermissionLevel) ToEos() *eos.PermissionLevel

ToEos converts from fio.PermissionLevel to eos.PermissionLevel

type Producer

type Producer struct {
	Owner             eos.AccountName `json:"owner"`
	FioAddress        Address         `json:"fio_address"`
	TotalVotes        string          `json:"total_votes"`
	ProducerPublicKey string          `json:"producer_public_key"`
	IsActive          uint8           `json:"is_active"`
	Url               string          `json:"url"`
	UnpaidBlocks      uint64          `json:"unpaid_blocks"`
	LastClaimTime     string          `json:"last_claim_time"`
	Location          uint8           `json:"location"`
}

Producer is a modification of the corresponding eos-go structure

type ProducerKey

type ProducerKey struct {
	AccountName     eos.AccountName `json:"producer_name"`
	BlockSigningKey ecc.PublicKey   `json:"block_signing_key"`
}

type ProducerLocation

type ProducerLocation uint16

ProducerLocation valid values are 10-80 in increments of 10

const (
	LocationEastAsia         ProducerLocation = 10
	LocationAustralia        ProducerLocation = 20
	LocationWestAsia         ProducerLocation = 30
	LocationAfrica           ProducerLocation = 40
	LocationEurope           ProducerLocation = 50
	LocationEastNorthAmerica ProducerLocation = 60
	LocationSouthAmerica     ProducerLocation = 70
	LocationWestNorthAmerica ProducerLocation = 80
)

type ProducerSchedule

type ProducerSchedule struct {
	Active   Schedule `json:"active"`
	Pending  Schedule `json:"pending"`
	Proposed Schedule `json:"proposed"`
}

type ProducerToLast

type ProducerToLast struct {
	Producer          eos.AccountName `json:"producer"`
	BlockNum          uint32          `json:"block_num"`
	ProducedOrImplied string          `json:"produced_or_implied"`
}

type Producers

type Producers struct {
	Producers               []Producer `json:"producers"`
	TotalProducerVoteWeight string     `json:"total_producer_vote_weight"`
	More                    string     `json:"more"`
}

Producers is a modification of the corresponding eos-go structure

type PubAddress

type PubAddress struct {
	PublicAddress string `json:"public_address"`
	Message       string `json:"message"`
}

type RecordSend

type RecordSend struct {
	FioRequestId    string `json:"fio_request_id"`
	PayerFioAddress string `json:"payer_fio_address"`
	PayeeFioAddress string `json:"payee_fio_address"`
	Content         string `json:"content"`
	MaxFee          uint64 `json:"max_fee"`
	Actor           string `json:"actor"`
	Tpid            string `json:"tpid"`
}

type RegAddress

type RegAddress struct {
	FioAddress        string          `json:"fio_address"`
	OwnerFioPublicKey string          `json:"owner_fio_public_key"`
	MaxFee            uint64          `json:"max_fee"`
	Actor             eos.AccountName `json:"actor"`
	Tpid              string          `json:"tpid"`
}

RegAddress Registers a FIO Address on the FIO blockchain

type RegDomain

type RegDomain struct {
	FioDomain         string          `json:"fio_domain"`
	OwnerFioPublicKey string          `json:"owner_fio_public_key"`
	MaxFee            uint64          `json:"max_fee"`
	Actor             eos.AccountName `json:"actor"`
	Tpid              string          `json:"tpid"`
}

RegDomain registers a FIO Domain on the FIO blockchain

type RegProducer

type RegProducer struct {
	FioAddress string          `json:"fio_address"`
	FioPubKey  string          `json:"fio_pub_key"`
	Url        string          `json:"url"`
	Location   uint16          `json:"location"`
	Actor      eos.AccountName `json:"actor"`
	MaxFee     uint64          `json:"max_fee"`
}

type RegProxy

type RegProxy struct {
	FioAddress string          `json:"fio_address"`
	Actor      eos.AccountName `json:"actor"`
	MaxFee     uint64          `json:"max_fee"`
}

type RejectFndReq

type RejectFndReq struct {
	FioRequestId string `json:"fio_request_id"`
	MaxFee       uint64 `json:"max_fee"`
	Actor        string `json:"actor"`
	Tpid         string `json:"tpid"`
}

RejectFndReq is a response to a user, denying their request for funds.

type RemAllNft added in v1.0.5

type RemAllNft struct {
	FioAddress string          `json:"fio_address"`
	MaxFee     uint64          `json:"max_fee"`
	Actor      eos.AccountName `json:"actor"`
	Tpid       string          `json:"tpid"`
}

RemAllNft removes all NFTs for a FIO Address

type RemNft added in v1.0.5

type RemNft struct {
	FioAddress string          `json:"fio_address"`
	Nfts       []NftToDelete   `json:"nfts"`
	MaxFee     uint64          `json:"max_fee"`
	Actor      eos.AccountName `json:"actor"`
	Tpid       string          `json:"tpid"`
}

RemNft is used to remove NFTs from an address

type RemoveAction added in v1.0.2

type RemoveAction struct {
	Action eos.ActionName  `json:"action"`
	Actor  eos.AccountName `json:"actor"`
}

RemoveAction deletes an allowed action from the allowed list.

type RemoveAddrReq

type RemoveAddrReq struct {
	FioAddress      string          `json:"fio_address"`
	PublicAddresses []TokenPubAddr  `json:"public_addresses"`
	MaxFee          uint64          `json:"max_fee"`
	Actor           eos.AccountName `json:"actor"`
	Tpid            string          `json:"tpid"`
}

type RemoveAllAddrReq

type RemoveAllAddrReq struct {
	FioAddress string          `json:"fio_address"`
	MaxFee     uint64          `json:"max_fee"`
	Actor      eos.AccountName `json:"actor"`
	Tpid       string          `json:"tpid"`
}

RemoveAllAddrReq is for removing all public addresses associated with a FIO address

type RenewAddress

type RenewAddress struct {
	FioAddress string          `json:"fio_address"`
	MaxFee     uint64          `json:"max_fee"`
	Tpid       string          `json:"tpid"`
	Actor      eos.AccountName `json:"actor"`
}

RenewAddress extends the expiration of an address by a year, and refreshes the bundle

type RenewDomain

type RenewDomain struct {
	FioDomain string          `json:"fio_domain"`
	MaxFee    uint64          `json:"max_fee"`
	Tpid      string          `json:"tpid"`
	Actor     eos.AccountName `json:"actor"`
}

RenewDomain extends the expiration of a domain for a year

type RequestStatus

type RequestStatus struct {
	FioRequestId      uint64       `json:"fio_request_id"`
	PayerFioAddress   string       `json:"payer_fio_address"`
	PayeeFioAddress   string       `json:"payee_fio_address"`
	PayerFioPublicKey string       `json:"payer_fio_public_key"`
	PayeeFioPublicKey string       `json:"payee_fio_public_key"`
	Content           string       `json:"content"`
	TimeStamp         eos.JSONTime `json:"time_stamp"`
	Status            string       `json:"status"`
}

type RewardsPaid

type RewardsPaid struct {
	Tpid string `json:"tpid"`
}

RewardsPaid is privileged

type Schedule

type Schedule struct {
	Version   uint32        `json:"version"`
	Producers []ProducerKey `json:"producers"`
}

type SetDomainPub

type SetDomainPub struct {
	FioDomain string          `json:"fio_domain"`
	IsPublic  uint8           `json:"is_public"`
	MaxFee    uint64          `json:"max_fee"`
	Actor     eos.AccountName `json:"actor"`
	Tpid      string          `json:"tpid"`
}

SetDomainPub changes the permissions for a domain, allowing (or not) anyone to register an address

type SetFeeMult

type SetFeeMult struct {
	Multiplier float64         `json:"multiplier"`
	MaxFee     uint64          `json:"max_fee"`
	Actor      eos.AccountName `json:"actor"`
}

SetFeeMult is used by block producers to vote for the fee multiplier used for calculating rewards

type SetFeeVote

type SetFeeVote struct {
	FeeRatios []*FeeValue     `json:"fee_ratios"`
	MaxFee    uint64          `json:"max_fee"`
	Actor     eos.AccountName `json:"actor"`
}

SetFeeVote is used by block producers to adjust the fee for an action, it is possible that not all fees will fit into a single transaction and may require multiple calls.

type TokenPubAddr

type TokenPubAddr struct {
	TokenCode     string `json:"token_code"`
	ChainCode     string `json:"chain_code"`
	PublicAddress string `json:"public_address"`
}

TokenPubAddr holds *publicly* available token information for a FIO address, allowing anyone to lookup an address

type Transfer

type Transfer struct {
	From     eos.AccountName `json:"from"`
	To       eos.AccountName `json:"to"`
	Quantity eos.Asset       `json:"quantity"`
	Memo     string          `json:"memo"`
}

Transfer is a privileged call, and not normally used for sending tokens, use TransferTokensPubKey instead

type TransferAddress

type TransferAddress struct {
	FioAddress           string          `json:"fio_address"`
	NewOwnerFioPublicKey string          `json:"new_owner_fio_public_key"`
	MaxFee               uint64          `json:"max_fee"`
	Tpid                 string          `json:"tpid"`
	Actor                eos.AccountName `json:"actor"`
}

TransferAddress (future) transfers ownership of a FIO address

type TransferDom

type TransferDom struct {
	FioDomain            string          `json:"fio_domain"`
	NewOwnerFioPublicKey string          `json:"new_owner_fio_public_key"`
	MaxFee               uint64          `json:"max_fee"`
	Actor                eos.AccountName `json:"actor"`
	Tpid                 string          `json:"tpid"`
}

TransferDom (future) transfers ownership of a domain

type TransferLockedTokens added in v1.0.2

type TransferLockedTokens struct {
	PayeePublicKey string          `json:"payee_public_key"`
	CanVote        int32           `json:"can_vote"`
	Periods        []LockPeriods   `json:"periods"`
	Amount         uint64          `json:"amount"`  // differs from ABI, not sure why this call is unsigned, but making consistent in SDK.
	MaxFee         uint64          `json:"max_fee"` // ABI also differs here.
	Actor          eos.AccountName `json:"actor"`
	Tpid           string          `json:"tpid"`
}

type TransferTokensPubKey

type TransferTokensPubKey struct {
	PayeePublicKey string          `json:"payee_public_key"`
	Amount         uint64          `json:"amount"`
	MaxFee         uint64          `json:"max_fee"`
	Actor          eos.AccountName `json:"actor"`
	Tpid           string          `json:"tpid"`
}

TransferTokensPubKey is used to send FIO tokens to a public key

type TxOptions

type TxOptions struct {
	eos.TxOptions
}

TxOptions wraps eos.TxOptions

type UnRegProducer

type UnRegProducer struct {
	FioAddress string          `json:"fio_address"`
	Actor      eos.AccountName `json:"actor"`
	MaxFee     uint64          `json:"max_fee"`
}

type UpdateAuth

type UpdateAuth struct {
	Account    eos.AccountName `json:"account"`
	Permission eos.Name        `json:"permission"`
	Parent     eos.Name        `json:"parent"`
	Auth       Authority       `json:"auth"`
	MaxFee     uint64          `json:"max_fee"`
}

type UpdateBounty

type UpdateBounty struct {
	Amount uint64 `json:"amount"`
}

UpdateBounty is privileged

type UpdateTpid

type UpdateTpid struct {
	Tpid   string          `json:"tpid"`
	Owner  eos.AccountName `json:"owner"`
	Amount uint64          `json:"amount"`
}

UpdateTpid is a privileged call

type VoteProducer

type VoteProducer struct {
	Producers  []string `json:"producers"`
	FioAddress string   `json:"fio_address,omitempty"`
	Actor      eos.AccountName
	MaxFee     uint64 `json:"max_fee"`
}

VoteProducer votes for a producer

type VoteProxy

type VoteProxy struct {
	Proxy      string          `json:"proxy"`
	FioAddress string          `json:"fio_address,omitempty"`
	Actor      eos.AccountName `json:"actor"`
	MaxFee     uint64          `json:"max_fee"`
}

type WrapExecute

type WrapExecute struct {
	Executor eos.AccountName  `json:"executor"`
	Trx      *eos.Transaction `json:"trx"`
}

WrapExecute wraps a transaction to be executed with specific permissions via eosio.wrap NOTE: this is not working as expected, use caution.

Directories

Path Synopsis
eos
btcsuite/btcd/btcec
Package btcec implements support for the elliptic curves needed for bitcoin.
Package btcec implements support for the elliptic curves needed for bitcoin.
btcsuite/btcutil
Package btcutil provides bitcoin-specific convenience functions and types.
Package btcutil provides bitcoin-specific convenience functions and types.
btcsuite/btcutil/base58
Package base58 provides an API for working with modified base58 and Base58Check encodings.
Package base58 provides an API for working with modified base58 and Base58Check encodings.
ecc
p2p

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL