@sentio/sdk 1.14.4 → 1.15.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.
- package/lib/cli/upload.js +78 -42
- package/lib/cli/upload.js.map +1 -1
- package/lib/gen/processor/protos/processor.d.ts +3 -2
- package/lib/gen/processor/protos/processor.js +34 -17
- package/lib/gen/processor/protos/processor.js.map +1 -1
- package/lib/service.js +14 -11
- package/lib/service.js.map +1 -1
- package/lib/test/erc20.js +5 -0
- package/lib/test/erc20.js.map +1 -1
- package/lib/test/erc20.test.js +13 -0
- package/lib/test/erc20.test.js.map +1 -1
- package/lib/test/sui.test.js +2 -1
- package/lib/test/sui.test.js.map +1 -1
- package/package.json +1 -1
- package/src/cli/upload.ts +76 -38
- package/src/gen/processor/protos/processor.ts +37 -19
- package/src/service.ts +15 -11
- package/src/test/erc20.test.ts +15 -1
- package/src/test/erc20.ts +5 -1
- package/src/test/sui.test.ts +2 -1
package/lib/cli/upload.js
CHANGED
|
@@ -8,19 +8,30 @@ const child_process_1 = require("child_process");
|
|
|
8
8
|
const crypto_1 = require("crypto");
|
|
9
9
|
const form_data_1 = __importDefault(require("form-data"));
|
|
10
10
|
const fs_1 = __importDefault(require("fs"));
|
|
11
|
+
const readline_1 = __importDefault(require("readline"));
|
|
11
12
|
const key_1 = require("./key");
|
|
12
13
|
const path_1 = __importDefault(require("path"));
|
|
13
14
|
const chalk_1 = __importDefault(require("chalk"));
|
|
14
15
|
const build_1 = require("./build");
|
|
15
16
|
const node_fetch_1 = __importDefault(require("node-fetch"));
|
|
16
17
|
const utils_1 = require("./utils");
|
|
18
|
+
async function createProject(options, apiKey) {
|
|
19
|
+
const url = new URL('/api/v1/projects', options.host);
|
|
20
|
+
return (0, node_fetch_1.default)(url, {
|
|
21
|
+
method: 'POST',
|
|
22
|
+
headers: {
|
|
23
|
+
'api-key': apiKey,
|
|
24
|
+
},
|
|
25
|
+
body: JSON.stringify({ slug: options.project, visibility: 'PRIVATE' }),
|
|
26
|
+
});
|
|
27
|
+
}
|
|
17
28
|
async function uploadFile(options, apiKeyOverride) {
|
|
18
29
|
if (options.build) {
|
|
19
30
|
await (0, build_1.buildProcessor)(false, options.targets);
|
|
20
31
|
}
|
|
21
|
-
console.log(chalk_1.default.blue('
|
|
32
|
+
console.log(chalk_1.default.blue('Prepare to upload'));
|
|
22
33
|
const PROCESSOR_FILE = path_1.default.join(process.cwd(), 'dist/lib.js');
|
|
23
|
-
const url = new URL(options.host);
|
|
34
|
+
const url = new URL('/api/v1/processors', options.host);
|
|
24
35
|
const apiKey = apiKeyOverride || (0, key_1.ReadKey)(options.host);
|
|
25
36
|
const isProd = options.host === 'https://app.sentio.xyz';
|
|
26
37
|
if (!apiKey) {
|
|
@@ -38,47 +49,72 @@ async function uploadFile(options, apiKeyOverride) {
|
|
|
38
49
|
const hash = (0, crypto_1.createHash)('sha256');
|
|
39
50
|
hash.update(content);
|
|
40
51
|
const digest = hash.digest('hex');
|
|
41
|
-
const
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
catch (e) {
|
|
50
|
-
chalk_1.default.yellow(e);
|
|
51
|
-
}
|
|
52
|
-
try {
|
|
53
|
-
const gitUrl = (0, child_process_1.execSync)('git remote get-url origin').toString().trim();
|
|
54
|
-
data.append('gitUrl', gitUrl);
|
|
55
|
-
}
|
|
56
|
-
catch (e) {
|
|
57
|
-
// skip errors
|
|
58
|
-
}
|
|
59
|
-
url.pathname = '/api/v1/processors';
|
|
60
|
-
const res = await (0, node_fetch_1.default)(url, {
|
|
61
|
-
method: 'POST',
|
|
62
|
-
headers: {
|
|
63
|
-
'api-key': apiKey,
|
|
64
|
-
project: options.project,
|
|
65
|
-
version: (0, utils_1.getCliVersion)(),
|
|
66
|
-
},
|
|
67
|
-
body: data,
|
|
68
|
-
});
|
|
69
|
-
if (res.ok) {
|
|
70
|
-
console.log(chalk_1.default.green('Upload success: '));
|
|
71
|
-
console.log('\t', chalk_1.default.blue('sha256:'), digest);
|
|
72
|
-
if (commitSha) {
|
|
73
|
-
console.log('\t', chalk_1.default.blue('Git commit SHA:'), commitSha);
|
|
52
|
+
const upload = async () => {
|
|
53
|
+
const data = new form_data_1.default();
|
|
54
|
+
data.append('attachment', fs_1.default.createReadStream(PROCESSOR_FILE));
|
|
55
|
+
data.append('sha256', digest);
|
|
56
|
+
let commitSha = '';
|
|
57
|
+
try {
|
|
58
|
+
commitSha = (0, child_process_1.execSync)('git rev-parse HEAD').toString().trim();
|
|
59
|
+
data.append('commitSha', commitSha);
|
|
74
60
|
}
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
61
|
+
catch (e) {
|
|
62
|
+
chalk_1.default.yellow(e);
|
|
63
|
+
}
|
|
64
|
+
try {
|
|
65
|
+
const gitUrl = (0, child_process_1.execSync)('git remote get-url origin').toString().trim();
|
|
66
|
+
data.append('gitUrl', gitUrl);
|
|
67
|
+
}
|
|
68
|
+
catch (e) {
|
|
69
|
+
// skip errors
|
|
70
|
+
}
|
|
71
|
+
console.log(chalk_1.default.blue('Uploading'));
|
|
72
|
+
const res = await (0, node_fetch_1.default)(url, {
|
|
73
|
+
method: 'POST',
|
|
74
|
+
headers: {
|
|
75
|
+
'api-key': apiKey,
|
|
76
|
+
project: options.project,
|
|
77
|
+
version: (0, utils_1.getCliVersion)(),
|
|
78
|
+
},
|
|
79
|
+
body: data,
|
|
80
|
+
});
|
|
81
|
+
if (res.ok) {
|
|
82
|
+
console.log(chalk_1.default.green('Upload success: '));
|
|
83
|
+
console.log('\t', chalk_1.default.blue('sha256:'), digest);
|
|
84
|
+
if (commitSha) {
|
|
85
|
+
console.log('\t', chalk_1.default.blue('Git commit SHA:'), commitSha);
|
|
86
|
+
}
|
|
87
|
+
const { ProjectSlug } = await res.json();
|
|
88
|
+
console.log('\t', chalk_1.default.blue('Check status:'), `${options.host}/${ProjectSlug}/datasource`);
|
|
89
|
+
}
|
|
90
|
+
else {
|
|
91
|
+
console.error(chalk_1.default.red('Upload Failed'));
|
|
92
|
+
console.error(chalk_1.default.red(await res.text()));
|
|
93
|
+
if (res.status === 404) {
|
|
94
|
+
const rl = readline_1.default.createInterface({
|
|
95
|
+
input: process.stdin,
|
|
96
|
+
output: process.stdout,
|
|
97
|
+
});
|
|
98
|
+
const prompt = async () => {
|
|
99
|
+
const answer = await new Promise((resolve) => rl.question(`Do you want to create it and continue the uploading process? (yes/no) `, resolve));
|
|
100
|
+
if (['y', 'yes'].includes(answer.toLowerCase())) {
|
|
101
|
+
rl.close();
|
|
102
|
+
await createProject(options, apiKey);
|
|
103
|
+
console.log(chalk_1.default.green('Project created'));
|
|
104
|
+
await upload();
|
|
105
|
+
}
|
|
106
|
+
else if (['n', 'no'].includes(answer.toLowerCase())) {
|
|
107
|
+
rl.close();
|
|
108
|
+
}
|
|
109
|
+
else {
|
|
110
|
+
await prompt();
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
await prompt();
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
await upload();
|
|
82
118
|
}
|
|
83
119
|
exports.uploadFile = uploadFile;
|
|
84
120
|
//# sourceMappingURL=upload.js.map
|
package/lib/cli/upload.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"upload.js","sourceRoot":"","sources":["../../src/cli/upload.ts"],"names":[],"mappings":";;;;;;AAAA,iDAAwC;AACxC,mCAAmC;AACnC,0DAAgC;AAChC,4CAAmB;
|
|
1
|
+
{"version":3,"file":"upload.js","sourceRoot":"","sources":["../../src/cli/upload.ts"],"names":[],"mappings":";;;;;;AAAA,iDAAwC;AACxC,mCAAmC;AACnC,0DAAgC;AAChC,4CAAmB;AACnB,wDAA+B;AAE/B,+BAA+B;AAC/B,gDAAuB;AACvB,kDAAyB;AACzB,mCAAwC;AACxC,4D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-data'\nimport fs from 'fs'\nimport readline from 'readline'\nimport { SentioProjectConfig } from './config'\nimport { ReadKey } from './key'\nimport path from 'path'\nimport chalk from 'chalk'\nimport { buildProcessor } from './build'\nimport fetch from 'node-fetch'\nimport { getCliVersion } from './utils'\n\nasync function createProject(options: SentioProjectConfig, apiKey: string) {\n const url = new URL('/api/v1/projects', options.host)\n return fetch(url, {\n method: 'POST',\n headers: {\n 'api-key': apiKey,\n },\n body: JSON.stringify({ slug: options.project, visibility: 'PRIVATE' }),\n })\n}\n\nexport async function uploadFile(options: SentioProjectConfig, apiKeyOverride: string) {\n if (options.build) {\n await buildProcessor(false, options.targets)\n }\n\n console.log(chalk.blue('Prepare to upload'))\n\n const PROCESSOR_FILE = path.join(process.cwd(), 'dist/lib.js')\n\n const url = new URL('/api/v1/processors', options.host)\n const apiKey = apiKeyOverride || ReadKey(options.host)\n\n const isProd = options.host === 'https://app.sentio.xyz'\n if (!apiKey) {\n const cmd = isProd ? 'sentio login' : 'sentio login --host=' + options.host\n console.error(chalk.red('No Credential found for', options.host, '. Please run `' + cmd + '`.'))\n process.exit(1)\n }\n\n if (!fs.existsSync(PROCESSOR_FILE)) {\n console.error(chalk.red('File not existed ', PROCESSOR_FILE, \"don't use --nobuild\"))\n process.exit(1)\n }\n\n const stat = fs.statSync(PROCESSOR_FILE)\n console.log('Packed processor file size', Math.floor(stat.size / 1024) + 'K, last modified', stat.mtime)\n const content = fs.readFileSync(PROCESSOR_FILE)\n const hash = createHash('sha256')\n hash.update(content)\n const digest = hash.digest('hex')\n\n const upload = async () => {\n const data = new FormData()\n data.append('attachment', fs.createReadStream(PROCESSOR_FILE))\n data.append('sha256', digest)\n\n let commitSha = ''\n try {\n commitSha = execSync('git rev-parse HEAD').toString().trim()\n data.append('commitSha', commitSha)\n } catch (e) {\n chalk.yellow(e)\n }\n try {\n const gitUrl = execSync('git remote get-url origin').toString().trim()\n data.append('gitUrl', gitUrl)\n } catch (e) {\n // skip errors\n }\n console.log(chalk.blue('Uploading'))\n const res = await fetch(url, {\n method: 'POST',\n headers: {\n 'api-key': apiKey,\n project: options.project,\n version: getCliVersion(),\n },\n body: data,\n })\n\n if (res.ok) {\n console.log(chalk.green('Upload success: '))\n console.log('\\t', chalk.blue('sha256:'), digest)\n if (commitSha) {\n console.log('\\t', chalk.blue('Git commit SHA:'), commitSha)\n }\n const { ProjectSlug } = await res.json()\n console.log('\\t', chalk.blue('Check status:'), `${options.host}/${ProjectSlug}/datasource`)\n } else {\n console.error(chalk.red('Upload Failed'))\n console.error(chalk.red(await res.text()))\n\n if (res.status === 404) {\n const rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout,\n })\n\n const prompt = async () => {\n const answer: string = await new Promise((resolve) =>\n rl.question(`Do you want to create it and continue the uploading process? (yes/no) `, resolve)\n )\n if (['y', 'yes'].includes(answer.toLowerCase())) {\n rl.close()\n await createProject(options, apiKey)\n console.log(chalk.green('Project created'))\n await upload()\n } else if (['n', 'no'].includes(answer.toLowerCase())) {\n rl.close()\n } else {\n await prompt()\n }\n }\n await prompt()\n }\n }\n }\n\n await upload()\n}\n"]}
|
|
@@ -94,6 +94,7 @@ export interface ProcessTracesResponse {
|
|
|
94
94
|
result: ProcessResult | undefined;
|
|
95
95
|
}
|
|
96
96
|
export interface ProcessTransactionsRequest {
|
|
97
|
+
chainId: string;
|
|
97
98
|
transactions: RawTransaction[];
|
|
98
99
|
}
|
|
99
100
|
export interface ProcessInstructionsRequest {
|
|
@@ -126,9 +127,9 @@ export interface RawTrace {
|
|
|
126
127
|
raw: Uint8Array;
|
|
127
128
|
}
|
|
128
129
|
export interface RawTransaction {
|
|
129
|
-
txHash: string;
|
|
130
130
|
raw: Uint8Array;
|
|
131
|
-
programAccountId
|
|
131
|
+
programAccountId?: string | undefined;
|
|
132
|
+
slot?: Long | undefined;
|
|
132
133
|
}
|
|
133
134
|
export interface Instruction {
|
|
134
135
|
instructionData: string;
|
|
@@ -1218,12 +1218,15 @@ exports.ProcessTracesResponse = {
|
|
|
1218
1218
|
},
|
|
1219
1219
|
};
|
|
1220
1220
|
function createBaseProcessTransactionsRequest() {
|
|
1221
|
-
return { transactions: [] };
|
|
1221
|
+
return { chainId: "", transactions: [] };
|
|
1222
1222
|
}
|
|
1223
1223
|
exports.ProcessTransactionsRequest = {
|
|
1224
1224
|
encode(message, writer = minimal_1.default.Writer.create()) {
|
|
1225
|
+
if (message.chainId !== "") {
|
|
1226
|
+
writer.uint32(10).string(message.chainId);
|
|
1227
|
+
}
|
|
1225
1228
|
for (const v of message.transactions) {
|
|
1226
|
-
exports.RawTransaction.encode(v, writer.uint32(
|
|
1229
|
+
exports.RawTransaction.encode(v, writer.uint32(18).fork()).ldelim();
|
|
1227
1230
|
}
|
|
1228
1231
|
return writer;
|
|
1229
1232
|
},
|
|
@@ -1235,6 +1238,9 @@ exports.ProcessTransactionsRequest = {
|
|
|
1235
1238
|
const tag = reader.uint32();
|
|
1236
1239
|
switch (tag >>> 3) {
|
|
1237
1240
|
case 1:
|
|
1241
|
+
message.chainId = reader.string();
|
|
1242
|
+
break;
|
|
1243
|
+
case 2:
|
|
1238
1244
|
message.transactions.push(exports.RawTransaction.decode(reader, reader.uint32()));
|
|
1239
1245
|
break;
|
|
1240
1246
|
default:
|
|
@@ -1246,6 +1252,7 @@ exports.ProcessTransactionsRequest = {
|
|
|
1246
1252
|
},
|
|
1247
1253
|
fromJSON(object) {
|
|
1248
1254
|
return {
|
|
1255
|
+
chainId: isSet(object.chainId) ? String(object.chainId) : "",
|
|
1249
1256
|
transactions: Array.isArray(object?.transactions)
|
|
1250
1257
|
? object.transactions.map((e) => exports.RawTransaction.fromJSON(e))
|
|
1251
1258
|
: [],
|
|
@@ -1253,6 +1260,7 @@ exports.ProcessTransactionsRequest = {
|
|
|
1253
1260
|
},
|
|
1254
1261
|
toJSON(message) {
|
|
1255
1262
|
const obj = {};
|
|
1263
|
+
message.chainId !== undefined && (obj.chainId = message.chainId);
|
|
1256
1264
|
if (message.transactions) {
|
|
1257
1265
|
obj.transactions = message.transactions.map((e) => e ? exports.RawTransaction.toJSON(e) : undefined);
|
|
1258
1266
|
}
|
|
@@ -1263,6 +1271,7 @@ exports.ProcessTransactionsRequest = {
|
|
|
1263
1271
|
},
|
|
1264
1272
|
fromPartial(object) {
|
|
1265
1273
|
const message = createBaseProcessTransactionsRequest();
|
|
1274
|
+
message.chainId = object.chainId ?? "";
|
|
1266
1275
|
message.transactions =
|
|
1267
1276
|
object.transactions?.map((e) => exports.RawTransaction.fromPartial(e)) || [];
|
|
1268
1277
|
return message;
|
|
@@ -1726,18 +1735,22 @@ exports.RawTrace = {
|
|
|
1726
1735
|
},
|
|
1727
1736
|
};
|
|
1728
1737
|
function createBaseRawTransaction() {
|
|
1729
|
-
return {
|
|
1738
|
+
return {
|
|
1739
|
+
raw: new Uint8Array(),
|
|
1740
|
+
programAccountId: undefined,
|
|
1741
|
+
slot: undefined,
|
|
1742
|
+
};
|
|
1730
1743
|
}
|
|
1731
1744
|
exports.RawTransaction = {
|
|
1732
1745
|
encode(message, writer = minimal_1.default.Writer.create()) {
|
|
1733
|
-
if (message.txHash !== "") {
|
|
1734
|
-
writer.uint32(10).string(message.txHash);
|
|
1735
|
-
}
|
|
1736
1746
|
if (message.raw.length !== 0) {
|
|
1737
|
-
writer.uint32(
|
|
1747
|
+
writer.uint32(10).bytes(message.raw);
|
|
1738
1748
|
}
|
|
1739
|
-
if (message.programAccountId !==
|
|
1740
|
-
writer.uint32(
|
|
1749
|
+
if (message.programAccountId !== undefined) {
|
|
1750
|
+
writer.uint32(18).string(message.programAccountId);
|
|
1751
|
+
}
|
|
1752
|
+
if (message.slot !== undefined) {
|
|
1753
|
+
writer.uint32(24).uint64(message.slot);
|
|
1741
1754
|
}
|
|
1742
1755
|
return writer;
|
|
1743
1756
|
},
|
|
@@ -1749,13 +1762,13 @@ exports.RawTransaction = {
|
|
|
1749
1762
|
const tag = reader.uint32();
|
|
1750
1763
|
switch (tag >>> 3) {
|
|
1751
1764
|
case 1:
|
|
1752
|
-
message.
|
|
1765
|
+
message.raw = reader.bytes();
|
|
1753
1766
|
break;
|
|
1754
1767
|
case 2:
|
|
1755
|
-
message.
|
|
1768
|
+
message.programAccountId = reader.string();
|
|
1756
1769
|
break;
|
|
1757
1770
|
case 3:
|
|
1758
|
-
message.
|
|
1771
|
+
message.slot = reader.uint64();
|
|
1759
1772
|
break;
|
|
1760
1773
|
default:
|
|
1761
1774
|
reader.skipType(tag & 7);
|
|
@@ -1766,27 +1779,31 @@ exports.RawTransaction = {
|
|
|
1766
1779
|
},
|
|
1767
1780
|
fromJSON(object) {
|
|
1768
1781
|
return {
|
|
1769
|
-
txHash: isSet(object.txHash) ? String(object.txHash) : "",
|
|
1770
1782
|
raw: isSet(object.raw) ? bytesFromBase64(object.raw) : new Uint8Array(),
|
|
1771
1783
|
programAccountId: isSet(object.programAccountId)
|
|
1772
1784
|
? String(object.programAccountId)
|
|
1773
|
-
:
|
|
1785
|
+
: undefined,
|
|
1786
|
+
slot: isSet(object.slot) ? long_1.default.fromValue(object.slot) : undefined,
|
|
1774
1787
|
};
|
|
1775
1788
|
},
|
|
1776
1789
|
toJSON(message) {
|
|
1777
1790
|
const obj = {};
|
|
1778
|
-
message.txHash !== undefined && (obj.txHash = message.txHash);
|
|
1779
1791
|
message.raw !== undefined &&
|
|
1780
1792
|
(obj.raw = base64FromBytes(message.raw !== undefined ? message.raw : new Uint8Array()));
|
|
1781
1793
|
message.programAccountId !== undefined &&
|
|
1782
1794
|
(obj.programAccountId = message.programAccountId);
|
|
1795
|
+
message.slot !== undefined &&
|
|
1796
|
+
(obj.slot = (message.slot || undefined).toString());
|
|
1783
1797
|
return obj;
|
|
1784
1798
|
},
|
|
1785
1799
|
fromPartial(object) {
|
|
1786
1800
|
const message = createBaseRawTransaction();
|
|
1787
|
-
message.txHash = object.txHash ?? "";
|
|
1788
1801
|
message.raw = object.raw ?? new Uint8Array();
|
|
1789
|
-
message.programAccountId = object.programAccountId ??
|
|
1802
|
+
message.programAccountId = object.programAccountId ?? undefined;
|
|
1803
|
+
message.slot =
|
|
1804
|
+
object.slot !== undefined && object.slot !== null
|
|
1805
|
+
? long_1.default.fromValue(object.slot)
|
|
1806
|
+
: undefined;
|
|
1790
1807
|
return message;
|
|
1791
1808
|
},
|
|
1792
1809
|
};
|