@orb-labs/orby-core 0.0.1
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/LICENSE +21 -0
- package/README.md +1 -0
- package/dist/actions/account_cluster.d.ts +24 -0
- package/dist/actions/account_cluster.js +147 -0
- package/dist/actions/admin.d.ts +17 -0
- package/dist/actions/admin.js +42 -0
- package/dist/actions/application.d.ts +6 -0
- package/dist/actions/application.js +25 -0
- package/dist/actions/instance.d.ts +16 -0
- package/dist/actions/instance.js +94 -0
- package/dist/actions/operation.d.ts +78 -0
- package/dist/actions/operation.js +113 -0
- package/dist/actions/token.d.ts +15 -0
- package/dist/actions/token.js +46 -0
- package/dist/constants.d.ts +4 -0
- package/dist/constants.js +36 -0
- package/dist/entities/account.d.ts +14 -0
- package/dist/entities/account.js +52 -0
- package/dist/entities/financial/account_balance.d.ts +12 -0
- package/dist/entities/financial/account_balance.js +35 -0
- package/dist/entities/financial/asset.d.ts +31 -0
- package/dist/entities/financial/asset.js +42 -0
- package/dist/entities/financial/currency.d.ts +41 -0
- package/dist/entities/financial/currency.js +56 -0
- package/dist/entities/financial/currency_amount.d.ts +31 -0
- package/dist/entities/financial/currency_amount.js +81 -0
- package/dist/entities/financial/fungible_token.d.ts +41 -0
- package/dist/entities/financial/fungible_token.js +70 -0
- package/dist/entities/financial/fungible_token_amount.d.ts +33 -0
- package/dist/entities/financial/fungible_token_amount.js +84 -0
- package/dist/entities/financial/non_fungible_token.d.ts +39 -0
- package/dist/entities/financial/non_fungible_token.js +66 -0
- package/dist/entities/financial/semi_fungible_token.d.ts +41 -0
- package/dist/entities/financial/semi_fungible_token.js +68 -0
- package/dist/entities/library_request.d.ts +8 -0
- package/dist/entities/library_request.js +37 -0
- package/dist/entities/state.d.ts +22 -0
- package/dist/entities/state.js +105 -0
- package/dist/enums.d.ts +115 -0
- package/dist/enums.js +137 -0
- package/dist/index.d.ts +26 -0
- package/dist/index.js +47 -0
- package/dist/interfaces/account_cluster.d.ts +22 -0
- package/dist/interfaces/account_cluster.js +2 -0
- package/dist/interfaces/admin.d.ts +14 -0
- package/dist/interfaces/admin.js +2 -0
- package/dist/interfaces/application.d.ts +3 -0
- package/dist/interfaces/application.js +2 -0
- package/dist/interfaces/instance.d.ts +13 -0
- package/dist/interfaces/instance.js +2 -0
- package/dist/interfaces/operation.d.ts +76 -0
- package/dist/interfaces/operation.js +2 -0
- package/dist/interfaces/orby.d.ts +8 -0
- package/dist/interfaces/orby.js +2 -0
- package/dist/interfaces/token.d.ts +12 -0
- package/dist/interfaces/token.js +2 -0
- package/dist/types.d.ts +143 -0
- package/dist/types.js +2 -0
- package/dist/utils/utils.d.ts +26 -0
- package/dist/utils/utils.js +319 -0
- package/dist/utils/validateAndParseAddress.d.ts +10 -0
- package/dist/utils/validateAndParseAddress.js +29 -0
- package/package.json +25 -0
package/dist/enums.js
ADDED
@@ -0,0 +1,137 @@
|
|
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;
|
5
|
+
(function (Blockchain) {
|
6
|
+
Blockchain["ETHEREUM"] = "ethereum";
|
7
|
+
Blockchain["POLYGON"] = "polygon";
|
8
|
+
Blockchain["BINANCE"] = "binance";
|
9
|
+
Blockchain["ARBITRUM"] = "arbitrum";
|
10
|
+
Blockchain["BASE"] = "base";
|
11
|
+
Blockchain["AVALANCHE"] = "avalanche";
|
12
|
+
Blockchain["ARBITRUM_NOVA"] = "arbitrum_nova";
|
13
|
+
Blockchain["OPTIMISM"] = "optimism";
|
14
|
+
Blockchain["EVMOS"] = "evmos";
|
15
|
+
Blockchain["MOONBEAM"] = "moonbeam";
|
16
|
+
// testnets
|
17
|
+
Blockchain["ETHEREUM_SEPOLIA"] = "ethereum_sepolia";
|
18
|
+
Blockchain["ETHEREUM_HOLESKY"] = "ethereum_holesky";
|
19
|
+
Blockchain["BASE_SEPOLIA"] = "base_sepolia";
|
20
|
+
Blockchain["ARBITRUM_SEPOLIA"] = "arbitrum_sepolia";
|
21
|
+
Blockchain["OPTIMISM_SEPOLIA"] = "optimism_sepolia";
|
22
|
+
Blockchain["POLYGON_AMOY"] = "polygon_amoy";
|
23
|
+
Blockchain["BINANCE_TESTNET"] = "binance_testnet";
|
24
|
+
Blockchain["OPBNB_TESTNET"] = "opbnb_testnet";
|
25
|
+
Blockchain["MOONBEAM_ALPHA"] = "moonbeam_alpha";
|
26
|
+
// local testing
|
27
|
+
Blockchain["HARDHAT"] = "hardhat";
|
28
|
+
Blockchain["LOCAL_CHAIN_0"] = "local_chain_0";
|
29
|
+
Blockchain["LOCAL_CHAIN_1"] = "local_chain_1";
|
30
|
+
})(Blockchain || (exports.Blockchain = Blockchain = {}));
|
31
|
+
var TokenType;
|
32
|
+
(function (TokenType) {
|
33
|
+
TokenType["FUNGIBLE_TOKEN"] = "FUNGIBLE_TOKEN";
|
34
|
+
TokenType["NON_FUNGIBLE_TOKEN"] = "NON_FUNGIBLE_TOKEN";
|
35
|
+
TokenType["SEMI_FUNGIBLE_TOKEN"] = "SEMI_FUNGIBLE_TOKEN";
|
36
|
+
TokenType["FIAT"] = "FIAT";
|
37
|
+
})(TokenType || (exports.TokenType = TokenType = {}));
|
38
|
+
var AccountType;
|
39
|
+
(function (AccountType) {
|
40
|
+
AccountType["EOA"] = "EOA";
|
41
|
+
AccountType["SCA"] = "SCA";
|
42
|
+
})(AccountType || (exports.AccountType = AccountType = {}));
|
43
|
+
var VMType;
|
44
|
+
(function (VMType) {
|
45
|
+
VMType["EVM"] = "EVM";
|
46
|
+
})(VMType || (exports.VMType = VMType = {}));
|
47
|
+
var ChainSupportStatus;
|
48
|
+
(function (ChainSupportStatus) {
|
49
|
+
ChainSupportStatus["CHAIN_SUPPORTED"] = "CHAIN_SUPPORTED";
|
50
|
+
ChainSupportStatus["CHAIN_UNAVAILABLE"] = "CHAIN_UNAVAILABLE";
|
51
|
+
ChainSupportStatus["ACCOUNT_UNAVAILABLE"] = "ACCOUNT_UNAVAILABLE";
|
52
|
+
})(ChainSupportStatus || (exports.ChainSupportStatus = ChainSupportStatus = {}));
|
53
|
+
var CreateOperationsStatus;
|
54
|
+
(function (CreateOperationsStatus) {
|
55
|
+
CreateOperationsStatus["INSUFFICIENT_FUNDS"] = "INSUFFICIENT_FUNDS";
|
56
|
+
CreateOperationsStatus["INTERNAL"] = "INTERNAL";
|
57
|
+
CreateOperationsStatus["INVALID_ARGUMENT"] = "INVALID_ARGUMENT";
|
58
|
+
CreateOperationsStatus["NO_EXECUTION_PATH"] = "NO_EXECUTION_PATH";
|
59
|
+
CreateOperationsStatus["SUCCESS"] = "SUCCESS";
|
60
|
+
})(CreateOperationsStatus || (exports.CreateOperationsStatus = CreateOperationsStatus = {}));
|
61
|
+
var OperationDataFormat;
|
62
|
+
(function (OperationDataFormat) {
|
63
|
+
OperationDataFormat["TRANSACTION"] = "TRANSACTION";
|
64
|
+
OperationDataFormat["TYPED_DATA"] = "TYPED_DATA";
|
65
|
+
})(OperationDataFormat || (exports.OperationDataFormat = OperationDataFormat = {}));
|
66
|
+
var OperationType;
|
67
|
+
(function (OperationType) {
|
68
|
+
OperationType["APPROVE_ERC20_TOKEN"] = "APPROVE_ERC20_TOKEN";
|
69
|
+
OperationType["CANCEL_OPERATION"] = "CANCEL_OPERATION";
|
70
|
+
OperationType["CANCEL_TRANSACTION"] = "CANCEL_TRANSACTION";
|
71
|
+
OperationType["FINAL_TRANSACTION"] = "FINAL_TRANSACTION";
|
72
|
+
OperationType["GAS_ABSTRACTION"] = "GAS_ABSTRACTION";
|
73
|
+
OperationType["NATIVE_TOKEN_TRANSFER"] = "NATIVE_TOKEN_TRANSFER";
|
74
|
+
OperationType["SUBMIT_INTENT"] = "SUBMIT_INTENT";
|
75
|
+
})(OperationType || (exports.OperationType = OperationType = {}));
|
76
|
+
var Category;
|
77
|
+
(function (Category) {
|
78
|
+
Category["SEND"] = "SEND";
|
79
|
+
Category["RECEIVE"] = "RECEIVE";
|
80
|
+
Category["SWAP"] = "SWAP";
|
81
|
+
Category["REBALANCE"] = "REBALANCE";
|
82
|
+
Category["BRIDGE"] = "BRIDGE";
|
83
|
+
Category["FUNCTION_CALL"] = "FUNCTION_CALL";
|
84
|
+
Category["TYPED_DATA_SIGNATURE"] = "TYPED_DATA_SIGNATURE";
|
85
|
+
})(Category || (exports.Category = Category = {}));
|
86
|
+
var OperationStatusType;
|
87
|
+
(function (OperationStatusType) {
|
88
|
+
OperationStatusType["FAILED"] = "FAILED";
|
89
|
+
OperationStatusType["NOT_FOUND"] = "NOT_FOUND";
|
90
|
+
OperationStatusType["PENDING"] = "PENDING";
|
91
|
+
OperationStatusType["SUCCESSFUL"] = "SUCCESSFUL";
|
92
|
+
OperationStatusType["WAITING_PRECONDITION"] = "WAITING_PRECONDITION";
|
93
|
+
})(OperationStatusType || (exports.OperationStatusType = OperationStatusType = {}));
|
94
|
+
var QuoteType;
|
95
|
+
(function (QuoteType) {
|
96
|
+
QuoteType["EXACT_INPUT"] = "EXACT_INPUT";
|
97
|
+
QuoteType["EXACT_OUTPUT"] = "EXACT_OUTPUT";
|
98
|
+
})(QuoteType || (exports.QuoteType = QuoteType = {}));
|
99
|
+
var Order;
|
100
|
+
(function (Order) {
|
101
|
+
Order["NEWEST"] = "NEWEST";
|
102
|
+
Order["OLDEST"] = "OLDEST";
|
103
|
+
})(Order || (exports.Order = Order = {}));
|
104
|
+
var ActivityStatus;
|
105
|
+
(function (ActivityStatus) {
|
106
|
+
ActivityStatus["CANCELLED"] = "CANCELLED";
|
107
|
+
ActivityStatus["FAILED"] = "FAILED";
|
108
|
+
ActivityStatus["PENDING"] = "PENDING";
|
109
|
+
ActivityStatus["SUCCESS"] = "SUCCESS";
|
110
|
+
})(ActivityStatus || (exports.ActivityStatus = ActivityStatus = {}));
|
111
|
+
var BlockchainEnvironment;
|
112
|
+
(function (BlockchainEnvironment) {
|
113
|
+
BlockchainEnvironment["MAINNET"] = "MAINNET";
|
114
|
+
BlockchainEnvironment["TESTNET"] = "TESTNET";
|
115
|
+
})(BlockchainEnvironment || (exports.BlockchainEnvironment = BlockchainEnvironment = {}));
|
116
|
+
var TokenAllowlistType;
|
117
|
+
(function (TokenAllowlistType) {
|
118
|
+
TokenAllowlistType["ALL_TOKENS"] = "ALL_TOKENS";
|
119
|
+
TokenAllowlistType["ONLY_FUNGIBLE_TOKENS"] = "ONLY_FUNGIBLE_TOKENS";
|
120
|
+
TokenAllowlistType["ONLY_NON_FUNGIBLE_TOKENS"] = "ONLY_NON_FUNGIBLE_TOKENS";
|
121
|
+
TokenAllowlistType["ONLY_SEMI_FUNGIBLE_TOKENS"] = "ONLY_SEMI_FUNGIBLE_TOKENS";
|
122
|
+
})(TokenAllowlistType || (exports.TokenAllowlistType = TokenAllowlistType = {}));
|
123
|
+
var TimeIntervalUnits;
|
124
|
+
(function (TimeIntervalUnits) {
|
125
|
+
TimeIntervalUnits["DAYS"] = "DAYS";
|
126
|
+
TimeIntervalUnits["FOREVER"] = "FOREVER";
|
127
|
+
TimeIntervalUnits["HOURS"] = "HOURS";
|
128
|
+
TimeIntervalUnits["MINUTES"] = "MINUTES";
|
129
|
+
TimeIntervalUnits["MONTHS"] = "MONTHS";
|
130
|
+
TimeIntervalUnits["WEEKS"] = "WEEKS";
|
131
|
+
TimeIntervalUnits["YEARS"] = "YEARS";
|
132
|
+
})(TimeIntervalUnits || (exports.TimeIntervalUnits = TimeIntervalUnits = {}));
|
133
|
+
var LIBRARY_TYPE;
|
134
|
+
(function (LIBRARY_TYPE) {
|
135
|
+
LIBRARY_TYPE["VIEM"] = "VIEM";
|
136
|
+
LIBRARY_TYPE["ETHERS"] = "ETHERS";
|
137
|
+
})(LIBRARY_TYPE || (exports.LIBRARY_TYPE = LIBRARY_TYPE = {}));
|
package/dist/index.d.ts
ADDED
@@ -0,0 +1,26 @@
|
|
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 "./actions/account_cluster";
|
9
|
+
export * from "./actions/admin";
|
10
|
+
export * from "./actions/application";
|
11
|
+
export * from "./actions/instance";
|
12
|
+
export * from "./actions/operation";
|
13
|
+
export * from "./actions/token";
|
14
|
+
export * from "./entities/financial/account_balance";
|
15
|
+
export * from "./entities/financial/asset";
|
16
|
+
export * from "./entities/financial/currency_amount";
|
17
|
+
export * from "./entities/financial/currency";
|
18
|
+
export * from "./entities/financial/fungible_token_amount";
|
19
|
+
export * from "./entities/financial/fungible_token";
|
20
|
+
export * from "./entities/financial/non_fungible_token";
|
21
|
+
export * from "./entities/financial/semi_fungible_token";
|
22
|
+
export * from "./entities/account";
|
23
|
+
export * from "./entities/state";
|
24
|
+
export * from "./constants";
|
25
|
+
export * from "./enums";
|
26
|
+
export * from "./types";
|
package/dist/index.js
ADDED
@@ -0,0 +1,47 @@
|
|
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
|
+
// 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);
|
25
|
+
// 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);
|
32
|
+
// 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);
|
43
|
+
// utils
|
44
|
+
// other
|
45
|
+
__exportStar(require("./constants"), exports);
|
46
|
+
__exportStar(require("./enums"), exports);
|
47
|
+
__exportStar(require("./types"), exports);
|
@@ -0,0 +1,22 @@
|
|
1
|
+
import { Account } from "../entities/account";
|
2
|
+
import { AccountCluster, Activity, ChainEndpoint, FungibleTokenOverview, StandardizedBalance } from "../types";
|
3
|
+
import { ChainSupportStatus, Order } from "../enums";
|
4
|
+
export interface IAccountClusterActions {
|
5
|
+
createAccountCluster(accounts: Account[]): Promise<AccountCluster>;
|
6
|
+
addToAccountCluster(accounts: Account[], accountClusterId: string): Promise<AccountCluster>;
|
7
|
+
removeFromAccountCluster(accounts: Account[], accountClusterId: string): Promise<AccountCluster>;
|
8
|
+
enableChainAbstractionForAccountCluster(accountClusterId: string, enable: boolean): Promise<boolean>;
|
9
|
+
setCustomChainEndpointsForAccountCluster(accountClusterId: string, chainEndpoints: ChainEndpoint[]): Promise<boolean>;
|
10
|
+
removeCustomChainEndpointsForAccountCluster(accountClusterId: string, chainIds: bigint[]): Promise<boolean>;
|
11
|
+
getCustomChainEndpointsForAccountCluster(accountClusterId: string, returnChainIdsOnly: boolean): Promise<boolean>;
|
12
|
+
isChainSupportedOnAccountCluster(accountClusterId: string, chainId: bigint): Promise<ChainSupportStatus>;
|
13
|
+
getNodeRpcUrl(accountClusterId: string, chainId: bigint): Promise<string>;
|
14
|
+
getVirtualNodeRpcUrl(accountClusterId: string, chainId: bigint, entrypointAccountAddress: string): Promise<string>;
|
15
|
+
getActivity(accountClusterId: string, limit?: number, offset?: number, order?: Order, startDate?: number, endDate?: number, filters?: {
|
16
|
+
transactionHash?: string;
|
17
|
+
address?: string;
|
18
|
+
}[]): Promise<Activity[]>;
|
19
|
+
getPortfolioOverview(accountClusterId: string): Promise<FungibleTokenOverview>;
|
20
|
+
getFungibleTokenPortfolio(accountClusterId: string): Promise<FungibleTokenOverview>;
|
21
|
+
getFungibleTokenBalances(accountClusterId: string, offset?: number, limit?: number, tokensToOmit?: string[]): Promise<StandardizedBalance[]>;
|
22
|
+
}
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import { GasSpendForInstance, GasSponsorshipData } from "../types";
|
2
|
+
export interface IAdminActions {
|
3
|
+
createInstance(name: string): Promise<{
|
4
|
+
success: boolean;
|
5
|
+
orbyInstancePrivateUrl: string;
|
6
|
+
orbyInstancePublicUrl: string;
|
7
|
+
}>;
|
8
|
+
getInstanceUrls(name: string): Promise<{
|
9
|
+
orbyInstancePrivateUrl: string;
|
10
|
+
orbyInstancePublicUrl: string;
|
11
|
+
}>;
|
12
|
+
getGasSpentForCustomer(month: string, year: string): Promise<GasSponsorshipData>;
|
13
|
+
getGasSpentForInstances(month: string, year: string, instanceNames: string[]): Promise<GasSpendForInstance[]>;
|
14
|
+
}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import { BlockchainInformation, ChainEndpoint, GasSponsorshipPolicy } from "../types";
|
2
|
+
export interface IInstanceActions {
|
3
|
+
setCustomChainEndpointsForInstance(chainEndpoints: ChainEndpoint[]): Promise<boolean>;
|
4
|
+
removeCustomChainEndpointForInstance(chainIds: bigint[]): Promise<boolean>;
|
5
|
+
getCustomChainEndpointsForInstance(returnChainIdsOnly: boolean): Promise<boolean>;
|
6
|
+
getChainsSupportedByDefault(): Promise<BlockchainInformation[]>;
|
7
|
+
enabledChainAbstractionForInstance(enable: boolean): Promise<boolean>;
|
8
|
+
enableGasSponsorshipForInstance(enable: boolean): Promise<boolean>;
|
9
|
+
getGasSponsorForInstance(): Promise<string>;
|
10
|
+
getOrbyGasSponsorPolicyForInstance(): Promise<GasSponsorshipPolicy>;
|
11
|
+
setOrbyGasSponsorPolicyForInstance(gasSponsorshipPolicy: GasSponsorshipPolicy): Promise<boolean>;
|
12
|
+
removeOrbyGasSponsorPolicyForInstance(): Promise<boolean>;
|
13
|
+
}
|
@@ -0,0 +1,76 @@
|
|
1
|
+
import { Operation, OperationStatus, SignedOperation } from "../types";
|
2
|
+
import { CurrencyAmount } from "../entities/financial/currency_amount";
|
3
|
+
import { QuoteType } from "../enums";
|
4
|
+
export interface IOperationActions {
|
5
|
+
getOperationsToExecuteTransaction(accountClusterId: string, to: string, data: string, value?: string): Promise<Operation[]>;
|
6
|
+
getOperationsToSignTypedData(accountClusterId: string, data: string): Promise<Operation[]>;
|
7
|
+
getOperationsToCancelTransaction(accountClusterId: string, operationSetId: string): Promise<Operation[]>;
|
8
|
+
isTransactionPreconditionSatisfied(accountClusterId: string, to: string, data: string, value?: string): Promise<boolean>;
|
9
|
+
isTypedDataPreconditionSatisfied(accountClusterId: string, data: string): Promise<boolean>;
|
10
|
+
sendSignedOperations(accountClusterId: string, signedOperations: SignedOperation[]): Promise<{
|
11
|
+
operationSetId: string;
|
12
|
+
operationResponses: OperationStatus[];
|
13
|
+
}>;
|
14
|
+
getOperationStatuses(operationIds: string[]): Promise<OperationStatus[]>;
|
15
|
+
estimateFiatCostToExecuteTransaction(to: string, data: string, value?: string): Promise<CurrencyAmount>;
|
16
|
+
estimateFiatCostToSignTypedData(data: string): Promise<CurrencyAmount>;
|
17
|
+
getOperationsToTransferToken(accountClusterId: string, standardizedTokenId: string, amount: number, recipient: {
|
18
|
+
chainId: bigint;
|
19
|
+
recipientAddress: string;
|
20
|
+
}, gasToken?: {
|
21
|
+
standardizedTokenId: string;
|
22
|
+
tokenSources?: {
|
23
|
+
chainId: bigint;
|
24
|
+
address?: string;
|
25
|
+
}[];
|
26
|
+
}): Promise<Operation[]>;
|
27
|
+
getOperationsToSwap(accountClusterId: string, swapType: QuoteType, input: {
|
28
|
+
standardizedTokenId: string;
|
29
|
+
amount?: number;
|
30
|
+
tokenSources?: {
|
31
|
+
chainId: string;
|
32
|
+
address?: string;
|
33
|
+
}[];
|
34
|
+
}, output: {
|
35
|
+
standardizedTokenId: string;
|
36
|
+
amount?: number;
|
37
|
+
tokenDestination?: {
|
38
|
+
chainId: string;
|
39
|
+
address?: string;
|
40
|
+
};
|
41
|
+
}, gasToken?: {
|
42
|
+
standardizedTokenId: string;
|
43
|
+
tokenSources?: {
|
44
|
+
chainId: bigint;
|
45
|
+
address?: string;
|
46
|
+
}[];
|
47
|
+
}): Promise<Operation[]>;
|
48
|
+
getQuote(accountClusterId: string, swapType: QuoteType, input: {
|
49
|
+
standardizedTokenId: string;
|
50
|
+
amount?: number;
|
51
|
+
tokenSources?: {
|
52
|
+
chainId: string;
|
53
|
+
address?: string;
|
54
|
+
}[];
|
55
|
+
}, output: {
|
56
|
+
standardizedTokenId: string;
|
57
|
+
amount?: number;
|
58
|
+
tokenDestination?: {
|
59
|
+
chainId: string;
|
60
|
+
address?: string;
|
61
|
+
};
|
62
|
+
}): Promise<Operation[]>;
|
63
|
+
getOperationsToBridge(accountClusterId: string, standardizedTokenId: string, amount: bigint, tokenSources?: {
|
64
|
+
chainId: string;
|
65
|
+
address?: string;
|
66
|
+
}[], tokenDestination?: {
|
67
|
+
chainId: string;
|
68
|
+
address?: string;
|
69
|
+
}, gasToken?: {
|
70
|
+
standardizedTokenId: string;
|
71
|
+
tokenSources?: {
|
72
|
+
chainId: bigint;
|
73
|
+
address?: string;
|
74
|
+
}[];
|
75
|
+
}): Promise<Operation[]>;
|
76
|
+
}
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import { IAccountClusterActions } from "./account_cluster";
|
2
|
+
import { IAdminActions } from "./admin";
|
3
|
+
import { IApplicationActions } from "./application";
|
4
|
+
import { IInstanceActions } from "./instance";
|
5
|
+
import { IOperationActions } from "./operation";
|
6
|
+
import { ITokenActions } from "./token";
|
7
|
+
export interface Orby extends IAccountClusterActions, IAdminActions, IApplicationActions, IInstanceActions, IOperationActions, ITokenActions {
|
8
|
+
}
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import { StandardizedToken } from "../types";
|
2
|
+
export interface ITokenActions {
|
3
|
+
getStandardizedTokenIds(tokens: {
|
4
|
+
tokenAddress: string;
|
5
|
+
chainId: bigint;
|
6
|
+
}[]): Promise<string[]>;
|
7
|
+
getStandardizedTokens(tokens: {
|
8
|
+
tokenAddress: string;
|
9
|
+
chainId: bigint;
|
10
|
+
}[]): Promise<StandardizedToken[]>;
|
11
|
+
getFungibleTokenData(standardizedTokenIds: string[]): Promise<StandardizedToken>;
|
12
|
+
}
|
package/dist/types.d.ts
ADDED
@@ -0,0 +1,143 @@
|
|
1
|
+
import { Account } from "./entities/account";
|
2
|
+
import { Currency } from "./entities/financial/currency";
|
3
|
+
import { CurrencyAmount } from "./entities/financial/currency_amount";
|
4
|
+
import { FungibleToken } from "./entities/financial/fungible_token";
|
5
|
+
import { FungibleTokenAmount } from "./entities/financial/fungible_token_amount";
|
6
|
+
import { State } from "./entities/state";
|
7
|
+
import { ActivityStatus, BlockchainEnvironment, Category, CreateOperationsStatus, OperationDataFormat, OperationStatusType, OperationType, TimeIntervalUnits, TokenAllowlistType } from "./enums";
|
8
|
+
export type AccountCluster = {
|
9
|
+
accountClusterId: string;
|
10
|
+
accounts: Account[];
|
11
|
+
};
|
12
|
+
export type ChainEndpoint = {
|
13
|
+
chainId: bigint;
|
14
|
+
customRpcUrls?: string[];
|
15
|
+
customIndexerUrls?: string[];
|
16
|
+
};
|
17
|
+
export interface Operation {
|
18
|
+
status: CreateOperationsStatus;
|
19
|
+
primaryOperation?: OnchainOperation;
|
20
|
+
primaryOperationPreconditions?: State;
|
21
|
+
inputState?: State;
|
22
|
+
outputState?: State;
|
23
|
+
intents?: Intent[];
|
24
|
+
aggregateNetworkFeeInFiatCurrency?: CurrencyAmount;
|
25
|
+
aggregateOperationFeeInFiatCurrency?: CurrencyAmount;
|
26
|
+
aggregateEstimatedTimeInMs?: number;
|
27
|
+
}
|
28
|
+
export type Intent = {
|
29
|
+
estimatedProtocolFees?: FungibleTokenAmount;
|
30
|
+
estimatedProtocolFeesInFiatCurrency?: CurrencyAmount;
|
31
|
+
inputState?: State;
|
32
|
+
intentOperations?: OnchainOperation[];
|
33
|
+
outputState?: State;
|
34
|
+
};
|
35
|
+
export interface OnchainOperation {
|
36
|
+
chainId: bigint;
|
37
|
+
data: string;
|
38
|
+
estimatedNetworkFees?: CurrencyAmount;
|
39
|
+
estimatedNetworkFeesInFiatCurrency?: CurrencyAmount;
|
40
|
+
estimatedTimeInMs?: bigint;
|
41
|
+
format: OperationDataFormat;
|
42
|
+
from?: string;
|
43
|
+
gasLimit?: bigint;
|
44
|
+
gasPrice?: bigint;
|
45
|
+
inputState?: State;
|
46
|
+
maxFeePerGas?: bigint;
|
47
|
+
maxPriorityFeePerGas?: bigint;
|
48
|
+
nativeCurrency?: Currency;
|
49
|
+
nonce?: bigint;
|
50
|
+
outputState?: State;
|
51
|
+
to?: string;
|
52
|
+
txRpcUrl: string;
|
53
|
+
type: OperationType;
|
54
|
+
value?: bigint;
|
55
|
+
}
|
56
|
+
export type SignedOperation = {
|
57
|
+
type: OperationType;
|
58
|
+
signature: string;
|
59
|
+
category?: Category;
|
60
|
+
data?: string;
|
61
|
+
};
|
62
|
+
export type OperationStatus = {
|
63
|
+
blockHash?: string;
|
64
|
+
blockNumber?: bigint;
|
65
|
+
chainId?: bigint;
|
66
|
+
errorReason: string;
|
67
|
+
hash?: string;
|
68
|
+
id?: string;
|
69
|
+
status: OperationStatusType;
|
70
|
+
type: OperationType;
|
71
|
+
};
|
72
|
+
export type Activity = {
|
73
|
+
aggregateFiatValueOfInputState?: CurrencyAmount;
|
74
|
+
aggregateFiatValueOfOutputState?: CurrencyAmount;
|
75
|
+
aggregateNetworkFeesInFiatCurrency?: CurrencyAmount;
|
76
|
+
aggregateProtocolFeesInFiatCurrency?: CurrencyAmount;
|
77
|
+
category: Category;
|
78
|
+
initiateAt?: Date;
|
79
|
+
inputState?: State;
|
80
|
+
operationStatuses: OperationStatus;
|
81
|
+
outputState?: State;
|
82
|
+
overallStatus: ActivityStatus;
|
83
|
+
};
|
84
|
+
export type FungibleTokenOverview = {
|
85
|
+
tokenCount: number;
|
86
|
+
hiddenTokenCount: number;
|
87
|
+
totalValueInFiat: CurrencyAmount;
|
88
|
+
};
|
89
|
+
export type StandardizedBalance = {
|
90
|
+
standardizedTokenId: string;
|
91
|
+
tokenBalances: FungibleTokenAmount[];
|
92
|
+
tokenBalancesOnChains: FungibleTokenAmount[];
|
93
|
+
total: CurrencyAmount;
|
94
|
+
totalValueInFiat?: CurrencyAmount;
|
95
|
+
};
|
96
|
+
export type StandardizedToken = {
|
97
|
+
stardardizedTokenId: string;
|
98
|
+
currency: Currency;
|
99
|
+
priceInFiat?: CurrencyAmount;
|
100
|
+
tokens: FungibleToken[];
|
101
|
+
};
|
102
|
+
export type BlockchainInformation = {
|
103
|
+
chainId: bigint;
|
104
|
+
environment: BlockchainEnvironment;
|
105
|
+
logoUrl?: string;
|
106
|
+
name?: string;
|
107
|
+
};
|
108
|
+
export type ContractAllowlistWithAllMethodFallback = {
|
109
|
+
contractAddress: string;
|
110
|
+
sponsoredFunctions?: string[];
|
111
|
+
};
|
112
|
+
export type TokenAllowlistWithAllMethodsFallback = {
|
113
|
+
sponsoredFunctions?: string[];
|
114
|
+
tokenAllowlistType: TokenAllowlistType;
|
115
|
+
};
|
116
|
+
export type AllowlistWithOpenFallback = {
|
117
|
+
arbitraryContractAllowlist?: ContractAllowlistWithAllMethodFallback[];
|
118
|
+
tokenAllowlist?: TokenAllowlistWithAllMethodsFallback;
|
119
|
+
};
|
120
|
+
export type TimeInterval = {
|
121
|
+
amount?: bigint;
|
122
|
+
unit: TimeIntervalUnits;
|
123
|
+
};
|
124
|
+
export type MaxAmountPerInterval = {
|
125
|
+
amount: bigint;
|
126
|
+
interval: TimeInterval;
|
127
|
+
};
|
128
|
+
export type GasSponsorshipPolicy = {
|
129
|
+
allowlistWithOpenFallback?: AllowlistWithOpenFallback;
|
130
|
+
maxGasSpendPerTransaction?: bigint;
|
131
|
+
maxTotalGasSpendForInstance?: MaxAmountPerInterval;
|
132
|
+
maxTotalGasSpendPerUser?: MaxAmountPerInterval;
|
133
|
+
maxTotalTransactionCountForInstance?: MaxAmountPerInterval;
|
134
|
+
maxTotalTransactionCountPerUser?: MaxAmountPerInterval;
|
135
|
+
};
|
136
|
+
export type GasSpendForInstance = {
|
137
|
+
instanceName?: string;
|
138
|
+
gasSpentForInstance?: GasSponsorshipData;
|
139
|
+
};
|
140
|
+
export type GasSponsorshipData = {
|
141
|
+
totalGasSpent: CurrencyAmount;
|
142
|
+
totalTransactionCount: bigint;
|
143
|
+
};
|
package/dist/types.js
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
import { Blockchain } from "../enums";
|
2
|
+
import { AccountCluster, Activity, AllowlistWithOpenFallback, BlockchainInformation, FungibleTokenOverview, GasSpendForInstance, GasSponsorshipData, GasSponsorshipPolicy, Intent, MaxAmountPerInterval, OnchainOperation, Operation, OperationStatus, StandardizedBalance, StandardizedToken } from "../types";
|
3
|
+
export declare const extractAccountCluster: (accountCluster?: any) => AccountCluster;
|
4
|
+
export declare const extractOperationSet: (operations?: any) => Operation[];
|
5
|
+
export declare const extractOnchainOperation: (onchainOperation?: any) => OnchainOperation;
|
6
|
+
export declare const extractIntent: (intent?: any) => Intent;
|
7
|
+
export declare const extractOperationStatuses: (operationStatus?: any[]) => OperationStatus[];
|
8
|
+
export declare const extractOperationStatus: (status?: any) => OperationStatus;
|
9
|
+
export declare const extractActivities: (activities?: any[]) => Activity[];
|
10
|
+
export declare const extractFungibleTokenOverview: (overview?: any) => FungibleTokenOverview;
|
11
|
+
export declare const extractStandardizedBalances: (balances?: any) => StandardizedBalance[];
|
12
|
+
export declare const extractStandardizedBalance: (balance?: any) => StandardizedBalance;
|
13
|
+
export declare const extractStandardizedTokens: (tokens?: any) => StandardizedToken[];
|
14
|
+
export declare const extractStandardizedToken: (token?: any) => StandardizedToken;
|
15
|
+
export declare const extractBlockchainInformations: (blockchainInformation?: any[]) => BlockchainInformation[];
|
16
|
+
export declare const extractBlockchainInformation: (blockchainInformation?: any) => BlockchainInformation;
|
17
|
+
export declare const extractMaxAmountPerInterval: (maxAmountPerInterval?: any) => MaxAmountPerInterval;
|
18
|
+
export declare const extractAllowlistWithOpenFallback: (allowlist?: any) => AllowlistWithOpenFallback;
|
19
|
+
export declare const extractGasSponsorshipPolicy: (gasSponsorshipPolicy?: any) => GasSponsorshipPolicy;
|
20
|
+
export declare const extractGasSpendForInstances: (gasSpendForInstances?: any[]) => GasSpendForInstance[];
|
21
|
+
export declare const extractGasSpendForInstance: (gasSpendForInstance?: any) => GasSpendForInstance;
|
22
|
+
export declare const extractGasSponsorshipInformation: (gasSponsorshipData?: any[]) => GasSponsorshipData[];
|
23
|
+
export declare const extractGasSponsorshipData: (gasSponsorshipData?: any) => GasSponsorshipData;
|
24
|
+
export declare const getChainIdFromOrbyChainId: (value: string) => bigint | undefined;
|
25
|
+
export declare const getBlockchainIdFromBlockchain: (blockchain: Blockchain) => number;
|
26
|
+
export declare const getBlockchainFromName: (chainName: string) => Blockchain;
|