Documentation ¶
Index ¶
- func LoadKey(path string) (*rsa.PrivateKey, error)
- 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 Config
- type Option
- type Status
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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 ...Option) (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 Config ¶
type Config struct { // NetworkTimeout is the allowed duration for a single network request. // This is intended to be used for network requests that can be replayed. NetworkTimeout time.Duration // QueryInterval is the interval at which the FireBlocks client will // call the get transaction by id to check for confirmations after a txn // has been sent QueryInterval time.Duration // LogFreqFactor is the frequency at which the FireBlocks client will // log a warning message if the transaction has not been signed yet LogFreqFactor int // SignNote is a note to include in the sign request SignNote string // Host is the base URL for the FireBlocks API. Host string // TestAccounts overrides dynamic account TestAccounts map[common.Address]uint64 }
Config houses parameters for altering the behavior of a SimpleTxManager.
type Option ¶
type Option func(*Config)
Option is a function that modifies the Config.
func WithLogFreqFactor ¶
func WithQueryInterval ¶
func WithSignNote ¶
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" )