wapi-client 0.12.0-beta.3 → 0.12.3

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.
Files changed (75) hide show
  1. package/dist/api/ws-client.cjs +1 -1
  2. package/dist/api/ws-client.js +1 -1
  3. package/dist/client.cjs +1 -1
  4. package/dist/client.js +1 -1
  5. package/dist/db/consts.browser.cjs +0 -2
  6. package/dist/db/consts.browser.js +0 -2
  7. package/dist/db/consts.cjs +0 -2
  8. package/dist/db/consts.d.ts +1 -1
  9. package/dist/db/consts.js +0 -2
  10. package/dist/fns/consts.enums.d.ts +1 -2
  11. package/dist/fns/export-tokens/export-tokens.browser.cjs +23 -1
  12. package/dist/fns/export-tokens/export-tokens.browser.js +27 -2
  13. package/dist/fns/export-tokens/export-tokens.cjs +23 -1
  14. package/dist/fns/export-tokens/export-tokens.js +27 -2
  15. package/dist/fns/export-transfer-groups/export-transfer-groups.browser.cjs +24 -2
  16. package/dist/fns/export-transfer-groups/export-transfer-groups.browser.js +28 -3
  17. package/dist/fns/export-transfer-groups/export-transfer-groups.cjs +24 -2
  18. package/dist/fns/export-transfer-groups/export-transfer-groups.js +28 -3
  19. package/dist/fns/export-transfers/export-transfers.browser.cjs +23 -2
  20. package/dist/fns/export-transfers/export-transfers.browser.js +27 -3
  21. package/dist/fns/export-transfers/export-transfers.cjs +23 -2
  22. package/dist/fns/export-transfers/export-transfers.js +27 -3
  23. package/dist/fns/export-wallets/export-wallets.browser.cjs +7 -15
  24. package/dist/fns/export-wallets/export-wallets.browser.js +8 -17
  25. package/dist/fns/export-wallets/export-wallets.cjs +7 -15
  26. package/dist/fns/export-wallets/export-wallets.js +8 -17
  27. package/dist/fns/find-balances/find-balances.browser.cjs +23 -1
  28. package/dist/fns/find-balances/find-balances.browser.js +27 -2
  29. package/dist/fns/find-balances/find-balances.cjs +23 -1
  30. package/dist/fns/find-balances/find-balances.js +27 -2
  31. package/dist/fns/find-tokens/find-tokens.browser.cjs +23 -1
  32. package/dist/fns/find-tokens/find-tokens.browser.js +27 -2
  33. package/dist/fns/find-tokens/find-tokens.cjs +23 -1
  34. package/dist/fns/find-tokens/find-tokens.js +27 -2
  35. package/dist/fns/find-transfer-groups/find-transfer-groups.browser.cjs +23 -1
  36. package/dist/fns/find-transfer-groups/find-transfer-groups.browser.js +27 -2
  37. package/dist/fns/find-transfer-groups/find-transfer-groups.cjs +23 -1
  38. package/dist/fns/find-transfer-groups/find-transfer-groups.js +27 -2
  39. package/dist/fns/find-transfers/find-transfers.browser.cjs +18 -28
  40. package/dist/fns/find-transfers/find-transfers.browser.js +19 -29
  41. package/dist/fns/find-transfers/find-transfers.cjs +18 -28
  42. package/dist/fns/find-transfers/find-transfers.js +19 -29
  43. package/dist/fns/find-wallets/find-wallets.browser.cjs +6 -14
  44. package/dist/fns/find-wallets/find-wallets.browser.js +7 -16
  45. package/dist/fns/find-wallets/find-wallets.cjs +6 -14
  46. package/dist/fns/find-wallets/find-wallets.js +7 -16
  47. package/dist/fns/fn-types.d.ts +43 -43
  48. package/dist/fns/list-exports/list-exports.browser.cjs +4 -2
  49. package/dist/fns/list-exports/list-exports.browser.js +5 -3
  50. package/dist/fns/list-exports/list-exports.cjs +4 -2
  51. package/dist/fns/list-exports/list-exports.js +5 -3
  52. package/dist/index.browser.cjs +2 -0
  53. package/dist/index.browser.js +2 -0
  54. package/dist/index.cjs +2 -0
  55. package/dist/index.js +2 -0
  56. package/dist/lib/polyfill.browser.cjs +43 -0
  57. package/dist/lib/polyfill.browser.js +23 -0
  58. package/dist/lib/polyfill.cjs +47 -0
  59. package/dist/lib/polyfill.d.ts +1 -0
  60. package/dist/lib/polyfill.js +23 -0
  61. package/dist/lib/ts-utils.browser.cjs +5 -1
  62. package/dist/lib/ts-utils.browser.js +5 -1
  63. package/dist/lib/ts-utils.cjs +7 -2
  64. package/dist/lib/ts-utils.d.ts +5 -0
  65. package/dist/lib/ts-utils.js +5 -1
  66. package/dist/lib/utils.browser.cjs +20 -20
  67. package/dist/lib/utils.browser.js +20 -22
  68. package/dist/lib/utils.cjs +22 -19
  69. package/dist/lib/utils.d.ts +5 -3
  70. package/dist/lib/utils.js +20 -18
  71. package/dist/txs/tx-types.d.ts +51 -51
  72. package/dist/types/index.d.ts +16 -6
  73. package/dist/wapi-client-web.iife.js +1 -1
  74. package/dist/wapi-client.iife.js +1 -1
  75. package/package.json +1 -1
