@pioneer-platform/mayachain-client 0.0.36 → 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 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
- export {};
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 = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), 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)
@@ -55,7 +55,7 @@ var networkSupport = [
55
55
  ChainToNetworkId["BTC"],
56
56
  ChainToNetworkId["MAYA"],
57
57
  ChainToNetworkId["ETH"],
58
- ChainToNetworkId["THOR"],
58
+ // ChainToNetworkId["THOR"],
59
59
  ChainToNetworkId["DASH"],
60
60
  ChainToNetworkId["ARB"],
61
61
  ];
@@ -63,7 +63,7 @@ var assetSupport = [
63
63
  shortListSymbolToCaip["BTC"],
64
64
  shortListSymbolToCaip["ETH"],
65
65
  shortListSymbolToCaip["MAYA"],
66
- shortListSymbolToCaip["THOR"],
66
+ // shortListSymbolToCaip["THOR"], Eats money, need to handle msgDeposit?
67
67
  shortListSymbolToCaip["DASH"],
68
68
  shortListSymbolToCaip["ARB"],
69
69
  ];
@@ -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, BaseDecimal_1, 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;
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:
@@ -137,10 +137,11 @@ var get_quote = function (quote) {
137
137
  output.meta = {
138
138
  quoteMode: "MAYA_SUPPORTED_TO_MAYA_SUPPORTED"
139
139
  };
140
+ output.source = 'mayachain';
140
141
  output.steps = 1;
141
142
  output.complete = true;
142
143
  output.id = uuid();
143
- BaseDecimal_1 = {
144
+ BaseDecimal = {
144
145
  ARB: 18,
145
146
  AVAX: 18,
146
147
  BCH: 8,
@@ -167,7 +168,7 @@ var get_quote = function (quote) {
167
168
  asset = quote.sellAsset.split(".")[0];
168
169
  if (!asset)
169
170
  throw Error("unable to pasre asset from quote.sellAsset");
170
- DECIMALS = BaseDecimal_1[asset];
171
+ DECIMALS = BaseDecimal[asset];
171
172
  if (!DECIMALS)
172
173
  throw Error("unable to get DECIMALS for asset: " + asset);
173
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.36",
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.3.1",
8
- "@pioneer-platform/maya-network": "^8.3.7",
9
- "@pioneer-platform/pioneer-caip": "^9.2.23",
10
- "@pioneer-platform/pioneer-coins": "^9.2.13",
11
- "axios": "^1.3.4",
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": "^13.13.21",
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.2"
25
+ "typescript": "^5.0.4"
33
26
  },
34
- "gitHead": "a76012f6693a12181c4744e53e977a9eaeef0ed3"
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
+ }