@orb-labs/orby-core 0.0.4 → 0.0.6

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 (35) hide show
  1. package/dist/actions/account_cluster.d.ts +1 -1
  2. package/dist/actions/account_cluster.js +316 -158
  3. package/dist/actions/admin.js +115 -46
  4. package/dist/actions/application.js +68 -20
  5. package/dist/actions/instance.js +237 -113
  6. package/dist/actions/operation.js +242 -110
  7. package/dist/actions/token.js +107 -41
  8. package/dist/constants.js +92 -97
  9. package/dist/entities/account.js +26 -28
  10. package/dist/entities/financial/account_balance.js +22 -24
  11. package/dist/entities/financial/asset.js +15 -17
  12. package/dist/entities/financial/currency.js +37 -25
  13. package/dist/entities/financial/currency_amount.js +79 -64
  14. package/dist/entities/financial/fungible_token.js +49 -34
  15. package/dist/entities/financial/fungible_token_amount.js +85 -70
  16. package/dist/entities/financial/non_fungible_token.js +45 -30
  17. package/dist/entities/financial/semi_fungible_token.js +45 -30
  18. package/dist/entities/library_request.js +19 -24
  19. package/dist/entities/state.js +67 -60
  20. package/dist/enums.js +34 -37
  21. package/dist/index.js +27 -43
  22. package/dist/interfaces/account_cluster.d.ts +1 -1
  23. package/dist/interfaces/account_cluster.js +1 -2
  24. package/dist/interfaces/admin.js +1 -2
  25. package/dist/interfaces/application.js +1 -2
  26. package/dist/interfaces/instance.js +1 -2
  27. package/dist/interfaces/operation.js +1 -2
  28. package/dist/interfaces/orby.js +1 -2
  29. package/dist/interfaces/token.js +1 -2
  30. package/dist/tsconfig.tsbuildinfo +1 -0
  31. package/dist/types.js +1 -2
  32. package/dist/utils/action_helpers.js +99 -109
  33. package/dist/utils/utils.js +24 -32
  34. package/dist/utils/validateAndParseAddress.js +7 -11
  35. package/package.json +1 -1
@@ -1,13 +1,26 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SemiFungibleToken = void 0;
4
- const currency_1 = require("./currency");
5
- const validateAndParseAddress_1 = require("../../utils/validateAndParseAddress");
6
- const enums_1 = require("../../enums");
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
+ })();
16
+ import { Currency } from "./currency";
17
+ import { checkValidAddress, validateAndParseAddress, } from "../../utils/validateAndParseAddress";
18
+ import { TokenType } from "../../enums";
7
19
  /**
8
20
  * Represents an ERC1155 token with a unique address and some metadata.
9
21
  */
