|
@@ -1,276 +0,0 @@
|
|
|
-namespace cashu {};
|
|
|
-
|
|
|
-[Error]
|
|
|
-interface CashuError {
|
|
|
- Generic(string err);
|
|
|
-};
|
|
|
-
|
|
|
-// Types
|
|
|
-
|
|
|
-[Enum]
|
|
|
-interface CurrencyUnit {
|
|
|
- Sat();
|
|
|
- Usd();
|
|
|
- Custom(string unit);
|
|
|
-};
|
|
|
-
|
|
|
-interface Bolt11Invoice {
|
|
|
- [Throws=CashuError]
|
|
|
- constructor(string bolt11);
|
|
|
- string as_string();
|
|
|
- Amount? amount();
|
|
|
-};
|
|
|
-
|
|
|
-interface Amount {
|
|
|
- constructor(u64 amount);
|
|
|
- sequence<Amount> split();
|
|
|
-};
|
|
|
-
|
|
|
-interface Secret {
|
|
|
- constructor();
|
|
|
- sequence<u8> as_bytes();
|
|
|
-};
|
|
|
-
|
|
|
-interface MintQuote {
|
|
|
- constructor(string id, Amount amount, string unit, Bolt11Invoice request, boolean paid, u64 boolean);
|
|
|
-};
|
|
|
-
|
|
|
-interface MeltQuote {
|
|
|
- constructor(string id, Amount amount, string unit, Bolt11Invoice request, Amount fee_reserve, boolean paid, u64 boolean);
|
|
|
-};
|
|
|
-
|
|
|
-// NUT00
|
|
|
-
|
|
|
-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(Id keyset_id, Amount amount, PublicKey b);
|
|
|
- Amount amount();
|
|
|
- Id keyset_id();
|
|
|
- PublicKey b();
|
|
|
-};
|
|
|
-
|
|
|
-interface Proof {
|
|
|
- constructor(Amount amount, Secret secret, PublicKey c, Id id);
|
|
|
- Amount amount();
|
|
|
- Secret secret();
|
|
|
- PublicKey c();
|
|
|
- Id keyset_id();
|
|
|
-};
|
|
|
-
|
|
|
-interface BlindedSignature {
|
|
|
- constructor(Id keyset_id, Amount amount, PublicKey c);
|
|
|
- Id keyset_id();
|
|
|
- Amount amount();
|
|
|
- PublicKey c();
|
|
|
-};
|
|
|
-
|
|
|
-interface MintProof {
|
|
|
- constructor(Amount? amount, Secret secret, PublicKey? c, Id? id);
|
|
|
- Amount? amount();
|
|
|
- Secret secret();
|
|
|
- PublicKey? c();
|
|
|
- Id? keyset_id();
|
|
|
-
|
|
|
-};
|
|
|
-
|
|
|
-interface MintProofs {
|
|
|
- [Throws=CashuError]
|
|
|
- constructor(string mint, sequence<Proof> proofs);
|
|
|
- string url();
|
|
|
- sequence<Proof> proofs();
|
|
|
-};
|
|
|
-
|
|
|
-interface Token {
|
|
|
- [Throws=CashuError]
|
|
|
- constructor(string mint, sequence<Proof> token, string? memo, string? unit);
|
|
|
- sequence<MintProofs> token();
|
|
|
- string? memo();
|
|
|
- string? unit();
|
|
|
- string to_string();
|
|
|
- [Throws=CashuError, Name=from_string]
|
|
|
- constructor(string token);
|
|
|
-
|
|
|
-};
|
|
|
-
|
|
|
-interface PreMintSecrets {
|
|
|
- [Throws=CashuError, Name=random]
|
|
|
- constructor(Id keyset_id, Amount amount);
|
|
|
- [Throws=CashuError, Name=blank]
|
|
|
- constructor(Id keyset_id, Amount amount);
|
|
|
- sequence<BlindedMessage> blinded_messages();
|
|
|
- sequence<Secret> secrets();
|
|
|
- sequence<SecretKey> rs();
|
|
|
- sequence<Amount> amounts();
|
|
|
-};
|
|
|
-
|
|
|
-
|
|
|
-// NUT-02
|
|
|
-
|
|
|
-interface Id {
|
|
|
- [Throws=CashuError]
|
|
|
- constructor(string id);
|
|
|
-};
|
|
|
-
|
|
|
-interface KeyPair {
|
|
|
- [Name=from_secret_key]
|
|
|
- constructor(SecretKey secret_key);
|
|
|
- SecretKey secret_key();
|
|
|
- PublicKey public_key();
|
|
|
-};
|
|
|
-
|
|
|
-interface Keys {
|
|
|
- constructor(record<string, PublicKey> keys);
|
|
|
- record<string, PublicKey> keys();
|
|
|
- record<string, string> as_hashmap();
|
|
|
- PublicKey? amount_key(Amount amount);
|
|
|
-};
|
|
|
-
|
|
|
-interface KeySet {
|
|
|
- constructor(Id id, string unit, Keys keys);
|
|
|
- Id id();
|
|
|
- Keys keys();
|
|
|
-};
|
|
|
-
|
|
|
-interface MintKeySet {
|
|
|
- [Name=generate]
|
|
|
- constructor(string secret, string unit, string derivation_path, u8 max_order);
|
|
|
-};
|
|
|
-
|
|
|
-interface KeysResponse {
|
|
|
- constructor(sequence<KeySet> keysets);
|
|
|
-};
|
|
|
-
|
|
|
-interface KeySetResponse {
|
|
|
- constructor(sequence<KeySetInfo> keysets);
|
|
|
- sequence<KeySetInfo> keysets();
|
|
|
-};
|
|
|
-
|
|
|
-// NUT-03
|
|
|
-
|
|
|
-interface SwapRequest {
|
|
|
- constructor(sequence<Proof> proofs, sequence<BlindedMessage> outputs);
|
|
|
- sequence<Proof> proofs();
|
|
|
- sequence<BlindedMessage> outputs();
|
|
|
- Amount proofs_amount();
|
|
|
- Amount output_amount();
|
|
|
-};
|
|
|
-
|
|
|
-interface SwapResponse {
|
|
|
- constructor(sequence<BlindedSignature> promises);
|
|
|
- sequence<BlindedSignature> signatures();
|
|
|
-};
|
|
|
-
|
|
|
-// NUT-04
|
|
|
-
|
|
|
-interface MintQuoteBolt11Request {
|
|
|
- constructor(Amount amount, string unit);
|
|
|
- Amount amount();
|
|
|
-};
|
|
|
-
|
|
|
-interface MintQuoteBolt11Response {
|
|
|
- constructor(string quote, string request, boolean paid, u64 expiry);
|
|
|
- string quote();
|
|
|
- string request();
|
|
|
- boolean paid();
|
|
|
- u64 expiry();
|
|
|
-};
|
|
|
-
|
|
|
-
|
|
|
-interface MintBolt11Request {
|
|
|
- constructor(string quote, sequence<BlindedMessage> outputs);
|
|
|
- string quote();
|
|
|
- sequence<BlindedMessage> outputs();
|
|
|
-};
|
|
|
-
|
|
|
-interface MintBolt11Response {
|
|
|
- constructor(sequence<BlindedSignature> signatures);
|
|
|
- sequence<BlindedSignature> signatures();
|
|
|
-};
|
|
|
-
|
|
|
-// NUT-05
|
|
|
-
|
|
|
-interface MeltQuoteBolt11Response {
|
|
|
- [Throws=CashuError]
|
|
|
- constructor(string quote, u64 amount, u64 fee_reserve, boolean paid, u64 expiry);
|
|
|
- string quote();
|
|
|
- u64 amount();
|
|
|
- u64 fee_reserve();
|
|
|
- boolean paid();
|
|
|
- u64 expiry();
|
|
|
-};
|
|
|
-
|
|
|
-interface MeltQuoteBolt11Request {
|
|
|
- [Throws=CashuError]
|
|
|
- constructor(string request, string unit);
|
|
|
- string request();
|
|
|
-};
|
|
|
-
|
|
|
-interface MeltBolt11Request {
|
|
|
- [Throws=CashuError]
|
|
|
- constructor(string quote, sequence<Proof> inputs, sequence<BlindedMessage>? outputs);
|
|
|
- sequence<Proof> inputs();
|
|
|
- string quote();
|
|
|
-};
|
|
|
-
|
|
|
-interface MeltBolt11Response {
|
|
|
- constructor(boolean paid, string? payment_preimage, sequence<BlindedSignature>? change);
|
|
|
- string? payment_preimage();
|
|
|
- boolean paid();
|
|
|
-};
|
|
|
-
|
|
|
-// NUT-06
|
|
|
-
|
|
|
-interface MintInfo {
|
|
|
- constructor(string? name, PublicKey? pubkey, MintVersion? version, string? description, string? description_long, sequence<sequence<string>>? contact, string nuts, string? motd);
|
|
|
- string? name();
|
|
|
- PublicKey? pubkey();
|
|
|
- MintVersion? version();
|
|
|
- string? description();
|
|
|
- string? description_long();
|
|
|
- sequence<sequence<string>>? contact();
|
|
|
- string? motd();
|
|
|
-};
|
|
|
-
|
|
|
-// NUT-07
|
|
|
-
|
|
|
-interface CheckSpendableRequest {
|
|
|
- constructor(sequence<MintProof> proofs);
|
|
|
- sequence<MintProof> proofs();
|
|
|
-};
|
|
|
-
|
|
|
-interface CheckSpendableResponse {
|
|
|
- constructor(sequence<boolean> spendable, sequence<boolean> pending);
|
|
|
- sequence<boolean> spendable();
|
|
|
- sequence<boolean> pending();
|
|
|
-};
|
|
|
-
|
|
|
-interface MintVersion {
|
|
|
- constructor(string name, string version);
|
|
|
- string name();
|
|
|
- string version();
|
|
|
-};
|
|
|
-
|
|
|
-interface KeySetInfo {
|
|
|
- constructor(Id id, string unit);
|
|
|
-
|
|
|
-};
|
|
|
-
|
|
|
-enum InvoiceStatus {
|
|
|
- "Unpaid",
|
|
|
- "Paid",
|
|
|
- "Expired",
|
|
|
- "InFlight"
|
|
|
-};
|
|
|
-
|