Type Alias SwapOptions

SwapOptions: {
    counter?: number;
    includeFees?: boolean;
    keysetId?: string;
    outputAmounts?: OutputAmounts;
    outputData?: {
        keep?: OutputDataLike[] | OutputDataFactory;
        send?: OutputDataLike[] | OutputDataFactory;
    };
    p2pk?: { locktime?: number; pubkey: string; refundKeys?: string[] };
    privkey?: string;
    proofsWeHave?: Proof[];
    pubkey?: string;
}

Type declaration

  • Optionalcounter?: number
  • OptionalincludeFees?: boolean
  • OptionalkeysetId?: string
  • OptionaloutputAmounts?: OutputAmounts
  • OptionaloutputData?: {
        keep?: OutputDataLike[] | OutputDataFactory;
        send?: OutputDataLike[] | OutputDataFactory;
    }
  • Optionalp2pk?: { locktime?: number; pubkey: string; refundKeys?: string[] }
  • Optionalprivkey?: string
  • OptionalproofsWeHave?: Proof[]
  • Optionalpubkey?: string

Optional parameters for configuring the swap operation:

  • amount: amount to send while performing the optimal split (least proofs possible). can be set to undefined if preference is set
  • proofs proofs matching that amount
  • outputAmounts? optionally specify the output's amounts to keep and to send.
  • counter? optionally set counter to derive secret deterministically. CashuWallet class must be initialized with seed phrase to take effect
  • keysetId? override the keysetId derived from the current mintKeys with a custom one. This should be a keyset that was fetched from the /keysets endpoint
  • includeFees? include estimated fees for the receiver to receive the proofs
  • proofsWeHave? optionally provide all currently stored proofs of this mint. Cashu-ts will use them to derive the optimal output amounts
  • pubkey? optionally locks ecash to pubkey. Will not be deterministic, even if counter is set!
  • privkey? will create a signature on the proofs secrets if set