@bitcredit/bcr-ebill-wasm 0.3.12 → 0.3.13

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
@@ -97,7 +97,7 @@ export interface RejectActionBillPayload {
97
97
  }
98
98
 
99
99
  export interface BillCombinedBitcoinKeyWeb {
100
- private_key: string;
100
+ private_descriptor: string;
101
101
  }
102
102
 
103
103
  export type BillsFilterRoleWeb = "All" | "Payer" | "Payee" | "Contingent";
@@ -169,7 +169,7 @@ export interface PastPaymentDataSellWeb {
169
169
  sum: string;
170
170
  link_to_pay: string;
171
171
  address_to_pay: string;
172
- private_key_to_spend: string;
172
+ private_descriptor_to_spend: string;
173
173
  mempool_link_for_address_to_pay: string;
174
174
  status: PastPaymentStatusWeb;
175
175
  }
@@ -182,7 +182,7 @@ export interface PastPaymentDataPaymentWeb {
182
182
  sum: string;
183
183
  link_to_pay: string;
184
184
  address_to_pay: string;
185
- private_key_to_spend: string;
185
+ private_descriptor_to_spend: string;
186
186
  mempool_link_for_address_to_pay: string;
187
187
  status: PastPaymentStatusWeb;
188
188
  }
@@ -195,7 +195,7 @@ export interface PastPaymentDataRecourseWeb {
195
195
  sum: string;
196
196
  link_to_pay: string;
197
197
  address_to_pay: string;
198
- private_key_to_spend: string;
198
+ private_descriptor_to_spend: string;
199
199
  mempool_link_for_address_to_pay: string;
200
200
  status: PastPaymentStatusWeb;
201
201
  }
@@ -258,6 +258,7 @@ export interface BillStatusWeb {
258
258
  payment: BillPaymentStatusWeb;
259
259
  sell: BillSellStatusWeb;
260
260
  recourse: BillRecourseStatusWeb;
261
+ mint: BillMintStatusWeb;
261
262
  redeemed_funds_available: boolean;
262
263
  has_requested_funds: boolean;
263
264
  }
@@ -294,6 +295,10 @@ export interface BillRecourseStatusWeb {
294
295
  rejected_request_to_recourse: boolean;
295
296
  }
296
297
 
