@bitcredit/bcr-ebill-wasm 0.3.13 → 0.3.14

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;
@@ -639,7 +632,7 @@ export interface UploadFileResponse {
639
632
  file_upload_id: string;
640
633
  }
641
634
 
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";
635
+ 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
636
 
644
637
  export interface JsErrorData {
645
638
  error: JsErrorType;
@@ -668,9 +661,16 @@ export interface MintRequestStateResponse {
668
661
  request_states: MintRequestStateWeb[];
669
662
  }
670
663
 
671
- export interface MintOfferWeb {}
664
+ export interface MintOfferWeb {
665
+ mint_request_id: string;
666
+ keyset_id: string;
667
+ expiration_timestamp: number;
668
+ discounted_sum: number;
669
+ proofs: string | undefined;
670
+ proofs_spent: boolean;
671
+ }
672
672
 
673
- export type MintRequestStatusWeb = "Pending" | "Denied" | "Offered" | "Accepted" | "Rejected" | "Cancelled" | "Expired";
673
+ export type MintRequestStatusWeb = "Pending" | { Denied: { timestamp: number } } | "Offered" | "Accepted" | { Rejected: { timestamp: number } } | { Cancelled: { timestamp: number } } | { Expired: { timestamp: number } };
674
674
 
675
675
  export interface MintRequestWeb {
676
676
  requester_node_id: string;
@@ -728,11 +728,8 @@ export class Bill {
728
728
  mint_state(id: string): Promise<MintRequestStateWeb>;
729
729
  check_mint_state(id: string): Promise<void>;
730
730
  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>;
731
+ accept_mint_offer(mint_request_id: string): Promise<void>;
732
+ reject_mint_offer(mint_request_id: string): Promise<void>;
736
733
  reject_to_accept(payload: RejectActionBillPayload): Promise<void>;
737
734
  reject_to_pay(payload: RejectActionBillPayload): Promise<void>;
738
735
  reject_to_buy(payload: RejectActionBillPayload): Promise<void>;
@@ -840,8 +837,8 @@ export interface InitOutput {
840
837
  readonly bill_mint_state: (a: number, b: number, c: number) => any;
841
838
  readonly bill_check_mint_state: (a: number, b: number, c: number) => any;
842
839
  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;
840
+ readonly bill_accept_mint_offer: (a: number, b: number, c: number) => any;
841
+ readonly bill_reject_mint_offer: (a: number, b: number, c: number) => any;
845
842
  readonly bill_reject_to_accept: (a: number, b: any) => any;
846
843
  readonly bill_reject_to_pay: (a: number, b: any) => any;
847
844
  readonly bill_reject_to_buy: (a: number, b: any) => any;
@@ -909,13 +906,13 @@ export interface InitOutput {
909
906
  readonly api_contact: () => number;
910
907
  readonly api_company: () => number;
911
908
  readonly api_quote: () => number;
912
- readonly __wbg_quote_free: (a: number, b: number) => void;
913
909
  readonly __wbg_notification_free: (a: number, b: number) => void;
910
+ readonly __wbg_identity_free: (a: number, b: number) => void;
914
911
  readonly __wbg_general_free: (a: number, b: number) => void;
912
+ readonly __wbg_contact_free: (a: number, b: number) => void;
915
913
  readonly __wbg_company_free: (a: number, b: number) => void;
916
914
  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;
915
+ readonly __wbg_quote_free: (a: number, b: number) => void;
919
916
  readonly __wbindgen_malloc: (a: number, b: number) => number;
920
917
  readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
921
918
  readonly __wbindgen_exn_store: (a: number) => void;
@@ -924,10 +921,10 @@ export interface InitOutput {
924
921
  readonly __wbindgen_free: (a: number, b: number, c: number) => void;
925
922
  readonly __wbindgen_export_6: WebAssembly.Table;
926
923
  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;
924
+ readonly _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h59ab8c65b0857936: (a: number, b: number) => void;
925
+ readonly closure326_externref_shim: (a: number, b: number, c: any) => void;
926
+ readonly closure817_externref_shim_multivalue_shim: (a: number, b: number, c: any) => [number, number];
927
+ readonly closure592_externref_shim: (a: number, b: number, c: any, d: any) => void;
931
928
  readonly __wbindgen_start: () => void;
932
929
  }
933
930
 
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__h59ab8c65b0857936(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.closure326_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.closure592_externref_shim(arg0, arg1, arg2, arg3);
247
247
  }
248
248
 
249
249
  /**
@@ -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_59db5cacdf248b98 = 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
  };
@@ -1384,7 +1387,7 @@ function __wbg_get_imports() {
1384
1387
  const ret = arg0.fetch(arg1);
1385
1388
  return ret;
1386
1389
  };
1387
- imports.wbg.__wbg_fetch_d36a73832f0a45e8 = function(arg0) {
1390
+ imports.wbg.__wbg_fetch_c5c80d27f943f3fc = function(arg0) {
1388
1391
  const ret = fetch(arg0);
1389
1392
  return ret;
1390
1393
  };
@@ -1741,7 +1744,7 @@ 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) {
1747
+ imports.wbg.__wbg_setTimeout_d8ea9e3c1b1cb3b6 = function(arg0, arg1) {
1745
1748
  const ret = setTimeout(arg0, arg1);
1746
1749
  return ret;
1747
1750
  };
@@ -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_wrapper10651 = 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_wrapper19354 = function(arg0, arg1, arg2) {
1968
+ const ret = makeMutClosure(arg0, arg1, 582, __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_wrapper19395 = function(arg0, arg1, arg2) {
1972
+ const ret = makeMutClosure(arg0, arg1, 582, __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_wrapper2122 = function(arg0, arg1, arg2) {
1976
+ const ret = makeMutClosure(arg0, arg1, 582, __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_wrapper2823 = function(arg0, arg1, arg2) {
1980
+ const ret = makeMutClosure(arg0, arg1, 327, __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_wrapper2951 = 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_wrapper9613 = function(arg0, arg1, arg2) {
1988
+ const ret = makeMutClosure(arg0, arg1, 668, __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.14",
5
5
  "license": "MIT",
6
6
  "files": [
7
7
  "index_bg.wasm",