@@ -1,10 +1,28 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
3
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
4
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
5
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6
+ var __spreadValues = (a, b) => {
7
+ for (var prop in b || (b = {}))
8
+ if (__hasOwnProp.call(b, prop))
9
+ __defNormalProp(a, prop, b[prop]);
10
+ if (__getOwnPropSymbols)
11
+ for (var prop of __getOwnPropSymbols(b)) {
12
+ if (__propIsEnum.call(b, prop))
13
+ __defNormalProp(a, prop, b[prop]);
14
+ }
15
+ return a;
16
+ };
17
+
1
18
  // src/fns/find-transfer-groups/find-transfer-groups.ts
2
19
  import { QueryBuilder } from "../../lib/query-builder.browser.js";
3
- import { getIdentifierFilter, mergeFnOptionsOrderBy } from "../../lib/utils.browser.js";
20
+ import { getIdentifierFilter, orderByToOrder } from "../../lib/utils.browser.js";
4
21
  import { getValidator } from "../../lib/validation.browser.js";
5
22
  import { findTransferGroupsFnInputSchema } from "./find-transfer-groups.schema.zod.browser.js";
6
23
  var zodValidator = getValidator(findTransferGroupsFnInputSchema);
7
24
  function findTransferGroups(options, input, fnOptions) {
25
+ var _a, _b;
8
26
  const { client } = options;
9
27
  if (input === void 0) {
10
28
  return new QueryBuilder({
@@ -34,7 +52,14 @@ function findTransferGroups(options, input, fnOptions) {
34
52
  if (inputCopy.reverses) {
35
53
  filter.reverses = getIdentifierFilter(inputCopy.reverses);
36
54
  }
37
- const findOptions = mergeFnOptionsOrderBy(inputCopy.options);
55
+ const orderBy = (_a = inputCopy.options) == null ? void 0 : _a.order_by;
56
+ (_b = inputCopy.options) == null ? true : delete _b.order_by;
57
+ const findOptions = __spreadValues({}, inputCopy.options);
58
+ if (!findOptions.order && orderBy) {
59
+ findOptions.order = orderByToOrder(
60
+ orderBy
61
+ );
62
+ }
38
63
  return client.api.findTransferGroupMany({
39
64
  transfer_group: filter,
40
65
  options: findOptions
@@ -2,7 +2,21 @@
2
2
  var __defProp = Object.defineProperty;
3
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
8
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
9
+ var __spreadValues = (a, b) => {
10
+ for (var prop in b || (b = {}))
11
+ if (__hasOwnProp.call(b, prop))
12
+ __defNormalProp(a, prop, b[prop]);
13
+ if (__getOwnPropSymbols)
14
+ for (var prop of __getOwnPropSymbols(b)) {
15
+ if (__propIsEnum.call(b, prop))
16
+ __defNormalProp(a, prop, b[prop]);
17
+ }
18
+ return a;
19
+ };
6
20
  var __export = (target, all) => {
7
21
  for (var name in all)
8
22
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -29,6 +43,7 @@ var import_validation = require('../../lib/validation.cjs');
29
43
  var import_find_transfer_groups_schema = require('./find-transfer-groups.schema.zod.cjs');
30
44
  var zodValidator = (0, import_validation.getValidator)(import_find_transfer_groups_schema.findTransferGroupsFnInputSchema);
31
45
  function findTransferGroups(options, input, fnOptions) {
46
+ var _a, _b;
32
47
  const { client } = options;
33
48
  if (input === void 0) {
34
49
  return new import_query_builder.QueryBuilder({
@@ -58,7 +73,14 @@ function findTransferGroups(options, input, fnOptions) {
58
73
  if (inputCopy.reverses) {
59
74
  filter.reverses = (0, import_utils.getIdentifierFilter)(inputCopy.reverses);
60
75
  }
61
- const findOptions = (0, import_utils.mergeFnOptionsOrderBy)(inputCopy.options);
76
+ const orderBy = (_a = inputCopy.options) == null ? void 0 : _a.order_by;
77
+ (_b = inputCopy.options) == null ? true : delete _b.order_by;
78
+ const findOptions = __spreadValues({}, inputCopy.options);
79
+ if (!findOptions.order && orderBy) {
80
+ findOptions.order = (0, import_utils.orderByToOrder)(
81
+ orderBy
82
+ );
83
+ }
62
84
  return client.api.findTransferGroupMany({
63
85
  transfer_group: filter,
64
86
  options: findOptions
@@ -1,10 +1,28 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
3
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
4
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
5
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6
+ var __spreadValues = (a, b) => {
7
+ for (var prop in b || (b = {}))
8
+ if (__hasOwnProp.call(b, prop))
9
+ __defNormalProp(a, prop, b[prop]);
10
+ if (__getOwnPropSymbols)
11
+ for (var prop of __getOwnPropSymbols(b)) {
12
+ if (__propIsEnum.call(b, prop))
13
+ __defNormalProp(a, prop, b[prop]);
14
+ }
15
+ return a;
16
+ };
17
+
1
18
  // src/fns/find-transfer-groups/find-transfer-groups.ts
2
19
  import { QueryBuilder } from "../../lib/query-builder";
3
- import { getIdentifierFilter, mergeFnOptionsOrderBy } from "../../lib/utils";
20
+ import { getIdentifierFilter, orderByToOrder } from "../../lib/utils";
4
21
  import { getValidator } from "../../lib/validation";
5
22
  import { findTransferGroupsFnInputSchema } from "./find-transfer-groups.schema.zod";
6
23
  var zodValidator = getValidator(findTransferGroupsFnInputSchema);
7
24
  function findTransferGroups(options, input, fnOptions) {
25
+ var _a, _b;
8
26
  const { client } = options;
9
27
  if (input === void 0) {
10
28
  return new QueryBuilder({
@@ -34,7 +52,14 @@ function findTransferGroups(options, input, fnOptions) {
34
52
  if (inputCopy.reverses) {
35
53
  filter.reverses = getIdentifierFilter(inputCopy.reverses);
36
54
  }
37
- const findOptions = mergeFnOptionsOrderBy(inputCopy.options);
55
+ const orderBy = (_a = inputCopy.options) == null ? void 0 : _a.order_by;
56
+ (_b = inputCopy.options) == null ? true : delete _b.order_by;
57
+ const findOptions = __spreadValues({}, inputCopy.options);
58
+ if (!findOptions.order && orderBy) {
59
+ findOptions.order = orderByToOrder(
60
+ orderBy
61
+ );
62
+ }
38
63
  return client.api.findTransferGroupMany({
39
64
  transfer_group: filter,
40
65
  options: findOptions
@@ -17,18 +17,6 @@ var __spreadValues = (a, b) => {
17
17
  }
18
18
  return a;
19
19
  };
20
- var __objRest = (source, exclude) => {
21
- var target = {};
22
- for (var prop in source)
23
- if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
24
- target[prop] = source[prop];
25
- if (source != null && __getOwnPropSymbols)
26
- for (var prop of __getOwnPropSymbols(source)) {
27
- if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
28
- target[prop] = source[prop];
29
- }
30
- return target;
31
- };
32
20
  var __export = (target, all) => {
33
21
  for (var name in all)
34
22
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -95,6 +83,8 @@ function findTransfers(options, input, fnOptions) {
95
83
  filter.metadata = inputCopy.metadata;
96
84
  }
97
85
  (_a = inputCopy.options) != null ? _a : inputCopy.options = {};
86
+ const orderBy = inputCopy.options.order_by;
87
+ delete inputCopy.options.order_by;
98
88
  if (inputCopy.options.return_running_balance) {
99
89
  if (inputCopy.options.return_running_balance_for_wallet) {
100
90
  throw new import_errors.InputError("CONFLICTING_OPTIONS_FOR_BALANCE", {
@@ -108,6 +98,8 @@ function findTransfers(options, input, fnOptions) {
108
98
  }
109
99
  inputCopy.options.return_running_balance_for_wallet = inputCopy.wallet;
110
100
  }
101
+ const returnRunningBalance = inputCopy.options.return_running_balance_for_wallet;
102
+ delete inputCopy.options.return_running_balance_for_wallet;
111
103
  if (inputCopy.options.return_signed_amount) {
112
104
  if (inputCopy.options.return_signed_amount_for_wallet) {
113
105
  throw new import_errors.InputError("CONFLICTING_OPTIONS_FOR_SIGNED_AMOUNT", {
@@ -121,22 +113,20 @@ function findTransfers(options, input, fnOptions) {
121
113
  }
122
114
  inputCopy.options.return_signed_amount_for_wallet = inputCopy.wallet;
123
115
  }
124
- const _b = inputCopy.options, {
125
- return_signed_amount_for_wallet,
126
- return_running_balance_for_wallet
127
- } = _b, preOptions = __objRest(_b, [
128
- "return_signed_amount_for_wallet",
129
- "return_running_balance_for_wallet"
130
- ]);
131
- const findOptions = (0, import_utils.mergeFnOptionsOrderBy)(__spreadValues(__spreadValues(__spreadValues({}, preOptions), return_running_balance_for_wallet ? {
132
- return_running_balance_for_wallet: (0, import_utils.getForeign)(
133
- return_running_balance_for_wallet
134
- )
135
- } : {}), return_signed_amount_for_wallet ? {
136
- return_signed_amount_for_wallet: (0, import_utils.getForeign)(
137
- return_signed_amount_for_wallet
138
- )
139
- } : {}));
116
+ const returnSigned = inputCopy.options.return_signed_amount_for_wallet;
117
+ delete inputCopy.options.return_signed_amount_for_wallet;
118
+ const findOptions = __spreadValues({}, inputCopy.options);
119
+ if (!findOptions.order && orderBy) {
120
+ findOptions.order = (0, import_utils.orderByToOrder)(
121
+ orderBy
122
+ );
123
+ }
124
+ if (returnRunningBalance) {
125
+ findOptions.return_running_balance_for_wallet = (0, import_utils.getForeign)(returnRunningBalance);
126
+ }
127
+ if (returnSigned) {
128
+ findOptions.return_signed_amount_for_wallet = (0, import_utils.getForeign)(returnSigned);
129
+ }
140
130
  return client.api.findTransferMany({
141
131
  transfer: filter,
142
132
  options: findOptions
@@ -14,18 +14,6 @@ var __spreadValues = (a, b) => {
14
14
  }
15
15
  return a;
16
16
  };
17
- var __objRest = (source, exclude) => {
18
- var target = {};
19
- for (var prop in source)
20
- if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
21
- target[prop] = source[prop];
22
- if (source != null && __getOwnPropSymbols)
23
- for (var prop of __getOwnPropSymbols(source)) {
24
- if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
25
- target[prop] = source[prop];
26
- }
27
- return target;
28
- };
29
17
 
30
18
  // src/fns/find-transfers/find-transfers.ts
31
19
  import { QueryBuilder } from "../../lib/query-builder.browser.js";
@@ -33,7 +21,7 @@ import { InputError } from "../../lib/errors.browser.js";
33
21
  import {
34
22
  getForeign,
35
23
  getIdentifierFilter,
36
- mergeFnOptionsOrderBy
24
+ orderByToOrder
37
25
  } from "../../lib/utils.browser.js";
38
26
  import { getValidator } from "../../lib/validation.browser.js";
39
27
  import { findTransfersFnInputSchema } from "./find-transfers.schema.zod.browser.js";
@@ -78,6 +66,8 @@ function findTransfers(options, input, fnOptions) {
78
66
  filter.metadata = inputCopy.metadata;
79
67
  }
80
68
  (_a = inputCopy.options) != null ? _a : inputCopy.options = {};
69
+ const orderBy = inputCopy.options.order_by;
70
+ delete inputCopy.options.order_by;
81
71
  if (inputCopy.options.return_running_balance) {
82
72
  if (inputCopy.options.return_running_balance_for_wallet) {
83
73
  throw new InputError("CONFLICTING_OPTIONS_FOR_BALANCE", {
@@ -91,6 +81,8 @@ function findTransfers(options, input, fnOptions) {
91
81
  }
92
82
  inputCopy.options.return_running_balance_for_wallet = inputCopy.wallet;
93
83
  }
84
+ const returnRunningBalance = inputCopy.options.return_running_balance_for_wallet;
85
+ delete inputCopy.options.return_running_balance_for_wallet;
94
86
  if (inputCopy.options.return_signed_amount) {
95
87
  if (inputCopy.options.return_signed_amount_for_wallet) {
96
88
  throw new InputError("CONFLICTING_OPTIONS_FOR_SIGNED_AMOUNT", {
@@ -104,22 +96,20 @@ function findTransfers(options, input, fnOptions) {
104
96
  }
105
97
  inputCopy.options.return_signed_amount_for_wallet = inputCopy.wallet;
106
98
  }
107
- const _b = inputCopy.options, {
108
- return_signed_amount_for_wallet,
109
- return_running_balance_for_wallet
110
- } = _b, preOptions = __objRest(_b, [
111
- "return_signed_amount_for_wallet",
112
- "return_running_balance_for_wallet"
113
- ]);
114
- const findOptions = mergeFnOptionsOrderBy(__spreadValues(__spreadValues(__spreadValues({}, preOptions), return_running_balance_for_wallet ? {
115
- return_running_balance_for_wallet: getForeign(
116
- return_running_balance_for_wallet
117
- )
118
- } : {}), return_signed_amount_for_wallet ? {
119
- return_signed_amount_for_wallet: getForeign(
120
- return_signed_amount_for_wallet
121
- )
122
- } : {}));
99
+ const returnSigned = inputCopy.options.return_signed_amount_for_wallet;
100
+ delete inputCopy.options.return_signed_amount_for_wallet;
101
+ const findOptions = __spreadValues({}, inputCopy.options);
102
+ if (!findOptions.order && orderBy) {
103
+ findOptions.order = orderByToOrder(
104
+ orderBy
105
+ );
106
+ }
107
+ if (returnRunningBalance) {
108
+ findOptions.return_running_balance_for_wallet = getForeign(returnRunningBalance);
109
+ }
110
+ if (returnSigned) {
111
+ findOptions.return_signed_amount_for_wallet = getForeign(returnSigned);
112
+ }
123
113
  return client.api.findTransferMany({
124
114
  transfer: filter,
125
115
  options: findOptions
@@ -17,18 +17,6 @@ var __spreadValues = (a, b) => {
17
17
  }
18
18
  return a;
19
19
  };
20
- var __objRest = (source, exclude) => {
21
- var target = {};
22
- for (var prop in source)
23
- if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
24
- target[prop] = source[prop];
25
- if (source != null && __getOwnPropSymbols)
26
- for (var prop of __getOwnPropSymbols(source)) {
27
- if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
28
- target[prop] = source[prop];
29
- }
30
- return target;
31
- };
32
20
  var __export = (target, all) => {
33
21
  for (var name in all)
34
22
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -95,6 +83,8 @@ function findTransfers(options, input, fnOptions) {
95
83
  filter.metadata = inputCopy.metadata;
96
84
  }
97
85
  (_a = inputCopy.options) != null ? _a : inputCopy.options = {};
86
+ const orderBy = inputCopy.options.order_by;
87
+ delete inputCopy.options.order_by;
98
88
  if (inputCopy.options.return_running_balance) {
99
89
  if (inputCopy.options.return_running_balance_for_wallet) {
100
90
  throw new import_errors.InputError("CONFLICTING_OPTIONS_FOR_BALANCE", {
@@ -108,6 +98,8 @@ function findTransfers(options, input, fnOptions) {
108
98
  }
109
99
  inputCopy.options.return_running_balance_for_wallet = inputCopy.wallet;
110
100
  }
101
+ const returnRunningBalance = inputCopy.options.return_running_balance_for_wallet;
102
+ delete inputCopy.options.return_running_balance_for_wallet;
111
103
  if (inputCopy.options.return_signed_amount) {
112
104
  if (inputCopy.options.return_signed_amount_for_wallet) {
113
105
  throw new import_errors.InputError("CONFLICTING_OPTIONS_FOR_SIGNED_AMOUNT", {
@@ -121,22 +113,20 @@ function findTransfers(options, input, fnOptions) {
121
113
  }
122
114
  inputCopy.options.return_signed_amount_for_wallet = inputCopy.wallet;
123
115
  }
124
- const _b = inputCopy.options, {
125
- return_signed_amount_for_wallet,
126
- return_running_balance_for_wallet
127
- } = _b, preOptions = __objRest(_b, [
128
- "return_signed_amount_for_wallet",
129
- "return_running_balance_for_wallet"
130
- ]);
131
- const findOptions = (0, import_utils.mergeFnOptionsOrderBy)(__spreadValues(__spreadValues(__spreadValues({}, preOptions), return_running_balance_for_wallet ? {
132
- return_running_balance_for_wallet: (0, import_utils.getForeign)(
133
- return_running_balance_for_wallet
134
- )
135
- } : {}), return_signed_amount_for_wallet ? {
136
- return_signed_amount_for_wallet: (0, import_utils.getForeign)(
137
- return_signed_amount_for_wallet
138
- )
139
- } : {}));
116
+ const returnSigned = inputCopy.options.return_signed_amount_for_wallet;
117
+ delete inputCopy.options.return_signed_amount_for_wallet;
118
+ const findOptions = __spreadValues({}, inputCopy.options);
119
+ if (!findOptions.order && orderBy) {
120
+ findOptions.order = (0, import_utils.orderByToOrder)(
121
+ orderBy
122
+ );
123
+ }
124
+ if (returnRunningBalance) {
125
+ findOptions.return_running_balance_for_wallet = (0, import_utils.getForeign)(returnRunningBalance);
126
+ }
127
+ if (returnSigned) {
128
+ findOptions.return_signed_amount_for_wallet = (0, import_utils.getForeign)(returnSigned);
129
+ }
140
130
  return client.api.findTransferMany({
141
131
  transfer: filter,
142
132
  options: findOptions
@@ -14,18 +14,6 @@ var __spreadValues = (a, b) => {
14
14
  }
15
15
  return a;
16
16
  };
17
- var __objRest = (source, exclude) => {
18
- var target = {};
19
- for (var prop in source)
20
- if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
21
- target[prop] = source[prop];
22
- if (source != null && __getOwnPropSymbols)
23
- for (var prop of __getOwnPropSymbols(source)) {
24
- if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
25
- target[prop] = source[prop];
26
- }
27
- return target;
28
- };
29
17
 
30
18
  // src/fns/find-transfers/find-transfers.ts
31
19
  import { QueryBuilder } from "../../lib/query-builder";
@@ -33,7 +21,7 @@ import { InputError } from "../../lib/errors";
33
21
  import {
34
22
  getForeign,
35
23
  getIdentifierFilter,
36
- mergeFnOptionsOrderBy
24
+ orderByToOrder
37
25
  } from "../../lib/utils";
38
26
  import { getValidator } from "../../lib/validation";
39
27
  import { findTransfersFnInputSchema } from "./find-transfers.schema.zod";
@@ -78,6 +66,8 @@ function findTransfers(options, input, fnOptions) {
78
66
  filter.metadata = inputCopy.metadata;
79
67
  }
80
68
  (_a = inputCopy.options) != null ? _a : inputCopy.options = {};
69
+ const orderBy = inputCopy.options.order_by;
70
+ delete inputCopy.options.order_by;
81
71
  if (inputCopy.options.return_running_balance) {
82
72
  if (inputCopy.options.return_running_balance_for_wallet) {
83
73
  throw new InputError("CONFLICTING_OPTIONS_FOR_BALANCE", {
@@ -91,6 +81,8 @@ function findTransfers(options, input, fnOptions) {
91
81
  }
92
82
  inputCopy.options.return_running_balance_for_wallet = inputCopy.wallet;
93
83
  }
84
+ const returnRunningBalance = inputCopy.options.return_running_balance_for_wallet;
85
+ delete inputCopy.options.return_running_balance_for_wallet;
94
86
  if (inputCopy.options.return_signed_amount) {
95
87
  if (inputCopy.options.return_signed_amount_for_wallet) {
96
88
  throw new InputError("CONFLICTING_OPTIONS_FOR_SIGNED_AMOUNT", {
@@ -104,22 +96,20 @@ function findTransfers(options, input, fnOptions) {
104
96
  }
105
97
  inputCopy.options.return_signed_amount_for_wallet = inputCopy.wallet;
106
98
  }
107
- const _b = inputCopy.options, {
108
- return_signed_amount_for_wallet,
109
- return_running_balance_for_wallet
110
- } = _b, preOptions = __objRest(_b, [
111
- "return_signed_amount_for_wallet",
112
- "return_running_balance_for_wallet"
113
- ]);
114
- const findOptions = mergeFnOptionsOrderBy(__spreadValues(__spreadValues(__spreadValues({}, preOptions), return_running_balance_for_wallet ? {
115
- return_running_balance_for_wallet: getForeign(
116
- return_running_balance_for_wallet
117
- )
118
- } : {}), return_signed_amount_for_wallet ? {
119
- return_signed_amount_for_wallet: getForeign(
120
- return_signed_amount_for_wallet
121
- )
122
- } : {}));
99
+ const returnSigned = inputCopy.options.return_signed_amount_for_wallet;
100
+ delete inputCopy.options.return_signed_amount_for_wallet;
101
+ const findOptions = __spreadValues({}, inputCopy.options);
102
+ if (!findOptions.order && orderBy) {
103
+ findOptions.order = orderByToOrder(
104
+ orderBy
105
+ );
106
+ }
107
+ if (returnRunningBalance) {
108
+ findOptions.return_running_balance_for_wallet = getForeign(returnRunningBalance);
109
+ }
110
+ if (returnSigned) {
111
+ findOptions.return_signed_amount_for_wallet = getForeign(returnSigned);
112
+ }
123
113
  return client.api.findTransferMany({
124
114
  transfer: filter,
125
115
  options: findOptions
@@ -5,18 +5,6 @@ var __getOwnPropNames = Object.getOwnPropertyNames;
5
5
  var __getOwnPropSymbols = Object.getOwnPropertySymbols;
6
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
7
  var __propIsEnum = Object.prototype.propertyIsEnumerable;
8
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
9
- var __spreadValues = (a, b) => {
10
- for (var prop in b || (b = {}))
11
- if (__hasOwnProp.call(b, prop))
12
- __defNormalProp(a, prop, b[prop]);
13
- if (__getOwnPropSymbols)
14
- for (var prop of __getOwnPropSymbols(b)) {
15
- if (__propIsEnum.call(b, prop))
16
- __defNormalProp(a, prop, b[prop]);
17
- }
18
- return a;
19
- };
20
8
  var __objRest = (source, exclude) => {
21
9
  var target = {};
22
10
  for (var prop in source)
@@ -74,8 +62,12 @@ function findWallets(options, input, fnOptions) {
74
62
  }
75
63
  const inputCopy = zodValidator.validateInputWOptions(input, fnOptions);
76
64
  const _a = inputCopy, { options: inputOptions } = _a, filter = __objRest(_a, ["options"]);
77
- const _b = inputOptions, { include_balance_for_token } = _b, preOptions = __objRest(_b, ["include_balance_for_token"]);
78
- const findOptions = (0, import_utils.mergeFnOptionsOrderBy)(__spreadValues(__spreadValues({}, preOptions), include_balance_for_token ? { include_balance_for_token: (0, import_utils.getForeign)(include_balance_for_token) } : {}));
65
+ const _b = inputOptions != null ? inputOptions : {}, { order_by: orderBy } = _b, findOptions = __objRest(_b, ["order_by"]);
66
+ if (!findOptions.order && orderBy) {
67
+ findOptions.order = (0, import_utils.orderByToOrder)(
68
+ orderBy
69
+ );
70
+ }
79
71
  return client.api.findWalletMany({
80
72
  wallet: filter,
81
73
  options: findOptions
@@ -1,19 +1,6 @@
1
- var __defProp = Object.defineProperty;
2
1
  var __getOwnPropSymbols = Object.getOwnPropertySymbols;
3
2
  var __hasOwnProp = Object.prototype.hasOwnProperty;
4
3
  var __propIsEnum = Object.prototype.propertyIsEnumerable;
5
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6
- var __spreadValues = (a, b) => {
7
- for (var prop in b || (b = {}))
8
- if (__hasOwnProp.call(b, prop))
9
- __defNormalProp(a, prop, b[prop]);
10
- if (__getOwnPropSymbols)
11
- for (var prop of __getOwnPropSymbols(b)) {
12
- if (__propIsEnum.call(b, prop))
13
- __defNormalProp(a, prop, b[prop]);
14
- }
15
- return a;
16
- };
17
4
  var __objRest = (source, exclude) => {
18
5
  var target = {};
19
6
  for (var prop in source)
@@ -29,7 +16,7 @@ var __objRest = (source, exclude) => {
29
16
 
30
17
  // src/fns/find-wallets/find-wallets.ts
31
18
  import { QueryBuilder } from "../../lib/query-builder.browser.js";
32
- import { getForeign, mergeFnOptionsOrderBy } from "../../lib/utils.browser.js";
19
+ import { getForeign, orderByToOrder } from "../../lib/utils.browser.js";
33
20
  import { getValidator } from "../../lib/validation.browser.js";
34
21
  import { findWalletsFnInputSchema } from "./find-wallets.schema.zod.browser.js";
35
22
  var zodValidator = getValidator(findWalletsFnInputSchema);
@@ -53,8 +40,12 @@ function findWallets(options, input, fnOptions) {
53
40
  }
54
41
  const inputCopy = zodValidator.validateInputWOptions(input, fnOptions);
55
42
  const _a = inputCopy, { options: inputOptions } = _a, filter = __objRest(_a, ["options"]);
56
- const _b = inputOptions, { include_balance_for_token } = _b, preOptions = __objRest(_b, ["include_balance_for_token"]);
57
- const findOptions = mergeFnOptionsOrderBy(__spreadValues(__spreadValues({}, preOptions), include_balance_for_token ? { include_balance_for_token: getForeign(include_balance_for_token) } : {}));
43
+ const _b = inputOptions != null ? inputOptions : {}, { order_by: orderBy } = _b, findOptions = __objRest(_b, ["order_by"]);
44
+ if (!findOptions.order && orderBy) {
45
+ findOptions.order = orderByToOrder(
46
+ orderBy
47
+ );
48
+ }
58
49
  return client.api.findWalletMany({
59
50
  wallet: filter,
60
51
  options: findOptions
@@ -5,18 +5,6 @@ var __getOwnPropNames = Object.getOwnPropertyNames;
5
5
  var __getOwnPropSymbols = Object.getOwnPropertySymbols;
6
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
7
  var __propIsEnum = Object.prototype.propertyIsEnumerable;
8
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
9
- var __spreadValues = (a, b) => {
10
- for (var prop in b || (b = {}))
11
- if (__hasOwnProp.call(b, prop))
12
- __defNormalProp(a, prop, b[prop]);
13
- if (__getOwnPropSymbols)
14
- for (var prop of __getOwnPropSymbols(b)) {
15
- if (__propIsEnum.call(b, prop))
16
- __defNormalProp(a, prop, b[prop]);
17
- }
18
- return a;
19
- };
20
8
  var __objRest = (source, exclude) => {
21
9
  var target = {};
22
10
  for (var prop in source)
@@ -74,8 +62,12 @@ function findWallets(options, input, fnOptions) {
74
62
  }
75
63
  const inputCopy = zodValidator.validateInputWOptions(input, fnOptions);
76
64
  const _a = inputCopy, { options: inputOptions } = _a, filter = __objRest(_a, ["options"]);
77
- const _b = inputOptions, { include_balance_for_token } = _b, preOptions = __objRest(_b, ["include_balance_for_token"]);
78
- const findOptions = (0, import_utils.mergeFnOptionsOrderBy)(__spreadValues(__spreadValues({}, preOptions), include_balance_for_token ? { include_balance_for_token: (0, import_utils.getForeign)(include_balance_for_token) } : {}));
65
+ const _b = inputOptions != null ? inputOptions : {}, { order_by: orderBy } = _b, findOptions = __objRest(_b, ["order_by"]);
66
+ if (!findOptions.order && orderBy) {
67
+ findOptions.order = (0, import_utils.orderByToOrder)(
68
+ orderBy
69
+ );
70
+ }
79
71
  return client.api.findWalletMany({
80
72
  wallet: filter,
81
73
  options: findOptions
@@ -1,19 +1,6 @@
1
- var __defProp = Object.defineProperty;
2
1
  var __getOwnPropSymbols = Object.getOwnPropertySymbols;
3
2
  var __hasOwnProp = Object.prototype.hasOwnProperty;
4
3
  var __propIsEnum = Object.prototype.propertyIsEnumerable;
5
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6
- var __spreadValues = (a, b) => {
7
- for (var prop in b || (b = {}))
8
- if (__hasOwnProp.call(b, prop))
9
- __defNormalProp(a, prop, b[prop]);
10
- if (__getOwnPropSymbols)
11
- for (var prop of __getOwnPropSymbols(b)) {
12
- if (__propIsEnum.call(b, prop))
13
- __defNormalProp(a, prop, b[prop]);
14
- }
15
- return a;
16
- };
17
4
  var __objRest = (source, exclude) => {
18
5
  var target = {};
19
6
  for (var prop in source)
@@ -29,7 +16,7 @@ var __objRest = (source, exclude) => {
29
16
 
30
17
  // src/fns/find-wallets/find-wallets.ts
31
18
  import { QueryBuilder } from "../../lib/query-builder";
32
- import { getForeign, mergeFnOptionsOrderBy } from "../../lib/utils";
19
+ import { getForeign, orderByToOrder } from "../../lib/utils";
33
20
  import { getValidator } from "../../lib/validation";
34
21
  import { findWalletsFnInputSchema } from "./find-wallets.schema.zod";
35
22
  var zodValidator = getValidator(findWalletsFnInputSchema);
@@ -53,8 +40,12 @@ function findWallets(options, input, fnOptions) {
53
40
  }
54
41
  const inputCopy = zodValidator.validateInputWOptions(input, fnOptions);
55
42
  const _a = inputCopy, { options: inputOptions } = _a, filter = __objRest(_a, ["options"]);
56
- const _b = inputOptions, { include_balance_for_token } = _b, preOptions = __objRest(_b, ["include_balance_for_token"]);
57
- const findOptions = mergeFnOptionsOrderBy(__spreadValues(__spreadValues({}, preOptions), include_balance_for_token ? { include_balance_for_token: getForeign(include_balance_for_token) } : {}));
43
+ const _b = inputOptions != null ? inputOptions : {}, { order_by: orderBy } = _b, findOptions = __objRest(_b, ["order_by"]);
44
+ if (!findOptions.order && orderBy) {
45
+ findOptions.order = orderByToOrder(
46
+ orderBy
47
+ );
48
+ }
58
49
  return client.api.findWalletMany({
59
50
  wallet: filter,
60
51
  options: findOptions