298
+ export interface BillMintStatusWeb {
299
+ has_mint_requests: boolean;
300
+ }
301
+
297
302
  export interface BillDataWeb {
298
303
  language: string;
299
304
  time_of_drawing: number;
@@ -634,7 +639,7 @@ export interface UploadFileResponse {
634
639
  file_upload_id: string;
635
640
  }
636
641
 
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";
642
+ export type JsErrorType = "FieldEmpty" | "InvalidSum" | "InvalidCurrency" | "InvalidPaymentAddress" | "InvalidContentType" | "IdentityCantBeAnon" | "IdentityIsNotBillIssuer" | "InvalidContactType" | "InvalidIdentityType" | "InvalidDate" | "SelfDraftedBillCantBeBlank" | "RequestToMintForBillAndMintAlreadyActive" | "SignerCantBeAnon" | "ContactIsAnonymous" | "InvalidContact" | "InvalidMint" | "IssueDateAfterMaturityDate" | "MaturityDateInThePast" | "InvalidFileUploadId" | "InvalidBillType" | "DraweeCantBePayee" | "EndorserCantBeEndorsee" | "BuyerCantBeSeller" | "RecourserCantBeRecoursee" | "DraweeNotInContacts" | "PayeeNotInContacts" | "MintNotInContacts" | "BuyerNotInContacts" | "EndorseeNotInContacts" | "RecourseeNotInContacts" | "CancelMintRequestNotPending" | "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";
638
643
 
639
644
  export interface JsErrorData {
640
645
  error: JsErrorType;
@@ -650,6 +655,30 @@ export interface Config {
650
655
  nostr_only_known_contacts: boolean | undefined;
651
656
  job_runner_initial_delay_seconds: number;
652
657
  job_runner_check_interval_seconds: number;
658
+ default_mint_url: string;
659
+ default_mint_node_id: string;
660
+ }
661
+
662
+ export interface MintRequestStateWeb {
663
+ request: MintRequestWeb;
664
+ offer: MintOfferWeb | undefined;
665
+ }
666
+
667
+ export interface MintRequestStateResponse {
668
+ request_states: MintRequestStateWeb[];
669
+ }
670
+
671
+ export interface MintOfferWeb {}
672
+
673
+ export type MintRequestStatusWeb = "Pending" | "Denied" | "Offered" | "Accepted" | "Rejected" | "Cancelled" | "Expired";
674
+
675
+ export interface MintRequestWeb {
676
+ requester_node_id: string;
677
+ bill_id: string;
678
+ mint_node_id: string;
679
+ mint_request_id: string;
680
+ timestamp: number;
681
+ status: MintRequestStatusWeb;
653
682
  }
654
683
 
655
684
  export class Api {
@@ -696,6 +725,9 @@ export class Bill {
696
725
  request_to_accept(payload: RequestToAcceptBitcreditBillPayload): Promise<void>;
697
726
  accept(payload: AcceptBitcreditBillPayload): Promise<void>;
698
727
  request_to_mint(payload: RequestToMintBitcreditBillPayload): Promise<void>;
728
+ mint_state(id: string): Promise<MintRequestStateWeb>;
729
+ check_mint_state(id: string): Promise<void>;
730
+ cancel_request_to_mint(mint_request_id: string): Promise<void>;
699
731
  mint_bill(payload: MintBitcreditBillPayload): Promise<void>;
700
732
  /**
701
733
  * Blank mint - the contact doesn't have to be an anonymous contact
@@ -805,6 +837,9 @@ export interface InitOutput {
805
837
  readonly bill_request_to_accept: (a: number, b: any) => any;
806
838
  readonly bill_accept: (a: number, b: any) => any;
807
839
  readonly bill_request_to_mint: (a: number, b: any) => any;
840
+ readonly bill_mint_state: (a: number, b: number, c: number) => any;
841
+ readonly bill_check_mint_state: (a: number, b: number, c: number) => any;
842
+ readonly bill_cancel_request_to_mint: (a: number, b: number, c: number) => any;
808
843
  readonly bill_mint_bill: (a: number, b: any) => any;
809
844
  readonly bill_mint_bill_blank: (a: number, b: any) => any;
810
845
  readonly bill_reject_to_accept: (a: number, b: any) => any;
@@ -877,10 +912,10 @@ export interface InitOutput {
877
912
  readonly __wbg_quote_free: (a: number, b: number) => void;
878
913
  readonly __wbg_notification_free: (a: number, b: number) => void;
879
914
  readonly __wbg_general_free: (a: number, b: number) => void;
880
- readonly __wbg_contact_free: (a: number, b: number) => void;
881
- readonly __wbg_identity_free: (a: number, b: number) => void;
882
915
  readonly __wbg_company_free: (a: number, b: number) => void;
883
916
  readonly __wbg_bill_free: (a: number, b: number) => void;
917
+ readonly __wbg_contact_free: (a: number, b: number) => void;
918
+ readonly __wbg_identity_free: (a: number, b: number) => void;
884
919
  readonly __wbindgen_malloc: (a: number, b: number) => number;
885
920
  readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
886
921
  readonly __wbindgen_exn_store: (a: number) => void;
@@ -889,10 +924,10 @@ export interface InitOutput {
889
924
  readonly __wbindgen_free: (a: number, b: number, c: number) => void;
890
925
  readonly __wbindgen_export_6: WebAssembly.Table;
891
926
  readonly __externref_table_dealloc: (a: number) => 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;
927
+ readonly _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h5200cc0755260c49: (a: number, b: number) => void;
928
+ readonly closure366_externref_shim: (a: number, b: number, c: any) => void;
929
+ readonly closure942_externref_shim_multivalue_shim: (a: number, b: number, c: any) => [number, number];
930
+ readonly closure687_externref_shim: (a: number, b: number, c: any, d: any) => void;
896
931
  readonly __wbindgen_start: () => void;
897
932
  }
898
933
 
package/index.js CHANGED
@@ -228,22 +228,22 @@ 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__h8272bbffa8fe9e5a(arg0, arg1);
231
+ wasm._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h5200cc0755260c49(arg0, arg1);
232
232
  }
233
233
 
234
234
  function __wbg_adapter_57(arg0, arg1, arg2) {
235
- wasm.closure356_externref_shim(arg0, arg1, arg2);
235
+ wasm.closure366_externref_shim(arg0, arg1, arg2);
236
236
  }
237
237
 
238
238
  function __wbg_adapter_64(arg0, arg1, arg2) {
239
- const ret = wasm.closure837_externref_shim_multivalue_shim(arg0, arg1, arg2);
239
+ const ret = wasm.closure942_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_248(arg0, arg1, arg2, arg3) {
246
- wasm.closure609_externref_shim(arg0, arg1, arg2, arg3);
245
+ function __wbg_adapter_251(arg0, arg1, arg2, arg3) {
246
+ wasm.closure687_externref_shim(arg0, arg1, arg2, arg3);
247
247
  }
248
248
 
249
249
  /**
@@ -581,6 +581,36 @@ export class Bill {
581
581
  const ret = wasm.bill_request_to_mint(this.__wbg_ptr, payload);
582
582
  return ret;
583
583
  }
584
+ /**
585
+ * @param {string} id
586
+ * @returns {MintRequestStateWeb}
587
+ */
588
+ mint_state(id) {
589
+ const ptr0 = passStringToWasm0(id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
590
+ const len0 = WASM_VECTOR_LEN;
591
+ const ret = wasm.bill_mint_state(this.__wbg_ptr, ptr0, len0);
592
+ return ret;
593
+ }
594
+ /**
595
+ * @param {string} id
596
+ * @returns {Promise<void>}
597
+ */
598
+ check_mint_state(id) {
599
+ const ptr0 = passStringToWasm0(id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
600
+ const len0 = WASM_VECTOR_LEN;
601
+ const ret = wasm.bill_check_mint_state(this.__wbg_ptr, ptr0, len0);
602
+ return ret;
603
+ }
604
+ /**
605
+ * @param {string} mint_request_id
606
+ * @returns {Promise<void>}
607
+ */
608
+ cancel_request_to_mint(mint_request_id) {
609
+ const ptr0 = passStringToWasm0(mint_request_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
610
+ const len0 = WASM_VECTOR_LEN;
611
+ const ret = wasm.bill_cancel_request_to_mint(this.__wbg_ptr, ptr0, len0);
612
+ return ret;
613
+ }
584
614
  /**
585
615
  * @param {MintBitcreditBillPayload} payload
586
616
  * @returns {Promise<void>}
@@ -1361,9 +1391,6 @@ function __wbg_get_imports() {
1361
1391
  imports.wbg.__wbg_getRandomValues_3c9c0d586e575a16 = function() { return handleError(function (arg0, arg1) {
1362
1392
  globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
1363
1393
  }, arguments) };
1364
- imports.wbg.__wbg_getRandomValues_3d90134a348e46b3 = function() { return handleError(function (arg0, arg1) {
1365
- globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
1366
- }, arguments) };
1367
1394
  imports.wbg.__wbg_getRandomValues_b8f5dbd5f3995a9e = function() { return handleError(function (arg0, arg1) {
1368
1395
  arg0.getRandomValues(arg1);
1369
1396
  }, arguments) };
@@ -1533,7 +1560,7 @@ function __wbg_get_imports() {
1533
1560
  const a = state0.a;
1534
1561
  state0.a = 0;
1535
1562
  try {
1536
- return __wbg_adapter_248(a, state0.b, arg0, arg1);
1563
+ return __wbg_adapter_251(a, state0.b, arg0, arg1);
1537
1564
  } finally {
1538
1565
  state0.a = a;
1539
1566
  }
@@ -1604,10 +1631,6 @@ function __wbg_get_imports() {
1604
1631
  const ret = arg0.node;
1605
1632
  return ret;
1606
1633
  };
1607
- imports.wbg.__wbg_now_698fd875f24e9a0f = function() { return handleError(function () {
1608
- const ret = Date.now();
1609
- return ret;
1610
- }, arguments) };
1611
1634
  imports.wbg.__wbg_now_71123b9940376874 = function(arg0) {
1612
1635
  const ret = arg0.now();
1613
1636
  return ret;
@@ -1616,6 +1639,10 @@ function __wbg_get_imports() {
1616
1639
  const ret = Date.now();
1617
1640
  return ret;
1618
1641
  };
1642
+ imports.wbg.__wbg_now_af563e9b04dc2a0a = function() { return handleError(function () {
1643
+ const ret = Date.now();
1644
+ return ret;
1645
+ }, arguments) };
1619
1646
  imports.wbg.__wbg_now_d18023d54d4e5500 = function(arg0) {
1620
1647
  const ret = arg0.now();
1621
1648
  return ret;
@@ -1930,32 +1957,32 @@ function __wbg_get_imports() {
1930
1957
  const ret = false;
1931
1958
  return ret;
1932
1959
  };
1933
- imports.wbg.__wbindgen_closure_wrapper18261 = function(arg0, arg1, arg2) {
1934
- const ret = makeMutClosure(arg0, arg1, 598, __wbg_adapter_57);
1960
+ imports.wbg.__wbindgen_closure_wrapper10299 = function(arg0, arg1, arg2) {
1961
+ const ret = makeMutClosure(arg0, arg1, 675, __wbg_adapter_54);
1935
1962
  return ret;
1936
1963
  };
1937
- imports.wbg.__wbindgen_closure_wrapper18302 = function(arg0, arg1, arg2) {
1938
- const ret = makeMutClosure(arg0, arg1, 598, __wbg_adapter_54);
1964
+ imports.wbg.__wbindgen_closure_wrapper10318 = function(arg0, arg1, arg2) {
1965
+ const ret = makeMutClosure(arg0, arg1, 367, __wbg_adapter_64);
1939
1966
  return ret;
1940
1967
  };
1941
- imports.wbg.__wbindgen_closure_wrapper2090 = function(arg0, arg1, arg2) {
1942
- const ret = makeMutClosure(arg0, arg1, 598, __wbg_adapter_54);
1968
+ imports.wbg.__wbindgen_closure_wrapper19153 = function(arg0, arg1, arg2) {
1969
+ const ret = makeMutClosure(arg0, arg1, 675, __wbg_adapter_57);
1943
1970
  return ret;
1944
1971
  };
1945
- imports.wbg.__wbindgen_closure_wrapper2781 = function(arg0, arg1, arg2) {
1946
- const ret = makeMutClosure(arg0, arg1, 357, __wbg_adapter_57);
1972
+ imports.wbg.__wbindgen_closure_wrapper19194 = function(arg0, arg1, arg2) {
1973
+ const ret = makeMutClosure(arg0, arg1, 675, __wbg_adapter_54);
1947
1974
  return ret;
1948
1975
  };
1949
- imports.wbg.__wbindgen_closure_wrapper2892 = function(arg0, arg1, arg2) {
1950
- const ret = makeMutClosure(arg0, arg1, 598, __wbg_adapter_54);
1976
+ imports.wbg.__wbindgen_closure_wrapper2123 = function(arg0, arg1, arg2) {
1977
+ const ret = makeMutClosure(arg0, arg1, 675, __wbg_adapter_54);
1951
1978
  return ret;
1952
1979
  };
1953
- imports.wbg.__wbindgen_closure_wrapper8548 = function(arg0, arg1, arg2) {
1954
- const ret = makeMutClosure(arg0, arg1, 598, __wbg_adapter_57);
1980
+ imports.wbg.__wbindgen_closure_wrapper2823 = function(arg0, arg1, arg2) {
1981
+ const ret = makeMutClosure(arg0, arg1, 367, __wbg_adapter_57);
1955
1982
  return ret;
1956
1983
  };
1957
- imports.wbg.__wbindgen_closure_wrapper9564 = function(arg0, arg1, arg2) {
1958
- const ret = makeMutClosure(arg0, arg1, 357, __wbg_adapter_64);
1984
+ imports.wbg.__wbindgen_closure_wrapper9305 = function(arg0, arg1, arg2) {
1985
+ const ret = makeMutClosure(arg0, arg1, 675, __wbg_adapter_57);
1959
1986
  return ret;
1960
1987
  };
1961
1988
  imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
package/index_bg.wasm CHANGED
Binary file
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bitcredit/bcr-ebill-wasm",
3
3
  "type": "module",
4
- "version": "0.3.12",
4
+ "version": "0.3.13",
5
5
  "license": "MIT",
6
6
  "files": [
7
7
  "index_bg.wasm",