@sentio/sdk 1.7.20 → 1.7.21

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.
Files changed (94) hide show
  1. package/lib/builtin/erc20/index.d.ts +1 -1
  2. package/lib/builtin/erc20/index.js +1 -1
  3. package/lib/builtin/erc20/index.js.map +1 -1
  4. package/lib/builtin/erc20/test-utils.d.ts +2 -1
  5. package/lib/builtin/erc20/test-utils.js +14 -3
  6. package/lib/builtin/erc20/test-utils.js.map +1 -1
  7. package/lib/builtin/erc20bytes/index.d.ts +2 -0
  8. package/lib/builtin/erc20bytes/index.js +22 -0
  9. package/lib/builtin/erc20bytes/index.js.map +1 -0
  10. package/lib/builtin/erc20bytes/test-utils.d.ts +4 -0
  11. package/lib/builtin/erc20bytes/test-utils.js +35 -0
  12. package/lib/builtin/erc20bytes/test-utils.js.map +1 -0
  13. package/lib/builtin/internal/ERC20.d.ts +307 -0
  14. package/lib/builtin/internal/{Weth9.js → ERC20.js} +1 -1
  15. package/lib/builtin/internal/ERC20.js.map +1 -0
  16. package/lib/builtin/internal/{Erc20.d.ts → ERC20Bytes.d.ts} +62 -46
  17. package/lib/builtin/internal/ERC20Bytes.js +3 -0
  18. package/lib/builtin/internal/ERC20Bytes.js.map +1 -0
  19. package/lib/builtin/internal/{Weth9.d.ts → WETH9.d.ts} +3 -3
  20. package/lib/builtin/internal/{Erc20.js → WETH9.js} +1 -1
  21. package/lib/builtin/internal/{Weth9.js.map → WETH9.js.map} +1 -1
  22. package/lib/builtin/internal/erc20_processor.d.ts +28 -16
  23. package/lib/builtin/internal/erc20_processor.js +168 -32
  24. package/lib/builtin/internal/erc20_processor.js.map +1 -1
  25. package/lib/builtin/internal/erc20bytes_processor.d.ts +42 -0
  26. package/lib/builtin/internal/erc20bytes_processor.js +271 -0
  27. package/lib/builtin/internal/erc20bytes_processor.js.map +1 -0
  28. package/lib/builtin/internal/factories/ERC20Bytes__factory.d.ts +48 -0
  29. package/lib/builtin/internal/factories/{Erc20__factory.js → ERC20Bytes__factory.js} +127 -89
  30. package/lib/builtin/internal/factories/ERC20Bytes__factory.js.map +1 -0
  31. package/lib/builtin/internal/factories/{Erc20__factory.d.ts → ERC20__factory.d.ts} +12 -5
  32. package/lib/builtin/internal/factories/ERC20__factory.js +404 -0
  33. package/lib/builtin/internal/factories/ERC20__factory.js.map +1 -0
  34. package/lib/builtin/internal/factories/{Weth9__factory.d.ts → WETH9__factory.d.ts} +4 -4
  35. package/lib/builtin/internal/factories/{Weth9__factory.js → WETH9__factory.js} +4 -4
  36. package/lib/builtin/internal/factories/{Weth9__factory.js.map → WETH9__factory.js.map} +1 -1
  37. package/lib/builtin/internal/factories/index.d.ts +3 -2
  38. package/lib/builtin/internal/factories/index.js +7 -5
  39. package/lib/builtin/internal/factories/index.js.map +1 -1
  40. package/lib/builtin/internal/index.d.ts +6 -4
  41. package/lib/builtin/internal/index.js +7 -5
  42. package/lib/builtin/internal/index.js.map +1 -1
  43. package/lib/builtin/internal/weth9_processor.d.ts +20 -20
  44. package/lib/builtin/internal/weth9_processor.js +36 -36
  45. package/lib/builtin/internal/weth9_processor.js.map +1 -1
  46. package/lib/builtin/weth9/index.d.ts +1 -1
  47. package/lib/builtin/weth9/index.js +1 -1
  48. package/lib/builtin/weth9/index.js.map +1 -1
  49. package/lib/builtin/weth9/test-utils.js +4 -4
  50. package/lib/builtin/weth9/test-utils.js.map +1 -1
  51. package/lib/test/erc20-template.js +3 -3
  52. package/lib/test/erc20-template.js.map +1 -1
  53. package/lib/test/erc20.js +8 -8
  54. package/lib/test/erc20.js.map +1 -1
  55. package/lib/test/erc20.test.js +3 -3
  56. package/lib/test/erc20.test.js.map +1 -1
  57. package/lib/utils/erc20.d.ts +9 -0
  58. package/lib/utils/erc20.js +51 -0
  59. package/lib/utils/erc20.js.map +1 -0
  60. package/lib/utils/erc20.test.d.ts +1 -0
  61. package/lib/utils/erc20.test.js +28 -0
  62. package/lib/utils/erc20.test.js.map +1 -0
  63. package/lib/utils/index.d.ts +1 -0
  64. package/lib/utils/index.js +4 -1
  65. package/lib/utils/index.js.map +1 -1
  66. package/package.json +1 -1
  67. package/src/abis/ERC20.json +174 -0
  68. package/src/abis/{erc20.json → ERC20Bytes.json} +124 -86
  69. package/src/abis/{weth9.json → WETH9.json} +0 -0
  70. package/src/builtin/erc20/index.ts +1 -1
  71. package/src/builtin/erc20/test-utils.ts +25 -3
  72. package/src/builtin/erc20bytes/index.ts +6 -0
  73. package/src/builtin/erc20bytes/test-utils.ts +53 -0
  74. package/src/builtin/internal/ERC20.ts +679 -0
  75. package/src/builtin/internal/{Erc20.ts → ERC20Bytes.ts} +138 -110
  76. package/src/builtin/internal/{Weth9.ts → WETH9.ts} +3 -3
  77. package/src/builtin/internal/erc20_processor.ts +188 -44
  78. package/src/builtin/internal/erc20bytes_processor.ts +362 -0
  79. package/src/builtin/internal/factories/{Erc20__factory.ts → ERC20Bytes__factory.ts} +132 -91
  80. package/src/builtin/internal/factories/ERC20__factory.ts +404 -0
  81. package/src/builtin/internal/factories/{Weth9__factory.ts → WETH9__factory.ts} +6 -6
  82. package/src/builtin/internal/factories/index.ts +3 -2
  83. package/src/builtin/internal/index.ts +6 -4
  84. package/src/builtin/internal/weth9_processor.ts +52 -52
  85. package/src/builtin/weth9/index.ts +1 -1
  86. package/src/builtin/weth9/test-utils.ts +5 -5
  87. package/src/test/erc20-template.ts +4 -4
  88. package/src/test/erc20.test.ts +3 -3
  89. package/src/test/erc20.ts +9 -9
  90. package/src/utils/erc20.test.ts +31 -0
  91. package/src/utils/erc20.ts +60 -0
  92. package/src/utils/index.ts +1 -0
  93. package/lib/builtin/internal/Erc20.js.map +0 -1
  94. package/lib/builtin/internal/factories/Erc20__factory.js.map +0 -1
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const sdk_1 = require("@sentio/sdk");
4
+ const erc20_1 = require("./erc20");
5
+ describe('erc20 tests', () => {
6
+ beforeAll(async () => {
7
+ global.PROCESSOR_STATE = new sdk_1.ProcessorState();
8
+ (0, sdk_1.setProvider)({
9
+ '1': {
10
+ ChainID: '1',
11
+ Https: ['https://eth-mainnet.alchemyapi.io/v2/Gk024pFA-64RaEPIawL40n__1esXJFb2'], // Use env
12
+ },
13
+ });
14
+ });
15
+ test('test bytes32', async () => {
16
+ const info = await (0, erc20_1.getERC20TokenInfo)('0x9f8F72aA9304c8B593d555F12eF6589cC3A579A2');
17
+ expect(info.decimal).toEqual(18);
18
+ expect(info.symbol).toEqual('MKR');
19
+ expect(info.name).toEqual('Maker');
20
+ });
21
+ test('test normal', async () => {
22
+ const info = await (0, erc20_1.getERC20TokenInfo)('0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48');
23
+ expect(info.decimal).toEqual(6);
24
+ expect(info.symbol).toEqual('USDC');
25
+ expect(info.name).toEqual('USD Coin');
26
+ });
27
+ });
28
+ //# sourceMappingURL=erc20.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"erc20.test.js","sourceRoot":"","sources":["../../src/utils/erc20.test.ts"],"names":[],"mappings":";;AAAA,qCAAyD;AACzD,mCAA2C;AAE3C,QAAQ,CAAC,aAAa,EAAE,GAAG,EAAE;IAC3B,SAAS,CAAC,KAAK,IAAI,EAAE;QACnB,MAAM,CAAC,eAAe,GAAG,IAAI,oBAAc,EAAE,CAAA;QAE7C,IAAA,iBAAW,EAAC;YACV,GAAG,EAAE;gBACH,OAAO,EAAE,GAAG;gBACZ,KAAK,EAAE,CAAC,uEAAuE,CAAC,EAAE,UAAU;aAC7F;SACF,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;IAEF,IAAI,CAAC,cAAc,EAAE,KAAK,IAAI,EAAE;QAC9B,MAAM,IAAI,GAAG,MAAM,IAAA,yBAAiB,EAAC,4CAA4C,CAAC,CAAA;QAElF,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAA;QAChC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;QAClC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAA;IACpC,CAAC,CAAC,CAAA;IAEF,IAAI,CAAC,aAAa,EAAE,KAAK,IAAI,EAAE;QAC7B,MAAM,IAAI,GAAG,MAAM,IAAA,yBAAiB,EAAC,4CAA4C,CAAC,CAAA;QAElF,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAA;QAC/B,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA;QACnC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,CAAA;IACvC,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA","sourcesContent":["import { ProcessorState, setProvider } from '@sentio/sdk'\nimport { getERC20TokenInfo } from './erc20'\n\ndescribe('erc20 tests', () => {\n beforeAll(async () => {\n global.PROCESSOR_STATE = new ProcessorState()\n\n setProvider({\n '1': {\n ChainID: '1',\n Https: ['https://eth-mainnet.alchemyapi.io/v2/Gk024pFA-64RaEPIawL40n__1esXJFb2'], // Use env\n },\n })\n })\n\n test('test bytes32', async () => {\n const info = await getERC20TokenInfo('0x9f8F72aA9304c8B593d555F12eF6589cC3A579A2')\n\n expect(info.decimal).toEqual(18)\n expect(info.symbol).toEqual('MKR')\n expect(info.name).toEqual('Maker')\n })\n\n test('test normal', async () => {\n const info = await getERC20TokenInfo('0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48')\n\n expect(info.decimal).toEqual(6)\n expect(info.symbol).toEqual('USDC')\n expect(info.name).toEqual('USD Coin')\n })\n})\n"]}
@@ -1,2 +1,3 @@
1
1
  export { getChainName } from './chainmap';
