namespace cashu {}; [Error] interface CashuError { Generic(string err); }; interface Bolt11Invoice { [Throws=CashuError] constructor(string bolt11); string as_string(); Amount? amount(); }; interface Amount { u64 to_sat(); u64 to_msat(); [Name = from_sat] constructor(u64 sat); [Name = from_msat] constructor(u64 msat); sequence split(); }; interface Secret { constructor(); sequence as_bytes(); }; interface Id { [Throws=CashuError] constructor(string id); }; interface PublicKey { [Throws=CashuError, Name=from_hex] constructor(string hex); [Throws=CashuError] string to_hex(); }; interface SecretKey { [Throws=CashuError] string to_hex(); }; interface BlindedMessage { constructor(Amount amount, PublicKey b); Amount amount(); PublicKey b(); }; interface Proof { constructor(Amount amount, Secret secret, PublicKey c, Id? id); Amount amount(); Secret secret(); PublicKey c(); Id? id(); }; interface BlindedSignature { constructor(Id id, Amount amount, PublicKey c); Id id(); Amount amount(); PublicKey c(); }; interface MintProof { constructor(Amount? amount, Secret secret, PublicKey? c, Id? id); Amount? amount(); Secret secret(); PublicKey? c(); Id? id(); }; interface MintProofs { [Throws=CashuError] constructor(string mint, sequence proofs); string url(); sequence proofs(); }; interface Token { [Throws=CashuError] constructor(string mint, sequence token, string? memo); sequence token(); string? memo(); [Throws=CashuError] string as_string(); [Throws=CashuError, Name=from_string] constructor(string token); }; interface BlindedMessages { [Throws=CashuError, Name=random] constructor(Amount amount); [Throws=CashuError, Name=blank] constructor(Amount fee_reserve); sequence blinded_messages(); sequence secrets(); sequence rs(); sequence amounts(); }; interface KeyPair { [Name=from_secret_key] constructor(SecretKey secret_key); SecretKey secret_key(); PublicKey public_key(); }; interface Keys { constructor(record keys); record keys(); record as_hashmap(); PublicKey? amount_key(Amount amount); }; interface KeySet { constructor(Id id, Keys keys); Id id(); Keys keys(); }; interface MintKeySet { [Name=generate] constructor(string secret, string derivation_path, u8 max_order); }; interface KeysResponse { constructor(Keys keys); }; interface KeySetResponse { constructor(sequence keyset_ids); sequence keyset_ids(); }; interface RequestMintResponse { [Throws=CashuError] constructor(string invoice, string hash); string invoice(); string hash(); }; interface MintRequest { constructor(sequence outputs); sequence outputs(); Amount total_amount(); }; interface PostMintResponse { constructor(sequence promises); sequence promises(); }; interface CheckFeesRequest { [Throws=CashuError] constructor(string invoice); string invoice(); }; interface CheckFeesResponse { constructor(Amount amount); Amount amount(); }; interface Nut05MeltRequest { [Throws=CashuError] constructor(sequence proofs, string Invoice); sequence proofs(); string invoice(); }; interface Nut05MeltResponse { constructor(boolean paid, string? preimage); boolean paid(); string? preimage(); }; interface SplitRequest { constructor(sequence proofs, sequence outputs); sequence proofs(); sequence outputs(); Amount proofs_amount(); Amount output_amount(); }; interface SplitResponse { constructor(sequence promises); sequence promises(); Amount? promises_amount(); }; interface CheckSpendableRequest { constructor(sequence proofs); sequence proofs(); }; interface CheckSpendableResponse { constructor(sequence spendable, sequence pending); sequence spendable(); sequence pending(); }; interface MeltRequest { [Throws=CashuError] constructor(sequence proofs, string Invoice, sequence? outputs); sequence proofs(); string invoice(); sequence? outputs(); }; interface MeltResponse { constructor(boolean paid, string? preimage, sequence? change); boolean paid(); string? preimage(); sequence? change(); }; interface MintVersion { constructor(string name, string version); string name(); string version(); }; interface MintInfo { constructor(string? name, PublicKey? pubkey, MintVersion? version, string? description, string? description_long, sequence>? contact, sequence nuts, string? motd); string? name(); PublicKey? pubkey(); MintVersion? version(); string? description(); string? description_long(); sequence>? contact(); sequence nuts(); string? motd(); }; enum InvoiceStatus { "Unpaid", "Paid", "Expired", "InFlight" };