React Hooks
glossary
Types

Types

Glossary of Types in LaWallet

CardConfigPayload

Type that defines the configuration of a card

CardConfigPayload
type CardConfigPayload = {
  'trusted-merchants': { pubkey: string }[];
  cards: { [uuid: string]: CardPayload };
};
CardPayload
type CardPayload = {
  name: string;
  description: string;
  status: string;
  limits: Limit[];
};
Limit
type Limit = {
  name: string;
  description: string;
  token: string;
  amount: bigint;
  delta: number;
};

CardDataPayload

Type that defines the information of a card

CardDataPayload
type CardDataPayload = { [uuid: string]: { design: Design } };
Design
type Design = { uuid: string; name: string; description: string };

CardPayload

Type that defines the configuration of the card

CardPayload
type CardPayload = {
  name: string;
  description: string;
  status: string;
  limits: Limit[];
};

CreateIdentityReturns

Type that defines the return from using createIdentity()

CreateIdentityReturns
type CreateIdentityReturns = {
  success: boolean;
  message: string;
  identity?: UserIdentity;
};

InvoiceProps

Type that defines the information of a new invoice to be paid

InvoiceProps
type InvoiceProps = {
  bolt11: string;
  created_at: number;
  loading: boolean;
  payed: boolean;
};

InvoiceTransferType

Type that defines the payment information of an invoice. See TransferInformation

InvoiceTransferType
interface InvoiceTransferType extends TransferInformation {
  expired: boolean;
}

LNRequestResponse

Type that defines the payRequest or withdrawRequest of a lightning network account

LNRequestResponse
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

LNURLTransferType
interface LNURLTransferType extends TransferInformation {
  comment: string;
  receiverPubkey: string;
  request: LNRequestResponse | null;
}

SignerTypes

Type to define the signer types. See NDKSigner

SignerTypes
type SignerTypes = NDKSigner | undefined;

TokenBalance

Type to define the balance of a token

TokenBalance
interface TokenBalance {
  tokenId: string;
  amount: number;
  loading: boolean;
  lastEvent?: NostrEvent;
  createdAt?: Date;
}

Transaction

Type to define a transaction

Transaction
interface Transaction {
  id: string;
  status: TransactionStatus;
  direction: TransactionDirection;
  type: TransactionType;
  tokens: TokensAmount;
  memo: string;
  errors: string[];
  events: NostrEvent[];
  createdAt: number;
}
Status
enum TransactionStatus {
  PENDING = 'PENDING',
  CONFIRMED = 'CONFIRMED',
  ERROR = 'ERROR',
  REVERTED = 'REVERTED',
}
Direction
enum TransactionDirection {
  INCOMING = 'INCOMING',
  OUTGOING = 'OUTGOING',
}
Types
enum TransactionType {
  CARD = 'CARD',
  INTERNAL = 'INTERNAL',
  LN = 'LN',
}
TokensAmount
type TokensAmount = {
  [_tokenId: string]: number;
};

TransferInformation

Type that defines the information of a transfer. See TransferTypes

TransferInformation
interface TransferInformation {
  data: string;
  amount: number;
  type: TransferTypes;
}

TransferTypes

Defines the types of existing transfers

TransferTypes
enum TransferTypes {
  INTERNAL = 'INTERNAL',
  LUD16 = 'LUD16',
  INVOICE = 'INVOICE',
  LNURL = 'LNURL',
  LNURLW = 'LNURLW',
  NONE = 'NONE',
}

InternalTransferParameters

Type that defines the parameters of an internal transfer

InternalTransferParameters
type InternalTransferParameters = {
  pubkey: string;
  amount: number;
  comment: string;
  tags?: NDKTag[];
};

OutboundTransferParameters

Type that defines the parameters of an external transfer

OutboundTransferParameters
type OutboundTransferParameters = { amount: number; tags: NDKTag[] };