@bitcredit/bcr-ebill-wasm 0.4.4 → 0.4.6

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
@@ -93,6 +93,10 @@ export interface BillCombinedBitcoinKeyWeb {
93
93
  private_descriptor: string;
94
94
  }
95
95
 
96
+ export interface ResyncBillPayload {
97
+ bill_id: string;
98
+ }
99
+
96
100
  export type BillsFilterRoleWeb = "All" | "Payer" | "Payee" | "Contingent";
97
101
 
98
102
  export interface PastEndorseeWeb {
@@ -108,7 +112,7 @@ export interface LightSignedByWeb {
108
112
  }
109
113
 
110
114
  export interface EndorsementWeb {
111
- pay_to_the_order_of: LightBillIdentParticipantWithAddressWeb;
115
+ pay_to_the_order_of: LightBillParticipantWeb;
112
116
  signed: LightSignedByWeb;
113
117
  signing_timestamp: number;
114
118
  signing_address: PostalAddressWeb | undefined;
@@ -241,6 +245,7 @@ export interface BillStatusWeb {
241
245
  mint: BillMintStatusWeb;
242
246
  redeemed_funds_available: boolean;
243
247
  has_requested_funds: boolean;
248
+ last_block_time: number;
244
249
  }
245
250
 
246
251
  export interface BillAcceptanceStatusWeb {
@@ -516,6 +521,16 @@ export interface SeedPhrase {
516
521
  seed_phrase: string;
517
522
  }
518
523
 
524
+ export interface IdentityProofWeb {
525
+ id: string;
526
+ node_id: NodeId;
527
+ stamp: IdentityProofStamp;
528
+ url: Url;
529
+ timestamp: number;
530
+ status: IdentityProofStatusWeb;
531
+ status_last_checked_timestamp: number;
532
+ }
533
+
519
534
  export interface NotificationStatusWeb {
520
535
  node_id: string;
521
536
  active: boolean;
@@ -631,7 +646,7 @@ export interface UploadFileResponse {
631
646
  file_upload_id: string;
632
647
  }
633
648
 
634
- export type JsErrorType = "FieldEmpty" | "InvalidSum" | "InvalidCurrency" | "InvalidPaymentAddress" | "InvalidContentType" | "IdentityCantBeAnon" | "IdentityIsNotBillIssuer" | "InvalidContactType" | "InvalidIdentityType" | "InvalidDate" | "SelfDraftedBillCantBeBlank" | "RequestToMintForBillAndMintAlreadyActive" | "SignerCantBeAnon" | "ContactIsAnonymous" | "InvalidContact" | "InvalidMint" | "IssueDateAfterMaturityDate" | "MaturityDateInThePast" | "InvalidFileUploadId" | "InvalidNodeId" | "InvalidBillId" | "InvalidBillType" | "DraweeCantBePayee" | "EndorserCantBeEndorsee" | "BuyerCantBeSeller" | "RecourserCantBeRecoursee" | "DraweeNotInContacts" | "PayeeNotInContacts" | "MintNotInContacts" | "BuyerNotInContacts" | "EndorseeNotInContacts" | "RecourseeNotInContacts" | "CancelMintRequestNotPending" | "RejectMintRequestNotOffered" | "AcceptMintRequestNotOffered" | "AcceptMintOfferExpired" | "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" | "FileIsEmpty" | "TooManyFiles" | "InvalidFileName" | "UnknownNodeId" | "BackupNotSupported" | "CallerMustBeSignatory";
649
+ export type JsErrorType = "FieldEmpty" | "InvalidSum" | "InvalidCurrency" | "InvalidPaymentAddress" | "InvalidContentType" | "IdentityCantBeAnon" | "IdentityIsNotBillIssuer" | "InvalidContactType" | "InvalidIdentityType" | "InvalidDate" | "SelfDraftedBillCantBeBlank" | "RequestToMintForBillAndMintAlreadyActive" | "SignerCantBeAnon" | "ContactIsAnonymous" | "InvalidContact" | "InvalidMint" | "IssueDateAfterMaturityDate" | "MaturityDateInThePast" | "InvalidFileUploadId" | "InvalidNodeId" | "InvalidBillId" | "InvalidBillType" | "DraweeCantBePayee" | "EndorserCantBeEndorsee" | "BuyerCantBeSeller" | "RecourserCantBeRecoursee" | "DraweeNotInContacts" | "PayeeNotInContacts" | "MintNotInContacts" | "BuyerNotInContacts" | "EndorseeNotInContacts" | "RecourseeNotInContacts" | "CancelMintRequestNotPending" | "RejectMintRequestNotOffered" | "AcceptMintRequestNotOffered" | "AcceptMintOfferExpired" | "NoFileForFileUploadId" | "NotFound" | "ExternalApi" | "Io" | "Crypto" | "Persistence" | "Blockchain" | "InvalidRelayUrl" | "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" | "FileIsEmpty" | "TooManyFiles" | "InvalidFileName" | "UnknownNodeId" | "BackupNotSupported" | "CallerMustBeSignatory" | "InvalidBase58" | "InvalidSignature" | "InvalidUrl" | "InvalidIdentityProofStatus";
635
650
 
636
651
  export interface JsErrorData {
637
652
  error: JsErrorType;
@@ -641,6 +656,7 @@ export interface JsErrorData {
641
656
 
642
657
  export interface Config {
643
658
  log_level: string | undefined;
659
+ app_url: string;
644
660
  bitcoin_network: string;
645
661
  esplora_base_url: string;
646
662
  nostr_relays: string[];
@@ -687,6 +703,7 @@ export class Api {
687
703
  static general(): General;
688
704
  static contact(): Contact;
689
705
  static identity(): Identity;
706
+ static identity_proof(): IdentityProof;
690
707
  static notification(): Notification;
691
708
  static company(): Company;
692
709
  static bill(): Bill;
@@ -737,6 +754,10 @@ export class Bill {
737
754
  request_to_recourse_bill_payment(payload: RequestRecourseForPaymentPayload): Promise<void>;
738
755
  request_to_recourse_bill_acceptance(payload: RequestRecourseForPaymentPayload): Promise<void>;
739
756
  clear_bill_cache(): Promise<void>;
757
+ /**
758
+ * Given a bill id, resync the chain via block transport
759
+ */
760
+ sync_bill_chain(payload: ResyncBillPayload): Promise<void>;
740
761
  }
741
762
  export class Company {
742
763
  private constructor();
@@ -793,14 +814,48 @@ export class Identity {
793
814
  seed_backup(): Promise<SeedPhrase>;
794
815
  seed_recover(payload: SeedPhrase): Promise<void>;
795
816
  }
817
+ export class IdentityProof {
818
+ private constructor();
819
+ free(): void;
820
+ static new(): IdentityProof;
821
+ /**
822
+ * Get identity stamp to post on social media for the currently selected identity
823
+ */
824
+ get_identity_stamp(): Promise<string>;
825
+ /**
826
+ * Fetch identity proofs for the currently selected identity
827
+ */
828
+ list(): Promise<IdentityProofWeb[]>;
829
+ /**
830
+ * Add identity proof for the currently selected identity
831
+ */
832
+ add(url: string, stamp: string): Promise<IdentityProofWeb>;
833
+ /**
834
+ * Archive the identity proof with the given id for the currently selected identity
835
+ */
836
+ archive(id: string): Promise<void>;
837
+ /**
838
+ * Re-check the identity proof by its URL with the given id for the currently selected identity
839
+ * returning the new result
840
+ */
841
+ re_check(id: string): Promise<IdentityProofWeb>;
842
+ }
796
843
  export class Notification {
797
844
  private constructor();
798
845
  free(): void;
799
846
  static new(): Notification;
800
- active_notifications_for_node_ids(node_ids: Vec<String>): Promise<NotificationStatusWeb[]>;
847
+ active_notifications_for_node_ids(node_ids: string[]): Promise<NotificationStatusWeb[]>;
801
848
  subscribe(callback: Function): Promise<void>;
802
849
  list(filters: NotificationFilters): Promise<NotificationWeb[]>;
803
850
  mark_as_done(notification_id: string): Promise<void>;
851
+ /**
852
+ * Register email notifications for the currently selected identity
853
+ */
854
+ register_email_notifications(relay_url: string): Promise<void>;
855
+ /**
856
+ * Fetch email notifications preferences link for the currently selected identity
857
+ */
858
+ get_email_notifications_preferences_link(): Promise<string>;
804
859
  trigger_test_msg(payload: any): Promise<void>;
805
860
  }
806
861
 
@@ -844,6 +899,7 @@ export interface InitOutput {
844
899
  readonly bill_request_to_recourse_bill_payment: (a: number, b: any) => any;
845
900
  readonly bill_request_to_recourse_bill_acceptance: (a: number, b: any) => any;
846
901
  readonly bill_clear_bill_cache: (a: number) => any;
902
+ readonly bill_sync_bill_chain: (a: number, b: any) => any;
847
903
  readonly company_file: (a: number, b: number, c: number, d: number, e: number) => any;
848
904
  readonly company_file_base64: (a: number, b: number, c: number, d: number, e: number) => any;
849
905
  readonly company_upload: (a: number, b: any) => any;
@@ -879,10 +935,17 @@ export interface InitOutput {
879
935
  readonly identity_switch: (a: number, b: any) => any;
880
936
  readonly identity_seed_backup: (a: number) => any;
881
937
  readonly identity_seed_recover: (a: number, b: any) => any;
938
+ readonly identityproof_get_identity_stamp: (a: number) => any;
939
+ readonly identityproof_list: (a: number) => any;
940
+ readonly identityproof_add: (a: number, b: number, c: number, d: number, e: number) => any;
941
+ readonly identityproof_archive: (a: number, b: number, c: number) => any;
942
+ readonly identityproof_re_check: (a: number, b: number, c: number) => any;
882
943
  readonly notification_active_notifications_for_node_ids: (a: number, b: any) => any;
883
944
  readonly notification_subscribe: (a: number, b: any) => any;
884
945
  readonly notification_list: (a: number, b: any) => any;
885
946
  readonly notification_mark_as_done: (a: number, b: number, c: number) => any;
947
+ readonly notification_register_email_notifications: (a: number, b: number, c: number) => any;
948
+ readonly notification_get_email_notifications_preferences_link: (a: number) => any;
886
949
  readonly notification_trigger_test_msg: (a: number, b: any) => any;
887
950
  readonly __wbg_api_free: (a: number, b: number) => void;
888
951
  readonly api_bill: () => number;
@@ -897,19 +960,22 @@ export interface InitOutput {
897
960
  readonly contact_new: () => number;
898
961
  readonly general_new: () => number;
899
962
  readonly identity_new: () => number;
963
+ readonly identityproof_new: () => number;
900
964
  readonly notification_new: () => number;
901
965
  readonly bill_new: () => number;
902
966
  readonly api_general: () => number;
903
967
  readonly api_identity: () => number;
968
+ readonly api_identity_proof: () => number;
904
969
  readonly api_notification: () => number;
905
970
  readonly api_contact: () => number;
906
971
  readonly api_company: () => number;
907
- readonly __wbg_company_free: (a: number, b: number) => void;
908
- readonly __wbg_general_free: (a: number, b: number) => void;
909
- readonly __wbg_bill_free: (a: number, b: number) => void;
972
+ readonly __wbg_identityproof_free: (a: number, b: number) => void;
973
+ readonly __wbg_identity_free: (a: number, b: number) => void;
910
974
  readonly __wbg_notification_free: (a: number, b: number) => void;
975
+ readonly __wbg_general_free: (a: number, b: number) => void;
911
976
  readonly __wbg_contact_free: (a: number, b: number) => void;
912
- readonly __wbg_identity_free: (a: number, b: number) => void;
977
+ readonly __wbg_bill_free: (a: number, b: number) => void;
978
+ readonly __wbg_company_free: (a: number, b: number) => void;
913
979
  readonly __wbindgen_malloc: (a: number, b: number) => number;
914
980
  readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
915
981
  readonly __wbindgen_exn_store: (a: number) => void;
@@ -918,11 +984,11 @@ export interface InitOutput {
918
984
  readonly __wbindgen_free: (a: number, b: number, c: number) => void;
919
985
  readonly __wbindgen_export_6: WebAssembly.Table;
920
986
  readonly __externref_table_dealloc: (a: number) => void;
921
- readonly _dyn_core__ops__function__Fn_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hcdc569c6fce875f5: (a: number, b: number) => void;
922
- readonly closure336_externref_shim: (a: number, b: number, c: any) => void;
923
- readonly _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h05d8c0db83408407: (a: number, b: number) => void;
924
- readonly closure843_externref_shim_multivalue_shim: (a: number, b: number, c: any) => [number, number];
925
- readonly closure626_externref_shim: (a: number, b: number, c: any, d: any) => void;
987
+ readonly wasm_bindgen__convert__closures_____invoke__h0172cc400d3e2d99: (a: number, b: number) => void;
988
+ readonly closure353_externref_shim: (a: number, b: number, c: any) => void;
989
+ readonly wasm_bindgen__convert__closures_____invoke__h40be9c133f5df086: (a: number, b: number) => void;
990
+ readonly closure861_externref_shim_multivalue_shim: (a: number, b: number, c: any) => [number, number];
991
+ readonly closure643_externref_shim: (a: number, b: number, c: any, d: any) => void;
926
992
  readonly __wbindgen_start: () => void;
927
993
  }
928
994