@orb-labs/orby-core 0.0.6 → 0.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/dist/actions/account_cluster.d.ts +12 -5
- package/dist/actions/account_cluster.js +185 -338
- package/dist/actions/admin.d.ts +3 -3
- package/dist/actions/admin.js +37 -127
- package/dist/actions/application.d.ts +2 -2
- package/dist/actions/application.js +14 -77
- package/dist/actions/blockchain.d.ts +16 -0
- package/dist/actions/blockchain.js +35 -0
- package/dist/actions/instance.d.ts +3 -4
- package/dist/actions/instance.js +90 -255
- package/dist/actions/operation.d.ts +19 -10
- package/dist/actions/operation.js +323 -259
- package/dist/actions/token.d.ts +3 -3
- package/dist/actions/token.js +43 -119
- package/dist/constants.d.ts +3 -3
- package/dist/constants.js +70 -71
- package/dist/entities/account.d.ts +1 -1
- package/dist/entities/account.js +25 -30
- package/dist/entities/financial/account_balance.d.ts +2 -2
- package/dist/entities/financial/account_balance.js +20 -22
- package/dist/entities/financial/asset.js +13 -15
- package/dist/entities/financial/currency.d.ts +1 -1
- package/dist/entities/financial/currency.js +16 -35
- package/dist/entities/financial/currency_amount.d.ts +1 -1
- package/dist/entities/financial/currency_amount.js +49 -71
- package/dist/entities/financial/fungible_token.d.ts +3 -3
- package/dist/entities/financial/fungible_token.js +31 -52
- package/dist/entities/financial/fungible_token_amount.d.ts +2 -2
- package/dist/entities/financial/fungible_token_amount.js +53 -75
- package/dist/entities/financial/non_fungible_token.d.ts +2 -2
- package/dist/entities/financial/non_fungible_token.js +25 -45
- package/dist/entities/financial/semi_fungible_token.d.ts +2 -2
- package/dist/entities/financial/semi_fungible_token.js +25 -45
- package/dist/entities/library_request.d.ts +1 -1
- package/dist/entities/library_request.js +7 -9
- package/dist/entities/state.d.ts +4 -4
- package/dist/entities/state.js +57 -67
- package/dist/index.d.ts +29 -27
- package/dist/index.js +29 -27
- package/dist/interfaces/account_cluster.d.ts +11 -4
- package/dist/interfaces/admin.d.ts +1 -1
- package/dist/interfaces/blockchain.d.ts +13 -0
- package/dist/interfaces/blockchain.js +1 -0
- package/dist/interfaces/instance.d.ts +1 -2
- package/dist/interfaces/operation.d.ts +25 -10
- package/dist/interfaces/orby.d.ts +8 -7
- package/dist/interfaces/token.d.ts +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types.d.ts +9 -9
- package/dist/utils/action_helpers.d.ts +1 -1
- package/dist/utils/action_helpers.js +43 -63
- package/dist/utils/utils.d.ts +2 -1
- package/dist/utils/utils.js +23 -19
- package/dist/utils/validateAndParseAddress.js +3 -3
- package/package.json +4 -2
@@ -1,26 +1,10 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
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 { Asset } from "./asset";
|
17
|
-
import { checkValidAddress, validateAndParseAddress, } from "../../utils/validateAndParseAddress";
|
18
|
-
import { TokenType } from "../../enums";
|
1
|
+
import { Asset } from "./asset.js";
|
2
|
+
import { checkValidAddress, validateAndParseAddress, } from "../../utils/validateAndParseAddress.js";
|
3
|
+
import { TokenType } from "../../enums.js";
|
19
4
|
/**
|
20
5
|
* Represents an ERC721 token with a unique address and some metadata.
|
21
6
|
*/
|
22
|
-
|
23
|
-
__extends(NonFungibleToken, _super);
|
7
|
+
export class NonFungibleToken extends Asset {
|
24
8
|
/**
|
25
9
|
* @param chainId The chain ID on which this token resides
|
26
10
|
* @param address The contract address on the chain on which this token lives
|
@@ -29,53 +13,49 @@ var NonFungibleToken = /** @class */ (function (_super) {
|
|
29
13
|
* @param url The URL of the token's metadata
|
30
14
|
* @param bypassChecksum If true it only checks for length === 42, startsWith 0x and contains only hex characters
|
31
15
|
*/
|
32
|
-
|
16
|
+
constructor(chainId, address, symbol, name, url, bypassChecksum, coinGeckoId) {
|
33
17
|
// TODO(felix): add this back
|
34
18
|
// invariant(!_.isUndefined(getBlockchainFromBlockchainId(chainId)), "CHAIN_ID");
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
_this.isToken = true;
|
19
|
+
super(symbol, name, coinGeckoId);
|
20
|
+
this.isNative = false;
|
21
|
+
this.isToken = true;
|
39
22
|
if (bypassChecksum) {
|
40
|
-
|
23
|
+
this.address = checkValidAddress(address)?.toLowerCase();
|
41
24
|
}
|
42
25
|
else {
|
43
|
-
|
26
|
+
this.address = validateAndParseAddress(address)?.toLowerCase();
|
44
27
|
}
|
45
|
-
|
46
|
-
|
47
|
-
return _this;
|
28
|
+
this.chainId = chainId;
|
29
|
+
this.url = url;
|
48
30
|
}
|
49
|
-
|
31
|
+
static toNonFungibleToken(nft) {
|
50
32
|
if (!nft) {
|
51
33
|
return undefined;
|
52
34
|
}
|
53
|
-
|
35
|
+
const asset = Asset.toAsset(nft.asset);
|
54
36
|
return new NonFungibleToken(nft.chainId, nft.address, asset.symbol, asset.name, nft.url);
|
55
|
-
}
|
37
|
+
}
|
56
38
|
/**
|
57
39
|
* Returns true if the two tokens are equivalent, i.e. have the same chainId and address.
|
58
40
|
* @param other other token to compare
|
59
41
|
*/
|
60
|
-
|
42
|
+
equals(other) {
|
61
43
|
// short circuit on reference equality
|
62
44
|
if (this === other)
|
63
45
|
return true;
|
64
46
|
return (this.chainId === other.chainId &&
|
65
47
|
this.address === other.address.toLowerCase());
|
66
|
-
}
|
48
|
+
}
|
67
49
|
/**
|
68
50
|
* Returns the asset representation of this currency
|
69
51
|
*/
|
70
|
-
|
52
|
+
asset() {
|
71
53
|
return this;
|
72
|
-
}
|
73
|
-
|
54
|
+
}
|
55
|
+
type() {
|
74
56
|
return TokenType.NON_FUNGIBLE_TOKEN;
|
75
|
-
}
|
76
|
-
|
77
|
-
return
|
78
|
-
}
|
79
|
-
|
80
|
-
}(Asset));
|
81
|
-
export { NonFungibleToken };
|
57
|
+
}
|
58
|
+
identifier() {
|
59
|
+
return `${this.chainId}+${this.address.toLowerCase()}`;
|
60
|
+
}
|
61
|
+
}
|
@@ -1,26 +1,10 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
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";
|
1
|
+
import { Currency } from "./currency.js";
|
2
|
+
import { checkValidAddress, validateAndParseAddress, } from "../../utils/validateAndParseAddress.js";
|
3
|
+
import { TokenType } from "../../enums.js";
|
19
4
|
/**
|
20
5
|
* Represents an ERC1155 token with a unique address and some metadata.
|
21
6
|
*/
|
22
|
-
|
23
|
-
__extends(SemiFungibleToken, _super);
|
7
|
+
export class SemiFungibleToken extends Currency {
|
24
8
|
/**
|
25
9
|
*
|
26
10
|
* @param chainId The chain ID on which this token resides
|
@@ -31,53 +15,49 @@ var SemiFungibleToken = /** @class */ (function (_super) {
|
|
31
15
|
* @param url The URL of the token's metadata
|
32
16
|
* @param bypassChecksum If true it only checks for length === 42, startsWith 0x and contains only hex characters
|
33
17
|
*/
|
34
|
-
|
18
|
+
constructor(chainId, address, decimals, symbol, name, url, bypassChecksum, coinGeckoId) {
|
35
19
|
// TODO(felix): add this back
|
36
20
|
// invariant(!_.isUndefined(getBlockchainFromBlockchainId(chainId)), "CHAIN_ID");
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
_this.isToken = true;
|
21
|
+
super(decimals, symbol, name, url, false, true, coinGeckoId);
|
22
|
+
this.isNative = false;
|
23
|
+
this.isToken = true;
|
41
24
|
if (bypassChecksum) {
|
42
|
-
|
25
|
+
this.address = checkValidAddress(address)?.toLowerCase();
|
43
26
|
}
|
44
27
|
else {
|
45
|
-
|
28
|
+
this.address = validateAndParseAddress(address)?.toLowerCase();
|
46
29
|
}
|
47
|
-
|
48
|
-
|
49
|
-
return _this;
|
30
|
+
this.chainId = chainId;
|
31
|
+
this.url = url;
|
50
32
|
}
|
51
|
-
|
33
|
+
static toSemiFungibleToken(sft) {
|
52
34
|
if (!sft) {
|
53
35
|
return undefined;
|
54
36
|
}
|
55
|
-
|
37
|
+
const currency = Currency.toCurrency(sft.currency);
|
56
38
|
return new SemiFungibleToken(sft.chainId, sft.address, currency.decimals, currency.symbol, currency.name, sft.url);
|
57
|
-
}
|
39
|
+
}
|
58
40
|
/**
|
59
41
|
* Returns true if the two tokens are equivalent, i.e. have the same chainId and address.
|
60
42
|
* @param other other token to compare
|
61
43
|
*/
|
62
|
-
|
44
|
+
equals(other) {
|
63
45
|
// short circuit on reference equality
|
64
46
|
if (this === other)
|
65
47
|
return true;
|
66
48
|
return (this.chainId === other.chainId &&
|
67
49
|
this.address === other.address.toLowerCase());
|
68
|
-
}
|
50
|
+
}
|
69
51
|
/**
|
70
52
|
* Returns the currency object that this token represents
|
71
53
|
*/
|
72
|
-
|
54
|
+
currency() {
|
73
55
|
return this;
|
74
|
-
}
|
75
|
-
|
56
|
+
}
|
57
|
+
type() {
|
76
58
|
return TokenType.SEMI_FUNGIBLE_TOKEN;
|
77
|
-
}
|
78
|
-
|
79
|
-
return
|
80
|
-
}
|
81
|
-
|
82
|
-
}(Currency));
|
83
|
-
export { SemiFungibleToken };
|
59
|
+
}
|
60
|
+
identifier() {
|
61
|
+
return `${this.chainId}+${this.address.toLowerCase()}`;
|
62
|
+
}
|
63
|
+
}
|
@@ -1,7 +1,7 @@
|
|
1
|
-
import { LIBRARY_TYPE } from "../enums";
|
1
|
+
import { LIBRARY_TYPE } from "../enums.js";
|
2
2
|
import invariant from "tiny-invariant";
|
3
|
-
|
4
|
-
|
3
|
+
export class LibraryRequest {
|
4
|
+
constructor(library, client, provider) {
|
5
5
|
if (library == LIBRARY_TYPE.VIEM) {
|
6
6
|
invariant(client, "CLIENT");
|
7
7
|
invariant(!provider, "PROVIDER");
|
@@ -19,14 +19,12 @@ var LibraryRequest = /** @class */ (function () {
|
|
19
19
|
this.client = client;
|
20
20
|
this.provider = provider;
|
21
21
|
}
|
22
|
-
|
22
|
+
sendRequest(method, params) {
|
23
23
|
if (this.library == LIBRARY_TYPE.VIEM) {
|
24
|
-
return this.client.request({ method
|
24
|
+
return this.client.request({ method, params });
|
25
25
|
}
|
26
26
|
else if (this.library == LIBRARY_TYPE.ETHERS) {
|
27
27
|
return this.provider.send(method, params);
|
28
28
|
}
|
29
|
-
}
|
30
|
-
|
31
|
-
}());
|
32
|
-
export { LibraryRequest };
|
29
|
+
}
|
30
|
+
}
|
package/dist/entities/state.d.ts
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
import { FungibleToken } from "./financial/fungible_token";
|
2
|
-
import { FungibleTokenAmount } from "./financial/fungible_token_amount";
|
3
|
-
import { NonFungibleToken } from "./financial/non_fungible_token";
|
4
|
-
import { SemiFungibleToken } from "./financial/semi_fungible_token";
|
1
|
+
import { FungibleToken } from "./financial/fungible_token.js";
|
2
|
+
import { FungibleTokenAmount } from "./financial/fungible_token_amount.js";
|
3
|
+
import { NonFungibleToken } from "./financial/non_fungible_token.js";
|
4
|
+
import { SemiFungibleToken } from "./financial/semi_fungible_token.js";
|
5
5
|
export declare class State {
|
6
6
|
private readonly fungibleTokens;
|
7
7
|
private readonly nonFungibleTokens;
|
package/dist/entities/state.js
CHANGED
@@ -1,112 +1,102 @@
|
|
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
|
-
|
5
|
-
|
6
|
-
this.fungibleTokens = fungibleTokens.reduce(
|
1
|
+
import { FungibleTokenAmount } from "./financial/fungible_token_amount.js";
|
2
|
+
import { NonFungibleToken } from "./financial/non_fungible_token.js";
|
3
|
+
import { SemiFungibleToken } from "./financial/semi_fungible_token.js";
|
4
|
+
export class State {
|
5
|
+
constructor(fungibleTokens, nonFungibleTokens, semiFungibleTokens) {
|
6
|
+
this.fungibleTokens = fungibleTokens.reduce((acc, amount) => {
|
7
7
|
acc.set(amount.token.identifier(), amount);
|
8
8
|
return acc;
|
9
9
|
}, new Map());
|
10
|
-
this.nonFungibleTokens = nonFungibleTokens.reduce(
|
10
|
+
this.nonFungibleTokens = nonFungibleTokens.reduce((acc, token) => {
|
11
11
|
acc.set(token.identifier(), token);
|
12
12
|
return acc;
|
13
13
|
}, new Map());
|
14
|
-
this.semiFungibleTokens = semiFungibleTokens.reduce(
|
14
|
+
this.semiFungibleTokens = semiFungibleTokens.reduce((acc, token) => {
|
15
15
|
acc.set(token.identifier(), token);
|
16
16
|
return acc;
|
17
17
|
}, new Map());
|
18
18
|
}
|
19
|
-
|
19
|
+
static fromFungibleTokenAmounts(fungibleTokenAmounts) {
|
20
20
|
return new State(fungibleTokenAmounts, [], []);
|
21
|
-
}
|
22
|
-
|
21
|
+
}
|
22
|
+
static fromTokenAndAmount(token, amount) {
|
23
23
|
if (!token || !amount) {
|
24
24
|
return undefined;
|
25
25
|
}
|
26
|
-
|
26
|
+
const fungibleTokenAmount = FungibleTokenAmount.fromRawAmount(token, amount);
|
27
27
|
return State.fromFungibleTokenAmounts([fungibleTokenAmount]);
|
28
|
-
}
|
29
|
-
|
28
|
+
}
|
29
|
+
getFungibleTokens() {
|
30
30
|
return Array.from(this.fungibleTokens.values());
|
31
|
-
}
|
32
|
-
|
31
|
+
}
|
32
|
+
getNonFungibleTokens() {
|
33
33
|
return Array.from(this.nonFungibleTokens.values());
|
34
|
-
}
|
35
|
-
|
34
|
+
}
|
35
|
+
getSemiFungibleTokens() {
|
36
36
|
return Array.from(this.semiFungibleTokens.values());
|
37
|
-
}
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
var currentAmount = _this.fungibleTokens.get(identifier);
|
37
|
+
}
|
38
|
+
addTokens(fungibleTokens) {
|
39
|
+
fungibleTokens.forEach((amount) => {
|
40
|
+
const identifier = amount.token.identifier();
|
41
|
+
const currentAmount = this.fungibleTokens.get(identifier);
|
43
42
|
if (currentAmount) {
|
44
|
-
|
43
|
+
this.fungibleTokens.set(identifier, currentAmount.add(amount));
|
45
44
|
}
|
46
45
|
else {
|
47
|
-
|
46
|
+
this.fungibleTokens.set(identifier, amount);
|
48
47
|
}
|
49
48
|
});
|
50
49
|
return this;
|
51
|
-
}
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
var identifier = amount.token.identifier();
|
57
|
-
var currentAmount = _this.fungibleTokens.get(identifier);
|
50
|
+
}
|
51
|
+
addState(other) {
|
52
|
+
other?.fungibleTokens?.forEach((amount) => {
|
53
|
+
const identifier = amount.token.identifier();
|
54
|
+
const currentAmount = this.fungibleTokens.get(identifier);
|
58
55
|
if (currentAmount) {
|
59
|
-
|
56
|
+
this.fungibleTokens.set(identifier, currentAmount.add(amount));
|
60
57
|
}
|
61
58
|
else {
|
62
|
-
|
59
|
+
this.fungibleTokens.set(identifier, amount);
|
63
60
|
}
|
64
61
|
});
|
65
62
|
return this;
|
66
|
-
}
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
_this.fungibleTokens.set(identifier, currentAmount.subtract(amount));
|
63
|
+
}
|
64
|
+
deductState(other) {
|
65
|
+
other.fungibleTokens.forEach((amount) => {
|
66
|
+
const identifier = amount.token.identifier();
|
67
|
+
const currentAmount = this.fungibleTokens.get(identifier);
|
68
|
+
if (currentAmount?.toRawAmount() > amount?.toRawAmount()) {
|
69
|
+
this.fungibleTokens.set(identifier, currentAmount.subtract(amount));
|
74
70
|
}
|
75
71
|
else if (currentAmount) {
|
76
|
-
|
72
|
+
this.fungibleTokens.delete(identifier);
|
77
73
|
}
|
78
74
|
});
|
79
75
|
return this;
|
80
|
-
}
|
81
|
-
|
76
|
+
}
|
77
|
+
equals(other) {
|
82
78
|
if (!other) {
|
83
79
|
return false;
|
84
80
|
}
|
85
81
|
return (this.fungibleTokens.size == other.fungibleTokens.size &&
|
86
|
-
Array.from(this.fungibleTokens.entries()).every(
|
87
|
-
|
88
|
-
var otherValue = other.fungibleTokens.get(key);
|
82
|
+
Array.from(this.fungibleTokens.entries()).every(([key, value]) => {
|
83
|
+
const otherValue = other.fungibleTokens.get(key);
|
89
84
|
return otherValue && value.equals(otherValue);
|
90
85
|
}));
|
91
|
-
}
|
92
|
-
|
93
|
-
|
94
|
-
states.forEach(function (state) { return _this.addState(state); });
|
86
|
+
}
|
87
|
+
addStates(states) {
|
88
|
+
states.forEach((state) => this.addState(state));
|
95
89
|
return this;
|
96
|
-
}
|
97
|
-
|
98
|
-
return states.reduce(
|
99
|
-
}
|
100
|
-
|
90
|
+
}
|
91
|
+
static mergeStates(states) {
|
92
|
+
return states.reduce((acc, state) => acc.addState(state), new State([], [], []));
|
93
|
+
}
|
94
|
+
static toState(state) {
|
101
95
|
if (!state)
|
102
96
|
return undefined;
|
103
|
-
|
104
|
-
|
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); });
|
97
|
+
const fungibleTokenAmounts = state.fungibleTokenAmounts.map((ft) => FungibleTokenAmount.toFungibleTokenAmount(ft));
|
98
|
+
const nonFungibleTokenAmounts = state.nonFungibleTokenAmounts.map((nft) => NonFungibleToken.toNonFungibleToken(nft));
|
99
|
+
const semiFungibleTokenAmounts = state.semiFungibleTokenAmounts.map((sft) => SemiFungibleToken.toSemiFungibleToken(sft));
|
108
100
|
return new State(fungibleTokenAmounts, nonFungibleTokenAmounts, semiFungibleTokenAmounts);
|
109
|
-
}
|
110
|
-
|
111
|
-
}());
|
112
|
-
export { State };
|
101
|
+
}
|
102
|
+
}
|
package/dist/index.d.ts
CHANGED
@@ -1,27 +1,29 @@
|
|
1
|
-
export * from "./interfaces/account_cluster";
|
2
|
-
export * from "./interfaces/admin";
|
3
|
-
export * from "./interfaces/application";
|
4
|
-
export * from "./interfaces/instance";
|
5
|
-
export * from "./interfaces/operation";
|
6
|
-
export * from "./interfaces/token";
|
7
|
-
export * from "./interfaces/orby";
|
8
|
-
export * from "./
|
9
|
-
export * from "./actions/
|
10
|
-
export * from "./actions/
|
11
|
-
export * from "./actions/
|
12
|
-
export * from "./actions/
|
13
|
-
export * from "./actions/
|
14
|
-
export * from "./
|
15
|
-
export * from "./
|
16
|
-
export * from "./entities/financial/
|
17
|
-
export * from "./entities/financial/
|
18
|
-
export * from "./entities/financial/
|
19
|
-
export * from "./entities/financial/
|
20
|
-
export * from "./entities/financial/
|
21
|
-
export * from "./entities/financial/
|
22
|
-
export * from "./entities/
|
23
|
-
export * from "./entities/
|
24
|
-
export * from "./
|
25
|
-
export * from "./
|
26
|
-
export * from "./
|
27
|
-
export * from "./
|
1
|
+
export * from "./interfaces/account_cluster.js";
|
2
|
+
export * from "./interfaces/admin.js";
|
3
|
+
export * from "./interfaces/application.js";
|
4
|
+
export * from "./interfaces/instance.js";
|
5
|
+
export * from "./interfaces/operation.js";
|
6
|
+
export * from "./interfaces/token.js";
|
7
|
+
export * from "./interfaces/orby.js";
|
8
|
+
export * from "./interfaces/blockchain.js";
|
9
|
+
export * from "./actions/account_cluster.js";
|
10
|
+
export * from "./actions/admin.js";
|
11
|
+
export * from "./actions/application.js";
|
12
|
+
export * from "./actions/instance.js";
|
13
|
+
export * from "./actions/operation.js";
|
14
|
+
export * from "./actions/token.js";
|
15
|
+
export * from "./actions/blockchain.js";
|
16
|
+
export * from "./entities/financial/account_balance.js";
|
17
|
+
export * from "./entities/financial/asset.js";
|
18
|
+
export * from "./entities/financial/currency_amount.js";
|
19
|
+
export * from "./entities/financial/currency.js";
|
20
|
+
export * from "./entities/financial/fungible_token_amount.js";
|
21
|
+
export * from "./entities/financial/fungible_token.js";
|
22
|
+
export * from "./entities/financial/non_fungible_token.js";
|
23
|
+
export * from "./entities/financial/semi_fungible_token.js";
|
24
|
+
export * from "./entities/account.js";
|
25
|
+
export * from "./entities/state.js";
|
26
|
+
export * from "./enums.js";
|
27
|
+
export * from "./types.js";
|
28
|
+
export * from "./constants.js";
|
29
|
+
export * from "./utils/utils.js";
|
package/dist/index.js
CHANGED
@@ -1,31 +1,33 @@
|
|
1
1
|
// interfaces
|
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";
|
2
|
+
export * from "./interfaces/account_cluster.js";
|
3
|
+
export * from "./interfaces/admin.js";
|
4
|
+
export * from "./interfaces/application.js";
|
5
|
+
export * from "./interfaces/instance.js";
|
6
|
+
export * from "./interfaces/operation.js";
|
7
|
+
export * from "./interfaces/token.js";
|
8
|
+
export * from "./interfaces/orby.js";
|
9
|
+
export * from "./interfaces/blockchain.js";
|
9
10
|
// actions
|
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";
|
11
|
+
export * from "./actions/account_cluster.js";
|
12
|
+
export * from "./actions/admin.js";
|
13
|
+
export * from "./actions/application.js";
|
14
|
+
export * from "./actions/instance.js";
|
15
|
+
export * from "./actions/operation.js";
|
16
|
+
export * from "./actions/token.js";
|
17
|
+
export * from "./actions/blockchain.js";
|
16
18
|
// entities
|
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";
|
19
|
+
export * from "./entities/financial/account_balance.js";
|
20
|
+
export * from "./entities/financial/asset.js";
|
21
|
+
export * from "./entities/financial/currency_amount.js";
|
22
|
+
export * from "./entities/financial/currency.js";
|
23
|
+
export * from "./entities/financial/fungible_token_amount.js";
|
24
|
+
export * from "./entities/financial/fungible_token.js";
|
25
|
+
export * from "./entities/financial/non_fungible_token.js";
|
26
|
+
export * from "./entities/financial/semi_fungible_token.js";
|
27
|
+
export * from "./entities/account.js";
|
28
|
+
export * from "./entities/state.js";
|
27
29
|
// enums, types and constants
|
28
|
-
export * from "./enums";
|
29
|
-
export * from "./types";
|
30
|
-
export * from "./constants";
|
31
|
-
export * from "./utils/utils";
|
30
|
+
export * from "./enums.js";
|
31
|
+
export * from "./types.js";
|
32
|
+
export * from "./constants.js";
|
33
|
+
export * from "./utils/utils.js";
|
@@ -1,6 +1,6 @@
|
|
1
|
-
import { Account } from "../entities/account";
|
2
|
-
import { AccountCluster, Activity, ChainEndpoint, FungibleTokenOverview, StandardizedBalance } from "../types";
|
3
|
-
import { ChainSupportStatus, Order } from "../enums";
|
1
|
+
import { Account } from "../entities/account.js";
|
2
|
+
import { AccountCluster, Activity, ChainEndpoint, FungibleTokenOverview, StandardizedBalance } from "../types.js";
|
3
|
+
import { ChainSupportStatus, Order } from "../enums.js";
|
4
4
|
export interface IAccountClusterActions {
|
5
5
|
createAccountCluster(accounts: Account[]): Promise<AccountCluster>;
|
6
6
|
addToAccountCluster(accounts: Account[], accountClusterId: string): Promise<AccountCluster>;
|
@@ -15,7 +15,14 @@ export interface IAccountClusterActions {
|
|
15
15
|
getActivity(accountClusterId: string, limit?: number, offset?: number, order?: Order, startDate?: number, endDate?: number, filters?: {
|
16
16
|
transactionHash?: string;
|
17
17
|
address?: string;
|
18
|
-
}[]): Promise<
|
18
|
+
}[]): Promise<{
|
19
|
+
activities: Activity[];
|
20
|
+
pageInfo: {
|
21
|
+
hasNextPage: boolean;
|
22
|
+
hasPreviousPage: boolean;
|
23
|
+
totalCount: number;
|
24
|
+
};
|
25
|
+
}>;
|
19
26
|
getPortfolioOverview(accountClusterId: string): Promise<FungibleTokenOverview>;
|
20
27
|
getFungibleTokenPortfolio(accountClusterId: string): Promise<StandardizedBalance[]>;
|
21
28
|
getFungibleTokenBalances(accountClusterId: string, offset?: number, limit?: number, chainId?: bigint, tokensToOmit?: string[]): Promise<StandardizedBalance[]>;
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import { BlockchainInformation } from "../types.js";
|
2
|
+
export interface IBlockchainActions {
|
3
|
+
getBlockchainInformation(chainId: bigint): Promise<BlockchainInformation>;
|
4
|
+
listBlockchainsInformation(offset?: number, limit?: number): Promise<{
|
5
|
+
blockchains: BlockchainInformation[];
|
6
|
+
pageInfo: {
|
7
|
+
hasNextPage: boolean;
|
8
|
+
hasPreviousPage: boolean;
|
9
|
+
totalCount: number;
|
10
|
+
};
|
11
|
+
}>;
|
12
|
+
getChainsSupportedByDefault(chainId: bigint): Promise<BlockchainInformation[]>;
|
13
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -1,9 +1,8 @@
|
|
1
|
-
import {
|
1
|
+
import { ChainEndpoint, GasSponsorshipPolicy } from "../types.js";
|
2
2
|
export interface IInstanceActions {
|
3
3
|
setCustomChainEndpointsForInstance(chainEndpoints: ChainEndpoint[]): Promise<boolean>;
|
4
4
|
removeCustomChainEndpointForInstance(chainIds: bigint[]): Promise<boolean>;
|
5
5
|
getCustomChainEndpointsForInstance(returnChainIdsOnly: boolean): Promise<boolean>;
|
6
|
-
getChainsSupportedByDefault(): Promise<BlockchainInformation[]>;
|
7
6
|
enabledChainAbstractionForInstance(enable: boolean): Promise<boolean>;
|
8
7
|
enableGasSponsorshipForInstance(enable: boolean): Promise<boolean>;
|
9
8
|
getGasSponsorForInstance(): Promise<string>;
|