@openocean.finance/openocean-sdk 0.1.88 → 0.1.89
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/lib/index.js +2 -20
- package/lib/index.js.LICENSE.txt +145 -0
- package/package.json +3 -2
- package/lib/api/index.js +0 -136
- package/lib/api/vo/RequestVo.js +0 -401
- package/lib/asset/abi/ERC20_abi.js +0 -119
- package/lib/asset/abi/aggregator.js +0 -391
- package/lib/config/Chains.js +0 -508
- package/lib/config/Wallets.js +0 -89
- package/lib/config/index.js +0 -11
- package/lib/swapSdk/Approve.js +0 -227
- package/lib/swapSdk/ConnectWallet.js +0 -312
- package/lib/swapSdk/NotoMobile.js +0 -141
- package/lib/swapSdk/RequestVo.js +0 -94
- package/lib/swapSdk/Swap.js +0 -739
- package/lib/swapSdk/getAllowance.js +0 -97
- package/lib/swapSdk/getBalance.js +0 -220
- package/lib/swapSdk/index.js +0 -277
- package/lib/swapSdk/limitOrder.js +0 -225
- package/lib/swapSdk/qrcode.d.ts +0 -6
- package/lib/swapSdk/qrcode.js +0 -969
- package/lib/utils/ajx.js +0 -150
- package/lib/utils/index.js +0 -91
- package/lib/utils/limit-order-sdk/abi/ERC20ABI.json +0 -222
- package/lib/utils/limit-order-sdk/abi/LimitOrderProtocol.json +0 -1506
- package/lib/utils/limit-order-sdk/connector/private-key-provider.connector.d.ts +0 -10
- package/lib/utils/limit-order-sdk/connector/private-key-provider.connector.js +0 -36
- package/lib/utils/limit-order-sdk/connector/provider.connector.d.ts +0 -1
- package/lib/utils/limit-order-sdk/connector/provider.connector.js +0 -2
- package/lib/utils/limit-order-sdk/connector/web3-provider.connector.d.ts +0 -9
- package/lib/utils/limit-order-sdk/connector/web3-provider.connector.js +0 -38
- package/lib/utils/limit-order-sdk/erc20.facade.d.ts +0 -7
- package/lib/utils/limit-order-sdk/erc20.facade.js +0 -19
- package/lib/utils/limit-order-sdk/index.d.ts +0 -1
- package/lib/utils/limit-order-sdk/index.js +0 -14
- package/lib/utils/limit-order-sdk/limit-order-predicate.builder.d.ts +0 -12
- package/lib/utils/limit-order-sdk/limit-order-predicate.builder.js +0 -60
- package/lib/utils/limit-order-sdk/limit-order-protocol.const.d.ts +0 -18
- package/lib/utils/limit-order-sdk/limit-order-protocol.const.js +0 -45
- package/lib/utils/limit-order-sdk/limit-order-protocol.facade.d.ts +0 -26
- package/lib/utils/limit-order-sdk/limit-order-protocol.facade.js +0 -180
- package/lib/utils/limit-order-sdk/limit-order.builder.d.ts +0 -101
- package/lib/utils/limit-order-sdk/limit-order.builder.js +0 -120
- package/lib/utils/limit-order-sdk/model/abi.model.d.ts +0 -1
- package/lib/utils/limit-order-sdk/model/abi.model.js +0 -2
- package/lib/utils/limit-order-sdk/model/eip712.model.d.ts +0 -1
- package/lib/utils/limit-order-sdk/model/eip712.model.js +0 -2
- package/lib/utils/limit-order-sdk/model/limit-order-protocol.model.d.ts +0 -3
- package/lib/utils/limit-order-sdk/model/limit-order-protocol.model.js +0 -38
- package/lib/utils/limit-order-sdk/utils/get-rpc-code.d.ts +0 -2
- package/lib/utils/limit-order-sdk/utils/get-rpc-code.js +0 -28
- package/lib/utils/limit-order-sdk/utils/limit-order-rfq.const.d.ts +0 -89
- package/lib/utils/limit-order-sdk/utils/limit-order-rfq.const.js +0 -140
- package/lib/utils/limit-order-sdk/utils/limit-order-rfq.helpers.d.ts +0 -10
- package/lib/utils/limit-order-sdk/utils/limit-order-rfq.helpers.js +0 -254
- package/lib/utils/limit-order-sdk/utils/limit-order-rfq.model.d.ts +0 -1
- package/lib/utils/limit-order-sdk/utils/limit-order-rfq.model.js +0 -2
- package/lib/utils/limit-order-sdk/utils/limit-order-rfq.utils.d.ts +0 -2
- package/lib/utils/limit-order-sdk/utils/limit-order-rfq.utils.js +0 -82
- package/lib/utils/web3.js +0 -9
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.LimitOrderBuilder = exports.generateRFQOrderInfo = exports.generateOrderSalt = void 0;
|
|
4
|
-
var limit_order_protocol_const_1 = require("./limit-order-protocol.const");
|
|
5
|
-
var limit_order_protocol_model_1 = require("./model/limit-order-protocol.model");
|
|
6
|
-
var eth_sig_util_1 = require("eth-sig-util");
|
|
7
|
-
function generateOrderSalt() {
|
|
8
|
-
return Math.round(Math.random() * Date.now()) + '';
|
|
9
|
-
}
|
|
10
|
-
exports.generateOrderSalt = generateOrderSalt;
|
|
11
|
-
function generateRFQOrderInfo(id, expiresInTimestamp, wrapEth) {
|
|
12
|
-
var info = (BigInt(expiresInTimestamp) << BigInt(64)) | BigInt(id);
|
|
13
|
-
if (wrapEth) {
|
|
14
|
-
return (info | (BigInt(1) << BigInt(255))).toString(10);
|
|
15
|
-
}
|
|
16
|
-
return info.toString(10);
|
|
17
|
-
}
|
|
18
|
-
exports.generateRFQOrderInfo = generateRFQOrderInfo;
|
|
19
|
-
var LimitOrderBuilder = /** @class */ (function () {
|
|
20
|
-
function LimitOrderBuilder(contractAddress, chainId, providerConnector, generateSalt) {
|
|
21
|
-
if (generateSalt === void 0) { generateSalt = generateOrderSalt; }
|
|
22
|
-
this.contractAddress = contractAddress;
|
|
23
|
-
this.chainId = chainId;
|
|
24
|
-
this.providerConnector = providerConnector;
|
|
25
|
-
this.generateSalt = generateSalt;
|
|
26
|
-
}
|
|
27
|
-
LimitOrderBuilder.prototype.buildOrderSignature = function (walletAddress, typedData) {
|
|
28
|
-
var dataHash = eth_sig_util_1.TypedDataUtils.hashStruct(typedData.primaryType, typedData.message, typedData.types, true).toString('hex');
|
|
29
|
-
return this.providerConnector.signTypedData(walletAddress, typedData, dataHash);
|
|
30
|
-
};
|
|
31
|
-
LimitOrderBuilder.prototype.buildLimitOrderHash = function (orderTypedData) {
|
|
32
|
-
var message = orderTypedData;
|
|
33
|
-
return limit_order_protocol_const_1.ZX + eth_sig_util_1.TypedDataUtils.sign(message).toString('hex');
|
|
34
|
-
};
|
|
35
|
-
LimitOrderBuilder.prototype.buildLimitOrderTypedData = function (order, domainName) {
|
|
36
|
-
if (domainName === void 0) { domainName = limit_order_protocol_const_1.PROTOCOL_NAME; }
|
|
37
|
-
return {
|
|
38
|
-
primaryType: 'Order',
|
|
39
|
-
types: {
|
|
40
|
-
EIP712Domain: limit_order_protocol_const_1.EIP712_DOMAIN,
|
|
41
|
-
Order: limit_order_protocol_const_1.ORDER_STRUCTURE,
|
|
42
|
-
},
|
|
43
|
-
domain: {
|
|
44
|
-
name: domainName,
|
|
45
|
-
version: limit_order_protocol_const_1.PROTOCOL_VERSION,
|
|
46
|
-
chainId: this.chainId,
|
|
47
|
-
verifyingContract: this.contractAddress,
|
|
48
|
-
},
|
|
49
|
-
message: order,
|
|
50
|
-
};
|
|
51
|
-
};
|
|
52
|
-
LimitOrderBuilder.prototype.buildRFQOrderTypedData = function (order, domainName) {
|
|
53
|
-
if (domainName === void 0) { domainName = limit_order_protocol_const_1.PROTOCOL_NAME; }
|
|
54
|
-
return {
|
|
55
|
-
primaryType: 'OrderRFQ',
|
|
56
|
-
types: {
|
|
57
|
-
EIP712Domain: limit_order_protocol_const_1.EIP712_DOMAIN,
|
|
58
|
-
OrderRFQ: limit_order_protocol_const_1.RFQ_ORDER_STRUCTURE,
|
|
59
|
-
},
|
|
60
|
-
domain: {
|
|
61
|
-
name: domainName,
|
|
62
|
-
version: limit_order_protocol_const_1.PROTOCOL_VERSION,
|
|
63
|
-
chainId: this.chainId,
|
|
64
|
-
verifyingContract: this.contractAddress,
|
|
65
|
-
},
|
|
66
|
-
message: order,
|
|
67
|
-
};
|
|
68
|
-
};
|
|
69
|
-
/* eslint-disable max-lines-per-function */
|
|
70
|
-
LimitOrderBuilder.prototype.buildRFQOrder = function (_a) {
|
|
71
|
-
var id = _a.id, _b = _a.wrapEth, wrapEth = _b === void 0 ? false : _b, expiresInTimestamp = _a.expiresInTimestamp, makerAssetAddress = _a.makerAssetAddress, takerAssetAddress = _a.takerAssetAddress, makerAddress = _a.makerAddress, _c = _a.takerAddress, takerAddress = _c === void 0 ? limit_order_protocol_const_1.ZERO_ADDRESS : _c, makerAmount = _a.makerAmount, takerAmount = _a.takerAmount;
|
|
72
|
-
return {
|
|
73
|
-
info: generateRFQOrderInfo(id, expiresInTimestamp, wrapEth),
|
|
74
|
-
makerAsset: makerAssetAddress,
|
|
75
|
-
takerAsset: takerAssetAddress,
|
|
76
|
-
maker: makerAddress,
|
|
77
|
-
allowedSender: takerAddress,
|
|
78
|
-
makingAmount: makerAmount,
|
|
79
|
-
takingAmount: takerAmount,
|
|
80
|
-
};
|
|
81
|
-
};
|
|
82
|
-
/* eslint-enable max-lines-per-function */
|
|
83
|
-
/* eslint-disable max-lines-per-function */
|
|
84
|
-
LimitOrderBuilder.prototype.buildLimitOrder = function (_a) {
|
|
85
|
-
var makerAssetAddress = _a.makerAssetAddress, takerAssetAddress = _a.takerAssetAddress, makerAddress = _a.makerAddress, _b = _a.receiver, receiver = _b === void 0 ? limit_order_protocol_const_1.ZERO_ADDRESS : _b, _c = _a.takerAddress, takerAddress = _c === void 0 ? limit_order_protocol_const_1.ZERO_ADDRESS : _c, makerAmount = _a.makerAmount, takerAmount = _a.takerAmount, _d = _a.predicate, predicate = _d === void 0 ? limit_order_protocol_const_1.ZX : _d, _e = _a.permit, permit = _e === void 0 ? limit_order_protocol_const_1.ZX : _e, _f = _a.interaction, interaction = _f === void 0 ? limit_order_protocol_const_1.ZX : _f;
|
|
86
|
-
return {
|
|
87
|
-
salt: this.generateSalt(),
|
|
88
|
-
makerAsset: makerAssetAddress,
|
|
89
|
-
takerAsset: takerAssetAddress,
|
|
90
|
-
maker: makerAddress,
|
|
91
|
-
receiver: receiver,
|
|
92
|
-
allowedSender: takerAddress,
|
|
93
|
-
makingAmount: makerAmount,
|
|
94
|
-
takingAmount: takerAmount,
|
|
95
|
-
makerAssetData: limit_order_protocol_const_1.ZX,
|
|
96
|
-
takerAssetData: limit_order_protocol_const_1.ZX,
|
|
97
|
-
getMakerAmount: this.getAmountData(limit_order_protocol_model_1.LimitOrderProtocolMethods.getMakerAmount, makerAmount, takerAmount),
|
|
98
|
-
getTakerAmount: this.getAmountData(limit_order_protocol_model_1.LimitOrderProtocolMethods.getTakerAmount, makerAmount, takerAmount),
|
|
99
|
-
predicate: predicate,
|
|
100
|
-
permit: permit,
|
|
101
|
-
interaction: interaction,
|
|
102
|
-
};
|
|
103
|
-
};
|
|
104
|
-
/* eslint-enable max-lines-per-function */
|
|
105
|
-
LimitOrderBuilder.prototype.getContractCallData = function (methodName, methodParams) {
|
|
106
|
-
if (methodParams === void 0) { methodParams = []; }
|
|
107
|
-
return this.providerConnector.contractEncodeABI(limit_order_protocol_const_1.LIMIT_ORDER_PROTOCOL_ABI, this.contractAddress, methodName, methodParams);
|
|
108
|
-
};
|
|
109
|
-
// Get nonce from contract (nonce method) and put it to predicate on order creating
|
|
110
|
-
LimitOrderBuilder.prototype.getAmountData = function (methodName, makerAmount, takerAmount, swapTakerAmount) {
|
|
111
|
-
if (swapTakerAmount === void 0) { swapTakerAmount = '0'; }
|
|
112
|
-
return this.getContractCallData(methodName, [
|
|
113
|
-
makerAmount,
|
|
114
|
-
takerAmount,
|
|
115
|
-
swapTakerAmount,
|
|
116
|
-
]).substr(0, 2 + 68 * 2);
|
|
117
|
-
};
|
|
118
|
-
return LimitOrderBuilder;
|
|
119
|
-
}());
|
|
120
|
-
exports.LimitOrderBuilder = LimitOrderBuilder;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export var __esModule: boolean;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export var __esModule: boolean;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.LimitOrderProtocolMethods = exports.ChainId = void 0;
|
|
4
|
-
var ChainId;
|
|
5
|
-
(function (ChainId) {
|
|
6
|
-
ChainId[ChainId["etherumMainnet"] = 1] = "etherumMainnet";
|
|
7
|
-
ChainId[ChainId["binanceMainnet"] = 56] = "binanceMainnet";
|
|
8
|
-
ChainId[ChainId["polygonMainnet"] = 137] = "polygonMainnet";
|
|
9
|
-
ChainId[ChainId["optimismMainnet"] = 10] = "optimismMainnet";
|
|
10
|
-
ChainId[ChainId["arbitrumMainnet"] = 42161] = "arbitrumMainnet";
|
|
11
|
-
})(ChainId = exports.ChainId || (exports.ChainId = {}));
|
|
12
|
-
var LimitOrderProtocolMethods;
|
|
13
|
-
(function (LimitOrderProtocolMethods) {
|
|
14
|
-
LimitOrderProtocolMethods["getMakerAmount"] = "getMakerAmount";
|
|
15
|
-
LimitOrderProtocolMethods["getTakerAmount"] = "getTakerAmount";
|
|
16
|
-
LimitOrderProtocolMethods["arbitraryStaticCall"] = "arbitraryStaticCall";
|
|
17
|
-
LimitOrderProtocolMethods["fillOrder"] = "fillOrder";
|
|
18
|
-
LimitOrderProtocolMethods["fillOrderToWithPermit"] = "fillOrderToWithPermit";
|
|
19
|
-
LimitOrderProtocolMethods["fillOrderRFQ"] = "fillOrderRFQ";
|
|
20
|
-
LimitOrderProtocolMethods["cancelOrder"] = "cancelOrder";
|
|
21
|
-
LimitOrderProtocolMethods["cancelOrderRFQ"] = "cancelOrderRFQ";
|
|
22
|
-
LimitOrderProtocolMethods["nonce"] = "nonce";
|
|
23
|
-
LimitOrderProtocolMethods["advanceNonce"] = "advanceNonce";
|
|
24
|
-
LimitOrderProtocolMethods["increaseNonce"] = "increaseNonce";
|
|
25
|
-
LimitOrderProtocolMethods["and"] = "and";
|
|
26
|
-
LimitOrderProtocolMethods["or"] = "or";
|
|
27
|
-
LimitOrderProtocolMethods["eq"] = "eq";
|
|
28
|
-
LimitOrderProtocolMethods["lt"] = "lt";
|
|
29
|
-
LimitOrderProtocolMethods["gt"] = "gt";
|
|
30
|
-
LimitOrderProtocolMethods["timestampBelow"] = "timestampBelow";
|
|
31
|
-
LimitOrderProtocolMethods["nonceEquals"] = "nonceEquals";
|
|
32
|
-
LimitOrderProtocolMethods["remaining"] = "remaining";
|
|
33
|
-
LimitOrderProtocolMethods["transferFrom"] = "transferFrom";
|
|
34
|
-
LimitOrderProtocolMethods["checkPredicate"] = "checkPredicate";
|
|
35
|
-
LimitOrderProtocolMethods["remainingsRaw"] = "remainingsRaw";
|
|
36
|
-
LimitOrderProtocolMethods["simulateCalls"] = "simulateCalls";
|
|
37
|
-
LimitOrderProtocolMethods["DOMAIN_SEPARATOR"] = "DOMAIN_SEPARATOR";
|
|
38
|
-
})(LimitOrderProtocolMethods = exports.LimitOrderProtocolMethods || (exports.LimitOrderProtocolMethods = {}));
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getRPCCode = void 0;
|
|
4
|
-
var tslib_1 = require("tslib");
|
|
5
|
-
var web3_1 = tslib_1.__importDefault(require("web3"));
|
|
6
|
-
function getRPCCode(response) {
|
|
7
|
-
var objectRegexp = /{(\n*|.*)*}/gi; // take all between { }
|
|
8
|
-
var match = response.match(objectRegexp);
|
|
9
|
-
var matched = match ? match[0] : null;
|
|
10
|
-
var rpcError = matched ? parseErrorObject(matched) : null;
|
|
11
|
-
var data = rpcError ? rpcError.data : null;
|
|
12
|
-
return data ? extractCodeFromData(data) : null;
|
|
13
|
-
}
|
|
14
|
-
exports.getRPCCode = getRPCCode;
|
|
15
|
-
function extractCodeFromData(data) {
|
|
16
|
-
var hexRegexp = /0[xX][0-9a-fA-F]+/;
|
|
17
|
-
var matched = data.match(hexRegexp);
|
|
18
|
-
var hex = matched === null || matched === void 0 ? void 0 : matched[0];
|
|
19
|
-
return hex ? web3_1.default.utils.hexToAscii(hex) : null;
|
|
20
|
-
}
|
|
21
|
-
function parseErrorObject(errorObjectString) {
|
|
22
|
-
try {
|
|
23
|
-
return JSON.parse(errorObjectString);
|
|
24
|
-
}
|
|
25
|
-
catch (e) {
|
|
26
|
-
return null;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
export var __esModule: boolean;
|
|
2
|
-
export var operationSchema: {
|
|
3
|
-
type: string;
|
|
4
|
-
name: string;
|
|
5
|
-
choices: {
|
|
6
|
-
title: string;
|
|
7
|
-
value: string;
|
|
8
|
-
}[];
|
|
9
|
-
message: string;
|
|
10
|
-
}[];
|
|
11
|
-
export var createOrderSchema: ({
|
|
12
|
-
type: string;
|
|
13
|
-
name: string;
|
|
14
|
-
message: string;
|
|
15
|
-
choices: {
|
|
16
|
-
title: string;
|
|
17
|
-
value: limit_order_protocol_model_1.ChainId;
|
|
18
|
-
}[];
|
|
19
|
-
} | {
|
|
20
|
-
type: string;
|
|
21
|
-
name: string;
|
|
22
|
-
message: string;
|
|
23
|
-
choices?: undefined;
|
|
24
|
-
} | {
|
|
25
|
-
type: string;
|
|
26
|
-
name: string;
|
|
27
|
-
message: string;
|
|
28
|
-
initial: number;
|
|
29
|
-
})[];
|
|
30
|
-
export var fillOrderSchema: ({
|
|
31
|
-
type: string;
|
|
32
|
-
name: string;
|
|
33
|
-
message: string;
|
|
34
|
-
choices: {
|
|
35
|
-
title: string;
|
|
36
|
-
value: limit_order_protocol_model_1.ChainId;
|
|
37
|
-
}[];
|
|
38
|
-
} | {
|
|
39
|
-
type: string;
|
|
40
|
-
name: string;
|
|
41
|
-
message: string;
|
|
42
|
-
choices?: undefined;
|
|
43
|
-
} | {
|
|
44
|
-
type: string;
|
|
45
|
-
name: string;
|
|
46
|
-
message: string;
|
|
47
|
-
initial: number;
|
|
48
|
-
})[];
|
|
49
|
-
export var cancelOrderSchema: ({
|
|
50
|
-
type: string;
|
|
51
|
-
name: string;
|
|
52
|
-
message: string;
|
|
53
|
-
choices: {
|
|
54
|
-
title: string;
|
|
55
|
-
value: limit_order_protocol_model_1.ChainId;
|
|
56
|
-
}[];
|
|
57
|
-
} | {
|
|
58
|
-
type: string;
|
|
59
|
-
name: string;
|
|
60
|
-
message: string;
|
|
61
|
-
choices?: undefined;
|
|
62
|
-
} | {
|
|
63
|
-
type: string;
|
|
64
|
-
name: string;
|
|
65
|
-
message: string;
|
|
66
|
-
initial: number;
|
|
67
|
-
})[];
|
|
68
|
-
export var rpcUrls: {
|
|
69
|
-
1: string;
|
|
70
|
-
56: string;
|
|
71
|
-
137: string;
|
|
72
|
-
10: string;
|
|
73
|
-
42161: string;
|
|
74
|
-
};
|
|
75
|
-
export var contractAddresses: {
|
|
76
|
-
1: string;
|
|
77
|
-
56: string;
|
|
78
|
-
137: string;
|
|
79
|
-
10: string;
|
|
80
|
-
42161: string;
|
|
81
|
-
};
|
|
82
|
-
export var explorersUrls: {
|
|
83
|
-
1: string;
|
|
84
|
-
56: string;
|
|
85
|
-
137: string;
|
|
86
|
-
10: string;
|
|
87
|
-
42161: string;
|
|
88
|
-
};
|
|
89
|
-
import limit_order_protocol_model_1 = require("../model/limit-order-protocol.model");
|
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
3
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
4
|
-
if (ar || !(i in from)) {
|
|
5
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
6
|
-
ar[i] = from[i];
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
10
|
-
};
|
|
11
|
-
var _a, _b, _c;
|
|
12
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
exports.explorersUrls = exports.contractAddresses = exports.rpcUrls = exports.cancelOrderSchema = exports.fillOrderSchema = exports.createOrderSchema = exports.operationSchema = void 0;
|
|
14
|
-
var limit_order_protocol_model_1 = require("../model/limit-order-protocol.model");
|
|
15
|
-
var commonProperties = [
|
|
16
|
-
{
|
|
17
|
-
type: 'select',
|
|
18
|
-
name: 'chainId',
|
|
19
|
-
message: 'Select network',
|
|
20
|
-
choices: [
|
|
21
|
-
{ title: 'Ethereum', value: limit_order_protocol_model_1.ChainId.etherumMainnet },
|
|
22
|
-
{ title: 'BSC', value: limit_order_protocol_model_1.ChainId.binanceMainnet },
|
|
23
|
-
{ title: 'Polygon', value: limit_order_protocol_model_1.ChainId.polygonMainnet },
|
|
24
|
-
{ title: 'Optimism', value: limit_order_protocol_model_1.ChainId.optimismMainnet },
|
|
25
|
-
{ title: 'Arbitrum', value: limit_order_protocol_model_1.ChainId.arbitrumMainnet },
|
|
26
|
-
],
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
type: 'password',
|
|
30
|
-
name: 'privateKey',
|
|
31
|
-
message: 'Enter your private key',
|
|
32
|
-
},
|
|
33
|
-
];
|
|
34
|
-
exports.operationSchema = [
|
|
35
|
-
{
|
|
36
|
-
type: 'select',
|
|
37
|
-
name: 'operation',
|
|
38
|
-
choices: [
|
|
39
|
-
{ title: 'create', value: 'create' },
|
|
40
|
-
{ title: 'fill', value: 'fill' },
|
|
41
|
-
{ title: 'cancel', value: 'cancel' },
|
|
42
|
-
],
|
|
43
|
-
message: 'Choose operation for limit order RFQ: create, fill, cancel',
|
|
44
|
-
},
|
|
45
|
-
];
|
|
46
|
-
exports.createOrderSchema = __spreadArray(__spreadArray([], commonProperties, true), [
|
|
47
|
-
{
|
|
48
|
-
type: 'number',
|
|
49
|
-
name: 'orderId',
|
|
50
|
-
message: 'Limit order RFQ id',
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
type: 'number',
|
|
54
|
-
name: 'expiresIn',
|
|
55
|
-
message: 'Expires in (seconds, for example: 300 - order will expired in 5 mins)',
|
|
56
|
-
initial: 300,
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
type: 'text',
|
|
60
|
-
name: 'makerAssetAddress',
|
|
61
|
-
message: 'Maker asset address',
|
|
62
|
-
},
|
|
63
|
-
{
|
|
64
|
-
type: 'text',
|
|
65
|
-
name: 'takerAssetAddress',
|
|
66
|
-
message: 'Taker asset address',
|
|
67
|
-
},
|
|
68
|
-
{
|
|
69
|
-
type: 'text',
|
|
70
|
-
name: 'makerAmount',
|
|
71
|
-
message: 'Maker asset amount',
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
type: 'text',
|
|
75
|
-
name: 'takerAmount',
|
|
76
|
-
message: 'Taker asset amount',
|
|
77
|
-
},
|
|
78
|
-
{
|
|
79
|
-
type: 'text',
|
|
80
|
-
name: 'takerAddress',
|
|
81
|
-
message: 'Taker address (optional)',
|
|
82
|
-
},
|
|
83
|
-
], false);
|
|
84
|
-
exports.fillOrderSchema = __spreadArray(__spreadArray([], commonProperties, true), [
|
|
85
|
-
{
|
|
86
|
-
type: 'number',
|
|
87
|
-
name: 'gasPrice',
|
|
88
|
-
message: 'Gas price (GWEI)',
|
|
89
|
-
initial: 10,
|
|
90
|
-
},
|
|
91
|
-
{
|
|
92
|
-
type: 'text',
|
|
93
|
-
name: 'order',
|
|
94
|
-
message: 'Limit order RFQ json',
|
|
95
|
-
},
|
|
96
|
-
{
|
|
97
|
-
type: 'text',
|
|
98
|
-
name: 'makerAmount',
|
|
99
|
-
message: 'Maker asset fill amount (set 0 if you will use taker asset amount)',
|
|
100
|
-
},
|
|
101
|
-
{
|
|
102
|
-
type: 'text',
|
|
103
|
-
name: 'takerAmount',
|
|
104
|
-
message: 'Taker asset amount (set 0 if has set maker asset amount)',
|
|
105
|
-
},
|
|
106
|
-
], false);
|
|
107
|
-
exports.cancelOrderSchema = __spreadArray(__spreadArray([], commonProperties, true), [
|
|
108
|
-
{
|
|
109
|
-
type: 'number',
|
|
110
|
-
name: 'gasPrice',
|
|
111
|
-
message: 'Gas price (GWEI)',
|
|
112
|
-
initial: 10,
|
|
113
|
-
},
|
|
114
|
-
{
|
|
115
|
-
type: 'text',
|
|
116
|
-
name: 'orderInfo',
|
|
117
|
-
message: 'Order info',
|
|
118
|
-
},
|
|
119
|
-
], false);
|
|
120
|
-
exports.rpcUrls = (_a = {},
|
|
121
|
-
_a[limit_order_protocol_model_1.ChainId.etherumMainnet] = 'https://web3-node.1inch.io',
|
|
122
|
-
_a[limit_order_protocol_model_1.ChainId.binanceMainnet] = 'https://bsc-dataseed.binance.org',
|
|
123
|
-
_a[limit_order_protocol_model_1.ChainId.polygonMainnet] = 'https://bor-nodes.1inch.io',
|
|
124
|
-
_a[limit_order_protocol_model_1.ChainId.optimismMainnet] = 'https://optimism-nodes.1inch.io',
|
|
125
|
-
_a[limit_order_protocol_model_1.ChainId.arbitrumMainnet] = 'https://arbitrum-nodes.1inch.io',
|
|
126
|
-
_a);
|
|
127
|
-
exports.contractAddresses = (_b = {},
|
|
128
|
-
_b[limit_order_protocol_model_1.ChainId.etherumMainnet] = '0x119c71d3bbac22029622cbaec24854d3d32d2828',
|
|
129
|
-
_b[limit_order_protocol_model_1.ChainId.binanceMainnet] = '0x1e38eff998df9d3669e32f4ff400031385bf6362',
|
|
130
|
-
_b[limit_order_protocol_model_1.ChainId.polygonMainnet] = '0x94bc2a1c732bcad7343b25af48385fe76e08734f',
|
|
131
|
-
_b[limit_order_protocol_model_1.ChainId.optimismMainnet] = '0x11431a89893025d2a48dca4eddc396f8c8117187',
|
|
132
|
-
_b[limit_order_protocol_model_1.ChainId.arbitrumMainnet] = '0x7f069df72b7a39bce9806e3afaf579e54d8cf2b9',
|
|
133
|
-
_b);
|
|
134
|
-
exports.explorersUrls = (_c = {},
|
|
135
|
-
_c[limit_order_protocol_model_1.ChainId.etherumMainnet] = 'https://etherscan.io',
|
|
136
|
-
_c[limit_order_protocol_model_1.ChainId.binanceMainnet] = 'https://bscscan.com',
|
|
137
|
-
_c[limit_order_protocol_model_1.ChainId.polygonMainnet] = 'https://polygonscan.com',
|
|
138
|
-
_c[limit_order_protocol_model_1.ChainId.optimismMainnet] = 'https://optimistic.etherscan.io',
|
|
139
|
-
_c[limit_order_protocol_model_1.ChainId.arbitrumMainnet] = 'https://arbiscan.io',
|
|
140
|
-
_c);
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
export var __esModule: boolean;
|
|
3
|
-
export function createOrderOperation(isRunningWithArgv: any, params: any): any;
|
|
4
|
-
export function fillOrderOperation(isRunningWithArgv: any, params: any): any;
|
|
5
|
-
export function cancelOrderOperation(isRunningWithArgv: any, params: any): any;
|
|
6
|
-
export function createOrder(params: any): import("..").RFQOrder;
|
|
7
|
-
export function fillOrder(params: any, order: any): any;
|
|
8
|
-
export function cancelOrder(params: any): any;
|
|
9
|
-
export function sendSignedTransaction(web3: any, txConfig: any, privateKey: any): any;
|
|
10
|
-
export function gweiToWei(value: any): string;
|