@openocean.finance/openocean-sdk 1.2.34 → 1.2.35
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/api/index.js +205 -0
- package/lib/api/vo/RequestVo.js +401 -0
- package/lib/asset/abi/ERC20_abi.js +119 -0
- package/lib/asset/abi/aggregator.js +391 -0
- package/lib/config/index.js +33 -0
- package/lib/index.d.ts +1 -1
- package/lib/index.js +50 -2
- package/lib/swapSdk/Approve.js +349 -0
- package/lib/swapSdk/NotoMobile.js +144 -0
- package/lib/swapSdk/RequestVo.js +94 -0
- package/lib/swapSdk/Swap.js +1159 -0
- package/lib/swapSdk/getAllowance.js +98 -0
- package/lib/swapSdk/getBalance.js +280 -0
- package/lib/swapSdk/index.js +257 -0
- package/lib/swapSdk/qrcode.js +969 -0
- package/lib/utils/ajx.js +153 -0
- package/lib/utils/index.js +367 -0
- package/lib/utils/web3.js +9 -0
- package/lib/v1/abis/ERC20.js +22 -0
- package/lib/v1/abis/IUniswapV2Pair.js +1434 -0
- package/lib/v1/constants.js +71 -0
- package/lib/v1/entities/currency.js +39 -0
- package/lib/v1/entities/fractions/currencyAmount.js +83 -0
- package/lib/v1/entities/fractions/fraction.js +109 -0
- package/lib/v1/entities/fractions/index.js +21 -0
- package/lib/v1/entities/fractions/percent.js +37 -0
- package/lib/v1/entities/fractions/price.js +90 -0
- package/lib/v1/entities/fractions/tokenAmount.js +43 -0
- package/lib/v1/entities/index.js +22 -0
- package/lib/v1/entities/pair.js +210 -0
- package/lib/v1/entities/route.js +43 -0
- package/lib/v1/entities/token.js +87 -0
- package/lib/v1/entities/trade.js +336 -0
- package/lib/v1/errors.js +56 -0
- package/lib/v1/fetcher.js +140 -0
- package/lib/v1/router.js +97 -0
- package/lib/v1/utils.js +87 -0
- package/package.json +2 -2
package/lib/api/index.js
ADDED
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
9
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
10
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
11
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
12
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
13
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
14
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
15
|
+
});
|
|
16
|
+
};
|
|
17
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
18
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
19
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
20
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
21
|
+
function step(op) {
|
|
22
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
23
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
24
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
25
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
26
|
+
switch (op[0]) {
|
|
27
|
+
case 0: case 1: t = op; break;
|
|
28
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
29
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
30
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
31
|
+
default:
|
|
32
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
33
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
34
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
35
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
36
|
+
if (t[2]) _.ops.pop();
|
|
37
|
+
_.trys.pop(); continue;
|
|
38
|
+
}
|
|
39
|
+
op = body.call(thisArg, _);
|
|
40
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
41
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
45
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
46
|
+
};
|
|
47
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
48
|
+
exports.Api = void 0;
|
|
49
|
+
var ajx_1 = require("../utils/ajx");
|
|
50
|
+
var config_1 = require("../config");
|
|
51
|
+
var RequestVo_1 = require("./vo/RequestVo");
|
|
52
|
+
var axios_1 = __importDefault(require("axios"));
|
|
53
|
+
var bignumber_js_1 = __importDefault(require("bignumber.js"));
|
|
54
|
+
var Api = /** @class */ (function () {
|
|
55
|
+
function Api(baseUrl) {
|
|
56
|
+
this.baseUrl = 'https://open-api.openocean.finance/v3';
|
|
57
|
+
this.baseUrlNft = 'http://10.17.130.161:7104/v1';
|
|
58
|
+
if (baseUrl)
|
|
59
|
+
this.baseUrl = baseUrl;
|
|
60
|
+
}
|
|
61
|
+
Api.prototype.collections = function (option) {
|
|
62
|
+
return (0, ajx_1.get)("".concat(this.baseUrlNft, "/").concat(option.chain, "/").concat(option.market, "/collections"), option, RequestVo_1.CollectionsVo);
|
|
63
|
+
};
|
|
64
|
+
Api.prototype.assets = function (option) {
|
|
65
|
+
return (0, ajx_1.get)("".concat(this.baseUrlNft, "/").concat(option.chain, "/").concat(option.market, "/assets"), option, RequestVo_1.AssetsVo);
|
|
66
|
+
};
|
|
67
|
+
Api.prototype.buy = function (option) {
|
|
68
|
+
return (0, ajx_1.post)("".concat(this.baseUrlNft, "/").concat(option.chain, "/").concat(option.market, "/buy"), option, RequestVo_1.NftBuyVo);
|
|
69
|
+
};
|
|
70
|
+
Api.prototype.sell = function (option) {
|
|
71
|
+
return (0, ajx_1.post)("".concat(this.baseUrlNft, "/").concat(option.chain, "/").concat(option.market, "/sell"), option, RequestVo_1.NftSellVo);
|
|
72
|
+
};
|
|
73
|
+
Api.prototype.sign = function (option) {
|
|
74
|
+
return (0, ajx_1.post)("".concat(this.baseUrlNft, "/").concat(option.chain, "/").concat(option.market, "/sign"), option, RequestVo_1.NftSignVo);
|
|
75
|
+
};
|
|
76
|
+
Api.prototype.quote = function (option) {
|
|
77
|
+
return (0, ajx_1.get)("".concat(this.baseUrl, "/").concat(option.chain, "/quote"), option, RequestVo_1.ReqQuoteVo);
|
|
78
|
+
};
|
|
79
|
+
Api.prototype.swapQuote = function (option) {
|
|
80
|
+
return (0, ajx_1.get)("".concat(this.baseUrl, "/").concat(option.chain, "/swap_quote"), option, RequestVo_1.ReqSwapVo);
|
|
81
|
+
};
|
|
82
|
+
Api.prototype.getGasPrice = function (option) {
|
|
83
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
84
|
+
var data, base, fast, instant, standard, gasPrice, maxFeePerGas;
|
|
85
|
+
return __generator(this, function (_a) {
|
|
86
|
+
switch (_a.label) {
|
|
87
|
+
case 0: return [4 /*yield*/, (0, ajx_1.get)("".concat(this.baseUrl, "/").concat(option.chain, "/gasPrice"), option, RequestVo_1.ChainName)];
|
|
88
|
+
case 1:
|
|
89
|
+
data = (_a.sent()).data;
|
|
90
|
+
if (!data)
|
|
91
|
+
return [2 /*return*/, 0];
|
|
92
|
+
base = data.base, fast = data.fast, instant = data.instant, standard = data.standard;
|
|
93
|
+
gasPrice = 0;
|
|
94
|
+
if (!base) {
|
|
95
|
+
gasPrice = standard;
|
|
96
|
+
}
|
|
97
|
+
else {
|
|
98
|
+
maxFeePerGas = standard.maxFeePerGas;
|
|
99
|
+
gasPrice = +maxFeePerGas;
|
|
100
|
+
}
|
|
101
|
+
return [2 /*return*/, new bignumber_js_1.default(gasPrice).div(Math.pow(10, 9)).toFixed()];
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
});
|
|
105
|
+
};
|
|
106
|
+
Api.prototype.getTransaction = function (option) {
|
|
107
|
+
return (0, ajx_1.get)("".concat(this.baseUrl, "/").concat(option.chain, "/getTransaction"), option, RequestVo_1.TransactionVo);
|
|
108
|
+
};
|
|
109
|
+
Api.prototype.getTokenList = function (option) {
|
|
110
|
+
return (0, ajx_1.get)("".concat(this.baseUrl, "/").concat(option.chain, "/tokenList"), option, RequestVo_1.ChainName);
|
|
111
|
+
};
|
|
112
|
+
Api.prototype.dexList = function (option) {
|
|
113
|
+
return (0, ajx_1.get)("".concat(this.baseUrl, "/").concat(option.chain, "/dexList"), option, RequestVo_1.ChainName);
|
|
114
|
+
};
|
|
115
|
+
Api.prototype.getTxs = function (option) {
|
|
116
|
+
return (0, ajx_1.get)("".concat(this.baseUrl, "/").concat(option.chain, "/getTxs"), option, RequestVo_1.TxsVo);
|
|
117
|
+
};
|
|
118
|
+
Api.prototype.getTokenPrice = function (id) {
|
|
119
|
+
return axios_1.default.get("https://api.coingecko.com/api/v3/simple/price?vs_currencies=usd&ids=".concat(id));
|
|
120
|
+
};
|
|
121
|
+
Api.prototype.getBalance = function (option) {
|
|
122
|
+
return (0, ajx_1.get)("".concat(this.baseUrl, "/").concat(option.chain, "/getBalance"), option, RequestVo_1.ReqBanlanceVo);
|
|
123
|
+
};
|
|
124
|
+
Api.prototype.getAllowance = function (option) {
|
|
125
|
+
return (0, ajx_1.get)("https://open-api.openocean.finance/v1/cross/getAllowance", option, RequestVo_1.ReqAllowanceVo);
|
|
126
|
+
};
|
|
127
|
+
Api.prototype.createWallet = function (option) {
|
|
128
|
+
return (0, ajx_1.get)("".concat(this.baseUrl, "/").concat(option.chain, "/createWallet"), option, RequestVo_1.ChainName);
|
|
129
|
+
};
|
|
130
|
+
Api.prototype.solanaScan = function (option) {
|
|
131
|
+
return (0, ajx_1.post)("https://market-api.openocean.finance/v1/solana/scan", option, RequestVo_1.SolanaScanVo);
|
|
132
|
+
};
|
|
133
|
+
Api.prototype.exchange = function (option) {
|
|
134
|
+
return (0, ajx_1.get)("".concat(this.baseUrl, "/").concat(option.chain, "/exChange"), option, RequestVo_1.ChainName);
|
|
135
|
+
};
|
|
136
|
+
__decorate([
|
|
137
|
+
setChainId
|
|
138
|
+
], Api.prototype, "collections", null);
|
|
139
|
+
__decorate([
|
|
140
|
+
setChainId
|
|
141
|
+
], Api.prototype, "assets", null);
|
|
142
|
+
__decorate([
|
|
143
|
+
setChainId
|
|
144
|
+
], Api.prototype, "buy", null);
|
|
145
|
+
__decorate([
|
|
146
|
+
setChainId
|
|
147
|
+
], Api.prototype, "sell", null);
|
|
148
|
+
__decorate([
|
|
149
|
+
setChainId
|
|
150
|
+
], Api.prototype, "sign", null);
|
|
151
|
+
__decorate([
|
|
152
|
+
setChainId
|
|
153
|
+
], Api.prototype, "quote", null);
|
|
154
|
+
__decorate([
|
|
155
|
+
setChainId
|
|
156
|
+
], Api.prototype, "swapQuote", null);
|
|
157
|
+
__decorate([
|
|
158
|
+
setChainId
|
|
159
|
+
], Api.prototype, "getGasPrice", null);
|
|
160
|
+
__decorate([
|
|
161
|
+
setChainId
|
|
162
|
+
], Api.prototype, "getTransaction", null);
|
|
163
|
+
__decorate([
|
|
164
|
+
setChainId
|
|
165
|
+
], Api.prototype, "getTokenList", null);
|
|
166
|
+
__decorate([
|
|
167
|
+
setChainId
|
|
168
|
+
], Api.prototype, "dexList", null);
|
|
169
|
+
__decorate([
|
|
170
|
+
setChainId
|
|
171
|
+
], Api.prototype, "getTxs", null);
|
|
172
|
+
__decorate([
|
|
173
|
+
setChainId
|
|
174
|
+
], Api.prototype, "getBalance", null);
|
|
175
|
+
__decorate([
|
|
176
|
+
setChainId
|
|
177
|
+
], Api.prototype, "getAllowance", null);
|
|
178
|
+
__decorate([
|
|
179
|
+
setChainId
|
|
180
|
+
], Api.prototype, "createWallet", null);
|
|
181
|
+
__decorate([
|
|
182
|
+
setChainId
|
|
183
|
+
], Api.prototype, "exchange", null);
|
|
184
|
+
return Api;
|
|
185
|
+
}());
|
|
186
|
+
exports.Api = Api;
|
|
187
|
+
function setChainId(target, method, descriptor) {
|
|
188
|
+
var oldMethod = descriptor.value;
|
|
189
|
+
descriptor.value = function () {
|
|
190
|
+
var args = [];
|
|
191
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
192
|
+
args[_i] = arguments[_i];
|
|
193
|
+
}
|
|
194
|
+
args = args.map(function (item, i) {
|
|
195
|
+
if (item && item.chain) {
|
|
196
|
+
item.chain = item.chain.toLowerCase();
|
|
197
|
+
if (config_1.config.chains.chainObj[item.chain] && config_1.config.chains.chainObj[item.chain].chainId) {
|
|
198
|
+
item.chainId = config_1.config.chains.chainObj[item.chain].chainId + '';
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
return item;
|
|
202
|
+
});
|
|
203
|
+
return oldMethod.apply(this, args);
|
|
204
|
+
};
|
|
205
|
+
}
|
|
@@ -0,0 +1,401 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
18
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
19
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
20
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
21
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
22
|
+
};
|
|
23
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
+
exports.SolanaScanVo = exports.ReqtransferVo = exports.ReqTransactionVo = exports.ReqTransactionReceiptVo = exports.ReqGetTokenVo = exports.ReqSwapVo = exports.ReqQuoteVo = exports.ReqTokenInfoVo = exports.ReqTokenPriceVo = exports.ReqAllowanceVo = exports.TxsVo = exports.NftSignVo = exports.NftSellVo = exports.NftBuyVo = exports.AssetsVo = exports.CollectionsVo = exports.TransactionVo = exports.ReqBanlanceVo = exports.UserCode = exports.ChainName = exports.ReqBase = void 0;
|
|
25
|
+
require("reflect-metadata");
|
|
26
|
+
var class_validator_1 = require("class-validator");
|
|
27
|
+
var class_transformer_1 = require("class-transformer");
|
|
28
|
+
var wallet_1 = require("@openocean.finance/wallet");
|
|
29
|
+
var ReqBase = /** @class */ (function () {
|
|
30
|
+
function ReqBase() {
|
|
31
|
+
}
|
|
32
|
+
__decorate([
|
|
33
|
+
(0, class_validator_1.IsNotEmpty)({ message: 'ChainId addresses cannot be empty' }),
|
|
34
|
+
(0, class_validator_1.IsIn)(wallet_1.chainsObj.chainIds, { message: 'Chain id in(31/56/100/137/250/42161/43114)' }),
|
|
35
|
+
(0, class_transformer_1.Type)(function () { return String; })
|
|
36
|
+
], ReqBase.prototype, "chainId", void 0);
|
|
37
|
+
return ReqBase;
|
|
38
|
+
}());
|
|
39
|
+
exports.ReqBase = ReqBase;
|
|
40
|
+
var ChainName = /** @class */ (function () {
|
|
41
|
+
function ChainName() {
|
|
42
|
+
}
|
|
43
|
+
__decorate([
|
|
44
|
+
(0, class_validator_1.IsNotEmpty)({ message: 'Chain cannot be empty' }),
|
|
45
|
+
(0, class_validator_1.IsIn)(wallet_1.chainsObj.chainNames, { message: "Chain in(".concat(wallet_1.chainsObj.chainNames.join(','), ")") }),
|
|
46
|
+
(0, class_transformer_1.Type)(function () { return String; })
|
|
47
|
+
], ChainName.prototype, "chain", void 0);
|
|
48
|
+
return ChainName;
|
|
49
|
+
}());
|
|
50
|
+
exports.ChainName = ChainName;
|
|
51
|
+
var UserCode = /** @class */ (function () {
|
|
52
|
+
function UserCode() {
|
|
53
|
+
}
|
|
54
|
+
__decorate([
|
|
55
|
+
(0, class_validator_1.IsNotEmpty)({ message: 'Code cannot be empty' }),
|
|
56
|
+
(0, class_transformer_1.Type)(function () { return String; })
|
|
57
|
+
], UserCode.prototype, "code", void 0);
|
|
58
|
+
return UserCode;
|
|
59
|
+
}());
|
|
60
|
+
exports.UserCode = UserCode;
|
|
61
|
+
var ReqBanlanceVo = /** @class */ (function (_super) {
|
|
62
|
+
__extends(ReqBanlanceVo, _super);
|
|
63
|
+
function ReqBanlanceVo() {
|
|
64
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
65
|
+
}
|
|
66
|
+
__decorate([
|
|
67
|
+
(0, class_validator_1.IsNotEmpty)({ message: 'Account cannot be empty' }),
|
|
68
|
+
(0, class_validator_1.Length)(30, 60, { message: 'Account length error' }),
|
|
69
|
+
(0, class_transformer_1.Type)(function () { return String; })
|
|
70
|
+
], ReqBanlanceVo.prototype, "account", void 0);
|
|
71
|
+
__decorate([
|
|
72
|
+
(0, class_validator_1.IsNotEmpty)({ message: 'Token addresses cannot be empty' }),
|
|
73
|
+
(0, class_validator_1.MinLength)(30, { message: 'Token addresses length error' }),
|
|
74
|
+
(0, class_transformer_1.Type)(function () { return String; })
|
|
75
|
+
], ReqBanlanceVo.prototype, "inTokenAddress", void 0);
|
|
76
|
+
return ReqBanlanceVo;
|
|
77
|
+
}(ChainName));
|
|
78
|
+
exports.ReqBanlanceVo = ReqBanlanceVo;
|
|
79
|
+
var TransactionVo = /** @class */ (function (_super) {
|
|
80
|
+
__extends(TransactionVo, _super);
|
|
81
|
+
function TransactionVo() {
|
|
82
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
83
|
+
}
|
|
84
|
+
__decorate([
|
|
85
|
+
(0, class_validator_1.IsNotEmpty)({ message: 'Hash cannot be empty' }),
|
|
86
|
+
(0, class_transformer_1.Type)(function () { return String; })
|
|
87
|
+
], TransactionVo.prototype, "hash", void 0);
|
|
88
|
+
return TransactionVo;
|
|
89
|
+
}(ChainName));
|
|
90
|
+
exports.TransactionVo = TransactionVo;
|
|
91
|
+
var CollectionsVo = /** @class */ (function (_super) {
|
|
92
|
+
__extends(CollectionsVo, _super);
|
|
93
|
+
function CollectionsVo() {
|
|
94
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
95
|
+
}
|
|
96
|
+
__decorate([
|
|
97
|
+
(0, class_validator_1.IsNotEmpty)({ message: 'Market cannot be empty' }),
|
|
98
|
+
(0, class_transformer_1.Type)(function () { return String; })
|
|
99
|
+
], CollectionsVo.prototype, "market", void 0);
|
|
100
|
+
__decorate([
|
|
101
|
+
(0, class_validator_1.IsNotEmpty)({ message: 'Limit cannot be empty' }),
|
|
102
|
+
(0, class_transformer_1.Type)(function () { return Number; })
|
|
103
|
+
], CollectionsVo.prototype, "limit", void 0);
|
|
104
|
+
__decorate([
|
|
105
|
+
(0, class_validator_1.IsNotEmpty)({ message: 'Offset cannot be empty' }),
|
|
106
|
+
(0, class_transformer_1.Type)(function () { return Number; })
|
|
107
|
+
], CollectionsVo.prototype, "offset", void 0);
|
|
108
|
+
return CollectionsVo;
|
|
109
|
+
}(ChainName));
|
|
110
|
+
exports.CollectionsVo = CollectionsVo;
|
|
111
|
+
var AssetsVo = /** @class */ (function (_super) {
|
|
112
|
+
__extends(AssetsVo, _super);
|
|
113
|
+
function AssetsVo() {
|
|
114
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
115
|
+
}
|
|
116
|
+
__decorate([
|
|
117
|
+
(0, class_validator_1.IsNotEmpty)({ message: 'Market cannot be empty' }),
|
|
118
|
+
(0, class_transformer_1.Type)(function () { return String; })
|
|
119
|
+
], AssetsVo.prototype, "market", void 0);
|
|
120
|
+
__decorate([
|
|
121
|
+
(0, class_validator_1.IsNotEmpty)({ message: 'Limit cannot be empty' }),
|
|
122
|
+
(0, class_transformer_1.Type)(function () { return Number; })
|
|
123
|
+
], AssetsVo.prototype, "limit", void 0);
|
|
124
|
+
__decorate([
|
|
125
|
+
(0, class_validator_1.IsNotEmpty)({ message: 'Offset cannot be empty' }),
|
|
126
|
+
(0, class_transformer_1.Type)(function () { return Number; })
|
|
127
|
+
], AssetsVo.prototype, "offset", void 0);
|
|
128
|
+
return AssetsVo;
|
|
129
|
+
}(ChainName));
|
|
130
|
+
exports.AssetsVo = AssetsVo;
|
|
131
|
+
var NftBuyVo = /** @class */ (function (_super) {
|
|
132
|
+
__extends(NftBuyVo, _super);
|
|
133
|
+
function NftBuyVo() {
|
|
134
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
135
|
+
}
|
|
136
|
+
__decorate([
|
|
137
|
+
(0, class_validator_1.IsNotEmpty)({ message: 'Market cannot be empty' }),
|
|
138
|
+
(0, class_transformer_1.Type)(function () { return String; })
|
|
139
|
+
], NftBuyVo.prototype, "market", void 0);
|
|
140
|
+
__decorate([
|
|
141
|
+
(0, class_validator_1.IsNotEmpty)({ message: 'Sender cannot be empty' }),
|
|
142
|
+
(0, class_transformer_1.Type)(function () { return String; })
|
|
143
|
+
], NftBuyVo.prototype, "sender", void 0);
|
|
144
|
+
__decorate([
|
|
145
|
+
(0, class_validator_1.IsNotEmpty)({ message: 'BalanceTokens cannot be empty' })
|
|
146
|
+
], NftBuyVo.prototype, "balanceTokens", void 0);
|
|
147
|
+
__decorate([
|
|
148
|
+
(0, class_validator_1.IsNotEmpty)({ message: 'DustTokens cannot be empty' })
|
|
149
|
+
], NftBuyVo.prototype, "dustTokens", void 0);
|
|
150
|
+
__decorate([
|
|
151
|
+
(0, class_validator_1.IsNotEmpty)({ message: 'Buy cannot be empty' })
|
|
152
|
+
], NftBuyVo.prototype, "buy", void 0);
|
|
153
|
+
return NftBuyVo;
|
|
154
|
+
}(ChainName));
|
|
155
|
+
exports.NftBuyVo = NftBuyVo;
|
|
156
|
+
var NftSellVo = /** @class */ (function (_super) {
|
|
157
|
+
__extends(NftSellVo, _super);
|
|
158
|
+
function NftSellVo() {
|
|
159
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
160
|
+
}
|
|
161
|
+
__decorate([
|
|
162
|
+
(0, class_validator_1.IsNotEmpty)({ message: 'Market cannot be empty' }),
|
|
163
|
+
(0, class_transformer_1.Type)(function () { return String; })
|
|
164
|
+
], NftSellVo.prototype, "market", void 0);
|
|
165
|
+
__decorate([
|
|
166
|
+
(0, class_validator_1.IsNotEmpty)({ message: 'Sender cannot be empty' }),
|
|
167
|
+
(0, class_transformer_1.Type)(function () { return String; })
|
|
168
|
+
], NftSellVo.prototype, "sender", void 0);
|
|
169
|
+
__decorate([
|
|
170
|
+
(0, class_validator_1.IsNotEmpty)({ message: 'Sell cannot be empty' })
|
|
171
|
+
], NftSellVo.prototype, "sell", void 0);
|
|
172
|
+
return NftSellVo;
|
|
173
|
+
}(ChainName));
|
|
174
|
+
exports.NftSellVo = NftSellVo;
|
|
175
|
+
var NftSignVo = /** @class */ (function (_super) {
|
|
176
|
+
__extends(NftSignVo, _super);
|
|
177
|
+
function NftSignVo() {
|
|
178
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
179
|
+
}
|
|
180
|
+
__decorate([
|
|
181
|
+
(0, class_validator_1.IsNotEmpty)({ message: 'Market cannot be empty' }),
|
|
182
|
+
(0, class_transformer_1.Type)(function () { return String; })
|
|
183
|
+
], NftSignVo.prototype, "market", void 0);
|
|
184
|
+
__decorate([
|
|
185
|
+
(0, class_validator_1.IsNotEmpty)({ message: 'Order cannot be empty' })
|
|
186
|
+
], NftSignVo.prototype, "order", void 0);
|
|
187
|
+
__decorate([
|
|
188
|
+
(0, class_validator_1.IsNotEmpty)({ message: 'Signature cannot be empty' }),
|
|
189
|
+
(0, class_transformer_1.Type)(function () { return String; })
|
|
190
|
+
], NftSignVo.prototype, "signature", void 0);
|
|
191
|
+
return NftSignVo;
|
|
192
|
+
}(ChainName));
|
|
193
|
+
exports.NftSignVo = NftSignVo;
|
|
194
|
+
var TxsVo = /** @class */ (function (_super) {
|
|
195
|
+
__extends(TxsVo, _super);
|
|
196
|
+
function TxsVo() {
|
|
197
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
198
|
+
}
|
|
199
|
+
__decorate([
|
|
200
|
+
(0, class_validator_1.IsNotEmpty)({ message: 'Hash cannot be empty' }),
|
|
201
|
+
(0, class_transformer_1.Type)(function () { return String; })
|
|
202
|
+
], TxsVo.prototype, "account", void 0);
|
|
203
|
+
__decorate([
|
|
204
|
+
(0, class_validator_1.IsNotEmpty)({ message: 'pageSize cannot be empty' }),
|
|
205
|
+
(0, class_transformer_1.Type)(function () { return Number; })
|
|
206
|
+
], TxsVo.prototype, "pageSize", void 0);
|
|
207
|
+
return TxsVo;
|
|
208
|
+
}(ChainName));
|
|
209
|
+
exports.TxsVo = TxsVo;
|
|
210
|
+
var ReqAllowanceVo = /** @class */ (function (_super) {
|
|
211
|
+
__extends(ReqAllowanceVo, _super);
|
|
212
|
+
function ReqAllowanceVo() {
|
|
213
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
214
|
+
}
|
|
215
|
+
__decorate([
|
|
216
|
+
(0, class_validator_1.IsNotEmpty)({ message: 'Account cannot be empty' }),
|
|
217
|
+
(0, class_validator_1.Length)(30, 60, { message: 'Account length error' }),
|
|
218
|
+
(0, class_transformer_1.Type)(function () { return String; })
|
|
219
|
+
], ReqAllowanceVo.prototype, "account", void 0);
|
|
220
|
+
__decorate([
|
|
221
|
+
(0, class_validator_1.IsNotEmpty)({ message: 'Token addresses cannot be empty' }),
|
|
222
|
+
(0, class_validator_1.MinLength)(30, { message: 'Token addresses length error' }),
|
|
223
|
+
(0, class_transformer_1.Type)(function () { return String; })
|
|
224
|
+
], ReqAllowanceVo.prototype, "inTokenAddress", void 0);
|
|
225
|
+
__decorate([
|
|
226
|
+
(0, class_validator_1.IsNotEmpty)({ message: 'Contract addresses cannot be empty' }),
|
|
227
|
+
(0, class_validator_1.MinLength)(30, { message: 'Contract addresses length error' }),
|
|
228
|
+
(0, class_transformer_1.Type)(function () { return String; })
|
|
229
|
+
], ReqAllowanceVo.prototype, "contractAddress", void 0);
|
|
230
|
+
return ReqAllowanceVo;
|
|
231
|
+
}(ChainName));
|
|
232
|
+
exports.ReqAllowanceVo = ReqAllowanceVo;
|
|
233
|
+
var ReqTokenPriceVo = /** @class */ (function () {
|
|
234
|
+
function ReqTokenPriceVo() {
|
|
235
|
+
}
|
|
236
|
+
__decorate([
|
|
237
|
+
(0, class_validator_1.IsNotEmpty)({ message: 'ChainId cannot be empty' }),
|
|
238
|
+
(0, class_transformer_1.Type)(function () { return String; })
|
|
239
|
+
], ReqTokenPriceVo.prototype, "ids", void 0);
|
|
240
|
+
__decorate([
|
|
241
|
+
(0, class_validator_1.IsNotEmpty)({ message: 'Token name cannot be empty' }),
|
|
242
|
+
(0, class_validator_1.Length)(2, 4, { message: 'Token name length error' }),
|
|
243
|
+
(0, class_transformer_1.Type)(function () { return String; })
|
|
244
|
+
], ReqTokenPriceVo.prototype, "vs_currencies", void 0);
|
|
245
|
+
return ReqTokenPriceVo;
|
|
246
|
+
}());
|
|
247
|
+
exports.ReqTokenPriceVo = ReqTokenPriceVo;
|
|
248
|
+
var ReqTokenInfoVo = /** @class */ (function () {
|
|
249
|
+
function ReqTokenInfoVo() {
|
|
250
|
+
}
|
|
251
|
+
__decorate([
|
|
252
|
+
(0, class_validator_1.IsNotEmpty)({ message: 'ChainId cannot be empty' }),
|
|
253
|
+
(0, class_transformer_1.Type)(function () { return String; })
|
|
254
|
+
], ReqTokenInfoVo.prototype, "id", void 0);
|
|
255
|
+
__decorate([
|
|
256
|
+
(0, class_validator_1.IsNotEmpty)({ message: 'Contract address cannot be empty' }),
|
|
257
|
+
(0, class_transformer_1.Type)(function () { return String; })
|
|
258
|
+
], ReqTokenInfoVo.prototype, "contract_address", void 0);
|
|
259
|
+
return ReqTokenInfoVo;
|
|
260
|
+
}());
|
|
261
|
+
exports.ReqTokenInfoVo = ReqTokenInfoVo;
|
|
262
|
+
var ReqQuoteVo = /** @class */ (function (_super) {
|
|
263
|
+
__extends(ReqQuoteVo, _super);
|
|
264
|
+
function ReqQuoteVo() {
|
|
265
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
266
|
+
}
|
|
267
|
+
__decorate([
|
|
268
|
+
(0, class_validator_1.IsNotEmpty)({ message: 'In Token address cannot be empty' }),
|
|
269
|
+
(0, class_transformer_1.Type)(function () { return String; })
|
|
270
|
+
], ReqQuoteVo.prototype, "inTokenAddress", void 0);
|
|
271
|
+
__decorate([
|
|
272
|
+
(0, class_validator_1.IsNotEmpty)({ message: 'Out Token address cannot be empty' }),
|
|
273
|
+
(0, class_transformer_1.Type)(function () { return String; })
|
|
274
|
+
], ReqQuoteVo.prototype, "outTokenAddress", void 0);
|
|
275
|
+
__decorate([
|
|
276
|
+
(0, class_validator_1.IsNotEmpty)({ message: 'Amount cannot be empty' }),
|
|
277
|
+
(0, class_transformer_1.Type)(function () { return Number; })
|
|
278
|
+
], ReqQuoteVo.prototype, "amount", void 0);
|
|
279
|
+
__decorate([
|
|
280
|
+
(0, class_transformer_1.Type)(function () { return String; })
|
|
281
|
+
], ReqQuoteVo.prototype, "gasPrice", void 0);
|
|
282
|
+
return ReqQuoteVo;
|
|
283
|
+
}(ChainName));
|
|
284
|
+
exports.ReqQuoteVo = ReqQuoteVo;
|
|
285
|
+
var ReqSwapVo = /** @class */ (function (_super) {
|
|
286
|
+
__extends(ReqSwapVo, _super);
|
|
287
|
+
function ReqSwapVo() {
|
|
288
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
289
|
+
}
|
|
290
|
+
__decorate([
|
|
291
|
+
(0, class_validator_1.IsNotEmpty)({ message: 'In Token address cannot be empty' }),
|
|
292
|
+
(0, class_transformer_1.Type)(function () { return String; })
|
|
293
|
+
], ReqSwapVo.prototype, "inTokenAddress", void 0);
|
|
294
|
+
__decorate([
|
|
295
|
+
(0, class_validator_1.IsNotEmpty)({ message: 'Out Token address cannot be empty' }),
|
|
296
|
+
(0, class_transformer_1.Type)(function () { return String; })
|
|
297
|
+
], ReqSwapVo.prototype, "outTokenAddress", void 0);
|
|
298
|
+
__decorate([
|
|
299
|
+
(0, class_validator_1.IsNotEmpty)({ message: 'Amount cannot be empty' }),
|
|
300
|
+
(0, class_transformer_1.Type)(function () { return Number; })
|
|
301
|
+
], ReqSwapVo.prototype, "amount", void 0);
|
|
302
|
+
__decorate([
|
|
303
|
+
(0, class_validator_1.IsNotEmpty)({ message: 'Slippage cannot be empty' }),
|
|
304
|
+
(0, class_transformer_1.Type)(function () { return Number; })
|
|
305
|
+
], ReqSwapVo.prototype, "slippage", void 0);
|
|
306
|
+
__decorate([
|
|
307
|
+
(0, class_validator_1.IsNotEmpty)({ message: 'String cannot be empty' }),
|
|
308
|
+
(0, class_transformer_1.Type)(function () { return String; })
|
|
309
|
+
], ReqSwapVo.prototype, "account", void 0);
|
|
310
|
+
__decorate([
|
|
311
|
+
(0, class_transformer_1.Type)(function () { return String; })
|
|
312
|
+
], ReqSwapVo.prototype, "gasPrice", void 0);
|
|
313
|
+
__decorate([
|
|
314
|
+
(0, class_transformer_1.Type)(function () { return String; })
|
|
315
|
+
], ReqSwapVo.prototype, "referrer", void 0);
|
|
316
|
+
__decorate([
|
|
317
|
+
(0, class_transformer_1.Type)(function () { return Number; })
|
|
318
|
+
], ReqSwapVo.prototype, "referrerFee", void 0);
|
|
319
|
+
return ReqSwapVo;
|
|
320
|
+
}(ChainName));
|
|
321
|
+
exports.ReqSwapVo = ReqSwapVo;
|
|
322
|
+
var ReqGetTokenVo = /** @class */ (function (_super) {
|
|
323
|
+
__extends(ReqGetTokenVo, _super);
|
|
324
|
+
function ReqGetTokenVo() {
|
|
325
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
326
|
+
}
|
|
327
|
+
__decorate([
|
|
328
|
+
(0, class_validator_1.IsNotEmpty)({ message: 'Address cannot be empty' }),
|
|
329
|
+
(0, class_transformer_1.Type)(function () { return String; })
|
|
330
|
+
], ReqGetTokenVo.prototype, "address", void 0);
|
|
331
|
+
return ReqGetTokenVo;
|
|
332
|
+
}(ChainName));
|
|
333
|
+
exports.ReqGetTokenVo = ReqGetTokenVo;
|
|
334
|
+
var TransactionType;
|
|
335
|
+
(function (TransactionType) {
|
|
336
|
+
TransactionType[TransactionType["transfer"] = 0] = "transfer";
|
|
337
|
+
TransactionType[TransactionType["swap"] = 1] = "swap";
|
|
338
|
+
})(TransactionType || (TransactionType = {}));
|
|
339
|
+
var ReqTransactionReceiptVo = /** @class */ (function (_super) {
|
|
340
|
+
__extends(ReqTransactionReceiptVo, _super);
|
|
341
|
+
function ReqTransactionReceiptVo() {
|
|
342
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
343
|
+
}
|
|
344
|
+
__decorate([
|
|
345
|
+
(0, class_validator_1.IsNotEmpty)({ message: 'Hash cannot be empty' }),
|
|
346
|
+
(0, class_transformer_1.Type)(function () { return String; })
|
|
347
|
+
], ReqTransactionReceiptVo.prototype, "hash", void 0);
|
|
348
|
+
return ReqTransactionReceiptVo;
|
|
349
|
+
}(ChainName));
|
|
350
|
+
exports.ReqTransactionReceiptVo = ReqTransactionReceiptVo;
|
|
351
|
+
var ReqTransactionVo = /** @class */ (function (_super) {
|
|
352
|
+
__extends(ReqTransactionVo, _super);
|
|
353
|
+
function ReqTransactionVo() {
|
|
354
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
355
|
+
}
|
|
356
|
+
__decorate([
|
|
357
|
+
(0, class_validator_1.IsNotEmpty)({ message: 'Type cannot be empty' }),
|
|
358
|
+
(0, class_validator_1.IsEnum)(TransactionType, { message: "Type in (transfer/swap)" }),
|
|
359
|
+
(0, class_transformer_1.Type)(function () { return String; })
|
|
360
|
+
], ReqTransactionVo.prototype, "type", void 0);
|
|
361
|
+
return ReqTransactionVo;
|
|
362
|
+
}(ReqTransactionReceiptVo));
|
|
363
|
+
exports.ReqTransactionVo = ReqTransactionVo;
|
|
364
|
+
var ReqtransferVo = /** @class */ (function (_super) {
|
|
365
|
+
__extends(ReqtransferVo, _super);
|
|
366
|
+
function ReqtransferVo() {
|
|
367
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
368
|
+
}
|
|
369
|
+
__decorate([
|
|
370
|
+
(0, class_validator_1.IsNotEmpty)({ message: 'In Token address cannot be empty' }),
|
|
371
|
+
(0, class_transformer_1.Type)(function () { return String; })
|
|
372
|
+
], ReqtransferVo.prototype, "inTokenAddress", void 0);
|
|
373
|
+
__decorate([
|
|
374
|
+
(0, class_validator_1.IsNotEmpty)({ message: 'Decimals cannot be empty' }),
|
|
375
|
+
(0, class_transformer_1.Type)(function () { return Number; })
|
|
376
|
+
], ReqtransferVo.prototype, "decimals", void 0);
|
|
377
|
+
__decorate([
|
|
378
|
+
(0, class_validator_1.IsNotEmpty)({ message: 'Amount cannot be empty' }),
|
|
379
|
+
(0, class_transformer_1.Type)(function () { return Number; })
|
|
380
|
+
], ReqtransferVo.prototype, "amount", void 0);
|
|
381
|
+
__decorate([
|
|
382
|
+
(0, class_validator_1.IsNotEmpty)({ message: 'GasPrice cannot be empty' }),
|
|
383
|
+
(0, class_transformer_1.Type)(function () { return Number; })
|
|
384
|
+
], ReqtransferVo.prototype, "gasPrice", void 0);
|
|
385
|
+
__decorate([
|
|
386
|
+
(0, class_validator_1.IsNotEmpty)({ message: 'TargetAddress cannot be empty' }),
|
|
387
|
+
(0, class_transformer_1.Type)(function () { return Number; })
|
|
388
|
+
], ReqtransferVo.prototype, "targetAddress", void 0);
|
|
389
|
+
return ReqtransferVo;
|
|
390
|
+
}(ChainName));
|
|
391
|
+
exports.ReqtransferVo = ReqtransferVo;
|
|
392
|
+
var SolanaScanVo = /** @class */ (function () {
|
|
393
|
+
function SolanaScanVo() {
|
|
394
|
+
}
|
|
395
|
+
__decorate([
|
|
396
|
+
(0, class_validator_1.IsNotEmpty)({ message: 'Hash cannot be empty' }),
|
|
397
|
+
(0, class_transformer_1.Type)(function () { return String; })
|
|
398
|
+
], SolanaScanVo.prototype, "hash", void 0);
|
|
399
|
+
return SolanaScanVo;
|
|
400
|
+
}());
|
|
401
|
+
exports.SolanaScanVo = SolanaScanVo;
|