paych

Payment channel signing methods

createPayChMsgParams

Encodes the message's params required to create a payment channel, returning the message params in base64.

Parameters

Parameter

Type

Description

from

string

The FIL address of the sender

to

string

The FIL address of the recipient

codeCID

string

CID of the Payment Channel Actor

createPaymentChannelMsg

Prepares the message required to create a payment channel.

Parameters

Parameter

Type

Description

from

string

The FIL address of the sender

to

string

The FIL address of the recipient

amount

BigNumber

The amount of FIL to send

nonce

number

The nonce of the sender's account

network

"mainnet" | "testnet"

The network of the message

codeCID

string

CID of the Payment Channel Actor

createVoucher

Creates a payment channel voucher and returns it encoded in base64

Parameters

Parameter

Type

Description

paymentChannelAddress

string

The address of the payment channel

timeLockMin

number

The minimum lock time

timeLockMax

number

The maximum lock time

secretHash

string

The hashed secret required to redeem the voucher

amount

BigNumber

The amount to be redeemed with the voucher

lane

number

The lane of the payment channel this voucher is valid forcodeCID

voucherNonce

number

The nonce of the voucher

minSettleHeight

number

The minimum settle height

signVoucher

Signs a payment channel voucher and returns it encoded in base64

Parameters

Parameter

Type

Description

voucher

string

The unsigned voucher encoded in base64

privateKey

string

The private key to sign the voucher with

verifyVoucherSignature

Verifies the signature of a signed voucher.

Parameters

Parameter

Type

Description

sv

string

Signed voucher encoded in base64

signerAddress

string

The address to which compare the recovered public key

updatePaymentChannelMsg

Creates the message to update the payment channel given a voucher

Parameters

Parameter

Type

Description

paymentChannelAddress

string

Address of the payment channel

from

string

The FIL address of the sender

sv

string

Signed voucher encoded in base64

secret

string

The hashed secret required to redeem the voucher

nonce

number

The nonce of the sender's account

gasLimit

number

The gas limit value

gasFeeCap

string

The gas fee cap value

gasPremium

string

The gas premium value

settlePaymentChannelMsg

Creates the message to settle the payment channel.

Parameters

Parameter

Type

Description

paymentChannelAddress

string

Address of the payment channel

from

string

The FIL address of the sender

nonce

number

The nonce of the sender's account

gasLimit

number

The gas limit value

gasFeeCap

string

The gas fee cap value

gasPremium

string

The gas premium value

collectPaymentChannelMsg

Creates the message to collect the payment channel.

Parameters

Parameter

Type

Description

paymentChannelAddress

string

Address of the payment channel

from

string

The FIL address of the sender

nonce

number

The nonce of the sender's account

gasLimit

number

The gas limit value

gasFeeCap

string

The gas fee cap value

gasPremium

string

The gas premium value

Last updated