10
- class SemiFungibleToken extends currency_1.Currency {
22
+ var SemiFungibleToken = /** @class */ (function (_super) {
23
+ __extends(SemiFungibleToken, _super);
11
24
  /**
12
25
  *
13
26
  * @param chainId The chain ID on which this token resides
@@ -18,51 +31,53 @@ class SemiFungibleToken extends currency_1.Currency {
18
31
  * @param url The URL of the token's metadata
19
32
  * @param bypassChecksum If true it only checks for length === 42, startsWith 0x and contains only hex characters
20
33
  */
21
- constructor(chainId, address, decimals, symbol, name, url, bypassChecksum, coinGeckoId) {
34
+ function SemiFungibleToken(chainId, address, decimals, symbol, name, url, bypassChecksum, coinGeckoId) {
22
35
  // TODO(felix): add this back
23
36
  // invariant(!_.isUndefined(getBlockchainFromBlockchainId(chainId)), "CHAIN_ID");
24
37
  var _a, _b;
25
- super(decimals, symbol, name, url, false, true, coinGeckoId);
26
- this.isNative = false;
27
- this.isToken = true;
38
+ var _this = _super.call(this, decimals, symbol, name, url, false, true, coinGeckoId) || this;
39
+ _this.isNative = false;
40
+ _this.isToken = true;
28
41
  if (bypassChecksum) {
29
- this.address = (_a = (0, validateAndParseAddress_1.checkValidAddress)(address)) === null || _a === void 0 ? void 0 : _a.toLowerCase();
42
+ _this.address = (_a = checkValidAddress(address)) === null || _a === void 0 ? void 0 : _a.toLowerCase();
30
43
  }
31
44
  else {
32
- this.address = (_b = (0, validateAndParseAddress_1.validateAndParseAddress)(address)) === null || _b === void 0 ? void 0 : _b.toLowerCase();
45
+ _this.address = (_b = validateAndParseAddress(address)) === null || _b === void 0 ? void 0 : _b.toLowerCase();
33
46
  }
34
- this.chainId = chainId;
35
- this.url = url;
47
+ _this.chainId = chainId;
48
+ _this.url = url;
49
+ return _this;
36
50
  }
37
- static toSemiFungibleToken(sft) {
51
+ SemiFungibleToken.toSemiFungibleToken = function (sft) {
38
52
  if (!sft) {
39
53
  return undefined;
40
54
  }
41
- const currency = currency_1.Currency.toCurrency(sft.currency);
55
+ var currency = Currency.toCurrency(sft.currency);
42
56
  return new SemiFungibleToken(sft.chainId, sft.address, currency.decimals, currency.symbol, currency.name, sft.url);
43
- }
57
+ };
44
58
  /**
45
59
  * Returns true if the two tokens are equivalent, i.e. have the same chainId and address.
46
60
  * @param other other token to compare
47
61
  */
48
- equals(other) {
62
+ SemiFungibleToken.prototype.equals = function (other) {
49
63
  // short circuit on reference equality
50
64
  if (this === other)
51
65
  return true;
52
66
  return (this.chainId === other.chainId &&
53
67
  this.address === other.address.toLowerCase());
54
- }
68
+ };
55
69
  /**
56
70
  * Returns the currency object that this token represents
57
71
  */
58
- currency() {
72
+ SemiFungibleToken.prototype.currency = function () {
59
73
  return this;
60
- }
61
- type() {
62
- return enums_1.TokenType.SEMI_FUNGIBLE_TOKEN;
63
- }
64
- identifier() {
65
- return `${this.chainId}+${this.address.toLowerCase()}`;
66
- }
67
- }
68
- exports.SemiFungibleToken = SemiFungibleToken;
74
+ };
75
+ SemiFungibleToken.prototype.type = function () {
76
+ return TokenType.SEMI_FUNGIBLE_TOKEN;
77
+ };
78
+ SemiFungibleToken.prototype.identifier = function () {
79
+ return "".concat(this.chainId, "+").concat(this.address.toLowerCase());
80
+ };
81
+ return SemiFungibleToken;
82
+ }(Currency));
83
+ export { SemiFungibleToken };
@@ -1,37 +1,32 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.LibraryRequest = void 0;
7
- const enums_1 = require("../enums");
8
- const tiny_invariant_1 = __importDefault(require("tiny-invariant"));
9
- class LibraryRequest {
10
- constructor(library, client, provider) {
11
- if (library == enums_1.LIBRARY_TYPE.VIEM) {
12
- (0, tiny_invariant_1.default)(client, "CLIENT");
13
- (0, tiny_invariant_1.default)(!provider, "PROVIDER");
1
+ import { LIBRARY_TYPE } from "../enums";
2
+ import invariant from "tiny-invariant";
3
+ var LibraryRequest = /** @class */ (function () {
4
+ function LibraryRequest(library, client, provider) {
5
+ if (library == LIBRARY_TYPE.VIEM) {
6
+ invariant(client, "CLIENT");
7
+ invariant(!provider, "PROVIDER");
14
8
  this.client = client;
15
9
  }
16
- else if (library == enums_1.LIBRARY_TYPE.ETHERS) {
17
- (0, tiny_invariant_1.default)(provider, "PROVIDER");
18
- (0, tiny_invariant_1.default)(!client, "CLIENT");
10
+ else if (library == LIBRARY_TYPE.ETHERS) {
11
+ invariant(provider, "PROVIDER");
12
+ invariant(!client, "CLIENT");
19
13
  this.provider = provider;
20
14
  }
21
15
  else {
22
- (0, tiny_invariant_1.default)(false, "LIBRARY");
16
+ invariant(false, "LIBRARY");
23
17
  }
24
18
  this.library = library;
25
19
  this.client = client;
26
20
  this.provider = provider;
27
21
  }
28
- sendRequest(method, params) {
29
- if (this.library == enums_1.LIBRARY_TYPE.VIEM) {
30
- return this.client.request({ method, params });
22
+ LibraryRequest.prototype.sendRequest = function (method, params) {
23
+ if (this.library == LIBRARY_TYPE.VIEM) {
24
+ return this.client.request({ method: method, params: params });
31
25
  }
32
- else if (this.library == enums_1.LIBRARY_TYPE.ETHERS) {
26
+ else if (this.library == LIBRARY_TYPE.ETHERS) {
33
27
  return this.provider.send(method, params);
34
28
  }
35
- }
36
- }
37
- exports.LibraryRequest = LibraryRequest;
29
+ };
30
+ return LibraryRequest;
31
+ }());
32
+ export { LibraryRequest };
@@ -1,105 +1,112 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.State = void 0;
4
- const fungible_token_amount_1 = require("./financial/fungible_token_amount");
5
- const non_fungible_token_1 = require("./financial/non_fungible_token");
6
- const semi_fungible_token_1 = require("./financial/semi_fungible_token");
7
- class State {
8
- constructor(fungibleTokens, nonFungibleTokens, semiFungibleTokens) {
9
- this.fungibleTokens = fungibleTokens.reduce((acc, amount) => {
1
+ import { FungibleTokenAmount } from "./financial/fungible_token_amount";
2
+ import { NonFungibleToken } from "./financial/non_fungible_token";
3
+ import { SemiFungibleToken } from "./financial/semi_fungible_token";
4
+ var State = /** @class */ (function () {
5
+ function State(fungibleTokens, nonFungibleTokens, semiFungibleTokens) {
6
+ this.fungibleTokens = fungibleTokens.reduce(function (acc, amount) {
10
7
  acc.set(amount.token.identifier(), amount);
11
8
  return acc;
12
9
  }, new Map());
13
- this.nonFungibleTokens = nonFungibleTokens.reduce((acc, token) => {
10
+ this.nonFungibleTokens = nonFungibleTokens.reduce(function (acc, token) {
14
11
  acc.set(token.identifier(), token);
15
12
  return acc;
16
13
  }, new Map());
17
- this.semiFungibleTokens = semiFungibleTokens.reduce((acc, token) => {
14
+ this.semiFungibleTokens = semiFungibleTokens.reduce(function (acc, token) {
18
15
  acc.set(token.identifier(), token);
19
16
  return acc;
20
17
  }, new Map());
21
18
  }
22
- static fromFungibleTokenAmounts(fungibleTokenAmounts) {
19
+ State.fromFungibleTokenAmounts = function (fungibleTokenAmounts) {
23
20
  return new State(fungibleTokenAmounts, [], []);
24
- }
25
- static fromTokenAndAmount(token, amount) {
21
+ };
22
+ State.fromTokenAndAmount = function (token, amount) {
26
23
  if (!token || !amount) {
27
24
  return undefined;
28
25
  }
29
- const fungibleTokenAmount = fungible_token_amount_1.FungibleTokenAmount.fromRawAmount(token, amount);
26
+ var fungibleTokenAmount = FungibleTokenAmount.fromRawAmount(token, amount);
30
27
  return State.fromFungibleTokenAmounts([fungibleTokenAmount]);
31
- }
32
- getFungibleTokens() {
28
+ };
29
+ State.prototype.getFungibleTokens = function () {
33
30
  return Array.from(this.fungibleTokens.values());
34
- }
35
- getNonFungibleTokens() {
31
+ };
32
+ State.prototype.getNonFungibleTokens = function () {
36
33
  return Array.from(this.nonFungibleTokens.values());
37
- }
38
- getSemiFungibleTokens() {
34
+ };
35
+ State.prototype.getSemiFungibleTokens = function () {
39
36
  return Array.from(this.semiFungibleTokens.values());
40
- }
41
- addTokens(fungibleTokens) {
42
- fungibleTokens.forEach((amount) => {
43
- const identifier = amount.token.identifier();
44
- const currentAmount = this.fungibleTokens.get(identifier);
37
+ };
38
+ State.prototype.addTokens = function (fungibleTokens) {
39
+ var _this = this;
40
+ fungibleTokens.forEach(function (amount) {
41
+ var identifier = amount.token.identifier();
42
+ var currentAmount = _this.fungibleTokens.get(identifier);
45
43
  if (currentAmount) {
46
- this.fungibleTokens.set(identifier, currentAmount.add(amount));
44
+ _this.fungibleTokens.set(identifier, currentAmount.add(amount));
47
45
  }
48
46
  else {
49
- this.fungibleTokens.set(identifier, amount);
47
+ _this.fungibleTokens.set(identifier, amount);
50
48
  }
51
49
  });
52
50
  return this;
53
- }
54
- addState(other) {
51
+ };
52
+ State.prototype.addState = function (other) {
53
+ var _this = this;
55
54
  var _a;
56
- (_a = other === null || other === void 0 ? void 0 : other.fungibleTokens) === null || _a === void 0 ? void 0 : _a.forEach((amount) => {
57
- const identifier = amount.token.identifier();
58
- const currentAmount = this.fungibleTokens.get(identifier);
55
+ (_a = other === null || other === void 0 ? void 0 : other.fungibleTokens) === null || _a === void 0 ? void 0 : _a.forEach(function (amount) {
56
+ var identifier = amount.token.identifier();
57
+ var currentAmount = _this.fungibleTokens.get(identifier);
59
58
  if (currentAmount) {
60
- this.fungibleTokens.set(identifier, currentAmount.add(amount));
59
+ _this.fungibleTokens.set(identifier, currentAmount.add(amount));
61
60
  }
62
61
  else {
63
- this.fungibleTokens.set(identifier, amount);
62
+ _this.fungibleTokens.set(identifier, amount);
64
63
  }
65
64
  });
66
65
  return this;
67
- }
68
- deductState(other) {
69
- other.fungibleTokens.forEach((amount) => {
70
- const identifier = amount.token.identifier();
71
- const currentAmount = this.fungibleTokens.get(identifier);
66
+ };
67
+ State.prototype.deductState = function (other) {
68
+ var _this = this;
69
+ other.fungibleTokens.forEach(function (amount) {
70
+ var identifier = amount.token.identifier();
71
+ var currentAmount = _this.fungibleTokens.get(identifier);
72
72
  if ((currentAmount === null || currentAmount === void 0 ? void 0 : currentAmount.toRawAmount()) > (amount === null || amount === void 0 ? void 0 : amount.toRawAmount())) {
73
- this.fungibleTokens.set(identifier, currentAmount.subtract(amount));
73
+ _this.fungibleTokens.set(identifier, currentAmount.subtract(amount));
74
74
  }
75
75
  else if (currentAmount) {
76
- this.fungibleTokens.delete(identifier);
76
+ _this.fungibleTokens.delete(identifier);
77
77
  }
78
78
  });
79
79
  return this;
80
- }
81
- equals(other) {
80
+ };
81
+ State.prototype.equals = function (other) {
82
82
  if (!other) {
83
83
  return false;
84
84
  }
85
85
  return (this.fungibleTokens.size == other.fungibleTokens.size &&
86
- Array.from(this.fungibleTokens.entries()).every(([key, value]) => {
87
- const otherValue = other.fungibleTokens.get(key);
86
+ Array.from(this.fungibleTokens.entries()).every(function (_a) {
87
+ var key = _a[0], value = _a[1];
88
+ var otherValue = other.fungibleTokens.get(key);
88
89
  return otherValue && value.equals(otherValue);
89
90
  }));
90
- }
91
- addStates(states) {
92
- states.forEach((state) => this.addState(state));
91
+ };
92
+ State.prototype.addStates = function (states) {
93
+ var _this = this;
94
+ states.forEach(function (state) { return _this.addState(state); });
93
95
  return this;
94
- }
95
- static mergeStates(states) {
96
- return states.reduce((acc, state) => acc.addState(state), new State([], [], []));
97
- }
98
- static toState(state) {
99
- const fungibleTokenAmounts = state.fungibleTokenAmounts.map((ft) => fungible_token_amount_1.FungibleTokenAmount.toFungibleTokenAmount(ft));
100
- const nonFungibleTokenAmounts = state.nonFungibleTokenAmounts.map((nft) => non_fungible_token_1.NonFungibleToken.toNonFungibleToken(nft));
101
- const semiFungibleTokenAmounts = state.semiFungibleTokenAmounts.map((sft) => semi_fungible_token_1.SemiFungibleToken.toSemiFungibleToken(sft));
96
+ };
97
+ State.mergeStates = function (states) {
98
+ return states.reduce(function (acc, state) { return acc.addState(state); }, new State([], [], []));
99
+ };
100
+ State.toState = function (state) {
101
+ if (!state)
102
+ return undefined;
103
+ var fungibleTokenAmounts = state.fungibleTokenAmounts.map(function (ft) {
104
+ return FungibleTokenAmount.toFungibleTokenAmount(ft);
105
+ });
106
+ var nonFungibleTokenAmounts = state.nonFungibleTokenAmounts.map(function (nft) { return NonFungibleToken.toNonFungibleToken(nft); });
107
+ var semiFungibleTokenAmounts = state.semiFungibleTokenAmounts.map(function (sft) { return SemiFungibleToken.toSemiFungibleToken(sft); });
102
108
  return new State(fungibleTokenAmounts, nonFungibleTokenAmounts, semiFungibleTokenAmounts);
103
- }
104
- }
105
- exports.State = State;
109
+ };
110
+ return State;
111
+ }());
112
+ export { State };
package/dist/enums.js CHANGED
@@ -1,7 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.LIBRARY_TYPE = exports.TimeIntervalUnits = exports.TokenAllowlistType = exports.BlockchainEnvironment = exports.ActivityStatus = exports.Order = exports.QuoteType = exports.OperationStatusType = exports.Category = exports.OperationType = exports.OperationDataFormat = exports.CreateOperationsStatus = exports.ChainSupportStatus = exports.VMType = exports.AccountType = exports.TokenType = exports.Blockchain = void 0;
4
- var Blockchain;
1
+ export var Blockchain;
5
2
  (function (Blockchain) {
6
3
  Blockchain["ETHEREUM"] = "ethereum";
7
4
  Blockchain["POLYGON"] = "polygon";
@@ -27,43 +24,43 @@ var Blockchain;
27
24
  Blockchain["HARDHAT"] = "hardhat";
28
25
  Blockchain["LOCAL_CHAIN_0"] = "local_chain_0";
29
26
  Blockchain["LOCAL_CHAIN_1"] = "local_chain_1";
30
- })(Blockchain || (exports.Blockchain = Blockchain = {}));
31
- var TokenType;
27
+ })(Blockchain || (Blockchain = {}));
28
+ export var TokenType;
32
29
  (function (TokenType) {
33
30
  TokenType["FUNGIBLE_TOKEN"] = "FUNGIBLE_TOKEN";
34
31
  TokenType["NON_FUNGIBLE_TOKEN"] = "NON_FUNGIBLE_TOKEN";
35
32
  TokenType["SEMI_FUNGIBLE_TOKEN"] = "SEMI_FUNGIBLE_TOKEN";
36
33
  TokenType["FIAT"] = "FIAT";
37
- })(TokenType || (exports.TokenType = TokenType = {}));
38
- var AccountType;
34
+ })(TokenType || (TokenType = {}));
35
+ export var AccountType;
39
36
  (function (AccountType) {
40
37
  AccountType["EOA"] = "EOA";
41
38
  AccountType["SCA"] = "SCA";
42
- })(AccountType || (exports.AccountType = AccountType = {}));
43
- var VMType;
39
+ })(AccountType || (AccountType = {}));
40
+ export var VMType;
44
41
  (function (VMType) {
45
42
  VMType["EVM"] = "EVM";
46
- })(VMType || (exports.VMType = VMType = {}));
47
- var ChainSupportStatus;
43
+ })(VMType || (VMType = {}));
44
+ export var ChainSupportStatus;
48
45
  (function (ChainSupportStatus) {
49
46
  ChainSupportStatus["CHAIN_SUPPORTED"] = "CHAIN_SUPPORTED";
50
47
  ChainSupportStatus["CHAIN_UNAVAILABLE"] = "CHAIN_UNAVAILABLE";
51
48
  ChainSupportStatus["ACCOUNT_UNAVAILABLE"] = "ACCOUNT_UNAVAILABLE";
52
- })(ChainSupportStatus || (exports.ChainSupportStatus = ChainSupportStatus = {}));
53
- var CreateOperationsStatus;
49
+ })(ChainSupportStatus || (ChainSupportStatus = {}));
50
+ export var CreateOperationsStatus;
54
51
  (function (CreateOperationsStatus) {
55
52
  CreateOperationsStatus["INSUFFICIENT_FUNDS"] = "INSUFFICIENT_FUNDS";
56
53
  CreateOperationsStatus["INTERNAL"] = "INTERNAL";
57
54
  CreateOperationsStatus["INVALID_ARGUMENT"] = "INVALID_ARGUMENT";
58
55
  CreateOperationsStatus["NO_EXECUTION_PATH"] = "NO_EXECUTION_PATH";
59
56
  CreateOperationsStatus["SUCCESS"] = "SUCCESS";
60
- })(CreateOperationsStatus || (exports.CreateOperationsStatus = CreateOperationsStatus = {}));
61
- var OperationDataFormat;
57
+ })(CreateOperationsStatus || (CreateOperationsStatus = {}));
58
+ export var OperationDataFormat;
62
59
  (function (OperationDataFormat) {
63
60
  OperationDataFormat["TRANSACTION"] = "TRANSACTION";
64
61
  OperationDataFormat["TYPED_DATA"] = "TYPED_DATA";
65
- })(OperationDataFormat || (exports.OperationDataFormat = OperationDataFormat = {}));
66
- var OperationType;
62
+ })(OperationDataFormat || (OperationDataFormat = {}));
63
+ export var OperationType;
67
64
  (function (OperationType) {
68
65
  OperationType["APPROVE_ERC20_TOKEN"] = "APPROVE_ERC20_TOKEN";
69
66
  OperationType["CANCEL_OPERATION"] = "CANCEL_OPERATION";
@@ -72,8 +69,8 @@ var OperationType;
72
69
  OperationType["GAS_ABSTRACTION"] = "GAS_ABSTRACTION";
73
70
  OperationType["NATIVE_TOKEN_TRANSFER"] = "NATIVE_TOKEN_TRANSFER";
74
71
  OperationType["SUBMIT_INTENT"] = "SUBMIT_INTENT";
75
- })(OperationType || (exports.OperationType = OperationType = {}));
76
- var Category;
72
+ })(OperationType || (OperationType = {}));
73
+ export var Category;
77
74
  (function (Category) {
78
75
  Category["SEND"] = "SEND";
79
76
  Category["RECEIVE"] = "RECEIVE";
@@ -82,45 +79,45 @@ var Category;
82
79
  Category["BRIDGE"] = "BRIDGE";
83
80
  Category["FUNCTION_CALL"] = "FUNCTION_CALL";
84
81
  Category["TYPED_DATA_SIGNATURE"] = "TYPED_DATA_SIGNATURE";
85
- })(Category || (exports.Category = Category = {}));
86
- var OperationStatusType;
82
+ })(Category || (Category = {}));
83
+ export var OperationStatusType;
87
84
  (function (OperationStatusType) {
88
85
  OperationStatusType["FAILED"] = "FAILED";
89
86
  OperationStatusType["NOT_FOUND"] = "NOT_FOUND";
90
87
  OperationStatusType["PENDING"] = "PENDING";
91
88
  OperationStatusType["SUCCESSFUL"] = "SUCCESSFUL";
92
89
  OperationStatusType["WAITING_PRECONDITION"] = "WAITING_PRECONDITION";
93
- })(OperationStatusType || (exports.OperationStatusType = OperationStatusType = {}));
94
- var QuoteType;
90
+ })(OperationStatusType || (OperationStatusType = {}));
91
+ export var QuoteType;
95
92
  (function (QuoteType) {
96
93
  QuoteType["EXACT_INPUT"] = "EXACT_INPUT";
97
94
  QuoteType["EXACT_OUTPUT"] = "EXACT_OUTPUT";
98
- })(QuoteType || (exports.QuoteType = QuoteType = {}));
99
- var Order;
95
+ })(QuoteType || (QuoteType = {}));
96
+ export var Order;
100
97
  (function (Order) {
101
98
  Order["NEWEST"] = "NEWEST";
102
99
  Order["OLDEST"] = "OLDEST";
103
- })(Order || (exports.Order = Order = {}));
104
- var ActivityStatus;
100
+ })(Order || (Order = {}));
101
+ export var ActivityStatus;
105
102
  (function (ActivityStatus) {
106
103
  ActivityStatus["CANCELLED"] = "CANCELLED";
107
104
  ActivityStatus["FAILED"] = "FAILED";
108
105
  ActivityStatus["PENDING"] = "PENDING";
109
106
  ActivityStatus["SUCCESS"] = "SUCCESS";
110
- })(ActivityStatus || (exports.ActivityStatus = ActivityStatus = {}));
111
- var BlockchainEnvironment;
107
+ })(ActivityStatus || (ActivityStatus = {}));
108
+ export var BlockchainEnvironment;
112
109
  (function (BlockchainEnvironment) {
113
110
  BlockchainEnvironment["MAINNET"] = "MAINNET";
114
111
  BlockchainEnvironment["TESTNET"] = "TESTNET";
115
- })(BlockchainEnvironment || (exports.BlockchainEnvironment = BlockchainEnvironment = {}));
116
- var TokenAllowlistType;
112
+ })(BlockchainEnvironment || (BlockchainEnvironment = {}));
113
+ export var TokenAllowlistType;
117
114
  (function (TokenAllowlistType) {
118
115
  TokenAllowlistType["ALL_TOKENS"] = "ALL_TOKENS";
119
116
  TokenAllowlistType["ONLY_FUNGIBLE_TOKENS"] = "ONLY_FUNGIBLE_TOKENS";
120
117
  TokenAllowlistType["ONLY_NON_FUNGIBLE_TOKENS"] = "ONLY_NON_FUNGIBLE_TOKENS";
121
118
  TokenAllowlistType["ONLY_SEMI_FUNGIBLE_TOKENS"] = "ONLY_SEMI_FUNGIBLE_TOKENS";
122
- })(TokenAllowlistType || (exports.TokenAllowlistType = TokenAllowlistType = {}));
123
- var TimeIntervalUnits;
119
+ })(TokenAllowlistType || (TokenAllowlistType = {}));
120
+ export var TimeIntervalUnits;
124
121
  (function (TimeIntervalUnits) {
125
122
  TimeIntervalUnits["DAYS"] = "DAYS";
126
123
  TimeIntervalUnits["FOREVER"] = "FOREVER";
@@ -129,9 +126,9 @@ var TimeIntervalUnits;
129
126
  TimeIntervalUnits["MONTHS"] = "MONTHS";
130
127
  TimeIntervalUnits["WEEKS"] = "WEEKS";
131
128
  TimeIntervalUnits["YEARS"] = "YEARS";
132
- })(TimeIntervalUnits || (exports.TimeIntervalUnits = TimeIntervalUnits = {}));
133
- var LIBRARY_TYPE;
129
+ })(TimeIntervalUnits || (TimeIntervalUnits = {}));
130
+ export var LIBRARY_TYPE;
134
131
  (function (LIBRARY_TYPE) {
135
132
  LIBRARY_TYPE["VIEM"] = "VIEM";
136
133
  LIBRARY_TYPE["ETHERS"] = "ETHERS";
137
- })(LIBRARY_TYPE || (exports.LIBRARY_TYPE = LIBRARY_TYPE = {}));
134
+ })(LIBRARY_TYPE || (LIBRARY_TYPE = {}));
package/dist/index.js CHANGED
@@ -1,47 +1,31 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
1
  // interfaces
