wapi-client 0.10.2 → 0.10.4

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.
@@ -61,7 +61,7 @@ var import_base_client = require('./base-client.cjs');
61
61
  var import_connection = require('./connection/connection.enums.cjs');
62
62
  var import__ = require('../index.cjs');
63
63
  var _a;
64
- var CLIENT_VERSION = (_a = '0.10.2') != null ? _a : "";
64
+ var CLIENT_VERSION = (_a = '0.10.4') != null ? _a : "";
65
65
  function createWsClient(opts) {
66
66
  const initialConnection = createConnection(opts);
67
67
  return new WsClient(initialConnection, opts);
@@ -31,7 +31,7 @@ import {
31
31
  } from "./connection/connection.enums";
32
32
  import { WapiClientType } from "../index";
33
33
  var _a;
34
- var CLIENT_VERSION = (_a = '0.10.2') != null ? _a : "";
34
+ var CLIENT_VERSION = (_a = '0.10.4') != null ? _a : "";
35
35
  function createWsClient(opts) {
36
36
  const initialConnection = createConnection(opts);
37
37
  return new WsClient(initialConnection, opts);
@@ -778,6 +778,49 @@ var Client = class {
778
778
  /**
779
779
  *
780
780
  *
781
+ * ```javascript
782
+ *
783
+ * // setup
784
+ * await wapiClient.createDeposit(
785
+ * {
786
+ * wallet: 'newWallet',
787
+ * amount: 10,
788
+ * status: 'pending',
789
+ * identifier: 'depositUSD',
790
+ * token: 'USD',
791
+ * },
792
+ * {
793
+ * create_wallet_if_not_exists: true,
794
+ * },
795
+ * );
796
+ * await wapiClient.updateTransfer({
797
+ * transfer: 'depositUSD',
798
+ * status: 'finished',
799
+ * });
800
+ *
801
+ * const result = await wapiClient.exportBalanceHistory(
802
+ * {
803
+ * wallet: 'newWallet',
804
+ * token: 'USD',
805
+ * },
806
+ * {
807
+ * limit: 0,
808
+ * select: [
809
+ * 'transfer_identifier',
810
+ * 'pending_amount',
811
+ * 'finished_amount',
812
+ * 'pending_amount_from',
813
+ * 'pending_amount_to',
814
+ * 'amount',
815
+ * ],
816
+ * offset: 0,
817
+ * order: 'desc',
818
+ * tracking_id: 'mylogId',
819
+ * // transaction_id: Transaction.identifier, // created transaction identifier
820
+ * },
821
+ * );
822
+ *
823
+ * ```
781
824
  *
782
825
  * @param {ExportBalanceHistoryFnInput} input
783
826
  * @param {ExportBalanceHistoryFnOptions} [options]
@@ -762,6 +762,49 @@ var Client = class {
762
762
  /**
763
763
  *
764
764
  *
765
+ * ```javascript
766
+ *
767
+ * // setup
768
+ * await wapiClient.createDeposit(
769
+ * {
770
+ * wallet: 'newWallet',
771
+ * amount: 10,
772
+ * status: 'pending',
773
+ * identifier: 'depositUSD',
774
+ * token: 'USD',
775
+ * },
776
+ * {
777
+ * create_wallet_if_not_exists: true,
778
+ * },
779
+ * );
780
+ * await wapiClient.updateTransfer({
781
+ * transfer: 'depositUSD',
782
+ * status: 'finished',
783
+ * });
784
+ *
785
+ * const result = await wapiClient.exportBalanceHistory(
786
+ * {
787
+ * wallet: 'newWallet',
788
+ * token: 'USD',
789
+ * },
790
+ * {
791
+ * limit: 0,
792
+ * select: [
793
+ * 'transfer_identifier',
794
+ * 'pending_amount',
795
+ * 'finished_amount',
796
+ * 'pending_amount_from',
797
+ * 'pending_amount_to',
798
+ * 'amount',
799
+ * ],
800
+ * offset: 0,
801
+ * order: 'desc',
802
+ * tracking_id: 'mylogId',
803
+ * // transaction_id: Transaction.identifier, // created transaction identifier
804
+ * },
805
+ * );
806
+ *
807
+ * ```
765
808
  *
766
809
  * @param {ExportBalanceHistoryFnInput} input
767
810
  * @param {ExportBalanceHistoryFnOptions} [options]
package/dist/client.cjs CHANGED
@@ -66,7 +66,7 @@ var import_errors = require('./lib/errors.cjs');
66
66
  var import_fns = require('./fns/index.cjs');
67
67
  var import_import_data = require('./fns/import-data/import-data.guards.cjs');
68
68
  var _a;
69
- var CLIENT_VERSION = (_a = '0.10.2') != null ? _a : "";
69
+ var CLIENT_VERSION = (_a = '0.10.4') != null ? _a : "";
70
70
  var Client = class {
71
71
  /**
72
72
  * @internal
@@ -778,6 +778,49 @@ var Client = class {
778
778
  /**
779
779
  *
780
780
  *
781
+ * ```javascript
782
+ *
783
+ * // setup
784
+ * await wapiClient.createDeposit(
785
+ * {
786
+ * wallet: 'newWallet',
787
+ * amount: 10,
788
+ * status: 'pending',
789
+ * identifier: 'depositUSD',
790
+ * token: 'USD',
791
+ * },
792
+ * {
793
+ * create_wallet_if_not_exists: true,
794
+ * },
795
+ * );
796
+ * await wapiClient.updateTransfer({
797
+ * transfer: 'depositUSD',
798
+ * status: 'finished',
799
+ * });
800
+ *
801
+ * const result = await wapiClient.exportBalanceHistory(
802
+ * {
803
+ * wallet: 'newWallet',
804
+ * token: 'USD',
805
+ * },
806
+ * {
807
+ * limit: 0,
808
+ * select: [
809
+ * 'transfer_identifier',
810
+ * 'pending_amount',
811
+ * 'finished_amount',
812
+ * 'pending_amount_from',
813
+ * 'pending_amount_to',
814
+ * 'amount',
815
+ * ],
816
+ * offset: 0,
817
+ * order: 'desc',
818
+ * tracking_id: 'mylogId',
819
+ * // transaction_id: Transaction.identifier, // created transaction identifier
820
+ * },
821
+ * );
822
+ *
823
+ * ```
781
824
  *
782
825
  * @param {ExportBalanceHistoryFnInput} input
783
826
  * @param {ExportBalanceHistoryFnOptions} [options]
package/dist/client.d.ts CHANGED
@@ -805,6 +805,49 @@ export declare class Client {
805
805
  /**
806
806
  *
807
807
  *
808
+ * ```javascript
809
+ *
810
+ * // setup
811
+ * await wapiClient.createDeposit(
812
+ * {
813
+ * wallet: 'newWallet',
814
+ * amount: 10,
815
+ * status: 'pending',
816
+ * identifier: 'depositUSD',
817
+ * token: 'USD',
818
+ * },
819
+ * {
820
+ * create_wallet_if_not_exists: true,
821
+ * },
822
+ * );
823
+ * await wapiClient.updateTransfer({
824
+ * transfer: 'depositUSD',
825
+ * status: 'finished',
826
+ * });
827
+ *
828
+ * const result = await wapiClient.exportBalanceHistory(
829
+ * {
830
+ * wallet: 'newWallet',
831
+ * token: 'USD',
832
+ * },
833
+ * {
834
+ * limit: 0,
835
+ * select: [
836
+ * 'transfer_identifier',
837
+ * 'pending_amount',
838
+ * 'finished_amount',
839
+ * 'pending_amount_from',
840
+ * 'pending_amount_to',
841
+ * 'amount',
842
+ * ],
843
+ * offset: 0,
844
+ * order: 'desc',
845
+ * tracking_id: 'mylogId',
846
+ * // transaction_id: Transaction.identifier, // created transaction identifier
847
+ * },
848
+ * );
849
+ *
850
+ * ```
808
851
  *
809
852
  * @param {ExportBalanceHistoryFnInput} input
810
853
  * @param {ExportBalanceHistoryFnOptions} [options]
package/dist/client.js CHANGED
@@ -50,7 +50,7 @@ import {
50
50
  isImportDataFnInput
51
51
  } from "./fns/import-data/import-data.guards";
52
52
  var _a;
53
- var CLIENT_VERSION = (_a = '0.10.2') != null ? _a : "";
53
+ var CLIENT_VERSION = (_a = '0.10.4') != null ? _a : "";
54
54
  var Client = class {
55
55
  /**
56
56
  * @internal
@@ -762,6 +762,49 @@ var Client = class {
762
762
  /**
763
763
  *
764
764
  *
765
+ * ```javascript
766
+ *
767
+ * // setup
768
+ * await wapiClient.createDeposit(
769
+ * {
770
+ * wallet: 'newWallet',
771
+ * amount: 10,
772
+ * status: 'pending',
773
+ * identifier: 'depositUSD',
774
+ * token: 'USD',
775
+ * },
776
+ * {
777
+ * create_wallet_if_not_exists: true,
778
+ * },
779
+ * );
780
+ * await wapiClient.updateTransfer({
781
+ * transfer: 'depositUSD',
782
+ * status: 'finished',
783
+ * });
784
+ *
785
+ * const result = await wapiClient.exportBalanceHistory(
786
+ * {
787
+ * wallet: 'newWallet',
788
+ * token: 'USD',
789
+ * },
790
+ * {
791
+ * limit: 0,
792
+ * select: [
793
+ * 'transfer_identifier',
794
+ * 'pending_amount',
795
+ * 'finished_amount',
796
+ * 'pending_amount_from',
797
+ * 'pending_amount_to',
798
+ * 'amount',
799
+ * ],
800
+ * offset: 0,
801
+ * order: 'desc',
802
+ * tracking_id: 'mylogId',
803
+ * // transaction_id: Transaction.identifier, // created transaction identifier
804
+ * },
805
+ * );
806
+ *
807
+ * ```
765
808
  *
766
809
  * @param {ExportBalanceHistoryFnInput} input
767
810
  * @param {ExportBalanceHistoryFnOptions} [options]
@@ -40,7 +40,8 @@ function updateTransfer(options, input, fnOptions) {
40
40
  transfer: (0, import_utils.getIdentifierFilter)(inputCopy.transfer),
41
41
  update: {
42
42
  status: inputCopy.status,
43
- metadata: inputCopy.metadata
43
+ metadata: inputCopy.metadata,
44
+ extend_metadata: inputCopy.extend_metadata
44
45
  },
45
46
  options: inputCopy.options
46
47
  });
@@ -16,7 +16,8 @@ function updateTransfer(options, input, fnOptions) {
16
16
  transfer: getIdentifierFilter(inputCopy.transfer),
17
17
  update: {
18
18
  status: inputCopy.status,
19
- metadata: inputCopy.metadata
19
+ metadata: inputCopy.metadata,
20
+ extend_metadata: inputCopy.extend_metadata
20
21
  },
21
22
  options: inputCopy.options
22
23
  });
@@ -40,7 +40,8 @@ function updateTransfer(options, input, fnOptions) {
40
40
  transfer: (0, import_utils.getIdentifierFilter)(inputCopy.transfer),
41
41
  update: {
42
42
  status: inputCopy.status,
43
- metadata: inputCopy.metadata
43
+ metadata: inputCopy.metadata,
44
+ extend_metadata: inputCopy.extend_metadata
44
45
  },
45
46
  options: inputCopy.options
46
47
  });
@@ -21,6 +21,12 @@ export interface UpdateTransferFnInput {
21
21
  metadata?: {
22
22
  [k: string]: unknown;
23
23
  } | null;
24
+ /**
25
+ * Key/value object describing this transfer
26
+ */
27
+ extend_metadata?: {
28
+ [k: string]: unknown;
29
+ } | null;
24
30
  options?: UpdateTransferFnOptions;
25
31
  }
26
32
  /**
@@ -16,7 +16,8 @@ function updateTransfer(options, input, fnOptions) {
16
16
  transfer: getIdentifierFilter(inputCopy.transfer),
17
17
  update: {
18
18
  status: inputCopy.status,
19
- metadata: inputCopy.metadata
19
+ metadata: inputCopy.metadata,
20
+ extend_metadata: inputCopy.extend_metadata
20
21
  },
21
22
  options: inputCopy.options
22
23
  });
@@ -16,6 +16,9 @@
16
16
  "metadata": {
17
17
  "$ref": "/db/transfer/transfer.schema.json#/properties/metadata"
18
18
  },
19
+ "extend_metadata": {
20
+ "$ref": "/db/transfer/transfer.schema.json#/properties/metadata"
21
+ },
19
22
  "options": {
20
23
  "$ref": "#/definitions/update_transfer_fn_options"
21
24
  }
@@ -62,7 +62,6 @@
62
62
  "properties": {
63
63
  "status": {
64
64
  "description": "Status the transfer should be set as. Only pending transfers can be updated",
65
- "default": "finished",
66
65
  "$ref": "/db/consts.schema.json#/definitions/TransferStatus"
67
66
  },
68
67
  "metadata": {
@@ -75,9 +74,6 @@
75
74
  "$ref": "/db/transfer/transfer.schema.json#/properties/updated_at"
76
75
  }
77
76
  },
78
- "default": {
79
- "status": "finished"
80
- },
81
77
  "additionalProperties": false
82
78
  }
83
79
  },
@@ -9539,6 +9539,12 @@ declare module 'wapi-client/fns/update-transfer/update-transfer.enums' {
9539
9539
  metadata?: {
9540
9540
  [k: string]: unknown;
9541
9541
  } | null;
9542
+ /**
9543
+ * Key/value object describing this transfer
9544
+ */
9545
+ extend_metadata?: {
9546
+ [k: string]: unknown;
9547
+ } | null;
9542
9548
  options?: UpdateTransferFnOptions;
9543
9549
  }
9544
9550
  /**
@@ -12755,6 +12761,49 @@ declare module 'wapi-client/client' {
12755
12761
  /**
12756
12762
  *
12757
12763
  *
12764
+ * ```javascript
12765
+ *
12766
+ * // setup
12767
+ * await wapiClient.createDeposit(
12768
+ * {
12769
+ * wallet: 'newWallet',
12770
+ * amount: 10,
12771
+ * status: 'pending',
12772
+ * identifier: 'depositUSD',
12773
+ * token: 'USD',
12774
+ * },
12775
+ * {
12776
+ * create_wallet_if_not_exists: true,
12777
+ * },
12778
+ * );
12779
+ * await wapiClient.updateTransfer({
12780
+ * transfer: 'depositUSD',
12781
+ * status: 'finished',
12782
+ * });
12783
+ *
12784
+ * const result = await wapiClient.exportBalanceHistory(
12785
+ * {
12786
+ * wallet: 'newWallet',
12787
+ * token: 'USD',
12788
+ * },
12789
+ * {
12790
+ * limit: 0,
12791
+ * select: [
12792
+ * 'transfer_identifier',
12793
+ * 'pending_amount',
12794
+ * 'finished_amount',
12795
+ * 'pending_amount_from',
12796
+ * 'pending_amount_to',
12797
+ * 'amount',
12798
+ * ],
12799
+ * offset: 0,
12800
+ * order: 'desc',
12801
+ * tracking_id: 'mylogId',
12802
+ * // transaction_id: Transaction.identifier, // created transaction identifier
12803
+ * },
12804
+ * );
12805
+ *
12806
+ * ```
12758
12807
  *
12759
12808
  * @param {ExportBalanceHistoryFnInput} input
12760
12809
  * @param {ExportBalanceHistoryFnOptions} [options]