ledger

package
v0.8.9-pre3 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2022 License: MIT Imports: 9 Imported by: 2

Documentation

Index

Constants

View Source
const LedgerVersion = "BTFS_Escrow_1.0.0"

Variables

This section is empty.

Functions

func NewAccount

func NewAccount(pubKey ic.PubKey, amount int64) (*ledgerpb.Account, error)

func NewChannelCommit

func NewChannelCommit(fromKey ic.PubKey, toKey ic.PubKey, amount int64) (*ledgerpb.ChannelCommit, error)

func NewChannelState

func NewChannelState(id *ledgerpb.ChannelID, sequence int64, fromAccount *ledgerpb.Account, toAccount *ledgerpb.Account) *ledgerpb.ChannelState

func NewContractID added in v0.2.19

func NewContractID(id string, key ic.PubKey) (*escrowpb.ContractID, error)

func NewEscrowContract added in v0.2.19

func NewEscrowContract(id string, payerPubKey ic.PubKey, hostPubKey ic.PubKey, authPubKey ic.PubKey,
	amount int64, ps escrowpb.Schedule, period int32, contrType escrowpb.ContractType,
	contingentAmount int64, storageLength int) (*escrowpb.EscrowContract, error)

func NewPayinRequest added in v0.2.19

func NewPayinRequest(payinId string, payerPubkey ic.PubKey, state *ledgerpb.SignedChannelState) (
	*escrowpb.PayinRequest, error)

func NewSignedChannelCommit added in v0.2.19

func NewSignedChannelCommit(commit *ledgerpb.ChannelCommit, sig []byte) *ledgerpb.SignedChannelCommit

func NewSignedChannelState

func NewSignedChannelState(channelState *ledgerpb.ChannelState, fromSig []byte, toSig []byte) *ledgerpb.SignedChannelState

func NewSignedCreateAccountRequest added in v0.5.13

func NewSignedCreateAccountRequest(key *ledgerpb.PublicKey, sig []byte) *ledgerpb.SignedCreateAccountRequest

func NewSignedPayinRequest added in v0.2.19

func NewSignedPayinRequest(req *escrowpb.PayinRequest, sig []byte) *escrowpb.SignedPayinRequest

func NewSignedPublicKey added in v0.2.19

func NewSignedPublicKey(privK ic.PrivKey, pubK ic.PubKey) (*ledgerpb.SignedPublicKey, error)

func NewSingedContractID added in v0.2.19

func NewSingedContractID(id *escrowpb.ContractID, sig []byte) *escrowpb.SignedContractID

Types

type Client added in v0.1.10

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(addr string) *Client

func (*Client) CloseChannel added in v0.1.10

func (c *Client) CloseChannel(ctx context.Context, signedChannelState *ledgerpb.SignedChannelState) error

func (*Client) CreateChannel added in v0.1.10

func (c *Client) CreateChannel(ctx context.Context, channelCommit *ledgerpb.ChannelCommit, sig []byte) (*ledgerpb.ChannelID, error)

func (*Client) ImportAccount added in v0.1.10

func (c *Client) ImportAccount(ctx context.Context, pubKey ic.PubKey) (*ledgerpb.Account, error)

func (*Client) ImportSignedAccount added in v0.1.10

func (c *Client) ImportSignedAccount(ctx context.Context, privKey ic.PrivKey, pubKey ic.PubKey) (*ledgerpb.SignedCreateAccountResult, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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