@bitcredit/bcr-ebill-wasm 0.3.10 → 0.3.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.d.ts CHANGED
@@ -8,8 +8,13 @@ export function task_worker_entry_point(ptr: number): void;
8
8
  export enum ContactTypeWeb {
9
9
  Person = 0,
10
10
  Company = 1,
11
+ Anon = 2,
11
12
  }
12
13
  export enum IdentityTypeWeb {
14
+ Ident = 0,
15
+ Anon = 1,
16
+ }
17
+ export enum SwitchIdentityTypeWeb {
13
18
  Person = 0,
14
19
  Company = 1,
15
20
  }
@@ -98,22 +103,22 @@ export interface BillCombinedBitcoinKeyWeb {
98
103
  export type BillsFilterRoleWeb = "All" | "Payer" | "Payee" | "Contingent";
99
104
 
100
105
  export interface PastEndorseeWeb {
101
- pay_to_the_order_of: LightIdentityPublicDataWeb;
106
+ pay_to_the_order_of: LightBillIdentParticipantWeb;
102
107
  signed: LightSignedByWeb;
103
108
  signing_timestamp: number;
104
- signing_address: PostalAddressWeb;
109
+ signing_address: PostalAddressWeb | undefined;
105
110
  }
106
111
 
107
112
  export interface LightSignedByWeb {
108
- data: LightIdentityPublicDataWeb;
109
- signatory: LightIdentityPublicDataWeb | undefined;
113
+ data: LightBillParticipantWeb;
114
+ signatory: LightBillIdentParticipantWeb | undefined;
110
115
  }
111
116
 
112
117
  export interface EndorsementWeb {
113
- pay_to_the_order_of: LightIdentityPublicDataWithAddressWeb;
118
+ pay_to_the_order_of: LightBillIdentParticipantWithAddressWeb;
114
119
  signed: LightSignedByWeb;
115
120
  signing_timestamp: number;
116
- signing_address: PostalAddressWeb;
121
+ signing_address: PostalAddressWeb | undefined;
117
122
  }
118
123
 
119
124
  export interface BillsSearchFilterPayload {
@@ -158,8 +163,8 @@ export type PastPaymentStatusWeb = { Paid: number } | { Rejected: number } | { E
158
163
 
159
164
  export interface PastPaymentDataSellWeb {
160
165
  time_of_request: number;
161
- buyer: IdentityPublicDataWeb;
162
- seller: IdentityPublicDataWeb;
166
+ buyer: BillParticipantWeb;
167
+ seller: BillParticipantWeb;
163
168
  currency: string;
164
169
  sum: string;
165
170
  link_to_pay: string;
@@ -171,8 +176,8 @@ export interface PastPaymentDataSellWeb {
171
176
 
172
177
  export interface PastPaymentDataPaymentWeb {
173
178
  time_of_request: number;
174
- payer: IdentityPublicDataWeb;
175
- payee: IdentityPublicDataWeb;
179
+ payer: BillIdentParticipantWeb;
180
+ payee: BillParticipantWeb;
176
181
  currency: string;
177
182
  sum: string;
178
183
  link_to_pay: string;
@@ -184,8 +189,8 @@ export interface PastPaymentDataPaymentWeb {
184
189
 
185
190
  export interface PastPaymentDataRecourseWeb {
186
191
  time_of_request: number;
187
- recourser: IdentityPublicDataWeb;
188
- recoursee: IdentityPublicDataWeb;
192
+ recourser: BillIdentParticipantWeb;
193
+ recoursee: BillIdentParticipantWeb;
189
194
  currency: string;
190
195
  sum: string;
191
196
  link_to_pay: string;
@@ -217,8 +222,8 @@ export type BillCurrentWaitingStateWeb = { Sell: BillWaitingForSellStateWeb } |
217
222
 
218
223
  export interface BillWaitingForSellStateWeb {
219
224
  time_of_request: number;
220
- buyer: IdentityPublicDataWeb;
221
- seller: IdentityPublicDataWeb;
225
+ buyer: BillParticipantWeb;
226
+ seller: BillParticipantWeb;
222
227
  currency: string;
223
228
  sum: string;
224
229
  link_to_pay: string;
@@ -228,8 +233,8 @@ export interface BillWaitingForSellStateWeb {
228
233
 
229
234
  export interface BillWaitingForPaymentStateWeb {
230
235
  time_of_request: number;
231
- payer: IdentityPublicDataWeb;
232
- payee: IdentityPublicDataWeb;
236
+ payer: BillIdentParticipantWeb;
237
+ payee: BillParticipantWeb;
233
238
  currency: string;
234
239
  sum: string;
235
240
  link_to_pay: string;
@@ -239,8 +244,8 @@ export interface BillWaitingForPaymentStateWeb {
239
244
 
240
245
  export interface BillWaitingForRecourseStateWeb {
241
246
  time_of_request: number;
242
- recourser: IdentityPublicDataWeb;
243
- recoursee: IdentityPublicDataWeb;
247
+ recourser: BillIdentParticipantWeb;
248
+ recoursee: BillIdentParticipantWeb;
244
249
  currency: string;
245
250
  sum: string;
246
251
  link_to_pay: string;
@@ -306,20 +311,20 @@ export interface BillDataWeb {
306
311
  }
307
312
 
308
313
  export interface BillParticipantsWeb {
309
- drawee: IdentityPublicDataWeb;
310
- drawer: IdentityPublicDataWeb;
311
- payee: IdentityPublicDataWeb;
312
- endorsee: IdentityPublicDataWeb | undefined;
314
+ drawee: BillIdentParticipantWeb;
315
+ drawer: BillIdentParticipantWeb;
316
+ payee: BillParticipantWeb;
317
+ endorsee: BillParticipantWeb | undefined;
313
318
  endorsements_count: number;
314
319
  all_participant_node_ids: string[];
315
320
  }
316
321
 
317
322
  export interface LightBitcreditBillWeb {
318
323
  id: string;
319
- drawee: LightIdentityPublicDataWeb;
320
- drawer: LightIdentityPublicDataWeb;
321
- payee: LightIdentityPublicDataWeb;
322
- endorsee: LightIdentityPublicDataWeb | undefined;
324
+ drawee: LightBillIdentParticipantWeb;
325
+ drawer: LightBillIdentParticipantWeb;
326
+ payee: LightBillParticipantWeb;
327
+ endorsee: LightBillParticipantWeb | undefined;
323
328
  active_notification: NotificationWeb | undefined;
324
329
  sum: string;
325
330
  currency: string;
@@ -328,23 +333,37 @@ export interface LightBitcreditBillWeb {
328
333
  time_of_maturity: number;
329
334
  }
330
335
 
331
- export interface IdentityPublicDataWeb {
336
+ export type BillParticipantWeb = { Anon: BillAnonParticipantWeb } | { Ident: BillIdentParticipantWeb };
337
+
338
+ export interface BillAnonParticipantWeb {
339
+ node_id: string;
340
+ email: string | undefined;
341
+ nostr_relays: string[];
342
+ }
343
+
344
+ export interface BillIdentParticipantWeb {
332
345
  t: ContactTypeWeb;
333
346
  node_id: string;
334
347
  name: string;
335
348
  postal_address: PostalAddressWeb;
336
349
  email: string | undefined;
337
- nostr_relay: string | undefined;
350
+ nostr_relays: string[];
338
351
  }
339
352
 
340
- export interface LightIdentityPublicDataWithAddressWeb {
353
+ export interface LightBillIdentParticipantWithAddressWeb {
341
354
  t: ContactTypeWeb;
342
355
  name: string;
343
356
  node_id: string;
344
357
  postal_address: PostalAddressWeb;
345
358
  }
346
359
 
347
- export interface LightIdentityPublicDataWeb {
360
+ export type LightBillParticipantWeb = { Anon: LightBillAnonParticipantWeb } | { Ident: LightBillIdentParticipantWeb };
361
+
362
+ export interface LightBillAnonParticipantWeb {
363
+ node_id: string;
364
+ }
365
+
366
+ export interface LightBillIdentParticipantWeb {
348
367
  t: ContactTypeWeb;
349
368
  name: string;
350
369
  node_id: string;
@@ -423,8 +442,8 @@ export interface NewContactPayload {
423
442
  t: number;
424
443
  node_id: string;
425
444
  name: string;
426
- email: string;
427
- postal_address: PostalAddressWeb;
445
+ email: string | undefined;
446
+ postal_address: PostalAddressWeb | undefined;
428
447
  date_of_birth_or_registration: string | undefined;
429
448
  country_of_birth_or_registration: string | undefined;
430
449
  city_of_birth_or_registration: string | undefined;
@@ -450,8 +469,8 @@ export interface ContactWeb {
450
469
  t: ContactTypeWeb;
451
470
  node_id: string;
452
471
  name: string;
453
- email: string;
454
- postal_address: PostalAddressWeb;
472
+ email: string | undefined;
473
+ postal_address: PostalAddressWeb | undefined;
455
474
  date_of_birth_or_registration: string | undefined;
456
475
  country_of_birth_or_registration: string | undefined;
457
476
  city_of_birth_or_registration: string | undefined;
@@ -462,13 +481,14 @@ export interface ContactWeb {
462
481
  }
463
482
 
464
483
  export interface SwitchIdentity {
465
- t: IdentityTypeWeb | undefined;
484
+ t: SwitchIdentityTypeWeb | undefined;
466
485
  node_id: string;
467
486
  }
468
487
 
469
488
  export interface NewIdentityPayload {
489
+ t: number;
470
490
  name: string;
471
- email: string;
491
+ email: string | undefined;
472
492
  postal_address: OptionalPostalAddressWeb;
473
493
  date_of_birth: string | undefined;
474
494
  country_of_birth: string | undefined;
@@ -491,9 +511,10 @@ export interface ChangeIdentityPayload {
491
511
  }
492
512
 
493
513
  export interface IdentityWeb {
514
+ t: IdentityTypeWeb;
494
515
  node_id: string;
495
516
  name: string;
496
- email: string;
517
+ email: string | undefined;
497
518
  bitcoin_public_key: string;
498
519
  npub: string;
499
520
  postal_address: OptionalPostalAddressWeb;
@@ -503,7 +524,7 @@ export interface IdentityWeb {
503
524
  identification_number: string | undefined;
504
525
  profile_picture_file: FileWeb | undefined;
505
526
  identity_document_file: FileWeb | undefined;
506
- nostr_relay: string | undefined;
527
+ nostr_relays: string[];
507
528
  }
508
529
 
509
530
  export interface SeedPhrase {
@@ -613,7 +634,7 @@ export interface UploadFileResponse {
613
634
  file_upload_id: string;
614
635
  }
615
636
 
616
- export type JsErrorType = "FieldEmpty" | "InvalidSum" | "InvalidCurrency" | "InvalidPaymentAddress" | "InvalidContentType" | "InvalidContactType" | "InvalidDate" | "IssueDateAfterMaturityDate" | "MaturityDateInThePast" | "InvalidFileUploadId" | "InvalidBillType" | "DraweeCantBePayee" | "EndorserCantBeEndorsee" | "BuyerCantBeSeller" | "RecourserCantBeRecoursee" | "DraweeNotInContacts" | "PayeeNotInContacts" | "MintNotInContacts" | "BuyerNotInContacts" | "EndorseeNotInContacts" | "RecourseeNotInContacts" | "NoFileForFileUploadId" | "NotFound" | "ExternalApi" | "Io" | "Crypto" | "Persistence" | "Blockchain" | "Serialization" | "Init" | "NotificationNetwork" | "NotificationMessage" | "InvalidOperation" | "BillAlreadyAccepted" | "BillWasRejectedToAccept" | "BillAcceptanceExpired" | "BillWasRejectedToPay" | "BillPaymentExpired" | "BillWasRejectedToRecourse" | "BillRequestToRecourseExpired" | "BillWasRecoursedToTheEnd" | "BillAlreadyRequestedToAccept" | "BillNotAccepted" | "CallerIsNotDrawee" | "CallerIsNotHolder" | "CallerIsNotRecoursee" | "CallerIsNotBuyer" | "RequestAlreadyExpired" | "RequestAlreadyRejected" | "BillAlreadyPaid" | "BillWasNotRequestedToAccept" | "BillWasNotRequestedToPay" | "BillWasNotOfferedToSell" | "BillRequestToAcceptDidNotExpireAndWasNotRejected" | "BillRequestToPayDidNotExpireAndWasNotRejected" | "RecourseeNotPastHolder" | "BillWasNotRequestedToRecourse" | "BillIsNotRequestedToRecourseAndWaitingForPayment" | "BillIsNotOfferToSellWaitingForPayment" | "BillSellDataInvalid" | "BillRecourseDataInvalid" | "BillIsRequestedToPayAndWaitingForPayment" | "BillIsOfferedToSellAndWaitingForPayment" | "BillIsInRecourseAndWaitingForPayment" | "BillWasRequestedToPay" | "DrawerIsNotBillIssuer" | "SignatoryNotInContacts" | "SignatoryAlreadySignatory" | "CantRemoveLastSignatory" | "NotASignatory" | "InvalidSecp256k1Key" | "FileIsTooBig" | "InvalidFileName" | "UnknownNodeId" | "BackupNotSupported" | "CallerMustBeSignatory";
637
+ export type JsErrorType = "FieldEmpty" | "InvalidSum" | "InvalidCurrency" | "InvalidPaymentAddress" | "InvalidContentType" | "IdentityCantBeAnon" | "IdentityIsNotBillIssuer" | "InvalidContactType" | "InvalidIdentityType" | "InvalidDate" | "SelfDraftedBillCantBeBlank" | "SignerCantBeAnon" | "ContactIsAnonymous" | "InvalidContact" | "IssueDateAfterMaturityDate" | "MaturityDateInThePast" | "InvalidFileUploadId" | "InvalidBillType" | "DraweeCantBePayee" | "EndorserCantBeEndorsee" | "BuyerCantBeSeller" | "RecourserCantBeRecoursee" | "DraweeNotInContacts" | "PayeeNotInContacts" | "MintNotInContacts" | "BuyerNotInContacts" | "EndorseeNotInContacts" | "RecourseeNotInContacts" | "NoFileForFileUploadId" | "NotFound" | "ExternalApi" | "Io" | "Crypto" | "Persistence" | "Blockchain" | "Serialization" | "Init" | "NotificationNetwork" | "NotificationMessage" | "InvalidOperation" | "BillAlreadyAccepted" | "BillWasRejectedToAccept" | "BillAcceptanceExpired" | "BillWasRejectedToPay" | "BillPaymentExpired" | "BillWasRejectedToRecourse" | "BillRequestToRecourseExpired" | "BillWasRecoursedToTheEnd" | "BillAlreadyRequestedToAccept" | "BillNotAccepted" | "CallerIsNotDrawee" | "CallerIsNotHolder" | "CallerIsNotRecoursee" | "CallerIsNotBuyer" | "RequestAlreadyExpired" | "RequestAlreadyRejected" | "BillAlreadyPaid" | "BillWasNotRequestedToAccept" | "BillWasNotRequestedToPay" | "BillWasNotOfferedToSell" | "BillRequestToAcceptDidNotExpireAndWasNotRejected" | "BillRequestToPayDidNotExpireAndWasNotRejected" | "RecourseeNotPastHolder" | "BillWasNotRequestedToRecourse" | "BillIsNotRequestedToRecourseAndWaitingForPayment" | "BillIsNotOfferToSellWaitingForPayment" | "BillSellDataInvalid" | "BillRecourseDataInvalid" | "BillIsRequestedToPayAndWaitingForPayment" | "BillIsOfferedToSellAndWaitingForPayment" | "BillIsInRecourseAndWaitingForPayment" | "BillWasRequestedToPay" | "DrawerIsNotBillIssuer" | "SignatoryNotInContacts" | "SignatoryAlreadySignatory" | "CantRemoveLastSignatory" | "NotASignatory" | "InvalidSecp256k1Key" | "FileIsTooBig" | "InvalidFileName" | "UnknownNodeId" | "BackupNotSupported" | "CallerMustBeSignatory";
617
638
 
618
639
  export interface JsErrorData {
619
640
  error: JsErrorType;
@@ -625,7 +646,8 @@ export interface Config {
625
646
  log_level: string | undefined;
626
647
  bitcoin_network: string;
627
648
  esplora_base_url: string;
628
- nostr_relay: string;
649
+ nostr_relays: string[];
650
+ nostr_only_known_contacts: boolean | undefined;
629
651
  job_runner_initial_delay_seconds: number;
630
652
  job_runner_check_interval_seconds: number;
631
653
  }
@@ -656,15 +678,29 @@ export class Bill {
656
678
  list(): Promise<BillsResponse>;
657
679
  numbers_to_words_for_sum(id: string): Promise<BillNumbersToWordsForSum>;
658
680
  detail(id: string): Promise<BitcreditBillWeb>;
681
+ check_payment_for_bill(id: string): Promise<void>;
659
682
  check_payment(): Promise<void>;
660
683
  issue(payload: BitcreditBillPayload): Promise<BillId>;
684
+ issue_blank(payload: BitcreditBillPayload): Promise<BillId>;
661
685
  offer_to_sell(payload: OfferToSellBitcreditBillPayload): Promise<void>;
686
+ /**
687
+ * Blank offer to sell - the contact doesn't have to be an anonymous contact
688
+ */
689
+ offer_to_sell_blank(payload: OfferToSellBitcreditBillPayload): Promise<void>;
662
690
  endorse_bill(payload: EndorseBitcreditBillPayload): Promise<void>;
691
+ /**
692
+ * Blank endorsement - the contact doesn't have to be an anonymous contact
693
+ */
694
+ endorse_bill_blank(payload: EndorseBitcreditBillPayload): Promise<void>;
663
695
  request_to_pay(payload: RequestToPayBitcreditBillPayload): Promise<void>;
664
696
  request_to_accept(payload: RequestToAcceptBitcreditBillPayload): Promise<void>;
665
697
  accept(payload: AcceptBitcreditBillPayload): Promise<void>;
666
698
  request_to_mint(payload: RequestToMintBitcreditBillPayload): Promise<void>;
667
699
  mint_bill(payload: MintBitcreditBillPayload): Promise<void>;
700
+ /**
701
+ * Blank mint - the contact doesn't have to be an anonymous contact
702
+ */
703
+ mint_bill_blank(payload: MintBitcreditBillPayload): Promise<void>;
668
704
  reject_to_accept(payload: RejectActionBillPayload): Promise<void>;
669
705
  reject_to_pay(payload: RejectActionBillPayload): Promise<void>;
670
706
  reject_to_buy(payload: RejectActionBillPayload): Promise<void>;
@@ -696,6 +732,7 @@ export class Contact {
696
732
  list(): Promise<ContactsResponse>;
697
733
  detail(node_id: string): Promise<ContactWeb>;
698
734
  remove(node_id: string): Promise<void>;
735
+ deanonymize(payload: NewContactPayload): Promise<ContactWeb>;
699
736
  create(payload: NewContactPayload): Promise<ContactWeb>;
700
737
  edit(payload: EditContactPayload): Promise<void>;
701
738
  }
@@ -715,8 +752,9 @@ export class Identity {
715
752
  static new(): Identity;
716
753
  file(file_name: string): Promise<BinaryFileResponse>;
717
754
  upload(payload: UploadFile): Promise<UploadFileResponse>;
718
- detail(): Promise<any>;
719
- create(payload: NewIdentityPayload): Promise<void>;
755
+ detail(): Promise<IdentityWeb>;
756
+ deanonymize(payload: NewIdentityPayload): Promise<IdentityWeb>;
757
+ create(payload: NewIdentityPayload): Promise<IdentityWeb>;
720
758
  change(payload: ChangeIdentityPayload): Promise<void>;
721
759
  active(): Promise<SwitchIdentity>;
722
760
  switch(switch_identity_payload: SwitchIdentity): Promise<void>;
@@ -755,15 +793,20 @@ export interface InitOutput {
755
793
  readonly bill_list: (a: number) => any;
756
794
  readonly bill_numbers_to_words_for_sum: (a: number, b: number, c: number) => any;
757
795
  readonly bill_detail: (a: number, b: number, c: number) => any;
796
+ readonly bill_check_payment_for_bill: (a: number, b: number, c: number) => any;
758
797
  readonly bill_check_payment: (a: number) => any;
759
798
  readonly bill_issue: (a: number, b: any) => any;
799
+ readonly bill_issue_blank: (a: number, b: any) => any;
760
800
  readonly bill_offer_to_sell: (a: number, b: any) => any;
801
+ readonly bill_offer_to_sell_blank: (a: number, b: any) => any;
761
802
  readonly bill_endorse_bill: (a: number, b: any) => any;
803
+ readonly bill_endorse_bill_blank: (a: number, b: any) => any;
762
804
  readonly bill_request_to_pay: (a: number, b: any) => any;
763
805
  readonly bill_request_to_accept: (a: number, b: any) => any;
764
806
  readonly bill_accept: (a: number, b: any) => any;
765
807
  readonly bill_request_to_mint: (a: number, b: any) => any;
766
808
  readonly bill_mint_bill: (a: number, b: any) => any;
809
+ readonly bill_mint_bill_blank: (a: number, b: any) => any;
767
810
  readonly bill_reject_to_accept: (a: number, b: any) => any;
768
811
  readonly bill_reject_to_pay: (a: number, b: any) => any;
769
812
  readonly bill_reject_to_buy: (a: number, b: any) => any;
@@ -785,6 +828,7 @@ export interface InitOutput {
785
828
  readonly contact_list: (a: number) => any;
786
829
  readonly contact_detail: (a: number, b: number, c: number) => any;
787
830
  readonly contact_remove: (a: number, b: number, c: number) => any;
831
+ readonly contact_deanonymize: (a: number, b: any) => any;
788
832
  readonly contact_create: (a: number, b: any) => any;
789
833
  readonly contact_edit: (a: number, b: any) => any;
790
834
  readonly general_status: (a: number) => any;
@@ -795,6 +839,7 @@ export interface InitOutput {
795
839
  readonly identity_file: (a: number, b: number, c: number) => any;
796
840
  readonly identity_upload: (a: number, b: any) => any;
797
841
  readonly identity_detail: (a: number) => any;
842
+ readonly identity_deanonymize: (a: number, b: any) => any;
798
843
  readonly identity_create: (a: number, b: any) => any;
799
844
  readonly identity_change: (a: number, b: any) => any;
800
845
  readonly identity_active: (a: number) => any;
@@ -829,13 +874,13 @@ export interface InitOutput {
829
874
  readonly api_contact: () => number;
830
875
  readonly api_company: () => number;
831
876
  readonly api_quote: () => number;
877
+ readonly __wbg_quote_free: (a: number, b: number) => void;
832
878
  readonly __wbg_notification_free: (a: number, b: number) => void;
833
- readonly __wbg_bill_free: (a: number, b: number) => void;
879
+ readonly __wbg_general_free: (a: number, b: number) => void;
880
+ readonly __wbg_contact_free: (a: number, b: number) => void;
834
881
  readonly __wbg_identity_free: (a: number, b: number) => void;
835
- readonly __wbg_quote_free: (a: number, b: number) => void;
836
882
  readonly __wbg_company_free: (a: number, b: number) => void;
837
- readonly __wbg_contact_free: (a: number, b: number) => void;
838
- readonly __wbg_general_free: (a: number, b: number) => void;
883
+ readonly __wbg_bill_free: (a: number, b: number) => void;
839
884
  readonly __wbindgen_malloc: (a: number, b: number) => number;
840
885
  readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
841
886
  readonly __wbindgen_exn_store: (a: number) => void;
@@ -844,10 +889,10 @@ export interface InitOutput {
844
889
  readonly __wbindgen_free: (a: number, b: number, c: number) => void;
845
890
  readonly __wbindgen_export_6: WebAssembly.Table;
846
891
  readonly __externref_table_dealloc: (a: number) => void;
847
- readonly _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h4f8a4b89d400fd7b: (a: number, b: number) => void;
848
- readonly closure247_externref_shim: (a: number, b: number, c: any) => void;
849
- readonly closure726_externref_shim_multivalue_shim: (a: number, b: number, c: any) => [number, number];
850
- readonly closure499_externref_shim: (a: number, b: number, c: any, d: any) => void;
892
+ readonly _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h8272bbffa8fe9e5a: (a: number, b: number) => void;
893
+ readonly closure356_externref_shim: (a: number, b: number, c: any) => void;
894
+ readonly closure837_externref_shim_multivalue_shim: (a: number, b: number, c: any) => [number, number];
895
+ readonly closure609_externref_shim: (a: number, b: number, c: any, d: any) => void;
851
896
  readonly __wbindgen_start: () => void;
852
897
  }
853
898
 
package/index.js CHANGED
@@ -228,35 +228,43 @@ export function task_worker_entry_point(ptr) {
228
228
  }
229
229
 
230
230
  function __wbg_adapter_54(arg0, arg1) {
231
- wasm._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h4f8a4b89d400fd7b(arg0, arg1);
231
+ wasm._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h8272bbffa8fe9e5a(arg0, arg1);
232
232
  }
233
233
 
234
234
  function __wbg_adapter_57(arg0, arg1, arg2) {
235
- wasm.closure247_externref_shim(arg0, arg1, arg2);
235
+ wasm.closure356_externref_shim(arg0, arg1, arg2);
236
236
  }
237
237
 
238
238
  function __wbg_adapter_64(arg0, arg1, arg2) {
239
- const ret = wasm.closure726_externref_shim_multivalue_shim(arg0, arg1, arg2);
239
+ const ret = wasm.closure837_externref_shim_multivalue_shim(arg0, arg1, arg2);
240
240
  if (ret[1]) {
241
241
  throw takeFromExternrefTable0(ret[0]);
242
242
  }
243
243
  }
244
244
 
245
- function __wbg_adapter_241(arg0, arg1, arg2, arg3) {
246
- wasm.closure499_externref_shim(arg0, arg1, arg2, arg3);
245
+ function __wbg_adapter_248(arg0, arg1, arg2, arg3) {
246
+ wasm.closure609_externref_shim(arg0, arg1, arg2, arg3);
247
247
  }
248
248
 
249
249
  /**
250
- * @enum {0 | 1}
250
+ * @enum {0 | 1 | 2}
251
251
  */
252
252
  export const ContactTypeWeb = Object.freeze({
253
253
  Person: 0, "0": "Person",
254
254
  Company: 1, "1": "Company",
255
+ Anon: 2, "2": "Anon",
255
256
  });
256
257
  /**
257
258
  * @enum {0 | 1}
258
259
  */
259
260
  export const IdentityTypeWeb = Object.freeze({
261
+ Ident: 0, "0": "Ident",
262
+ Anon: 1, "1": "Anon",
263
+ });
264
+ /**
265
+ * @enum {0 | 1}
266
+ */
267
+ export const SwitchIdentityTypeWeb = Object.freeze({
260
268
  Person: 0, "0": "Person",
261
269
  Company: 1, "1": "Company",
262
270
  });
@@ -474,6 +482,16 @@ export class Bill {
474
482
  const ret = wasm.bill_detail(this.__wbg_ptr, ptr0, len0);
475
483
  return ret;
476
484
  }
485
+ /**
486
+ * @param {string} id
487
+ * @returns {Promise<void>}
488
+ */
489
+ check_payment_for_bill(id) {
490
+ const ptr0 = passStringToWasm0(id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
491
+ const len0 = WASM_VECTOR_LEN;
492
+ const ret = wasm.bill_check_payment_for_bill(this.__wbg_ptr, ptr0, len0);
493
+ return ret;
494
+ }
477
495
  /**
478
496
  * @returns {Promise<void>}
479
497
  */
@@ -489,6 +507,14 @@ export class Bill {
489
507
  const ret = wasm.bill_issue(this.__wbg_ptr, payload);
490
508
  return ret;
491
509
  }
510
+ /**
511
+ * @param {BitcreditBillPayload} payload
512
+ * @returns {BillId}
513
+ */
514
+ issue_blank(payload) {
515
+ const ret = wasm.bill_issue_blank(this.__wbg_ptr, payload);
516
+ return ret;
517
+ }
492
518
  /**
493
519
  * @param {OfferToSellBitcreditBillPayload} payload
494
520
  * @returns {Promise<void>}
@@ -497,6 +523,15 @@ export class Bill {
497
523
  const ret = wasm.bill_offer_to_sell(this.__wbg_ptr, payload);
498
524
  return ret;
499
525
  }
526
+ /**
527
+ * Blank offer to sell - the contact doesn't have to be an anonymous contact
528
+ * @param {OfferToSellBitcreditBillPayload} payload
529
+ * @returns {Promise<void>}
530
+ */
531
+ offer_to_sell_blank(payload) {
532
+ const ret = wasm.bill_offer_to_sell_blank(this.__wbg_ptr, payload);
533
+ return ret;
534
+ }
500
535
  /**
501
536
  * @param {EndorseBitcreditBillPayload} payload
502
537
  * @returns {Promise<void>}
@@ -505,6 +540,15 @@ export class Bill {
505
540
  const ret = wasm.bill_endorse_bill(this.__wbg_ptr, payload);
506
541
  return ret;
507
542
  }
543
+ /**
544
+ * Blank endorsement - the contact doesn't have to be an anonymous contact
545
+ * @param {EndorseBitcreditBillPayload} payload
546
+ * @returns {Promise<void>}
547
+ */
548
+ endorse_bill_blank(payload) {
549
+ const ret = wasm.bill_endorse_bill_blank(this.__wbg_ptr, payload);
550
+ return ret;
551
+ }
508
552
  /**
509
553
  * @param {RequestToPayBitcreditBillPayload} payload
510
554
  * @returns {Promise<void>}
@@ -545,6 +589,15 @@ export class Bill {
545
589
  const ret = wasm.bill_mint_bill(this.__wbg_ptr, payload);
546
590
  return ret;
547
591
  }
592
+ /**
593
+ * Blank mint - the contact doesn't have to be an anonymous contact
594
+ * @param {MintBitcreditBillPayload} payload
595
+ * @returns {Promise<void>}
596
+ */
597
+ mint_bill_blank(payload) {
598
+ const ret = wasm.bill_mint_bill_blank(this.__wbg_ptr, payload);
599
+ return ret;
600
+ }
548
601
  /**
549
602
  * @param {RejectActionBillPayload} payload
550
603
  * @returns {Promise<void>}
@@ -796,6 +849,14 @@ export class Contact {
796
849
  const ret = wasm.contact_remove(this.__wbg_ptr, ptr0, len0);
797
850
  return ret;
798
851
  }
852
+ /**
853
+ * @param {NewContactPayload} payload
854
+ * @returns {ContactWeb}
855
+ */
856
+ deanonymize(payload) {
857
+ const ret = wasm.contact_deanonymize(this.__wbg_ptr, payload);
858
+ return ret;
859
+ }
799
860
  /**
800
861
  * @param {NewContactPayload} payload
801
862
  * @returns {ContactWeb}
@@ -941,7 +1002,7 @@ export class Identity {
941
1002
  return ret;
942
1003
  }
943
1004
  /**
944
- * @returns {Promise<any>}
1005
+ * @returns {IdentityWeb}
945
1006
  */
946
1007
  detail() {
947
1008
  const ret = wasm.identity_detail(this.__wbg_ptr);
@@ -949,7 +1010,15 @@ export class Identity {
949
1010
  }
950
1011
  /**
951
1012
  * @param {NewIdentityPayload} payload
952
- * @returns {Promise<void>}
1013
+ * @returns {IdentityWeb}
1014
+ */
1015
+ deanonymize(payload) {
1016
+ const ret = wasm.identity_deanonymize(this.__wbg_ptr, payload);
1017
+ return ret;
1018
+ }
1019
+ /**
1020
+ * @param {NewIdentityPayload} payload
1021
+ * @returns {IdentityWeb}
953
1022
  */
954
1023
  create(payload) {
955
1024
  const ret = wasm.identity_create(this.__wbg_ptr, payload);
@@ -1260,6 +1329,9 @@ function __wbg_get_imports() {
1260
1329
  const ret = Object.entries(arg0);
1261
1330
  return ret;
1262
1331
  };
1332
+ imports.wbg.__wbg_error_243f933071f88b86 = function(arg0, arg1) {
1333
+ console.error(getStringFromWasm0(arg0, arg1));
1334
+ };
1263
1335
  imports.wbg.__wbg_error_7534b8e9a36f1ab4 = function(arg0, arg1) {
1264
1336
  let deferred0_0;
1265
1337
  let deferred0_1;
@@ -1286,7 +1358,7 @@ function __wbg_get_imports() {
1286
1358
  const ret = fetch(arg0);
1287
1359
  return ret;
1288
1360
  };
1289
- imports.wbg.__wbg_getRandomValues_21a0191e74d0e1d3 = function() { return handleError(function (arg0, arg1) {
1361
+ imports.wbg.__wbg_getRandomValues_3c9c0d586e575a16 = function() { return handleError(function (arg0, arg1) {
1290
1362
  globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
1291
1363
  }, arguments) };
1292
1364
  imports.wbg.__wbg_getRandomValues_3d90134a348e46b3 = function() { return handleError(function (arg0, arg1) {
@@ -1401,6 +1473,16 @@ function __wbg_get_imports() {
1401
1473
  const ret = result;
1402
1474
  return ret;
1403
1475
  };
1476
+ imports.wbg.__wbg_instanceof_Window_def73ea0955fc569 = function(arg0) {
1477
+ let result;
1478
+ try {
1479
+ result = arg0 instanceof Window;
1480
+ } catch (_) {
1481
+ result = false;
1482
+ }
1483
+ const ret = result;
1484
+ return ret;
1485
+ };
1404
1486
  imports.wbg.__wbg_isArray_a1eab7e0d067391b = function(arg0) {
1405
1487
  const ret = Array.isArray(arg0);
1406
1488
  return ret;
@@ -1451,7 +1533,7 @@ function __wbg_get_imports() {
1451
1533
  const a = state0.a;
1452
1534
  state0.a = 0;
1453
1535
  try {
1454
- return __wbg_adapter_241(a, state0.b, arg0, arg1);
1536
+ return __wbg_adapter_248(a, state0.b, arg0, arg1);
1455
1537
  } finally {
1456
1538
  state0.a = a;
1457
1539
  }
@@ -1848,32 +1930,32 @@ function __wbg_get_imports() {
1848
1930
  const ret = false;
1849
1931
  return ret;
1850
1932
  };
1851
- imports.wbg.__wbindgen_closure_wrapper1478 = function(arg0, arg1, arg2) {
1852
- const ret = makeMutClosure(arg0, arg1, 488, __wbg_adapter_54);
1933
+ imports.wbg.__wbindgen_closure_wrapper18261 = function(arg0, arg1, arg2) {
1934
+ const ret = makeMutClosure(arg0, arg1, 598, __wbg_adapter_57);
1853
1935
  return ret;
1854
1936
  };
1855
- imports.wbg.__wbindgen_closure_wrapper18013 = function(arg0, arg1, arg2) {
1856
- const ret = makeMutClosure(arg0, arg1, 488, __wbg_adapter_57);
1937
+ imports.wbg.__wbindgen_closure_wrapper18302 = function(arg0, arg1, arg2) {
1938
+ const ret = makeMutClosure(arg0, arg1, 598, __wbg_adapter_54);
1857
1939
  return ret;
1858
1940
  };
1859
- imports.wbg.__wbindgen_closure_wrapper18054 = function(arg0, arg1, arg2) {
1860
- const ret = makeMutClosure(arg0, arg1, 488, __wbg_adapter_54);
1941
+ imports.wbg.__wbindgen_closure_wrapper2090 = function(arg0, arg1, arg2) {
1942
+ const ret = makeMutClosure(arg0, arg1, 598, __wbg_adapter_54);
1861
1943
  return ret;
1862
1944
  };
1863
- imports.wbg.__wbindgen_closure_wrapper2166 = function(arg0, arg1, arg2) {
1864
- const ret = makeMutClosure(arg0, arg1, 248, __wbg_adapter_57);
1945
+ imports.wbg.__wbindgen_closure_wrapper2781 = function(arg0, arg1, arg2) {
1946
+ const ret = makeMutClosure(arg0, arg1, 357, __wbg_adapter_57);
1865
1947
  return ret;
1866
1948
  };
1867
- imports.wbg.__wbindgen_closure_wrapper7700 = function(arg0, arg1, arg2) {
1868
- const ret = makeMutClosure(arg0, arg1, 488, __wbg_adapter_57);
1949
+ imports.wbg.__wbindgen_closure_wrapper2892 = function(arg0, arg1, arg2) {
1950
+ const ret = makeMutClosure(arg0, arg1, 598, __wbg_adapter_54);
1869
1951
  return ret;
1870
1952
  };
1871
- imports.wbg.__wbindgen_closure_wrapper8707 = function(arg0, arg1, arg2) {
1872
- const ret = makeMutClosure(arg0, arg1, 488, __wbg_adapter_54);
1953
+ imports.wbg.__wbindgen_closure_wrapper8548 = function(arg0, arg1, arg2) {
1954
+ const ret = makeMutClosure(arg0, arg1, 598, __wbg_adapter_57);
1873
1955
  return ret;
1874
1956
  };
1875
- imports.wbg.__wbindgen_closure_wrapper8726 = function(arg0, arg1, arg2) {
1876
- const ret = makeMutClosure(arg0, arg1, 248, __wbg_adapter_64);
1957
+ imports.wbg.__wbindgen_closure_wrapper9564 = function(arg0, arg1, arg2) {
1958
+ const ret = makeMutClosure(arg0, arg1, 357, __wbg_adapter_64);
1877
1959
  return ret;
1878
1960
  };
1879
1961
  imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
package/index_bg.wasm CHANGED
Binary file
package/package.json CHANGED
@@ -1,7 +1,8 @@
1
1
  {
2
2
  "name": "@bitcredit/bcr-ebill-wasm",
3
3
  "type": "module",
4
- "version": "0.3.10",
4
+ "version": "0.3.12",
5
+ "license": "MIT",
5
6
  "files": [
6
7
  "index_bg.wasm",
7
8
  "index.js",