@orb-labs/orby-core 0.0.3 → 0.0.5

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 (43) hide show
  1. package/README.md +42 -1
  2. package/dist/actions/account_cluster.d.ts +1 -1
  3. package/dist/actions/account_cluster.js +308 -121
  4. package/dist/actions/admin.js +115 -28
  5. package/dist/actions/application.js +68 -14
  6. package/dist/actions/instance.js +237 -72
  7. package/dist/actions/operation.d.ts +12 -6
  8. package/dist/actions/operation.js +242 -90
  9. package/dist/actions/token.js +107 -31
  10. package/dist/constants.d.ts +8 -0
  11. package/dist/constants.js +132 -36
  12. package/dist/entities/account.js +26 -28
  13. package/dist/entities/financial/account_balance.js +22 -24
  14. package/dist/entities/financial/asset.js +15 -17
  15. package/dist/entities/financial/currency.js +37 -25
  16. package/dist/entities/financial/currency_amount.js +79 -64
  17. package/dist/entities/financial/fungible_token.js +49 -34
  18. package/dist/entities/financial/fungible_token_amount.js +85 -70
  19. package/dist/entities/financial/non_fungible_token.js +45 -30
  20. package/dist/entities/financial/semi_fungible_token.js +45 -30
  21. package/dist/entities/library_request.js +19 -24
  22. package/dist/entities/state.js +67 -60
  23. package/dist/enums.js +34 -37
  24. package/dist/index.d.ts +1 -3
  25. package/dist/index.js +27 -46
  26. package/dist/interfaces/account_cluster.d.ts +1 -1
  27. package/dist/interfaces/account_cluster.js +1 -2
  28. package/dist/interfaces/admin.js +1 -2
  29. package/dist/interfaces/application.js +1 -2
  30. package/dist/interfaces/instance.js +1 -2
  31. package/dist/interfaces/operation.d.ts +5 -5
  32. package/dist/interfaces/operation.js +1 -2
  33. package/dist/interfaces/orby.js +1 -2
  34. package/dist/interfaces/token.js +1 -2
  35. package/dist/tsconfig.tsbuildinfo +1 -0
  36. package/dist/types.d.ts +4 -0
  37. package/dist/types.js +1 -2
  38. package/dist/utils/action_helpers.d.ts +22 -0
  39. package/dist/utils/action_helpers.js +270 -0
  40. package/dist/utils/utils.d.ts +5 -22
  41. package/dist/utils/utils.js +30 -279
  42. package/dist/utils/validateAndParseAddress.js +7 -11
  43. package/package.json +6 -1
package/README.md CHANGED
@@ -1 +1,42 @@
1
- # rpc-core
1
+ # Orby RPC SDK
2
+
3
+ A generic library for the Custom RPC functions on the Orby. The library can be used with either the ethers library or with extensions to the viem library. It us used by our @orb-labs/orby-viem-extension, @orb-labs/orby-ethers5 and @orb-labs/orby-ethers6 libraries.
4
+
5
+ Orby is an RPC-proxy that wraps around standard RPCs and extends their functionality to enable gas abstraction, gas sponsorship, and chain abstraction for any account (including EOAs) with just a few lines of code. Additionally, it allows wallets to monetize on any transaction from their users.
6
+
7
+ ## Development
8
+
9
+ Run `yarn run dev`
10
+
11
+ ## Publishing to npm
12
+
13
+ 1. Bump the package.json version
14
+
15
+ ```
16
+ // package.json
17
+ version: "0.0.1" // change to "0.0.2"
18
+ ```
19
+
20
+ 2. Run yarn at the root of orby folder
21
+
22
+ ```
23
+ yarn
24
+ ```
25
+
26
+ 3. Build
27
+
28
+ ```
29
+ yarn workspace @orb-labs/orby-core build
30
+ ```
31
+
32
+ 4. Login to npm
33
+
34
+ ```
35
+ yarn npm login
36
+ ```
37
+
38
+ 4. Publish @orb-labs/orby-core to npm
39
+
40
+ ```
41
+ yarn workspace @orb-labs/orby-core npm publish --access public
42
+ ```
@@ -19,6 +19,6 @@ export declare class AccountClusterActions extends LibraryRequest {
19
19
  address?: string;
20
20
  }[]): Promise<Activity[]>;