2
2
  export { toBigDecimal, metricValueToNumberish } from './convert';
3
+ export { getERC20TokenInfo, getER20NormalizedAmount } from './erc20';
@@ -1,9 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.metricValueToNumberish = exports.toBigDecimal = exports.getChainName = void 0;
3
+ exports.getER20NormalizedAmount = exports.getERC20TokenInfo = exports.metricValueToNumberish = exports.toBigDecimal = exports.getChainName = void 0;
4
4
  var chainmap_1 = require("./chainmap");
5
5
  Object.defineProperty(exports, "getChainName", { enumerable: true, get: function () { return chainmap_1.getChainName; } });
6
6
  var convert_1 = require("./convert");
7
7
  Object.defineProperty(exports, "toBigDecimal", { enumerable: true, get: function () { return convert_1.toBigDecimal; } });
8
8
  Object.defineProperty(exports, "metricValueToNumberish", { enumerable: true, get: function () { return convert_1.metricValueToNumberish; } });
9
+ var erc20_1 = require("./erc20");
10
+ Object.defineProperty(exports, "getERC20TokenInfo", { enumerable: true, get: function () { return erc20_1.getERC20TokenInfo; } });
11
+ Object.defineProperty(exports, "getER20NormalizedAmount", { enumerable: true, get: function () { return erc20_1.getER20NormalizedAmount; } });
9
12
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":";;;AAAA,uCAAyC;AAAhC,wGAAA,YAAY,OAAA;AACrB,qCAAgE;AAAvD,uGAAA,YAAY,OAAA;AAAE,iHAAA,sBAAsB,OAAA","sourcesContent":["export { getChainName } from './chainmap'\nexport { toBigDecimal, metricValueToNumberish } from './convert'\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":";;;AAAA,uCAAyC;AAAhC,wGAAA,YAAY,OAAA;AACrB,qCAAgE;AAAvD,uGAAA,YAAY,OAAA;AAAE,iHAAA,sBAAsB,OAAA;AAC7C,iCAAoE;AAA3D,0GAAA,iBAAiB,OAAA;AAAE,gHAAA,uBAAuB,OAAA","sourcesContent":["export { getChainName } from './chainmap'\nexport { toBigDecimal, metricValueToNumberish } from './convert'\nexport { getERC20TokenInfo, getER20NormalizedAmount } from './erc20'\n"]}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sentio/sdk",
3
3
  "license": "Apache-2.0",
