fiber-types 0.8.1

Core domain types for the Fiber Network
Documentation
import blockchain;

array PaymentHash [byte; 32];
array Signature [byte; 104];
option SignatureOpt (Signature);

option AmountOpt (Uint128);

// deprecated
struct FinalHtlcTimeout {
    value: Uint64,
}

struct FinalHtlcMinimumExpiryDelta {
    value: Uint64,
}

struct ExpiryTime {
    value: Uint64,
}

table Description {
    value: Bytes,
}

table FallbackAddr {
    value: Bytes,
}

table Feature {
    value: Bytes,
}

table UdtScript {
    value: Script,
}

table PayeePublicKey {
    value: Bytes,
}

// 0 - ckb hash (Default)
// 1 - sha256
struct HashAlgorithm {
    value: byte,
}

struct PaymentSecret {
    value: Byte32,
}

union InvoiceAttr {
    ExpiryTime,
    Description,
    // deprecated
    FinalHtlcTimeout,
    FinalHtlcMinimumExpiryDelta,
    FallbackAddr,
    Feature,
    UdtScript,
    PayeePublicKey,
    HashAlgorithm,
    PaymentSecret,
}

vector InvoiceAttrsVec <InvoiceAttr>;

table RawInvoiceData {
    timestamp: Uint128,
    payment_hash: PaymentHash,
    attrs: InvoiceAttrsVec,
}

table RawCkbInvoice {
    currency: byte,
    amount: AmountOpt,
    signature: SignatureOpt,
    data: RawInvoiceData,
}