18
- __exportStar(require("./interfaces/account_cluster"), exports);
19
- __exportStar(require("./interfaces/admin"), exports);
20
- __exportStar(require("./interfaces/application"), exports);
21
- __exportStar(require("./interfaces/instance"), exports);
22
- __exportStar(require("./interfaces/operation"), exports);
23
- __exportStar(require("./interfaces/token"), exports);
24
- __exportStar(require("./interfaces/orby"), exports);
2
+ export * from "./interfaces/account_cluster";
3
+ export * from "./interfaces/admin";
4
+ export * from "./interfaces/application";
5
+ export * from "./interfaces/instance";
6
+ export * from "./interfaces/operation";
7
+ export * from "./interfaces/token";
8
+ export * from "./interfaces/orby";
25
9
  // actions
26
- __exportStar(require("./actions/account_cluster"), exports);
27
- __exportStar(require("./actions/admin"), exports);
28
- __exportStar(require("./actions/application"), exports);
29
- __exportStar(require("./actions/instance"), exports);
30
- __exportStar(require("./actions/operation"), exports);
31
- __exportStar(require("./actions/token"), exports);
10
+ export * from "./actions/account_cluster";
11
+ export * from "./actions/admin";
12
+ export * from "./actions/application";
13
+ export * from "./actions/instance";
14
+ export * from "./actions/operation";
15
+ export * from "./actions/token";
32
16
  // entities