4
- "version": "1.7.20",
4
+ "version": "1.7.21",
5
5
  "scripts": {
6
6
  "compile_target": "yarn tsc -b src/target-ethers-sentio/tsconfig.json",
7
7
  "compile": "tsc -p . && cp src/cli/webpack.config.js lib/cli",
@@ -0,0 +1,174 @@
1
+ [
2
+ { "inputs": [], "stateMutability": "nonpayable", "type": "constructor" },
3
+ {
4
+ "anonymous": false,
5
+ "inputs": [
6
+ { "indexed": true, "internalType": "address", "name": "owner", "type": "address" },
7
+ { "indexed": true, "internalType": "address", "name": "spender", "type": "address" },
8
+ { "indexed": false, "internalType": "uint256", "name": "value", "type": "uint256" }
9
+ ],
10
+ "name": "Approval",
11
+ "type": "event"
12
+ },
13
+ {
14
+ "anonymous": false,
15
+ "inputs": [
16
+ { "indexed": true, "internalType": "address", "name": "previousOwner", "type": "address" },
17
+ { "indexed": true, "internalType": "address", "name": "newOwner", "type": "address" }
18
+ ],
19
+ "name": "OwnershipTransferred",
20
+ "type": "event"
21
+ },
22
+ {
23
+ "anonymous": false,
24
+ "inputs": [
25
+ { "indexed": true, "internalType": "address", "name": "from", "type": "address" },
26
+ { "indexed": true, "internalType": "address", "name": "to", "type": "address" },
27
+ { "indexed": false, "internalType": "uint256", "name": "value", "type": "uint256" }
28
+ ],
29
+ "name": "Transfer",
30
+ "type": "event"
31
+ },
32
+ {
33
+ "inputs": [
34
+ { "internalType": "address", "name": "owner", "type": "address" },
35
+ { "internalType": "address", "name": "spender", "type": "address" }
36
+ ],
37
+ "name": "allowance",
38
+ "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
39
+ "stateMutability": "view",
40
+ "type": "function"
41
+ },
42
+ {
43
+ "inputs": [
44
+ { "internalType": "address", "name": "spender", "type": "address" },
45
+ { "internalType": "uint256", "name": "amount", "type": "uint256" }
46
+ ],
47
+ "name": "approve",
48
+ "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
49
+ "stateMutability": "nonpayable",
50
+ "type": "function"
51
+ },
52
+ {
53
+ "inputs": [{ "internalType": "address", "name": "account", "type": "address" }],
54
+ "name": "balanceOf",
55
+ "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
56
+ "stateMutability": "view",
57
+ "type": "function"
58
+ },
59
+ {
60
+ "inputs": [{ "internalType": "uint256", "name": "amount", "type": "uint256" }],
61
+ "name": "burn",
62
+ "outputs": [],
63
+ "stateMutability": "nonpayable",
64
+ "type": "function"
65
+ },
66
+ {
67
+ "inputs": [
68
+ { "internalType": "address", "name": "account", "type": "address" },
69
+ { "internalType": "uint256", "name": "amount", "type": "uint256" }
70
+ ],
71
+ "name": "burnFrom",
72
+ "outputs": [],
73
+ "stateMutability": "nonpayable",
74
+ "type": "function"
75
+ },
76
+ {
77
+ "inputs": [],
78
+ "name": "decimals",
79
+ "outputs": [{ "internalType": "uint8", "name": "", "type": "uint8" }],
80
+ "stateMutability": "view",
81
+ "type": "function"
82
+ },
83
+ {
84
+ "inputs": [
85
+ { "internalType": "address", "name": "spender", "type": "address" },
86
+ { "internalType": "uint256", "name": "subtractedValue", "type": "uint256" }
87
+ ],
88
+ "name": "decreaseAllowance",
89
+ "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
90
+ "stateMutability": "nonpayable",
91
+ "type": "function"
92
+ },
93
+ {
94
+ "inputs": [
95
+ { "internalType": "address", "name": "spender", "type": "address" },
96
+ { "internalType": "uint256", "name": "addedValue", "type": "uint256" }
97
+ ],
98
+ "name": "increaseAllowance",
99
+ "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
100
+ "stateMutability": "nonpayable",
101
+ "type": "function"
102
+ },
103
+ {
104
+ "inputs": [],
105
+ "name": "locker",
106
+ "outputs": [{ "internalType": "contract ILocker", "name": "", "type": "address" }],
107
+ "stateMutability": "view",
108
+ "type": "function"
109
+ },
110
+ {
111
+ "inputs": [],
112
+ "name": "name",
113
+ "outputs": [{ "internalType": "string", "name": "", "type": "string" }],
114
+ "stateMutability": "view",
115
+ "type": "function"
116
+ },
117
+ {
118
+ "inputs": [],
119
+ "name": "owner",
120
+ "outputs": [{ "internalType": "address", "name": "", "type": "address" }],
121
+ "stateMutability": "view",
122
+ "type": "function"
123
+ },
124
+ { "inputs": [], "name": "renounceOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" },
125
+ {
126
+ "inputs": [{ "internalType": "address", "name": "_locker", "type": "address" }],
127
+ "name": "setLocker",
128
+ "outputs": [],
129
+ "stateMutability": "nonpayable",
130
+ "type": "function"
131
+ },
132
+ {
133
+ "inputs": [],
134
+ "name": "symbol",
135
+ "outputs": [{ "internalType": "string", "name": "", "type": "string" }],
136
+ "stateMutability": "view",
137
+ "type": "function"
138
+ },
139
+ {
140
+ "inputs": [],
141
+ "name": "totalSupply",
142
+ "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
143
+ "stateMutability": "view",
144
+ "type": "function"
145
+ },
146
+ {
147
+ "inputs": [
148
+ { "internalType": "address", "name": "recipient", "type": "address" },
149
+ { "internalType": "uint256", "name": "amount", "type": "uint256" }
150
+ ],
151
+ "name": "transfer",
152
+ "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
153
+ "stateMutability": "nonpayable",
154
+ "type": "function"
155
+ },
156
+ {
157
+ "inputs": [
158
+ { "internalType": "address", "name": "sender", "type": "address" },
159
+ { "internalType": "address", "name": "recipient", "type": "address" },
160
+ { "internalType": "uint256", "name": "amount", "type": "uint256" }
161
+ ],
162
+ "name": "transferFrom",
163
+ "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
164
+ "stateMutability": "nonpayable",
165
+ "type": "function"
166
+ },
167
+ {
168
+ "inputs": [{ "internalType": "address", "name": "newOwner", "type": "address" }],
169
+ "name": "transferOwnership",
170
+ "outputs": [],
171
+ "stateMutability": "nonpayable",
172
+ "type": "function"
173
+ }
174
+ ]
@@ -1,198 +1,236 @@
1
1
  [
2
2
  {
3
- "anonymous": false,
4
- "inputs": [
5
- {
6
- "indexed": true,
7
- "internalType": "address",
8
- "name": "owner",
9
- "type": "address"
10
- },
11
- {
12
- "indexed": true,
13
- "internalType": "address",
14
- "name": "spender",
15
- "type": "address"
16
- },
3
+ "constant": true,
4
+ "inputs": [],
5
+ "name": "name",
6
+ "outputs": [
17
7
  {
18
- "indexed": false,
19
- "internalType": "uint256",
20
- "name": "value",
21
- "type": "uint256"
8
+ "name": "",
9
+ "type": "bytes32"
22
10
  }
23
11
  ],
24
- "name": "Approval",
25
- "type": "event"
12
+ "payable": false,
13
+ "stateMutability": "view",
14
+ "type": "function"
26
15
  },
27
16
  {
28
- "anonymous": false,
17
+ "constant": false,
29
18
  "inputs": [
30
19
  {
31
- "indexed": true,
32
- "internalType": "address",
33
- "name": "from",
34
- "type": "address"
35
- },
36
- {
37
- "indexed": true,
38
- "internalType": "address",
39
- "name": "to",
20
+ "name": "spender",
40
21
  "type": "address"
41
22
  },
42
23
  {
43
- "indexed": false,
44
- "internalType": "uint256",
45
24
  "name": "value",
46
25
  "type": "uint256"
47
26
  }
48
27
  ],
49
- "name": "Transfer",
50
- "type": "event"
51
- },
52
- {
53
- "inputs": [
54
- {
55
- "internalType": "address",
56
- "name": "owner",
57
- "type": "address"
58
- },
28
+ "name": "approve",
29
+ "outputs": [
59
30
  {
60
- "internalType": "address",
61
- "name": "spender",
62
- "type": "address"
31
+ "name": "",
32
+ "type": "bool"
63
33
  }
64
34
  ],
65
- "name": "allowance",
35
+ "payable": false,
36
+ "stateMutability": "nonpayable",
37
+ "type": "function"
38
+ },
39
+ {
40
+ "constant": true,
41
+ "inputs": [],
42
+ "name": "totalSupply",
66
43
  "outputs": [
67
44
  {
68
- "internalType": "uint256",
69
45
  "name": "",
70
46
  "type": "uint256"
71
47
  }
72
48
  ],
49
+ "payable": false,
73
50
  "stateMutability": "view",
74
51
  "type": "function"
75
52
  },
76
53
  {
54
+ "constant": false,
77
55
  "inputs": [
78
56
  {
79
- "internalType": "address",
80
- "name": "spender",
57
+ "name": "from",
58
+ "type": "address"
59
+ },
60
+ {
61
+ "name": "to",
81
62
  "type": "address"
82
63
  },
83
64
  {
84
- "internalType": "uint256",
85
- "name": "amount",
65
+ "name": "value",
86
66
  "type": "uint256"
87
67
  }
88
68
  ],
89
- "name": "approve",
69
+ "name": "transferFrom",
90
70
  "outputs": [
91
71
  {
92
- "internalType": "bool",
93
72
  "name": "",
94
73
  "type": "bool"
95
74
  }
96
75
  ],
76
+ "payable": false,
97
77
  "stateMutability": "nonpayable",
98
78
  "type": "function"
99
79
  },
100
80
  {
81
+ "constant": true,
82
+ "inputs": [],
83
+ "name": "decimals",
84
+ "outputs": [
85
+ {
86
+ "name": "",
87
+ "type": "uint8"
88
+ }
89
+ ],
90
+ "payable": false,
91
+ "stateMutability": "view",
92
+ "type": "function"
93
+ },
94
+ {
95
+ "constant": true,
101
96
  "inputs": [
102
97
  {
103
- "internalType": "address",
104
- "name": "account",
98
+ "name": "who",
105
99
  "type": "address"
106
100
  }
107
101
  ],
108
102
  "name": "balanceOf",
109
103
  "outputs": [
110
104
  {
111
- "internalType": "uint256",
112
105
  "name": "",
113
106
  "type": "uint256"
114
107
  }
115
108
  ],
109
+ "payable": false,
116
110
  "stateMutability": "view",
117
111
  "type": "function"
118
112
  },
119
113
  {
114
+ "constant": true,
120
115
  "inputs": [],
121
- "name": "decimals",
116
+ "name": "symbol",
122
117
  "outputs": [
123
118
  {
124
- "internalType": "uint8",
125
119
  "name": "",
126
- "type": "uint8"
120
+ "type": "bytes32"
127
121
  }
128
122
  ],
123
+ "payable": false,
129
124
  "stateMutability": "view",
130
125
  "type": "function"
131
126
  },
132
127
  {
133
- "inputs": [],
134
- "name": "totalSupply",
128
+ "constant": false,
129
+ "inputs": [
130
+ {
131
+ "name": "to",
132
+ "type": "address"
133
+ },
134
+ {
135
+ "name": "value",
136
+ "type": "uint256"
137
+ }
138
+ ],
139
+ "name": "transfer",
135
140
  "outputs": [
136
141
  {
137
- "internalType": "uint256",
138
142
  "name": "",
139
- "type": "uint256"
143
+ "type": "bool"
140
144
  }
141
145
  ],
142
- "stateMutability": "view",
146
+ "payable": false,
147
+ "stateMutability": "nonpayable",
143
148
  "type": "function"
144
149
  },
145
150
  {
151
+ "constant": true,
146
152
  "inputs": [
147
153
  {
148
- "internalType": "address",
149
- "name": "to",
154
+ "name": "owner",
150
155
  "type": "address"
151
156
  },
152
157
  {
153
- "internalType": "uint256",
154
- "name": "amount",
155
- "type": "uint256"
158
+ "name": "spender",
159
+ "type": "address"
156
160
  }
157
161
  ],
158
- "name": "transfer",
162
+ "name": "allowance",
159
163
  "outputs": [
160
164
  {
161
- "internalType": "bool",
162
165
  "name": "",
163
- "type": "bool"
166
+ "type": "uint256"
164
167
  }
165
168
  ],
166
- "stateMutability": "nonpayable",
169
+ "payable": false,
170
+ "stateMutability": "view",
167
171
  "type": "function"
168
172
  },
169
173
  {
170
174
  "inputs": [
171
175
  {
172
- "internalType": "address",
173
- "name": "from",
176
+ "name": "_name",
177
+ "type": "string"
178
+ },
179
+ {
180
+ "name": "_symbol",
181
+ "type": "string"
182
+ },
183
+ {
184
+ "name": "_decimals",
185
+ "type": "uint8"
186
+ }
187
+ ],
188
+ "payable": false,
189
+ "stateMutability": "nonpayable",
190
+ "type": "constructor"
191
+ },
192
+ {
193
+ "anonymous": false,
194
+ "inputs": [
195
+ {
196
+ "indexed": true,
197
+ "name": "owner",
174
198
  "type": "address"
175
199
  },
176
200
  {
177
- "internalType": "address",
178
- "name": "to",
201
+ "indexed": true,
202
+ "name": "spender",
179
203
  "type": "address"
180
204
  },
181
205
  {
182
- "internalType": "uint256",
183
- "name": "amount",
206
+ "indexed": false,
207
+ "name": "value",
184
208
  "type": "uint256"
185
209
  }
186
210
  ],
187
- "name": "transferFrom",
188
- "outputs": [
211
+ "name": "Approval",
212
+ "type": "event"
213
+ },
214
+ {
215
+ "anonymous": false,
216
+ "inputs": [
189
217
  {
190
- "internalType": "bool",
191
- "name": "",
192
- "type": "bool"
218
+ "indexed": true,
219
+ "name": "from",
220
+ "type": "address"
221
+ },
222
+ {
223
+ "indexed": true,
224
+ "name": "to",
225
+ "type": "address"
226
+ },
227
+ {
228
+ "indexed": false,
229
+ "name": "value",
230
+ "type": "uint256"
193
231
  }
194
232
  ],
195
- "stateMutability": "nonpayable",
196
- "type": "function"
233
+ "name": "Transfer",
234
+ "type": "event"
197
235
  }
198
236
  ]
File without changes
@@ -3,4 +3,4 @@
3
3
  /* eslint-disable */
4
4
 
5
5
  export * from "../internal/erc20_processor";
6
- export * from "../internal/Erc20";
6
+ export * from "../internal/ERC20";
@@ -2,7 +2,12 @@
2
2
  /* tslint:disable */
3
3
  /* eslint-disable */
4
4
  import { Log } from "@ethersproject/providers";
5
- import { getErc20Contract, ApprovalEventObject, TransferEventObject } from ".";
5
+ import {
6
+ getERC20Contract,
7
+ ApprovalEventObject,
8
+ OwnershipTransferredEventObject,
9
+ TransferEventObject,
10
+ } from ".";
6
11
  const mockField = {
7
12
  blockHash:
8
13
  "0x0000000000000000000000000000000000000000000000000000000000000000",
@@ -18,7 +23,7 @@ export function mockApprovalLog(
18
23
  contractAddress: string,
19
24
  event: ApprovalEventObject
20
25
  ): Log {
21
- const contract = getErc20Contract(contractAddress);
26
+ const contract = getERC20Contract(contractAddress);
22
27
  const encodedLog = contract.rawContract.interface.encodeEventLog(
23
28
  contract.rawContract.interface.getEvent("Approval"),
24
29
  Object.values(event)
@@ -31,11 +36,28 @@ export function mockApprovalLog(
31
36
  };
32
37
  }
33
38
 
39
+ export function mockOwnershipTransferredLog(
40
+ contractAddress: string,
41
+ event: OwnershipTransferredEventObject
42
+ ): Log {
43
+ const contract = getERC20Contract(contractAddress);
44
+ const encodedLog = contract.rawContract.interface.encodeEventLog(
45
+ contract.rawContract.interface.getEvent("OwnershipTransferred"),
46
+ Object.values(event)
47
+ );
48
+ return {
49
+ ...mockField,
50
+ address: contractAddress,
51
+ data: encodedLog.data,
52
+ topics: encodedLog.topics,
53
+ };
54
+ }
55
+
34
56
  export function mockTransferLog(
35
57
  contractAddress: string,
36
58
  event: TransferEventObject
37
59
  ): Log {
38
- const contract = getErc20Contract(contractAddress);
60
+ const contract = getERC20Contract(contractAddress);
39
61
  const encodedLog = contract.rawContract.interface.encodeEventLog(
40
62
  contract.rawContract.interface.getEvent("Transfer"),
41
63
  Object.values(event)
@@ -0,0 +1,6 @@
1
+ /* Autogenerated file. Do not edit manually. */
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+
5
+ export * from "../internal/erc20bytes_processor";
6
+ export * from "../internal/ERC20Bytes";