@bitcredit/bcr-ebill-wasm 0.3.13 → 0.3.15

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
@@ -48,13 +48,6 @@ export interface EndorseBitcreditBillPayload {
48
48
  bill_id: string;
49
49
  }
50
50
 
51
- export interface MintBitcreditBillPayload {
52
- mint_node: string;
53
- bill_id: string;
54
- sum: string;
55
- currency: string;
56
- }
57
-
58
51
  export interface RequestToMintBitcreditBillPayload {
59
52
  mint_node: string;
60
53
  bill_id: string;
@@ -621,6 +614,7 @@ export interface NotificationFilters {
621
614
  export interface FileWeb {
622
615
  name: string;
623
616
  hash: string;
617
+ nostr_hash: string;
624
618
  }
625
619
 
626
620
  export interface BinaryFileResponse {
@@ -639,7 +633,7 @@ export interface UploadFileResponse {
639
633
  file_upload_id: string;
640
634
  }
641
635
 
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";
636
+ 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" | "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" | "InvalidFileName" | "UnknownNodeId" | "BackupNotSupported" | "CallerMustBeSignatory";
643
637
 
644
638
  export interface JsErrorData {
645
639
  error: JsErrorType;
@@ -668,9 +662,16 @@ export interface MintRequestStateResponse {
668
662
  request_states: MintRequestStateWeb[];
669
663
  }
670
664
 
671
- export interface MintOfferWeb {}
665
+ export interface MintOfferWeb {
666
+ mint_request_id: string;
667
+ keyset_id: string;
668
+ expiration_timestamp: number;
669
+ discounted_sum: number;
670
+ proofs: string | undefined;
671
+ proofs_spent: boolean;
672
+ }
672
673
 
673
- export type MintRequestStatusWeb = "Pending" | "Denied" | "Offered" | "Accepted" | "Rejected" | "Cancelled" | "Expired";
674
+ export type MintRequestStatusWeb = "Pending" | { Denied: { timestamp: number } } | "Offered" | "Accepted" | { Rejected: { timestamp: number } } | { Cancelled: { timestamp: number } } | { Expired: { timestamp: number } };
674
675
 
675
676
  export interface MintRequestWeb {
676
677
  requester_node_id: string;
@@ -725,14 +726,11 @@ export class Bill {
725
726
  request_to_accept(payload: RequestToAcceptBitcreditBillPayload): Promise<void>;
726
727
  accept(payload: AcceptBitcreditBillPayload): Promise<void>;
727
728
  request_to_mint(payload: RequestToMintBitcreditBillPayload): Promise<void>;
728
- mint_state(id: string): Promise<MintRequestStateWeb>;
729
+ mint_state(id: string): Promise<MintRequestStateResponse>;
729
730
  check_mint_state(id: string): Promise<void>;
730
731
  cancel_request_to_mint(mint_request_id: string): Promise<void>;
731
- mint_bill(payload: MintBitcreditBillPayload): Promise<void>;
732
- /**
733
- * Blank mint - the contact doesn't have to be an anonymous contact
734
- */
735
- mint_bill_blank(payload: MintBitcreditBillPayload): Promise<void>;
732
+ accept_mint_offer(mint_request_id: string): Promise<void>;
733
+ reject_mint_offer(mint_request_id: string): Promise<void>;
736
734
  reject_to_accept(payload: RejectActionBillPayload): Promise<void>;
737
735
  reject_to_pay(payload: RejectActionBillPayload): Promise<void>;
738
736
  reject_to_buy(payload: RejectActionBillPayload): Promise<void>;
@@ -840,8 +838,8 @@ export interface InitOutput {
840
838
  readonly bill_mint_state: (a: number, b: number, c: number) => any;
841
839
  readonly bill_check_mint_state: (a: number, b: number, c: number) => any;
842
840
  readonly bill_cancel_request_to_mint: (a: number, b: number, c: number) => any;
843
- readonly bill_mint_bill: (a: number, b: any) => any;
844
- readonly bill_mint_bill_blank: (a: number, b: any) => any;
841
+ readonly bill_accept_mint_offer: (a: number, b: number, c: number) => any;
842
+ readonly bill_reject_mint_offer: (a: number, b: number, c: number) => any;
845
843
  readonly bill_reject_to_accept: (a: number, b: any) => any;
846
844
  readonly bill_reject_to_pay: (a: number, b: any) => any;
847
845
  readonly bill_reject_to_buy: (a: number, b: any) => any;
@@ -909,13 +907,13 @@ export interface InitOutput {
909
907
  readonly api_contact: () => number;
910
908
  readonly api_company: () => number;
911
909
  readonly api_quote: () => number;
912
- readonly __wbg_quote_free: (a: number, b: number) => void;
913
- readonly __wbg_notification_free: (a: number, b: number) => void;
914
- readonly __wbg_general_free: (a: number, b: number) => void;
915
- readonly __wbg_company_free: (a: number, b: number) => void;
910
+ readonly __wbg_identity_free: (a: number, b: number) => void;
916
911
  readonly __wbg_bill_free: (a: number, b: number) => void;
912
+ readonly __wbg_notification_free: (a: number, b: number) => void;
917
913
  readonly __wbg_contact_free: (a: number, b: number) => void;
918
- readonly __wbg_identity_free: (a: number, b: number) => void;
914
+ readonly __wbg_company_free: (a: number, b: number) => void;
915
+ readonly __wbg_general_free: (a: number, b: number) => void;
916
+ readonly __wbg_quote_free: (a: number, b: number) => void;
919
917
  readonly __wbindgen_malloc: (a: number, b: number) => number;
920
918
  readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
921
919
  readonly __wbindgen_exn_store: (a: number) => void;
@@ -924,10 +922,10 @@ export interface InitOutput {
924
922
  readonly __wbindgen_free: (a: number, b: number, c: number) => void;
925
923
  readonly __wbindgen_export_6: WebAssembly.Table;
926
924
  readonly __externref_table_dealloc: (a: number) => 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;
925
+ readonly _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h80a8209a6c10d2d7: (a: number, b: number) => void;
926
+ readonly closure315_externref_shim: (a: number, b: number, c: any) => void;
927
+ readonly closure817_externref_shim_multivalue_shim: (a: number, b: number, c: any) => [number, number];
928
+ readonly closure591_externref_shim: (a: number, b: number, c: any, d: any) => void;
931
929
  readonly __wbindgen_start: () => void;
932
930
  }
933
931
 
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__h5200cc0755260c49(arg0, arg1);
231
+ wasm._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h80a8209a6c10d2d7(arg0, arg1);
232
232
  }
233
233
 
234
234
  function __wbg_adapter_57(arg0, arg1, arg2) {
235
- wasm.closure366_externref_shim(arg0, arg1, arg2);
235
+ wasm.closure315_externref_shim(arg0, arg1, arg2);
236
236
  }
237
237
 
238
238
  function __wbg_adapter_64(arg0, arg1, arg2) {
239
- const ret = wasm.closure942_externref_shim_multivalue_shim(arg0, arg1, arg2);
239
+ const ret = wasm.closure817_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
245
  function __wbg_adapter_251(arg0, arg1, arg2, arg3) {
246
- wasm.closure687_externref_shim(arg0, arg1, arg2, arg3);
246
+ wasm.closure591_externref_shim(arg0, arg1, arg2, arg3);
247
247
  }
248
248
 
249
249
  /**
@@ -583,7 +583,7 @@ export class Bill {
583
583
  }
584
584
  /**
585
585
  * @param {string} id
586
- * @returns {MintRequestStateWeb}
586
+ * @returns {MintRequestStateResponse}
587
587
  */
588
588
  mint_state(id) {
589
589
  const ptr0 = passStringToWasm0(id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
@@ -612,20 +612,23 @@ export class Bill {
612
612
  return ret;
613
613
  }
614
614
  /**
615
- * @param {MintBitcreditBillPayload} payload
615
+ * @param {string} mint_request_id
616
616
  * @returns {Promise<void>}
617
617
  */
618
- mint_bill(payload) {
619
- const ret = wasm.bill_mint_bill(this.__wbg_ptr, payload);
618
+ accept_mint_offer(mint_request_id) {
619
+ const ptr0 = passStringToWasm0(mint_request_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
620
+ const len0 = WASM_VECTOR_LEN;
621
+ const ret = wasm.bill_accept_mint_offer(this.__wbg_ptr, ptr0, len0);
620
622
  return ret;
621
623
  }
622
624
  /**
623
- * Blank mint - the contact doesn't have to be an anonymous contact
624
- * @param {MintBitcreditBillPayload} payload
625
+ * @param {string} mint_request_id
625
626
  * @returns {Promise<void>}
626
627
  */
627
- mint_bill_blank(payload) {
628
- const ret = wasm.bill_mint_bill_blank(this.__wbg_ptr, payload);
628
+ reject_mint_offer(mint_request_id) {
629
+ const ptr0 = passStringToWasm0(mint_request_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
630
+ const len0 = WASM_VECTOR_LEN;
631
+ const ret = wasm.bill_reject_mint_offer(this.__wbg_ptr, ptr0, len0);
629
632
  return ret;
630
633
  }
631
634
  /**
@@ -1296,11 +1299,11 @@ function __wbg_get_imports() {
1296
1299
  const ret = clearInterval(arg0);
1297
1300
  return ret;
1298
1301
  };
1299
- imports.wbg.__wbg_clearTimeout_5a54f8841c30079a = function(arg0) {
1302
+ imports.wbg.__wbg_clearTimeout_121ece162c044c80 = function(arg0) {
1300
1303
  const ret = clearTimeout(arg0);
1301
1304
  return ret;
1302
1305
  };
1303
- imports.wbg.__wbg_clearTimeout_86721db0036bea98 = function(arg0) {
1306
+ imports.wbg.__wbg_clearTimeout_5a54f8841c30079a = function(arg0) {
1304
1307
  const ret = clearTimeout(arg0);
1305
1308
  return ret;
1306
1309
  };
@@ -1359,7 +1362,7 @@ function __wbg_get_imports() {
1359
1362
  const ret = Object.entries(arg0);
1360
1363
  return ret;
1361
1364
  };
1362
- imports.wbg.__wbg_error_243f933071f88b86 = function(arg0, arg1) {
1365
+ imports.wbg.__wbg_error_1d3b71fa51de155e = function(arg0, arg1) {
1363
1366
  console.error(getStringFromWasm0(arg0, arg1));
1364
1367
  };
1365
1368
  imports.wbg.__wbg_error_7534b8e9a36f1ab4 = function(arg0, arg1) {
@@ -1380,12 +1383,12 @@ function __wbg_get_imports() {
1380
1383
  const ret = arg0.error;
1381
1384
  return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1382
1385
  }, arguments) };
1383
- imports.wbg.__wbg_fetch_509096533071c657 = function(arg0, arg1) {
1384
- const ret = arg0.fetch(arg1);
1386
+ imports.wbg.__wbg_fetch_43e69ddf509149f8 = function(arg0) {
1387
+ const ret = fetch(arg0);
1385
1388
  return ret;
1386
1389
  };
1387
- imports.wbg.__wbg_fetch_d36a73832f0a45e8 = function(arg0) {
1388
- const ret = fetch(arg0);
1390
+ imports.wbg.__wbg_fetch_509096533071c657 = function(arg0, arg1) {
1391
+ const ret = arg0.fetch(arg1);
1389
1392
  return ret;
1390
1393
  };
1391
1394
  imports.wbg.__wbg_getRandomValues_3c9c0d586e575a16 = function() { return handleError(function (arg0, arg1) {
@@ -1741,14 +1744,14 @@ function __wbg_get_imports() {
1741
1744
  const ret = setInterval(arg0, arg1);
1742
1745
  return ret;
1743
1746
  }, arguments) };
1744
- imports.wbg.__wbg_setTimeout_2e707715f8cc9497 = function(arg0, arg1) {
1745
- const ret = setTimeout(arg0, arg1);
1746
- return ret;
1747
- };
1748
1747
  imports.wbg.__wbg_setTimeout_db2dbaeefb6f39c7 = function() { return handleError(function (arg0, arg1) {
1749
1748
  const ret = setTimeout(arg0, arg1);
1750
1749
  return ret;
1751
1750
  }, arguments) };
1751
+ imports.wbg.__wbg_setTimeout_e64b2910d9d7169a = function(arg0, arg1) {
1752
+ const ret = setTimeout(arg0, arg1);
1753
+ return ret;
1754
+ };
1752
1755
  imports.wbg.__wbg_setTimeout_efd7c11531df1743 = function() { return handleError(function (arg0, arg1, arg2) {
1753
1756
  const ret = arg0.setTimeout(arg1, arg2);
1754
1757
  return ret;
@@ -1957,32 +1960,32 @@ function __wbg_get_imports() {
1957
1960
  const ret = false;
1958
1961
  return ret;
1959
1962
  };
1960
- imports.wbg.__wbindgen_closure_wrapper10299 = function(arg0, arg1, arg2) {
1961
- const ret = makeMutClosure(arg0, arg1, 675, __wbg_adapter_54);
1963
+ imports.wbg.__wbindgen_closure_wrapper10702 = function(arg0, arg1, arg2) {
1964
+ const ret = makeMutClosure(arg0, arg1, 818, __wbg_adapter_64);
1962
1965
  return ret;
1963
1966
  };
1964
- imports.wbg.__wbindgen_closure_wrapper10318 = function(arg0, arg1, arg2) {
1965
- const ret = makeMutClosure(arg0, arg1, 367, __wbg_adapter_64);
1967
+ imports.wbg.__wbindgen_closure_wrapper19408 = function(arg0, arg1, arg2) {
1968
+ const ret = makeMutClosure(arg0, arg1, 581, __wbg_adapter_57);
1966
1969
  return ret;
1967
1970
  };
1968
- imports.wbg.__wbindgen_closure_wrapper19153 = function(arg0, arg1, arg2) {
1969
- const ret = makeMutClosure(arg0, arg1, 675, __wbg_adapter_57);
1971
+ imports.wbg.__wbindgen_closure_wrapper19449 = function(arg0, arg1, arg2) {
1972
+ const ret = makeMutClosure(arg0, arg1, 581, __wbg_adapter_54);
1970
1973
  return ret;
1971
1974
  };
1972
- imports.wbg.__wbindgen_closure_wrapper19194 = function(arg0, arg1, arg2) {
1973
- const ret = makeMutClosure(arg0, arg1, 675, __wbg_adapter_54);
1975
+ imports.wbg.__wbindgen_closure_wrapper2106 = function(arg0, arg1, arg2) {
1976
+ const ret = makeMutClosure(arg0, arg1, 581, __wbg_adapter_54);
1974
1977
  return ret;
1975
1978
  };
1976
- imports.wbg.__wbindgen_closure_wrapper2123 = function(arg0, arg1, arg2) {
1977
- const ret = makeMutClosure(arg0, arg1, 675, __wbg_adapter_54);
1979
+ imports.wbg.__wbindgen_closure_wrapper2811 = function(arg0, arg1, arg2) {
1980
+ const ret = makeMutClosure(arg0, arg1, 316, __wbg_adapter_57);
1978
1981
  return ret;
1979
1982
  };
1980
- imports.wbg.__wbindgen_closure_wrapper2823 = function(arg0, arg1, arg2) {
1981
- const ret = makeMutClosure(arg0, arg1, 367, __wbg_adapter_57);
1983
+ imports.wbg.__wbindgen_closure_wrapper2938 = function(arg0, arg1, arg2) {
1984
+ const ret = makeMutClosure(arg0, arg1, 815, __wbg_adapter_54);
1982
1985
  return ret;
1983
1986
  };
1984
- imports.wbg.__wbindgen_closure_wrapper9305 = function(arg0, arg1, arg2) {
1985
- const ret = makeMutClosure(arg0, arg1, 675, __wbg_adapter_57);
1987
+ imports.wbg.__wbindgen_closure_wrapper9664 = function(arg0, arg1, arg2) {
1988
+ const ret = makeMutClosure(arg0, arg1, 669, __wbg_adapter_57);
1986
1989
  return ret;
1987
1990
  };
1988
1991
  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.13",
4
+ "version": "0.3.15",
5
5
  "license": "MIT",
6
6
  "files": [
7
7
  "index_bg.wasm",