33
- __exportStar(require("./entities/financial/account_balance"), exports);
34
- __exportStar(require("./entities/financial/asset"), exports);
35
- __exportStar(require("./entities/financial/currency_amount"), exports);
36
- __exportStar(require("./entities/financial/currency"), exports);
37
- __exportStar(require("./entities/financial/fungible_token_amount"), exports);
38
- __exportStar(require("./entities/financial/fungible_token"), exports);
39
- __exportStar(require("./entities/financial/non_fungible_token"), exports);
40
- __exportStar(require("./entities/financial/semi_fungible_token"), exports);
41
- __exportStar(require("./entities/account"), exports);
42
- __exportStar(require("./entities/state"), exports);
17
+ export * from "./entities/financial/account_balance";
18
+ export * from "./entities/financial/asset";
19
+ export * from "./entities/financial/currency_amount";
20
+ export * from "./entities/financial/currency";
21
+ export * from "./entities/financial/fungible_token_amount";
22
+ export * from "./entities/financial/fungible_token";
23
+ export * from "./entities/financial/non_fungible_token";
24
+ export * from "./entities/financial/semi_fungible_token";
25
+ export * from "./entities/account";
26
+ export * from "./entities/state";
43
27
  // enums, types and constants
44
- __exportStar(require("./enums"), exports);
45
- __exportStar(require("./types"), exports);
46
- __exportStar(require("./constants"), exports);
47
- __exportStar(require("./utils/utils"), exports);
28
+ export * from "./enums";
29
+ export * from "./types";
30
+ export * from "./constants";
31
+ export * from "./utils/utils";
@@ -18,5 +18,5 @@ export interface IAccountClusterActions {
18
18
  }[]): Promise<Activity[]>;
19
19
  getPortfolioOverview(accountClusterId: string): Promise<FungibleTokenOverview>;
20
20
  getFungibleTokenPortfolio(accountClusterId: string): Promise<StandardizedBalance[]>;
21
- getFungibleTokenBalances(accountClusterId: string, offset?: number, limit?: number, tokensToOmit?: string[]): Promise<StandardizedBalance[]>;
21
+ getFungibleTokenBalances(accountClusterId: string, offset?: number, limit?: number, chainId?: bigint, tokensToOmit?: string[]): Promise<StandardizedBalance[]>;
22
22
  }
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};