@shapeshiftoss/unchained-client 7.0.0 → 8.0.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.
@@ -10,8 +10,8 @@ class TransactionParser {
10
10
  this.chainId = args.chainId;
11
11
  this.assetId = (0, caip_1.toAssetId)({
12
12
  ...(0, caip_1.fromChainId)(this.chainId),
13
- assetNamespace: caip_1.AssetNamespace.Slip44,
14
- assetReference: caip_1.AssetReference.Bitcoin
13
+ assetNamespace: 'slip44',
14
+ assetReference: caip_1.ASSET_REFERENCE.Bitcoin
15
15
  });
16
16
  }
17
17
  async parse(tx, address) {
@@ -10,8 +10,8 @@ class TransactionParser {
10
10
  this.chainId = args.chainId;
11
11
  this.assetId = (0, caip_1.toAssetId)({
12
12
  ...(0, caip_1.fromChainId)(this.chainId),
13
- assetNamespace: caip_1.AssetNamespace.Slip44,
14
- assetReference: caip_1.AssetReference.Cosmos
13
+ assetNamespace: 'slip44',
14
+ assetReference: caip_1.ASSET_REFERENCE.Cosmos
15
15
  });
16
16
  }
17
17
  async parse(tx, address) {
@@ -25,6 +25,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
26
  exports.TransactionParser = void 0;
27
27
  const caip_1 = require("@shapeshiftoss/caip");
28
+ const src_1 = require("@shapeshiftoss/caip/src");
28
29
  const bignumber_js_1 = require("bignumber.js");
29
30
  const ethers_1 = require("ethers");
30
31
  const types_1 = require("../../types");
@@ -41,8 +42,8 @@ class TransactionParser {
41
42
  this.chainId = args.chainId;
42
43
  this.assetId = (0, caip_1.toAssetId)({
43
44
  ...(0, caip_1.fromChainId)(this.chainId),
44
- assetNamespace: caip_1.AssetNamespace.Slip44,
45
- assetReference: caip_1.AssetReference.Ethereum
45
+ assetNamespace: 'slip44',
46
+ assetReference: src_1.ASSET_REFERENCE.Ethereum
46
47
  });
47
48
  const provider = new ethers_1.ethers.providers.JsonRpcProvider(args.rpcUrl);
48
49
  this.thor = new thor.Parser({ chainId: this.chainId, rpcUrl: args.rpcUrl });
@@ -132,7 +133,7 @@ class TransactionParser {
132
133
  const transferArgs = [
133
134
  (0, caip_1.toAssetId)({
134
135
  ...(0, caip_1.fromChainId)(this.chainId),
135
- assetNamespace: caip_1.AssetNamespace.ERC20,
136
+ assetNamespace: 'erc20',
136
137
  assetReference: transfer.token
137
138
  }),
138
139
  transfer.from,
@@ -153,8 +154,8 @@ class TransactionParser {
153
154
  const transferArgs = [
154
155
  (0, caip_1.toAssetId)({
155
156
  ...(0, caip_1.fromChainId)(this.chainId),
156
- assetNamespace: caip_1.AssetNamespace.Slip44,
157
- assetReference: caip_1.AssetReference.Ethereum
157
+ assetNamespace: 'slip44',
158
+ assetReference: src_1.ASSET_REFERENCE.Ethereum
158
159
  }),
159
160
  internalTx.from,
160
161
  internalTx.to,
@@ -60,7 +60,7 @@ class Parser {
60
60
  const value = decoded.args.amountTokenDesired.toString();
61
61
  const assetId = (0, caip_1.toAssetId)({
62
62
  ...(0, caip_1.fromChainId)(this.chainId),
63
- assetNamespace: caip_1.AssetNamespace.ERC20,
63
+ assetNamespace: 'erc20',
64
64
  assetReference: tokenAddress
65
65
  });
66
66
  return [
@@ -83,7 +83,7 @@ class Parser {
83
83
  const value = decoded.args.liquidity.toString();
84
84
  const assetId = (0, caip_1.toAssetId)({
85
85
  ...(0, caip_1.fromChainId)(this.chainId),
86
- assetNamespace: caip_1.AssetNamespace.ERC20,
86
+ assetNamespace: 'erc20',
87
87
  assetReference: lpTokenAddress
88
88
  });
89
89
  return [
@@ -49,7 +49,7 @@ class Parser {
49
49
  const contract = new ethers_1.ethers.Contract(this.wethContract, erc20_1.default, this.provider);
50
50
  const assetId = (0, caip_1.toAssetId)({
51
51
  ...(0, caip_1.fromChainId)(this.chainId),
52
- assetNamespace: caip_1.AssetNamespace.ERC20,
52
+ assetNamespace: 'erc20',
53
53
  assetReference: this.wethContract
54
54
  });
55
55
  const token = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shapeshiftoss/unchained-client",
3
- "version": "7.0.0",
3
+ "version": "8.0.0",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "source": "src/index.ts",