cashubtc / cashu-ts

A TypeScript library for building Cashu wallets
MIT License
57 stars 33 forks source link

please add new types for NUT-15 #142

Open KraXen72 opened 4 months ago

KraXen72 commented 4 months ago

the library does not provide type definitions for NUT15. please add them. this is how i'm patching it for now. feel free to use the code.

import { GetInfoResponse as _GetInfoResponse } from '@cashu/cashu-ts'
type NUT15Entry = { method: string, unit: string, mpp: boolean }
type GetInfoResponse = _GetInfoResponse & {
  nuts: {
    15: Array<NUT15Entry>
  }
}
callebtc commented 3 months ago

Would you like to open a PR with this patch?

KraXen72 commented 3 months ago

sorry, i just realized, in minibits we are using our own fork of cashu-ts library. i'll first try to implement it there, so i can test it, and then if it works i can try to port it to here.