@pioneer-platform/helpers 4.0.6 → 4.0.8

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.
@@ -9,6 +9,7 @@ type TokenTax = {
9
9
  buy: number;
10
10
  sell: number;
11
11
  };
12
+ export declare function safeValue(value: NumberPrimitives, decimal: number): bigint;
12
13
  type AssetValueParams = {
13
14
  decimal: number;
14
15
  value: SwapKitValueType;
@@ -24,6 +25,8 @@ type TokenNames = TCTokenNames | (typeof CoinGeckoList)['tokens'][number]['ident
24
25
  export declare class AssetValue extends BigIntArithmetics {
25
26
  address?: string;
26
27
  caip?: string;
28
+ pubkey?: string;
29
+ identifier?: string;
27
30
  chain: Chain;
28
31
  isGasAsset: boolean;
29
32
  isSynthetic: boolean;
@@ -94,7 +94,7 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
94
94
  return to.concat(ar || Array.prototype.slice.call(from));
95
95
  };
96
96
  Object.defineProperty(exports, "__esModule", { value: true });
97
- exports.getMinAmountByChain = exports.AssetValue = void 0;
97
+ exports.getMinAmountByChain = exports.AssetValue = exports.safeValue = void 0;
98
98
  var types_1 = require("@coinmasters/types");
99
99
  var asset_1 = require("../helpers/asset");
100
100
  var validators_1 = require("../helpers/validators");
@@ -119,6 +119,7 @@ function safeValue(value, decimal) {
119
119
  return BigInt(0);
120
120
  }
121
121
  }
122
+ exports.safeValue = safeValue;
122
123
  var staticTokensMap;
123
124
  var getStaticToken = function (identifier) {
124
125
  var tag = TAG + " | getStaticToken | ";
@@ -184,6 +185,7 @@ var AssetValue = /** @class */ (function (_super) {
184
185
  _this.isSynthetic = false;
185
186
  var assetInfo = getAssetInfo(identifier);
186
187
  _this.type = (0, asset_1.getAssetType)(assetInfo);
188
+ _this.identifier = identifier;
187
189
  _this.chain = assetInfo.chain;
188
190
  _this.ticker = assetInfo.ticker;
189
191
  _this.symbol = assetInfo.symbol;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pioneer-platform/helpers",
3
- "version": "4.0.6",
3
+ "version": "4.0.8",
4
4
  "main": "./lib/index.js",
5
5
  "types": "./lib/index.d.ts",
6
6
  "scripts": {
@@ -26,7 +26,7 @@ const TAG = " | assetValue | ";
26
26
 
27
27
  type TokenTax = { buy: number; sell: number };
28
28
 
29
- function safeValue(value: NumberPrimitives, decimal: number) {
29
+ export function safeValue(value: NumberPrimitives, decimal: number) {
30
30
  let tag = TAG + " | safeValue | ";
31
31
  try {
32
32
  if (typeof value === 'bigint') {
@@ -105,6 +105,8 @@ const createAssetValue = async (assetString: string, value: NumberPrimitives = 0
105
105
  export class AssetValue extends BigIntArithmetics {
106
106
  address?: string;
107
107
  caip?: string;
108
+ pubkey?: string;
109
+ identifier?: string;
108
110
  //@ts-ignore
109
111
  chain: Chain;
110
112
  isGasAsset = false;
@@ -134,6 +136,7 @@ export class AssetValue extends BigIntArithmetics {
134
136
 
135
137
  const assetInfo:any = getAssetInfo(identifier);
136
138
  this.type = getAssetType(assetInfo);
139
+ this.identifier = identifier;
137
140
  this.chain = assetInfo.chain;
138
141
  this.ticker = assetInfo.ticker;
139
142
  this.symbol = assetInfo.symbol;