@shapeshiftoss/unchained-client 9.0.0-alpha.1 → 9.0.0-alpha.2
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.
|
@@ -50,7 +50,8 @@ class TransactionParser {
|
|
|
50
50
|
this.yearn = new yearn.Parser({ provider, chainId: this.chainId });
|
|
51
51
|
this.foxy = new foxy.Parser();
|
|
52
52
|
this.weth = new weth.Parser({ chainId: this.chainId, provider });
|
|
53
|
-
|
|
53
|
+
// order here matters currently as weth and yearn have the same sigHash for deposit() and the weth parser is stricter resulting in faster processing times
|
|
54
|
+
this.parsers = [this.zrx, this.thor, this.uniV2, this.weth, this.foxy, this.yearn];
|
|
54
55
|
}
|
|
55
56
|
async parse(tx, address) {
|
|
56
57
|
var _a;
|
|
@@ -8,6 +8,7 @@ export interface ParserArgs {
|
|
|
8
8
|
}
|
|
9
9
|
export declare class Parser implements SubParser {
|
|
10
10
|
provider: ethers.providers.JsonRpcProvider;
|
|
11
|
+
readonly name = "weth";
|
|
11
12
|
readonly chainId: ChainId;
|
|
12
13
|
readonly wethContract: string;
|
|
13
14
|
readonly abiInterface: ethers.utils.Interface;
|
|
@@ -7,12 +7,12 @@ exports.Parser = void 0;
|
|
|
7
7
|
const caip_1 = require("@shapeshiftoss/caip");
|
|
8
8
|
const ethers_1 = require("ethers");
|
|
9
9
|
const types_1 = require("../../types");
|
|
10
|
-
const erc20_1 = __importDefault(require("./abi/erc20"));
|
|
11
10
|
const weth_1 = __importDefault(require("./abi/weth"));
|
|
12
11
|
const constants_1 = require("./constants");
|
|
13
12
|
const utils_1 = require("./utils");
|
|
14
13
|
class Parser {
|
|
15
14
|
constructor(args) {
|
|
15
|
+
this.name = 'weth';
|
|
16
16
|
this.abiInterface = new ethers_1.ethers.utils.Interface(weth_1.default);
|
|
17
17
|
this.supportedFunctions = {
|
|
18
18
|
depositSigHash: this.abiInterface.getSighash('deposit'),
|
|
@@ -43,7 +43,6 @@ class Parser {
|
|
|
43
43
|
// failed to decode input data
|
|
44
44
|
if (!decoded)
|
|
45
45
|
return;
|
|
46
|
-
const contract = new ethers_1.ethers.Contract(this.wethContract, erc20_1.default, this.provider);
|
|
47
46
|
const assetId = (0, caip_1.toAssetId)({
|
|
48
47
|
...(0, caip_1.fromChainId)(this.chainId),
|
|
49
48
|
assetNamespace: 'erc20',
|
|
@@ -51,9 +50,9 @@ class Parser {
|
|
|
51
50
|
});
|
|
52
51
|
const token = {
|
|
53
52
|
contract: this.wethContract,
|
|
54
|
-
decimals:
|
|
55
|
-
name:
|
|
56
|
-
symbol:
|
|
53
|
+
decimals: 18,
|
|
54
|
+
name: 'Wrapped Ether',
|
|
55
|
+
symbol: 'WETH'
|
|
57
56
|
};
|
|
58
57
|
const transfers = (() => {
|
|
59
58
|
switch (txSigHash) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shapeshiftoss/unchained-client",
|
|
3
|
-
"version": "9.0.0-alpha.
|
|
3
|
+
"version": "9.0.0-alpha.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"source": "src/index.ts",
|
|
@@ -32,14 +32,14 @@
|
|
|
32
32
|
"peerDependencies": {
|
|
33
33
|
"@shapeshiftoss/caip": "^5.2.1",
|
|
34
34
|
"@shapeshiftoss/logger": "^1.1.2",
|
|
35
|
-
"@shapeshiftoss/types": "
|
|
35
|
+
"@shapeshiftoss/types": "4.3.1"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@openapitools/openapi-generator-cli": "^2.5.1",
|
|
39
39
|
"@shapeshiftoss/caip": "^5.2.1",
|
|
40
40
|
"@shapeshiftoss/common-api": "^6.11.0",
|
|
41
41
|
"@shapeshiftoss/logger": "^1.1.2",
|
|
42
|
-
"@shapeshiftoss/types": "
|
|
42
|
+
"@shapeshiftoss/types": "4.3.1",
|
|
43
43
|
"@types/ws": "^8.2.1"
|
|
44
44
|
}
|
|
45
45
|
}
|