fireblocks

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: May 22, 2024 License: GPL-3.0 Imports: 27 Imported by: 0

README

Fireblocks

https://developers.fireblocks.com/reference/api-overview

Transactions

This is going to be our primary API call. We use raw signing for all of our create transaction requests. This is because we cannot guranteee fireblocks is integrated with the chains we are deploying on.

Request Signing:

https://developers.fireblocks.com/reference/signing-a-request-jwt-structure

Note:

A deployment transaction is no different than a normal transaction, we build a transaction payload (the payload just specifies to deploy), we send the txn payload to fireblocks to be signed, we get it back and then send it to the chain.

Documentation

Index

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 WithHost

func WithHost(host string) func(*options)

func WithLogFreqFactor

func WithLogFreqFactor(factor int) func(*options)

func WithQueryInterval

func WithQueryInterval(interval time.Duration) func(*options)

func WithSignNote

func WithSignNote(note string) func(*options)

func WithTestAccount

func WithTestAccount(addr common.Address, accID uint64) func(*options)

Types

type Asset

type Asset struct {
	ID              string `json:"id"`
	Name            string `json:"name"`
	Type            string `json:"type"`
	ContractAddress string `json:"contractAddress,omitempty"`
	NativeAsset     string `json:"nativeAsset,omitempty"`
	Decimals        int    `json:"decimals,omitempty"`
}

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

func (c Client) Accounts(ctx context.Context) (map[common.Address]uint64, error)

Accounts returns all the vault accounts from the account cache, populating it if empty.

func (Client) GetPublicKey

func (c Client) GetPublicKey(ctx context.Context, account uint64) (*ecdsa.PublicKey, error)

GetPublicKey returns the public key for the given vault account.

func (Client) GetSupportedAssets

func (c Client) GetSupportedAssets(ctx context.Context) ([]Asset, error)

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"
)

func (Status) Completed

func (s Status) Completed() bool

func (Status) Failed

func (s Status) Failed() bool

Jump to

Keyboard shortcuts

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