Documentation ¶
Index ¶
- func LoadKey(path string) (*rsa.PrivateKey, error)
- func WithHost(host string) func(*options)
- func WithLogFreqFactor(factor int) func(*options)
- func WithQueryInterval(interval time.Duration) func(*options)
- func WithSignNote(note string) func(*options)
- func WithTestAccount(addr common.Address, accID uint64) func(*options)
- type Asset
- type Client
- func (c Client) Accounts(ctx context.Context) (map[common.Address]uint64, error)
- func (c Client) GetPublicKey(ctx context.Context, account uint64) (*ecdsa.PublicKey, error)
- func (c Client) GetSupportedAssets(ctx context.Context) ([]Asset, error)
- func (c Client) Sign(ctx context.Context, digest common.Hash, signer common.Address) ([65]byte, error)
- type Status
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadKey ¶
func LoadKey(path string) (*rsa.PrivateKey, error)
LoadKey loads and returns the RSA256 from disk.
func WithLogFreqFactor ¶
func WithLogFreqFactor(factor int) func(*options)
func WithQueryInterval ¶
func WithSignNote ¶
func WithSignNote(note string) func(*options)
func WithTestAccount ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a JSON HTTP client for the FireBlocks API.
func New ¶
func New(network netconf.ID, apiKey string, privateKey *rsa.PrivateKey, opts ...func(*options)) (Client, error)
New creates a new FireBlocks client.
func (Client) Accounts ¶
Accounts returns all the vault accounts from the account cache, populating it if empty.
func (Client) GetPublicKey ¶
GetPublicKey returns the public key for the given vault account.
func (Client) GetSupportedAssets ¶
GetSupportedAssets returns all asset types supported by Fireblocks.
func (Client) Sign ¶
func (c Client) Sign(ctx context.Context, digest common.Hash, signer common.Address) ([65]byte, error)
Sign creates a raw sign transaction and waits for it to complete, returning the resulting signature (Ethereum RSV format). The signer address is checked against the resulting signed address.
type Status ¶
type Status string
Status of a transaction. See https://developers.fireblocks.com/reference/primary-transaction-statuses.
const ( StatusCompleted Status = "COMPLETED" StatusFailed Status = "FAILED" StatusRejected Status = "REJECTED" StatusBlocked Status = "BLOCKED" StatusCancelled Status = "CANCELED" StatusCancelling Status = "CANCELING" StatusConfirming Status = "CONFIRMING" StatusBroadcasting Status = "BROADCASTING" StatusPending3rdParty Status = "PENDING_3RD_PARTY" StatusPendingSignature Status = "PENDING_SIGNATURE" StatusQueued Status = "QUEUED" StatusPendingAuthorization Status = "PENDING_AUTHORIZATION" StatusPendingAmlScreening Status = "PENDING_AML_SCREENING" StatusSubmitted Status = "SUBMITTED" )