Types
Glossary of Types in LaWallet
CardConfigPayload
Type that defines the configuration of a card
type CardConfigPayload = {
'trusted-merchants': { pubkey: string }[];
cards: { [uuid: string]: CardPayload };
};
type CardPayload = {
name: string;
description: string;
status: string;
limits: Limit[];
};
type Limit = {
name: string;
description: string;
token: string;
amount: bigint;
delta: number;
};
CardDataPayload
Type that defines the information of a card
type CardDataPayload = { [uuid: string]: { design: Design } };
type Design = { uuid: string; name: string; description: string };
CardPayload
Type that defines the configuration of the card
type CardPayload = {
name: string;
description: string;
status: string;
limits: Limit[];
};
CreateIdentityReturns
Type that defines the return from using createIdentity()
type CreateIdentityReturns = {
success: boolean;
message: string;
identity?: UserIdentity;
};
InvoiceProps
Type that defines the information of a new invoice to be paid
type InvoiceProps = {
bolt11: string;
created_at: number;
loading: boolean;
payed: boolean;
};
InvoiceTransferType
Type that defines the payment information of an invoice. See TransferInformation
interface InvoiceTransferType extends TransferInformation {
expired: boolean;
}
LNRequestResponse
Type that defines the payRequest or withdrawRequest of a lightning network account
interface LNRequestResponse {
tag: string;
callback: string;
metadata: string;
commentAllowed: number;
minSendable?: number;
maxSendable?: number;
k1?: string;
minWithdrawable?: number;
maxWithdrawable?: number;
}
LNURLTransferType
Type that defines the payment information of a LNURL. See TransferInformation
& LNRequestResponse
interface LNURLTransferType extends TransferInformation {
comment: string;
receiverPubkey: string;
request: LNRequestResponse | null;
}
SignerTypes
Type to define the signer types. See NDKSigner
type SignerTypes = NDKSigner | undefined;
TokenBalance
Type to define the balance of a token
interface TokenBalance {
tokenId: string;
amount: number;
loading: boolean;
lastEvent?: NostrEvent;
createdAt?: Date;
}
Transaction
Type to define a transaction
interface Transaction {
id: string;
status: TransactionStatus;
direction: TransactionDirection;
type: TransactionType;
tokens: TokensAmount;
memo: string;
errors: string[];
events: NostrEvent[];
createdAt: number;
}
enum TransactionStatus {
PENDING = 'PENDING',
CONFIRMED = 'CONFIRMED',
ERROR = 'ERROR',
REVERTED = 'REVERTED',
}
enum TransactionDirection {
INCOMING = 'INCOMING',
OUTGOING = 'OUTGOING',
}
enum TransactionType {
CARD = 'CARD',
INTERNAL = 'INTERNAL',
LN = 'LN',
}
type TokensAmount = {
[_tokenId: string]: number;
};
TransferInformation
Type that defines the information of a transfer. See TransferTypes
interface TransferInformation {
data: string;
amount: number;
type: TransferTypes;
}
TransferTypes
Defines the types of existing transfers
enum TransferTypes {
INTERNAL = 'INTERNAL',
LUD16 = 'LUD16',
INVOICE = 'INVOICE',
LNURL = 'LNURL',
LNURLW = 'LNURLW',
NONE = 'NONE',
}
InternalTransferParameters
Type that defines the parameters of an internal transfer
type InternalTransferParameters = {
pubkey: string;
amount: number;
comment: string;
tags?: NDKTag[];
};
OutboundTransferParameters
Type that defines the parameters of an external transfer
type OutboundTransferParameters = { amount: number; tags: NDKTag[] };