@sentio/sdk 1.40.4 → 1.40.5-rc.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.
- package/lib/core/big-decimal.d.ts +1 -1
- package/lib/core/big-decimal.js +2 -2
- package/lib/core/big-decimal.js.map +1 -1
- package/lib/core/logger.d.ts +1 -1
- package/lib/core/logger.js.map +1 -1
- package/lib/webpack.config.js +50 -0
- package/package.json +6 -6
- package/src/core/big-decimal.ts +1 -1
- package/src/core/logger.ts +1 -1
- package/src/webpack.config.js +50 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { BigDecimal } from '@sentio/bigdecimal';
|
package/lib/core/big-decimal.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.BigDecimal = void 0;
|
|
4
|
-
var
|
|
5
|
-
Object.defineProperty(exports, "BigDecimal", { enumerable: true, get: function () { return
|
|
4
|
+
var bigdecimal_1 = require("@sentio/bigdecimal");
|
|
5
|
+
Object.defineProperty(exports, "BigDecimal", { enumerable: true, get: function () { return bigdecimal_1.BigDecimal; } });
|
|
6
6
|
//# sourceMappingURL=big-decimal.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"big-decimal.js","sourceRoot":"","sources":["../../src/core/big-decimal.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"big-decimal.js","sourceRoot":"","sources":["../../src/core/big-decimal.ts"],"names":[],"mappings":";;;AAAA,iDAA+C;AAAtC,wGAAA,UAAU,OAAA","sourcesContent":["export { BigDecimal } from '@sentio/bigdecimal'\n"]}
|
package/lib/core/logger.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ export declare class Logger extends NamedResultDescriptor {
|
|
|
6
6
|
private readonly ctx;
|
|
7
7
|
constructor(ctx: BaseContext, name?: string);
|
|
8
8
|
withName(name: string): Logger;
|
|
9
|
-
log(level: LogLevel, message: any, attributes?: Attributes): void;
|
|
9
|
+
protected log(level: LogLevel, message: any, attributes?: Attributes): void;
|
|
10
10
|
info(msg: any, attributes?: Attributes): void;
|
|
11
11
|
warn(msg: any, attributes?: Attributes): void;
|
|
12
12
|
error(msg: any, attributes?: Attributes): void;
|
package/lib/core/logger.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../../src/core/logger.ts"],"names":[],"mappings":";;;AACA,2CAAyC;AACzC,yCAAkD;AAIlD,MAAa,MAAO,SAAQ,gCAAqB;IAC9B,GAAG,CAAa;IAEjC,YAAY,GAAgB,EAAE,IAAI,GAAG,EAAE;QACrC,KAAK,CAAC,IAAI,CAAC,CAAA;QACX,IAAI,CAAC,GAAG,GAAG,GAAG,CAAA;IAChB,CAAC;IAED,QAAQ,CAAC,IAAY;QACnB,OAAO,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,CAAA;IACnC,CAAC;
|
|
1
|
+
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../../src/core/logger.ts"],"names":[],"mappings":";;;AACA,2CAAyC;AACzC,yCAAkD;AAIlD,MAAa,MAAO,SAAQ,gCAAqB;IAC9B,GAAG,CAAa;IAEjC,YAAY,GAAgB,EAAE,IAAI,GAAG,EAAE;QACrC,KAAK,CAAC,IAAI,CAAC,CAAA;QACX,IAAI,CAAC,GAAG,GAAG,GAAG,CAAA;IAChB,CAAC;IAED,QAAQ,CAAC,IAAY;QACnB,OAAO,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,CAAA;IACnC,CAAC;IAES,GAAG,CAAC,KAAe,EAAE,OAAY,EAAE,aAAyB,EAAE;QACtE,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,CAAC,CAAC,OAAO,YAAY,MAAM,CAAC,EAAE;YAC/D,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAA;SAClC;QAED,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;YACtB,mBAAmB;YACnB,QAAQ,EAAE,IAAI,CAAC,GAAG,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE,CAAC;YAC7C,KAAK;YACL,OAAO;YACP,UAAU,EAAE,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC;YACtC,WAAW,EAAE,SAAS;SACvB,CAAC,CAAA;IACJ,CAAC;IAED,IAAI,CAAC,GAAQ,EAAE,aAAyB,EAAE;QACxC,IAAI,CAAC,GAAG,CAAC,iBAAQ,CAAC,IAAI,EAAE,GAAG,EAAE,UAAU,CAAC,CAAA;IAC1C,CAAC;IAED,IAAI,CAAC,GAAQ,EAAE,aAAyB,EAAE;QACxC,IAAI,CAAC,GAAG,CAAC,iBAAQ,CAAC,OAAO,EAAE,GAAG,EAAE,UAAU,CAAC,CAAA;IAC7C,CAAC;IAED,KAAK,CAAC,GAAQ,EAAE,aAAyB,EAAE;QACzC,IAAI,CAAC,GAAG,CAAC,iBAAQ,CAAC,KAAK,EAAE,GAAG,EAAE,UAAU,CAAC,CAAA;IAC3C,CAAC;IAED,QAAQ,CAAC,GAAQ,EAAE,aAAyB,EAAE;QAC5C,IAAI,CAAC,GAAG,CAAC,iBAAQ,CAAC,QAAQ,EAAE,GAAG,EAAE,UAAU,CAAC,CAAA;IAC9C,CAAC;CACF;AA1CD,wBA0CC","sourcesContent":["import { BaseContext } from './base-context'\nimport { LogLevel } from '@sentio/protos'\nimport { NamedResultDescriptor } from './metadata'\n\nexport type Attributes = Record<string, any>\n\nexport class Logger extends NamedResultDescriptor {\n private readonly ctx: BaseContext\n\n constructor(ctx: BaseContext, name = '') {\n super(name)\n this.ctx = ctx\n }\n\n withName(name: string) {\n return new Logger(this.ctx, name)\n }\n\n protected log(level: LogLevel, message: any, attributes: Attributes = {}) {\n if (typeof message !== 'string' && !(message instanceof String)) {\n message = JSON.stringify(message)\n }\n\n this.ctx._res.logs.push({\n // name: this.name,\n metadata: this.ctx.getMetaData(this.name, {}), // GetRecordMetaData(this.ctx, this, {}),\n level,\n message,\n attributes: JSON.stringify(attributes),\n runtimeInfo: undefined,\n })\n }\n\n info(msg: any, attributes: Attributes = {}) {\n this.log(LogLevel.INFO, msg, attributes)\n }\n\n warn(msg: any, attributes: Attributes = {}) {\n this.log(LogLevel.WARNING, msg, attributes)\n }\n\n error(msg: any, attributes: Attributes = {}) {\n this.log(LogLevel.ERROR, msg, attributes)\n }\n\n critical(msg: any, attributes: Attributes = {}) {\n this.log(LogLevel.CRITICAL, msg, attributes)\n }\n}\n"]}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
const path = require('path')
|
|
3
|
+
|
|
4
|
+
module.exports = {
|
|
5
|
+
entry: {
|
|
6
|
+
lib: './src/processor.ts',
|
|
7
|
+
},
|
|
8
|
+
devtool: 'inline-source-map',
|
|
9
|
+
module: {
|
|
10
|
+
rules: [
|
|
11
|
+
{
|
|
12
|
+
test: /\.tsx?$/,
|
|
13
|
+
use: 'ts-loader',
|
|
14
|
+
exclude: /node_modules/,
|
|
15
|
+
},
|
|
16
|
+
],
|
|
17
|
+
},
|
|
18
|
+
resolve: {
|
|
19
|
+
extensions: ['.ts', '.js'],
|
|
20
|
+
},
|
|
21
|
+
output: {
|
|
22
|
+
filename: '[name].js',
|
|
23
|
+
path: path.resolve(process.cwd(), 'dist'),
|
|
24
|
+
},
|
|
25
|
+
target: 'node',
|
|
26
|
+
mode: 'production',
|
|
27
|
+
externals: [
|
|
28
|
+
{
|
|
29
|
+
protobufjs: 'commonjs2 protobufjs',
|
|
30
|
+
aptos: 'commonjs2 aptos-sdk',
|
|
31
|
+
ethers: 'commonjs2 ethers',
|
|
32
|
+
bs58: 'commonjs2 bs58',
|
|
33
|
+
"bignumber.js": 'commonjs2 bignumber.js',
|
|
34
|
+
'bn.js': 'commonjs2 bn.js',
|
|
35
|
+
'csv-parse': 'commonjs2 csv-parse',
|
|
36
|
+
},
|
|
37
|
+
function ({ context, request }, callback) {
|
|
38
|
+
if (/^@(ethersproject|solana|project-serum|nice-grpc).*$/.test(request)) {
|
|
39
|
+
return callback(null, 'commonjs ' + request)
|
|
40
|
+
}
|
|
41
|
+
if (/^nice-grpc.*$/.test(request)) {
|
|
42
|
+
return callback(null, 'commonjs ' + request)
|
|
43
|
+
}
|
|
44
|
+
if (/^@sentio\/(sdk|runtime|base|protos|bigdecimal).*$/.test(request)) {
|
|
45
|
+
return callback(null, 'commonjs ' + request)
|
|
46
|
+
}
|
|
47
|
+
callback()
|
|
48
|
+
},
|
|
49
|
+
],
|
|
50
|
+
}
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sentio/sdk",
|
|
3
3
|
"license": "Apache-2.0",
|
|
4
|
-
"version": "1.40.
|
|
4
|
+
"version": "1.40.5-rc.2",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"compile_target": "yarn tsc -b src/target-ethers-sentio/tsconfig.json",
|
|
7
|
-
"compile": "tsc -p . && cp src/utils/*.csv lib/utils",
|
|
7
|
+
"compile": "tsc -p . && cp src/utils/*.csv lib/utils && cp src/webpack.config.js lib",
|
|
8
8
|
"build": "yarn gen && yarn compile",
|
|
9
9
|
"build_all": "yarn lerna run --scope=@sentio/sdk build --include-dependencies",
|
|
10
10
|
"start_ts": "ts-node --files ../runtime/src/processor-runner.ts --log-format=json ../../examples/x2y2/src/processor.ts",
|
|
@@ -18,10 +18,10 @@
|
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"@ethersproject/providers": "~5.7.0",
|
|
21
|
-
"@sentio/
|
|
22
|
-
"@sentio/
|
|
21
|
+
"@sentio/bigdecimal": "9.1.1-patch.1",
|
|
22
|
+
"@sentio/protos": "^1.40.5-rc.2",
|
|
23
|
+
"@sentio/runtime": "^1.40.5-rc.2",
|
|
23
24
|
"@typechain/ethers-v5": "^10.0.0",
|
|
24
|
-
"bignumber.js": "^9.1.0",
|
|
25
25
|
"command-line-args": "^5.2.1",
|
|
26
26
|
"command-line-usage": "^6.1.3",
|
|
27
27
|
"csv-parse": "^5.3.0",
|
|
@@ -51,5 +51,5 @@
|
|
|
51
51
|
"typedoc": {
|
|
52
52
|
"entryPoint": "./src/index.ts"
|
|
53
53
|
},
|
|
54
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "ff757dbb3953f6a8990a98b5a644b1e7a853dd7e"
|
|
55
55
|
}
|
package/src/core/big-decimal.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { BigDecimal } from '@sentio/bigdecimal'
|
package/src/core/logger.ts
CHANGED
|
@@ -16,7 +16,7 @@ export class Logger extends NamedResultDescriptor {
|
|
|
16
16
|
return new Logger(this.ctx, name)
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
log(level: LogLevel, message: any, attributes: Attributes = {}) {
|
|
19
|
+
protected log(level: LogLevel, message: any, attributes: Attributes = {}) {
|
|
20
20
|
if (typeof message !== 'string' && !(message instanceof String)) {
|
|
21
21
|
message = JSON.stringify(message)
|
|
22
22
|
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
const path = require('path')
|
|
3
|
+
|
|
4
|
+
module.exports = {
|
|
5
|
+
entry: {
|
|
6
|
+
lib: './src/processor.ts',
|
|
7
|
+
},
|
|
8
|
+
devtool: 'inline-source-map',
|
|
9
|
+
module: {
|
|
10
|
+
rules: [
|
|
11
|
+
{
|
|
12
|
+
test: /\.tsx?$/,
|
|
13
|
+
use: 'ts-loader',
|
|
14
|
+
exclude: /node_modules/,
|
|
15
|
+
},
|
|
16
|
+
],
|
|
17
|
+
},
|
|
18
|
+
resolve: {
|
|
19
|
+
extensions: ['.ts', '.js'],
|
|
20
|
+
},
|
|
21
|
+
output: {
|
|
22
|
+
filename: '[name].js',
|
|
23
|
+
path: path.resolve(process.cwd(), 'dist'),
|
|
24
|
+
},
|
|
25
|
+
target: 'node',
|
|
26
|
+
mode: 'production',
|
|
27
|
+
externals: [
|
|
28
|
+
{
|
|
29
|
+
protobufjs: 'commonjs2 protobufjs',
|
|
30
|
+
aptos: 'commonjs2 aptos-sdk',
|
|
31
|
+
ethers: 'commonjs2 ethers',
|
|
32
|
+
bs58: 'commonjs2 bs58',
|
|
33
|
+
"bignumber.js": 'commonjs2 bignumber.js',
|
|
34
|
+
'bn.js': 'commonjs2 bn.js',
|
|
35
|
+
'csv-parse': 'commonjs2 csv-parse',
|
|
36
|
+
},
|
|
37
|
+
function ({ context, request }, callback) {
|
|
38
|
+
if (/^@(ethersproject|solana|project-serum|nice-grpc).*$/.test(request)) {
|
|
39
|
+
return callback(null, 'commonjs ' + request)
|
|
40
|
+
}
|
|
41
|
+
if (/^nice-grpc.*$/.test(request)) {
|
|
42
|
+
return callback(null, 'commonjs ' + request)
|
|
43
|
+
}
|
|
44
|
+
if (/^@sentio\/(sdk|runtime|base|protos|bigdecimal).*$/.test(request)) {
|
|
45
|
+
return callback(null, 'commonjs ' + request)
|
|
46
|
+
}
|
|
47
|
+
callback()
|
|
48
|
+
},
|
|
49
|
+
],
|
|
50
|
+
}
|