21
21
  getPortfolioOverview(accountClusterId: string): Promise<FungibleTokenOverview>;
22
- getFungibleTokenPortfolio(accountClusterId: string): Promise<FungibleTokenOverview>;
22
+ getFungibleTokenPortfolio(accountClusterId: string): Promise<StandardizedBalance[]>;
23
23
  getFungibleTokenBalances(accountClusterId: string, offset?: number, limit?: number, tokensToOmit?: string[]): Promise<StandardizedBalance[]>;
24
24
  }
@@ -1,4 +1,18 @@
1
- "use strict";
1
+ var __extends = (this && this.__extends) || (function () {
2
+ var extendStatics = function (d, b) {
3
+ extendStatics = Object.setPrototypeOf ||
4
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
6
+ return extendStatics(d, b);
7
+ };
8
+ return function (d, b) {
9
+ if (typeof b !== "function" && b !== null)
10
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
11
+ extendStatics(d, b);
12
+ function __() { this.constructor = d; }
13
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
14
+ };
15
+ })();
2
16
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
17
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
18
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -8,140 +22,313 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
22
  step((generator = generator.apply(thisArg, _arguments || [])).next());
9
23
  });
10
24
  };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.AccountClusterActions = void 0;
13
- const utils_1 = require("../utils/utils");
14
- const library_request_1 = require("../entities/library_request");
15
- class AccountClusterActions extends library_request_1.LibraryRequest {
16
- constructor(library, client, provider) {
17
- super(library, client, provider);
25
+ var __generator = (this && this.__generator) || function (thisArg, body) {
26
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
27
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
28
+ function verb(n) { return function (v) { return step([n, v]); }; }
29
+ function step(op) {
30
+ if (f) throw new TypeError("Generator is already executing.");
31
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
32
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
33
+ if (y = 0, t) op = [op[0] & 2, t.value];
34
+ switch (op[0]) {
35
+ case 0: case 1: t = op; break;
36
+ case 4: _.label++; return { value: op[1], done: false };
37
+ case 5: _.label++; y = op[1]; op = [0]; continue;
38
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
39
+ default:
40
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
41
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
42
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
43
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
44
+ if (t[2]) _.ops.pop();
45
+ _.trys.pop(); continue;
46
+ }
47
+ op = body.call(thisArg, _);
48
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
49
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
18
50
  }
19
- createAccountCluster(accounts) {
20
- return __awaiter(this, void 0, void 0, function* () {
21
- const formattedAccounts = accounts.map((account) => account.toAccountModel());
22
- const accountCluster = yield this.sendRequest("orby_createAccountCluster", [
23
- { accounts: formattedAccounts },
24
- ]);
25
- return (0, utils_1.extractAccountCluster)(accountCluster);
26
- });
51
+ };
52
+ import { extractAccountCluster, extractFungibleTokenOverview, extractStandardizedBalances, } from "../utils/action_helpers";
53
+ import { LibraryRequest } from "../entities/library_request";
54
+ import { getChainIdFromOrbyChainId } from "../utils/utils";
55
+ var AccountClusterActions = /** @class */ (function (_super) {
56
+ __extends(AccountClusterActions, _super);
57
+ function AccountClusterActions(library, client, provider) {
58
+ return _super.call(this, library, client, provider) || this;
27
59
  }
28
- addToAccountCluster(accounts, accountClusterId) {
29
- return __awaiter(this, void 0, void 0, function* () {
30
- const formattedAccounts = accounts.map((account) => account.toAccountModel());
31
- const accountCluster = yield this.sendRequest("orby_addToAccountCluster", [
32
- { accounts: formattedAccounts, accountClusterId },
33
- ]);
34
- return (0, utils_1.extractAccountCluster)(accountCluster);
60
+ AccountClusterActions.prototype.createAccountCluster = function (accounts) {
61
+ return __awaiter(this, void 0, void 0, function () {
62
+ var formattedAccounts, accountCluster;
63
+ return __generator(this, function (_a) {
64
+ switch (_a.label) {
65
+ case 0:
66
+ formattedAccounts = accounts.map(function (account) {
67
+ return account.toAccountModel();
68
+ });
69
+ return [4 /*yield*/, this.sendRequest("orby_createAccountCluster", [
70
+ { accounts: formattedAccounts },
71
+ ])];
72
+ case 1:
73
+ accountCluster = _a.sent();
74
+ return [2 /*return*/, extractAccountCluster(accountCluster)];
75
+ }
76
+ });
35
77
  });
36
- }
37
- removeFromAccountCluster(accounts, accountClusterId) {
38
- return __awaiter(this, void 0, void 0, function* () {
39
- const formattedAccounts = accounts.map((account) => account.toAccountModel());
40
- const accountCluster = yield this.sendRequest("orby_removeFromAccountCluster", [{ accounts: formattedAccounts, accountClusterId }]);
41
- return (0, utils_1.extractAccountCluster)(accountCluster);
78
+ };
79
+ AccountClusterActions.prototype.addToAccountCluster = function (accounts, accountClusterId) {
80
+ return __awaiter(this, void 0, void 0, function () {
81
+ var formattedAccounts, accountCluster;
82
+ return __generator(this, function (_a) {
83
+ switch (_a.label) {
84
+ case 0:
85
+ formattedAccounts = accounts.map(function (account) {
86
+ return account.toAccountModel();
87
+ });
88
+ return [4 /*yield*/, this.sendRequest("orby_addToAccountCluster", [
89
+ { accounts: formattedAccounts, accountClusterId: accountClusterId },
90
+ ])];
91
+ case 1:
92
+ accountCluster = _a.sent();
93
+ return [2 /*return*/, extractAccountCluster(accountCluster)];
94
+ }
95
+ });
42
96
  });
43
- }
44
- enableChainAbstractionForAccountCluster(accountClusterId, enable) {
45
- return __awaiter(this, void 0, void 0, function* () {
46
- const { success } = yield this.sendRequest("orby_enableChainAbstractionForAccountCluster", [{ accountClusterId, enable }]);
47
- return success;
97
+ };
98
+ AccountClusterActions.prototype.removeFromAccountCluster = function (accounts, accountClusterId) {
99
+ return __awaiter(this, void 0, void 0, function () {
100
+ var formattedAccounts, accountCluster;
101
+ return __generator(this, function (_a) {
102
+ switch (_a.label) {
103
+ case 0:
104
+ formattedAccounts = accounts.map(function (account) {
105
+ return account.toAccountModel();
106
+ });
107
+ return [4 /*yield*/, this.sendRequest("orby_removeFromAccountCluster", [{ accounts: formattedAccounts, accountClusterId: accountClusterId }])];
108
+ case 1:
109
+ accountCluster = _a.sent();
110
+ return [2 /*return*/, extractAccountCluster(accountCluster)];
111
+ }
112
+ });
48
113
  });
49
- }
50
- setCustomChainEndpointsForAccountCluster(accountClusterId, chainEndpoints) {
51
- return __awaiter(this, void 0, void 0, function* () {
52
- const formattedEndpoints = chainEndpoints.map((endpoint) => {
53
- return {
54
- chainId: `EIP155-${endpoint.chainId}`,
55
- customRpcUrls: endpoint.customRpcUrls,
56
- customIndexerUrls: endpoint.customIndexerUrls,
57
- };
114
+ };
115
+ AccountClusterActions.prototype.enableChainAbstractionForAccountCluster = function (accountClusterId, enable) {
116
+ return __awaiter(this, void 0, void 0, function () {
117
+ var _a, success, message, code;
118
+ return __generator(this, function (_b) {
119
+ switch (_b.label) {
120
+ case 0: return [4 /*yield*/, this.sendRequest("orby_enableChainAbstractionForAccountCluster", [{ accountClusterId: accountClusterId, enable: enable }])];
121
+ case 1:
122
+ _a = _b.sent(), success = _a.success, message = _a.message, code = _a.code;
123
+ if (code && message) {
124
+ console.error("[enableChainAbstractionForAccountCluster]", code, message);
125
+ return [2 /*return*/, undefined];
126
+ }
127
+ return [2 /*return*/, success];
128
+ }
58
129
  });
59
- const { success } = yield this.sendRequest("orby_setCustomChainEndpointsForAccountCluster", [{ accountClusterId, chainEndpoints: formattedEndpoints }]);
60
- return success;
61
130
  });
62
- }
63
- removeCustomChainEndpointsForAccountCluster(accountClusterId, chainIds) {
64
- return __awaiter(this, void 0, void 0, function* () {
65
- const formattedChainIds = chainIds.map((chainId) => `EIP155-${chainId}`);
66
- const { success } = yield this.sendRequest("orby_removeCustomChainEndpointsForAccountCluster", [{ accountClusterId, chainIds: formattedChainIds }]);
67
- return success;
131
+ };
132
+ AccountClusterActions.prototype.setCustomChainEndpointsForAccountCluster = function (accountClusterId, chainEndpoints) {
133
+ return __awaiter(this, void 0, void 0, function () {
134
+ var formattedEndpoints, _a, success, message, code;
135
+ return __generator(this, function (_b) {
136
+ switch (_b.label) {
137
+ case 0:
138
+ formattedEndpoints = chainEndpoints.map(function (endpoint) {
139
+ return {
140
+ chainId: "EIP155-".concat(endpoint.chainId),
141
+ customRpcUrls: endpoint.customRpcUrls,
142
+ customIndexerUrls: endpoint.customIndexerUrls,
143
+ };
144
+ });
145
+ return [4 /*yield*/, this.sendRequest("orby_setCustomChainEndpointsForAccountCluster", [{ accountClusterId: accountClusterId, chainEndpoints: formattedEndpoints }])];
146
+ case 1:
147
+ _a = _b.sent(), success = _a.success, message = _a.message, code = _a.code;
148
+ if (code && message) {
149
+ console.error("[setCustomChainEndpointsForAccountCluster]", code, message);
150
+ return [2 /*return*/, undefined];
151
+ }
152
+ return [2 /*return*/, success];
153
+ }
154
+ });
68
155
  });
69
- }
70
- getCustomChainEndpointsForAccountCluster(accountClusterId, returnChainIdsOnly) {
71
- return __awaiter(this, void 0, void 0, function* () {
72
- const { chainEndpoints } = yield this.sendRequest("orby_getCustomChainEndpointsForAccountCluster", [{ accountClusterId, returnChainIdsOnly }]);
73
- return chainEndpoints.map((endpoint) => {
74
- return {
75
- chainId: (0, utils_1.getChainIdFromOrbyChainId)(endpoint.chainId),
76
- customRpcUrls: endpoint.customRpcUrls,
77
- customIndexerUrls: endpoint.customIndexerUrls,
78
- };
156
+ };
157
+ AccountClusterActions.prototype.removeCustomChainEndpointsForAccountCluster = function (accountClusterId, chainIds) {
158
+ return __awaiter(this, void 0, void 0, function () {
159
+ var formattedChainIds, _a, success, message, code;
160
+ return __generator(this, function (_b) {
161
+ switch (_b.label) {
162
+ case 0:
163
+ formattedChainIds = chainIds.map(function (chainId) { return "EIP155-".concat(chainId); });
164
+ return [4 /*yield*/, this.sendRequest("orby_removeCustomChainEndpointsForAccountCluster", [{ accountClusterId: accountClusterId, chainIds: formattedChainIds }])];
165
+ case 1:
166
+ _a = _b.sent(), success = _a.success, message = _a.message, code = _a.code;
167
+ if (code && message) {
168
+ console.error("[removeCustomChainEndpointsForAccountCluster]", code, message);
169
+ return [2 /*return*/, undefined];
170
+ }
171
+ return [2 /*return*/, success];
172
+ }
79
173
  });
80
174
  });
81
- }
82
- isChainSupportedOnAccountCluster(accountClusterId, chainId) {
83
- return __awaiter(this, void 0, void 0, function* () {
84
- const { supportStatus } = yield this.sendRequest("orby_isChainSupportedOnAccountCluster", [{ accountClusterId, chainId: `EIP155-${chainId}` }]);
85
- return supportStatus;
175
+ };
176
+ AccountClusterActions.prototype.getCustomChainEndpointsForAccountCluster = function (accountClusterId, returnChainIdsOnly) {
177
+ return __awaiter(this, void 0, void 0, function () {
178
+ var _a, chainEndpoints, message, code;
179
+ return __generator(this, function (_b) {
180
+ switch (_b.label) {
181
+ case 0: return [4 /*yield*/, this.sendRequest("orby_getCustomChainEndpointsForAccountCluster", [{ accountClusterId: accountClusterId, returnChainIdsOnly: returnChainIdsOnly }])];
182
+ case 1:
183
+ _a = _b.sent(), chainEndpoints = _a.chainEndpoints, message = _a.message, code = _a.code;
184
+ if (code && message) {
185
+ console.error("[getCustomChainEndpointsForAccountCluster]", code, message);
186
+ return [2 /*return*/, undefined];
187
+ }
188
+ return [2 /*return*/, chainEndpoints.map(function (endpoint) {
189
+ return {
190
+ chainId: getChainIdFromOrbyChainId(endpoint.chainId),
191
+ customRpcUrls: endpoint.customRpcUrls,
192
+ customIndexerUrls: endpoint.customIndexerUrls,
193
+ };
194
+ })];
195
+ }
196
+ });
86
197
  });
87
- }
88
- getNodeRpcUrl(accountClusterId, chainId) {
89
- return __awaiter(this, void 0, void 0, function* () {
90
- const { nodeRpcUrl } = yield this.sendRequest("orby_getNodeRpcUrl", [
91
- [{ accountClusterId, chainId: `EIP155-${chainId}` }],
92
- ]);
93
- return nodeRpcUrl;
198
+ };
199
+ AccountClusterActions.prototype.isChainSupportedOnAccountCluster = function (accountClusterId, chainId) {
200
+ return __awaiter(this, void 0, void 0, function () {
201
+ var _a, supportStatus, message, code;
202
+ return __generator(this, function (_b) {
203
+ switch (_b.label) {
204
+ case 0: return [4 /*yield*/, this.sendRequest("orby_isChainSupportedOnAccountCluster", [{ accountClusterId: accountClusterId, chainId: "EIP155-".concat(chainId) }])];
205
+ case 1:
206
+ _a = _b.sent(), supportStatus = _a.supportStatus, message = _a.message, code = _a.code;
207
+ if (code && message) {
208
+ console.error("[isChainSupportedOnAccountCluster]", code, message);
209
+ return [2 /*return*/, undefined];
210
+ }
211
+ return [2 /*return*/, supportStatus];
212
+ }
213
+ });
94
214
  });
95
- }
96
- getVirtualNodeRpcUrl(accountClusterId, chainId, entrypointAccountAddress) {
97
- return __awaiter(this, void 0, void 0, function* () {
98
- const { virtualNodeRpcUrl } = yield this.sendRequest("orby_getVirtualNodeRpcUrl", [
99
- [
100
- {
101
- accountClusterId,
102
- chainId: `EIP155-${chainId}`,
103
- entrypointAccountAddress,
104
- },
105
- ],
106
- ]);
107
- return virtualNodeRpcUrl;
215
+ };
216
+ AccountClusterActions.prototype.getNodeRpcUrl = function (accountClusterId, chainId) {
217
+ return __awaiter(this, void 0, void 0, function () {
218
+ var _a, nodeRpcUrl, code, message;
219
+ return __generator(this, function (_b) {
220
+ switch (_b.label) {
221
+ case 0: return [4 /*yield*/, this.sendRequest("orby_getNodeRpcUrl", [[{ accountClusterId: accountClusterId, chainId: "EIP155-".concat(chainId) }]])];
222
+ case 1:
223
+ _a = _b.sent(), nodeRpcUrl = _a.nodeRpcUrl, code = _a.code, message = _a.message;
224
+ if (code && message) {
225
+ console.error("[getNodeRpcUrl]", code, message);
226
+ return [2 /*return*/, undefined];
227
+ }
228
+ return [2 /*return*/, nodeRpcUrl];
229
+ }
230
+ });
108
231
  });
109
- }
110
- getActivity(accountClusterId, limit, offset, order, startDate, endDate, filters) {
111
- return __awaiter(this, void 0, void 0, function* () {
112
- const { virtualNodeRpcUrl } = yield this.sendRequest("orby_getActivity", [
113
- [
114
- {
115
- accountClusterId,
116
- limit,
117
- offset,
118
- order,
119
- startDate,
120
- endDate,
121
- filters,
122
- },
123
- ],
124
- ]);
125
- return virtualNodeRpcUrl;
232
+ };
233
+ AccountClusterActions.prototype.getVirtualNodeRpcUrl = function (accountClusterId, chainId, entrypointAccountAddress) {
234
+ return __awaiter(this, void 0, void 0, function () {
235
+ var _a, virtualNodeRpcUrl, message, code;
236
+ return __generator(this, function (_b) {
237
+ switch (_b.label) {
238
+ case 0: return [4 /*yield*/, this.sendRequest("orby_getVirtualNodeRpcUrl", [
239
+ {
240
+ accountClusterId: accountClusterId,
241
+ chainId: "EIP155-".concat(chainId),
242
+ entrypointAccountAddress: entrypointAccountAddress,
243
+ },
244
+ ])];
245
+ case 1:
246
+ _a = _b.sent(), virtualNodeRpcUrl = _a.virtualNodeRpcUrl, message = _a.message, code = _a.code;
247
+ if (code && message) {
248
+ console.error("[getVirtualNodeRpcUrl]", code, message);
249
+ return [2 /*return*/, undefined];
250
+ }
251
+ return [2 /*return*/, virtualNodeRpcUrl];
252
+ }
253
+ });
126
254
  });
127
- }
128
- getPortfolioOverview(accountClusterId) {
129
- return __awaiter(this, void 0, void 0, function* () {
130
- const { fungibleTokenOverview } = yield this.sendRequest("orby_getPortfolioOverview", [{ accountClusterId }]);
131
- return (0, utils_1.extractFungibleTokenOverview)(fungibleTokenOverview);
255
+ };
256
+ AccountClusterActions.prototype.getActivity = function (accountClusterId, limit, offset, order, startDate, endDate, filters) {
257
+ return __awaiter(this, void 0, void 0, function () {
258
+ var _a, virtualNodeRpcUrl, code, message;
259
+ return __generator(this, function (_b) {
260
+ switch (_b.label) {
261
+ case 0: return [4 /*yield*/, this.sendRequest("orby_getActivity", [
262
+ [
263
+ {
264
+ accountClusterId: accountClusterId,
265
+ limit: limit,
266
+ offset: offset,
267
+ order: order,
268
+ startDate: startDate,
269
+ endDate: endDate,
270
+ filters: filters,
271
+ },
272
+ ],
273
+ ])];
274
+ case 1:
275
+ _a = _b.sent(), virtualNodeRpcUrl = _a.virtualNodeRpcUrl, code = _a.code, message = _a.message;
276
+ if (code && message) {
277
+ console.error("[getActivity]", code, message);
278
+ return [2 /*return*/, undefined];
279
+ }
280
+ return [2 /*return*/, virtualNodeRpcUrl];
281
+ }
282
+ });
132
283
  });
133
- }
134
- getFungibleTokenPortfolio(accountClusterId) {
135
- return __awaiter(this, void 0, void 0, function* () {
136
- const { fungibleTokenOverview } = yield this.sendRequest("orby_getFungibleTokenPortfolio", [{ accountClusterId }]);
137
- return (0, utils_1.extractFungibleTokenOverview)(fungibleTokenOverview);
284
+ };
285
+ AccountClusterActions.prototype.getPortfolioOverview = function (accountClusterId) {
286
+ return __awaiter(this, void 0, void 0, function () {
287
+ var fungibleTokenOverview;
288
+ return __generator(this, function (_a) {
289
+ switch (_a.label) {
290
+ case 0: return [4 /*yield*/, this.sendRequest("orby_getPortfolioOverview", [{ accountClusterId: accountClusterId }])];
291
+ case 1:
292
+ fungibleTokenOverview = _a.sent();
293
+ return [2 /*return*/, extractFungibleTokenOverview(fungibleTokenOverview)];
294
+ }
295
+ });
138
296
  });
139
- }
140
- getFungibleTokenBalances(accountClusterId, offset, limit, tokensToOmit) {
141
- return __awaiter(this, void 0, void 0, function* () {
142
- const { fungibleTokenBalances } = yield this.sendRequest("orby_getFungibleTokenBalances", [{ accountClusterId, offset, limit, tokensToOmit }]);
143
- return (0, utils_1.extractStandardizedBalances)(fungibleTokenBalances);
297
+ };
298
+ AccountClusterActions.prototype.getFungibleTokenPortfolio = function (accountClusterId) {
299
+ return __awaiter(this, void 0, void 0, function () {
300
+ var _a, fungibleTokenBalances, code, message;
301
+ return __generator(this, function (_b) {
302
+ switch (_b.label) {
303
+ case 0: return [4 /*yield*/, this.sendRequest("orby_getFungibleTokenPortfolio", [{ accountClusterId: accountClusterId }])];
304
+ case 1:
305
+ _a = _b.sent(), fungibleTokenBalances = _a.fungibleTokenBalances, code = _a.code, message = _a.message;
306
+ if (code && message) {
307
+ console.error("[getFungibleTokenPortfolio]", code, message);
308
+ return [2 /*return*/, undefined];
309
+ }
310
+ return [2 /*return*/, extractStandardizedBalances(fungibleTokenBalances)];
311
+ }
312
+ });
144
313
  });
145
- }
146
- }
147
- exports.AccountClusterActions = AccountClusterActions;
314
+ };
315
+ AccountClusterActions.prototype.getFungibleTokenBalances = function (accountClusterId, offset, limit, tokensToOmit) {
316
+ return __awaiter(this, void 0, void 0, function () {
317
+ var _a, fungibleTokenBalances, code, message;
318
+ return __generator(this, function (_b) {
319
+ switch (_b.label) {
320
+ case 0: return [4 /*yield*/, this.sendRequest("orby_getFungibleTokenBalances", [{ accountClusterId: accountClusterId, offset: offset, limit: limit, tokensToOmit: tokensToOmit }])];
321
+ case 1:
322
+ _a = _b.sent(), fungibleTokenBalances = _a.fungibleTokenBalances, code = _a.code, message = _a.message;
323
+ if (code && message) {
324
+ console.error("[getFungibleTokenBalances]", code, message);
325
+ return [2 /*return*/, undefined];
326
+ }
327
+ return [2 /*return*/, extractStandardizedBalances(fungibleTokenBalances)];
328
+ }
329
+ });
330
+ });
331
+ };
332
+ return AccountClusterActions;
333
+ }(LibraryRequest));
334
+ export { AccountClusterActions };