@pioneer-platform/mayachain-client 0.0.37 → 0.1.0
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 +15 -0
- package/lib/index.d.ts +15 -1
- package/lib/index.js +6 -6
- package/package.json +17 -17
- package/LICENSE +0 -674
- package/yarn-error.log +0 -15253
package/CHANGELOG.md
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
# @pioneer-platform/mayachain-client
|
2
|
+
|
3
|
+
## 0.1.0
|
4
|
+
|
5
|
+
### Minor Changes
|
6
|
+
|
7
|
+
- Release: minor version bump for all packages
|
8
|
+
|
9
|
+
### Patch Changes
|
10
|
+
|
11
|
+
- Updated dependencies
|
12
|
+
- @pioneer-platform/maya-network@8.4.0
|
13
|
+
- @pioneer-platform/loggerdog@8.4.0
|
14
|
+
- @pioneer-platform/pioneer-coins@9.4.0
|
15
|
+
- @pioneer-platform/pioneer-caip@9.3.0
|
package/lib/index.d.ts
CHANGED
@@ -1 +1,15 @@
|
|
1
|
-
|
1
|
+
declare const TAG = " | maya | ";
|
2
|
+
type BaseDecimal = string | number;
|
3
|
+
declare const uuid: any;
|
4
|
+
declare const log: any;
|
5
|
+
declare let caipToNetworkId: any, shortListSymbolToCaip: any, ChainToNetworkId: any;
|
6
|
+
declare let network: any;
|
7
|
+
declare const createMemo: any, parseMemo: any;
|
8
|
+
declare const axios: any;
|
9
|
+
declare let Web3: any;
|
10
|
+
declare let service: string | undefined;
|
11
|
+
declare let web3: any;
|
12
|
+
declare let networkSupport: any[];
|
13
|
+
declare let assetSupport: any[];
|
14
|
+
declare function nodeRequest(path: any): Promise<any>;
|
15
|
+
declare const get_quote: (quote: any) => Promise<any>;
|
package/lib/index.js
CHANGED
@@ -13,8 +13,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
13
13
|
});
|
14
14
|
};
|
15
15
|
var __generator = (this && this.__generator) || function (thisArg, body) {
|
16
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
17
|
-
return g =
|
16
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
17
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
18
18
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
19
19
|
function step(op) {
|
20
20
|
if (f) throw new TypeError("Generator is already executing.");
|
@@ -39,13 +39,13 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
39
39
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
40
40
|
}
|
41
41
|
};
|
42
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
43
42
|
var TAG = " | maya | ";
|
44
43
|
var uuid = require('uuidv4').uuid;
|
45
44
|
var log = require('@pioneer-platform/loggerdog')();
|
46
45
|
var _a = require("@pioneer-platform/pioneer-caip"), caipToNetworkId = _a.caipToNetworkId, shortListSymbolToCaip = _a.shortListSymbolToCaip, ChainToNetworkId = _a.ChainToNetworkId;
|
47
46
|
var network = require("@pioneer-platform/maya-network");
|
48
47
|
var _b = require('@pioneer-platform/pioneer-coins'), createMemo = _b.createMemo, parseMemo = _b.parseMemo;
|
48
|
+
var axios = require('axios');
|
49
49
|
var Web3 = require('web3');
|
50
50
|
var service = process.env['PARITY_ARCHIVE_NODE'];
|
51
51
|
if (!service)
|
@@ -107,7 +107,7 @@ module.exports = {
|
|
107
107
|
};
|
108
108
|
var get_quote = function (quote) {
|
109
109
|
return __awaiter(this, void 0, void 0, function () {
|
110
|
-
var tag, output, pools,
|
110
|
+
var tag, output, pools, BaseDecimal, asset, DECIMALS, BASE_UNIT, sellAmountInBaseUnits, quoteFromNode, URL_1, amountOutEstimated, memoInput, memo, type, chain, tx, inbounds, inbound, tokenAddress, depositAbi, routerContract, quoteSellAmountInEther, numberBN, numberHex, data, gasLimit, block, baseFeePerGas, gasPrice, maxPriorityFeePerGas, maxFeePerGas, feeData, e_1;
|
111
111
|
return __generator(this, function (_a) {
|
112
112
|
switch (_a.label) {
|
113
113
|
case 0:
|
@@ -141,7 +141,7 @@ var get_quote = function (quote) {
|
|
141
141
|
output.steps = 1;
|
142
142
|
output.complete = true;
|
143
143
|
output.id = uuid();
|
144
|
-
|
144
|
+
BaseDecimal = {
|
145
145
|
ARB: 18,
|
146
146
|
AVAX: 18,
|
147
147
|
BCH: 8,
|
@@ -168,7 +168,7 @@ var get_quote = function (quote) {
|
|
168
168
|
asset = quote.sellAsset.split(".")[0];
|
169
169
|
if (!asset)
|
170
170
|
throw Error("unable to pasre asset from quote.sellAsset");
|
171
|
-
DECIMALS =
|
171
|
+
DECIMALS = BaseDecimal[asset];
|
172
172
|
if (!DECIMALS)
|
173
173
|
throw Error("unable to get DECIMALS for asset: " + asset);
|
174
174
|
BASE_UNIT = Math.pow(10, DECIMALS);
|
package/package.json
CHANGED
@@ -1,35 +1,35 @@
|
|
1
1
|
{
|
2
2
|
"name": "@pioneer-platform/mayachain-client",
|
3
|
-
"version": "0.0
|
3
|
+
"version": "0.1.0",
|
4
4
|
"main": "./lib/index.js",
|
5
5
|
"types": "./lib/index.d.ts",
|
6
6
|
"dependencies": {
|
7
|
-
"@pioneer-platform/loggerdog": "^8.
|
8
|
-
"@pioneer-platform/maya-network": "^8.
|
9
|
-
"@pioneer-platform/pioneer-caip": "^9.
|
10
|
-
"@pioneer-platform/pioneer-coins": "^9.
|
11
|
-
"axios": "^1.
|
7
|
+
"@pioneer-platform/loggerdog": "^8.4.0",
|
8
|
+
"@pioneer-platform/maya-network": "^8.4.0",
|
9
|
+
"@pioneer-platform/pioneer-caip": "^9.3.0",
|
10
|
+
"@pioneer-platform/pioneer-coins": "^9.4.0",
|
11
|
+
"axios": "^1.6.0",
|
12
12
|
"dotenv": "^8.2.0",
|
13
13
|
"rango-sdk": "^0.1.45",
|
14
14
|
"uuidv4": "^6.2.13",
|
15
15
|
"web3": "1.10.3"
|
16
16
|
},
|
17
|
-
"scripts": {
|
18
|
-
"npm": "npm i",
|
19
|
-
"test": "npm run build && node __tests__/test-module.js",
|
20
|
-
"build": "tsc -p .",
|
21
|
-
"prepublish": "npm run build",
|
22
|
-
"refresh": "rm -rf ./node_modules ./package-lock.json && npm install"
|
23
|
-
},
|
24
17
|
"devDependencies": {
|
25
18
|
"@types/jest": "^25.2.3",
|
26
|
-
"@types/node": "^
|
19
|
+
"@types/node": "^18.16.0",
|
27
20
|
"@types/source-map-support": "^0.5.3",
|
28
21
|
"jest": "^26.4.2",
|
29
22
|
"onchange": "^7.0.2",
|
30
23
|
"serve": "^11.3.2",
|
31
24
|
"ts-jest": "^29.0.5",
|
32
|
-
"typescript": "^5.0.
|
25
|
+
"typescript": "^5.0.4"
|
33
26
|
},
|
34
|
-
"gitHead": "
|
35
|
-
|
27
|
+
"gitHead": "a76012f6693a12181c4744e53e977a9eaeef0ed3",
|
28
|
+
"scripts": {
|
29
|
+
"npm": "pnpm i",
|
30
|
+
"test": "pnpm run build && node __tests__/test-module.js",
|
31
|
+
"build": "tsc -p .",
|
32
|
+
"prepublish": "pnpm run build",
|
33
|
+
"refresh": "rm -rf ./node_modules ./package-lock.json && pnpm install"
|
34
|
+
}
|
35
|
+
}
|