Documentation ¶
Index ¶
- func FromFil(v decimal.Decimal) abi.TokenAmount
- func ToFil(v abi.TokenAmount) decimal.Decimal
- type Client
- func (c *Client) AuthNew(ctx context.Context, perms []string) ([]byte, error)
- func (c *Client) AuthVerify(ctx context.Context, token string) ([]string, error)
- func (c *Client) BeaconGetEntry(ctx context.Context, epoch int64) (*types.BeaconEntry, error)
- func (c *Client) ChainExport(ctx context.Context, tsk types.TipSetKey) ([]byte, error)
- func (c *Client) ChainGetBlock(ctx context.Context, id cid.Cid) (*types.BlockHeader, error)
- func (c *Client) ChainGetBlockMessages(ctx context.Context, id cid.Cid) (*types.BlockMessages, error)
- func (c *Client) ChainGetGenesis(ctx context.Context) (*types.TipSet, error)
- func (c *Client) ChainGetMessage(ctx context.Context, id cid.Cid) (*types.Message, error)
- func (c *Client) ChainGetNode(ctx context.Context, p string) (*types.IpldObject, error)
- func (c *Client) ChainGetParentMessages(ctx context.Context, id cid.Cid) ([]types.ParentMessage, error)
- func (c *Client) ChainGetParentReceipts(ctx context.Context, id cid.Cid) ([]*types.MessageReceipt, error)
- func (c *Client) ChainGetPath(ctx context.Context, from types.TipSetKey, to types.TipSetKey) (*types.HeadChange, error)
- func (c *Client) ChainGetRandomnessFromBeacon(ctx context.Context, tsk types.TipSetKey, personalization int64, ...) ([]byte, error)
- func (c *Client) ChainGetRandomnessFromTickets(ctx context.Context, tsk types.TipSetKey, personalization int64, ...) ([]byte, error)
- func (c *Client) ChainGetTipSet(ctx context.Context, tsk types.TipSetKey) (*types.TipSet, error)
- func (c *Client) ChainGetTipSetByHeight(ctx context.Context, height int64, tsk types.TipSetKey) (*types.TipSet, error)
- func (c *Client) ChainHasObj(ctx context.Context, o cid.Cid) (bool, error)
- func (c *Client) ChainHead(ctx context.Context) (*types.TipSet, error)
- func (c *Client) ChainNotify()
- func (c *Client) ChainReadObj(ctx context.Context, obj cid.Cid) ([]byte, error)
- func (c *Client) ChainSetHead(ctx context.Context, tsk types.TipSetKey) error
- func (c *Client) ChainStatObj(ctx context.Context, obj, base cid.Cid) (types.ObjStat, error)
- func (c *Client) ChainTipSetWeight(ctx context.Context, tsk types.TipSetKey) (decimal.Decimal, error)
- func (c *Client) FilecoinMethod(method string) string
- func (c *Client) GasEstimateGasLimit(ctx context.Context, message *types.Message, cids []*cid.Cid) (int64, error)
- func (c *Client) GasEstimateMessageGas(ctx context.Context, message *types.Message, spec *types.MessageSendSpec, ...) (*types.Message, error)
- func (c *Client) MpoolGetNonce(ctx context.Context, address address.Address) (nonce uint64, err error)
- func (c *Client) MpoolPush(ctx context.Context, sm *types.SignedMessage) (cid.Cid, error)
- func (c *Client) Request(ctx context.Context, method string, result interface{}, params ...interface{}) error
- func (c *Client) SetToken(token string) *Client
- func (c *Client) StateGetActor(ctx context.Context, addr address.Address, cids []*cid.Cid) (*types.Actor, error)
- func (c *Client) StateGetReceipt(ctx context.Context, id cid.Cid, cids []*cid.Cid) (*types.MessageReceipt, error)
- func (c *Client) StateReplay(ctx context.Context, tsk types.TipSetKey, mc cid.Cid) (*types.InvocResult, error)
- func (c *Client) StateSearchMsg(ctx context.Context, msg cid.Cid) (*types.MsgLookup, error)
- func (c *Client) Version(ctx context.Context) (*types.Version, error)
- func (c *Client) WalletBalance(ctx context.Context, addr address.Address) (abi.TokenAmount, error)
- func (c *Client) WalletDefaultAddress(ctx context.Context) (address.Address, error)
- func (c *Client) WalletDelete(ctx context.Context, addr address.Address) error
- func (c *Client) WalletExport(ctx context.Context, addr address.Address) (*types.KeyInfo, error)
- func (c *Client) WalletHas(ctx context.Context, addr address.Address) (bool, error)
- func (c *Client) WalletImport(ctx context.Context, ki *types.KeyInfo) (address.Address, error)
- func (c *Client) WalletList(ctx context.Context) ([]address.Address, error)
- func (c *Client) WalletNew(ctx context.Context, typ types.KeyType) (address.Address, error)
- func (c *Client) WalletSetDefault(ctx context.Context, addr address.Address) error
- func (c *Client) WalletSign(ctx context.Context, addr address.Address, data []byte) (*crypto.Signature, error)
- func (c *Client) WalletSignMessage(ctx context.Context, addr address.Address, message *types.Message) (*types.SignedMessage, error)
- func (c *Client) WalletVerify(ctx context.Context, k string, msg []byte, sig *crypto.Signature) (bool, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶ added in v0.0.3
type Client struct {
// contains filtered or unexported fields
}
func (*Client) AuthVerify ¶ added in v0.0.4
AuthVerify
func (*Client) BeaconGetEntry ¶ added in v0.0.4
BeaconGetEntry returns the beacon entry for the given filecoin epoch. If the entry has not yet been produced, the call will block until the entry becomes available
func (*Client) ChainExport ¶ added in v0.0.4
ChainExport returns a stream of bytes with CAR dump of chain data.
func (*Client) ChainGetBlock ¶ added in v0.0.4
ChainGetBlock returns the block specified by the given CID.
func (*Client) ChainGetBlockMessages ¶ added in v0.0.3
func (c *Client) ChainGetBlockMessages(ctx context.Context, id cid.Cid) (*types.BlockMessages, error)
ChainGetBlockMessages returns messages stored in the specified block.
func (*Client) ChainGetGenesis ¶ added in v0.0.4
ChainGetGenesis returns the genesis tipset.
func (*Client) ChainGetMessage ¶ added in v0.0.3
ChainGetMessage reads a message referenced by the specified CID from the chain blockstore.
func (*Client) ChainGetNode ¶ added in v0.0.4
ChainGetNode
func (*Client) ChainGetParentMessages ¶ added in v0.0.4
func (c *Client) ChainGetParentMessages(ctx context.Context, id cid.Cid) ([]types.ParentMessage, error)
ChainGetParentMessages returns messages stored in parent tipset of the specified block.
func (*Client) ChainGetParentReceipts ¶ added in v0.0.4
func (c *Client) ChainGetParentReceipts(ctx context.Context, id cid.Cid) ([]*types.MessageReceipt, error)
ChainGetParentReceipts returns receipts for messages in parent tipset of the specified block.
func (*Client) ChainGetPath ¶ added in v0.0.4
func (c *Client) ChainGetPath(ctx context.Context, from types.TipSetKey, to types.TipSetKey) (*types.HeadChange, error)
ChainGetPath returns a set of revert/apply operations needed to get from one tipset to another
func (*Client) ChainGetRandomnessFromBeacon ¶ added in v0.0.4
func (c *Client) ChainGetRandomnessFromBeacon(ctx context.Context, tsk types.TipSetKey, personalization int64, randEpoch int64, entropy []byte) ([]byte, error)
ChainGetRandomnessFromBeacon is used to sample the beacon for randomness.
func (*Client) ChainGetRandomnessFromTickets ¶ added in v0.0.4
func (c *Client) ChainGetRandomnessFromTickets(ctx context.Context, tsk types.TipSetKey, personalization int64, randEpoch int64, entropy []byte) ([]byte, error)
ChainGetRandomnessFromTickets is used to sample the chain for randomness.
func (*Client) ChainGetTipSet ¶ added in v0.0.4
ChainGetTipSet returns the tipset specified by the given TipSetKey.
func (*Client) ChainGetTipSetByHeight ¶ added in v0.0.3
func (c *Client) ChainGetTipSetByHeight(ctx context.Context, height int64, tsk types.TipSetKey) (*types.TipSet, error)
ChainGetTipSetByHeight looks back for a tipset at the specified epoch. If there are no blocks at the specified epoch, a tipset at an earlier epoch will be returned.
func (*Client) ChainHasObj ¶ added in v0.0.4
ChainHasObj checks if a given CID exists in the chain blockstore.
func (*Client) ChainNotify ¶ added in v0.0.4
func (c *Client) ChainNotify()
ChainNotify returns channel with chain head updates. First message is guaranteed to be of len == 1, and type == 'current'.
func (*Client) ChainReadObj ¶ added in v0.0.4
ChainReadObj reads ipld nodes referenced by the specified CID from chain blockstore and returns raw bytes.
func (*Client) ChainSetHead ¶ added in v0.0.4
ChainSetHead forcefully sets current chain head. Use with caution.
func (*Client) ChainStatObj ¶ added in v0.0.4
ChainStatObj returns statistics about the graph referenced by 'obj'. If 'base' is also specified, then the returned stat will be a diff between the two objects.
func (*Client) ChainTipSetWeight ¶ added in v0.0.4
func (c *Client) ChainTipSetWeight(ctx context.Context, tsk types.TipSetKey) (decimal.Decimal, error)
ChainTipSetWeight computes weight for the specified tipset.
func (*Client) FilecoinMethod ¶ added in v0.0.3
Namespace Filecoin
func (*Client) GasEstimateGasLimit ¶ added in v0.0.3
func (c *Client) GasEstimateGasLimit(ctx context.Context, message *types.Message, cids []*cid.Cid) (int64, error)
GasEstimateGasLimit estimates gas used by the message and returns it. It fails if message fails to execute.
func (*Client) GasEstimateMessageGas ¶ added in v0.0.3
func (c *Client) GasEstimateMessageGas(ctx context.Context, message *types.Message, spec *types.MessageSendSpec, cids []*cid.Cid) (*types.Message, error)
GasEstimateMessageGas estimates gas values for unset message gas fields
func (*Client) MpoolGetNonce ¶ added in v0.3.1
func (c *Client) MpoolGetNonce(ctx context.Context, address address.Address) (nonce uint64, err error)
MpoolGetNonce 获取指定发送账号的下一个nonce值
func (*Client) Request ¶ added in v0.0.3
func (c *Client) Request(ctx context.Context, method string, result interface{}, params ...interface{}) error
Request call RPC method
func (*Client) StateGetActor ¶ added in v0.0.3
func (c *Client) StateGetActor(ctx context.Context, addr address.Address, cids []*cid.Cid) (*types.Actor, error)
StateGetActor returns the indicated actor's nonce and balance.
func (*Client) StateGetReceipt ¶ added in v0.0.3
func (c *Client) StateGetReceipt(ctx context.Context, id cid.Cid, cids []*cid.Cid) (*types.MessageReceipt, error)
StateGetReceipt returns the message receipt for the given message
func (*Client) StateReplay ¶ added in v0.0.5
func (c *Client) StateReplay(ctx context.Context, tsk types.TipSetKey, mc cid.Cid) (*types.InvocResult, error)
StateReplay returns the result of executing the indicated message, assuming it was executed in the indicated tipset.
func (*Client) StateSearchMsg ¶ added in v0.0.5
StateSearchMsg searches for a message in the chain, and returns its receipt and the tipset where it was executed
func (*Client) WalletBalance ¶ added in v0.0.3
WalletBalance returns the balance of the given address at the current head of the chain.
func (*Client) WalletDefaultAddress ¶ added in v0.0.3
WalletDefaultAddress returns the address marked as default in the wallet.
func (*Client) WalletDelete ¶ added in v0.0.4
WalletDelete deletes an address from the wallet.
func (*Client) WalletExport ¶ added in v0.0.3
WalletExport returns the private key of an address in the wallet.
func (*Client) WalletHas ¶ added in v0.0.3
WalletHas indicates whether the given address is in the wallet.
func (*Client) WalletImport ¶ added in v0.0.3
WalletImport receives a KeyInfo, which includes a private key, and imports it into the wallet.
func (*Client) WalletList ¶ added in v0.0.4
WalletList lists all the addresses in the wallet.
func (*Client) WalletNew ¶ added in v0.0.3
WalletNew creates a new address in the wallet with the given KeyType.
func (*Client) WalletSetDefault ¶ added in v0.0.3
WalletSetDefault marks the given address as as the default one.
func (*Client) WalletSign ¶ added in v0.0.3
func (c *Client) WalletSign(ctx context.Context, addr address.Address, data []byte) (*crypto.Signature, error)
WalletSign signs the given bytes using the given address.
func (*Client) WalletSignMessage ¶ added in v0.0.3
func (c *Client) WalletSignMessage(ctx context.Context, addr address.Address, message *types.Message) (*types.SignedMessage, error)
WalletSignMessage signs the given message using the given address.
func (*Client) WalletVerify ¶ added in v0.0.4
func (c *Client) WalletVerify(ctx context.Context, k string, msg []byte, sig *crypto.Signature) (bool, error)
WalletVerify takes an address, a signature, and some bytes, and indicates whether the signature is valid. The address does not have to be in the wallet.