@sentio/sdk 0.1.4 → 0.1.7
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/dist/cli/build.d.ts +1 -1
- package/dist/cli/build.js +47 -9
- package/dist/cli/build.js.map +1 -1
- package/dist/cli/cli.d.ts +2 -1
- package/dist/cli/cli.js +17 -3
- package/dist/cli/cli.js.map +1 -1
- package/dist/cli/config.d.ts +1 -0
- package/dist/cli/config.js.map +1 -1
- package/dist/cli/upload.js +3 -3
- package/dist/cli/upload.js.map +1 -1
- package/dist/cli/webpack.config.js +14 -4
- package/dist/context.d.ts +7 -0
- package/dist/context.js +12 -1
- package/dist/context.js.map +1 -1
- package/dist/gen/processor/protos/processor.d.ts +68 -0
- package/dist/gen/processor/protos/processor.js +281 -2
- package/dist/gen/processor/protos/processor.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/dist/meter.d.ts +4 -4
- package/dist/meter.js +30 -16
- package/dist/meter.js.map +1 -1
- package/dist/processor.js +1 -1
- package/dist/processor.js.map +1 -1
- package/dist/processor_server.d.ts +1 -1
- package/dist/processor_server.js +5 -2
- package/dist/processor_server.js.map +1 -1
- package/dist/service.d.ts +2 -1
- package/dist/service.js +131 -56
- package/dist/service.js.map +1 -1
- package/dist/solana_processor.d.ts +25 -0
- package/dist/solana_processor.js +84 -0
- package/dist/solana_processor.js.map +1 -0
- package/dist/target-ethers-sentio/index.js +1 -1
- package/dist/target-ethers-sentio/index.js.map +1 -1
- package/dist/test_case/mirrorworld.d.ts +4 -0
- package/dist/test_case/mirrorworld.js +61 -0
- package/dist/test_case/mirrorworld.js.map +1 -0
- package/dist/test_case/types/game_wallet.d.ts +45 -0
- package/dist/test_case/types/game_wallet.js +1396 -0
- package/dist/test_case/types/game_wallet.js.map +1 -0
- package/package.json +10 -3
package/dist/service.js
CHANGED
|
@@ -28,69 +28,92 @@ class ProcessorServiceImpl {
|
|
|
28
28
|
if (this.started) {
|
|
29
29
|
return {};
|
|
30
30
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
}
|
|
51
|
-
if (processor.config.chunkSize) {
|
|
52
|
-
contractConfig.chunkSize = processor.config.chunkSize;
|
|
53
|
-
}
|
|
54
|
-
// Prepare all the event handlers
|
|
55
|
-
for (const eventsHandler of processor.eventHandlers) {
|
|
56
|
-
// associate id with filter
|
|
57
|
-
const handlerId = this.eventHandlers.push(eventsHandler.handler) - 1;
|
|
58
|
-
const logConfig = {
|
|
59
|
-
handlerId: handlerId,
|
|
60
|
-
conditions: [],
|
|
31
|
+
if (globalThis.Processors) {
|
|
32
|
+
for (const processor of globalThis.Processors) {
|
|
33
|
+
// Start basic config for contract
|
|
34
|
+
const chainId = processor.network.chainId;
|
|
35
|
+
const contractConfig = {
|
|
36
|
+
contract: {
|
|
37
|
+
name: processor.name,
|
|
38
|
+
chainId: chainId,
|
|
39
|
+
address: processor.contract._underlineContract.address,
|
|
40
|
+
},
|
|
41
|
+
blockConfig: {
|
|
42
|
+
numHandlers: processor.blockHandlers.length,
|
|
43
|
+
},
|
|
44
|
+
logConfigs: [],
|
|
45
|
+
startBlock: processor.config.startBlock,
|
|
46
|
+
endBlock: MAX_BLOCK,
|
|
47
|
+
chunkSize: 1,
|
|
48
|
+
instructionConfig: [],
|
|
49
|
+
transactionConfig: [],
|
|
61
50
|
};
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
51
|
+
if (processor.config.endBlock) {
|
|
52
|
+
contractConfig.endBlock = processor.config.endBlock;
|
|
53
|
+
}
|
|
54
|
+
if (processor.config.chunkSize) {
|
|
55
|
+
contractConfig.chunkSize = processor.config.chunkSize;
|
|
56
|
+
}
|
|
57
|
+
// Prepare all the event handlers
|
|
58
|
+
for (const eventsHandler of processor.eventHandlers) {
|
|
59
|
+
// associate id with filter
|
|
60
|
+
const handlerId = this.eventHandlers.push(eventsHandler.handler) - 1;
|
|
61
|
+
const logConfig = {
|
|
62
|
+
handlerId: handlerId,
|
|
63
|
+
conditions: [],
|
|
68
64
|
};
|
|
69
|
-
for (const
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
hashes = hashes.concat(ts);
|
|
65
|
+
for (const filter of eventsHandler.filters) {
|
|
66
|
+
if (!filter.topics) {
|
|
67
|
+
throw new Error('Topic should not be null');
|
|
73
68
|
}
|
|
74
|
-
|
|
75
|
-
|
|
69
|
+
const condition = {
|
|
70
|
+
topics: [],
|
|
71
|
+
};
|
|
72
|
+
for (const ts of filter.topics) {
|
|
73
|
+
let hashes = [];
|
|
74
|
+
if (Array.isArray(ts)) {
|
|
75
|
+
hashes = hashes.concat(ts);
|
|
76
|
+
}
|
|
77
|
+
else if (ts) {
|
|
78
|
+
hashes.push(ts);
|
|
79
|
+
}
|
|
80
|
+
condition.topics.push({ hashes: hashes });
|
|
76
81
|
}
|
|
77
|
-
|
|
82
|
+
logConfig.conditions.push(condition);
|
|
78
83
|
}
|
|
79
|
-
|
|
84
|
+
contractConfig.logConfigs.push(logConfig);
|
|
80
85
|
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
86
|
+
// Prepare all the block handlers
|
|
87
|
+
let handlersForChain = this.blockHandlers.get(chainId);
|
|
88
|
+
if (handlersForChain === undefined) {
|
|
89
|
+
handlersForChain = [];
|
|
90
|
+
this.blockHandlers.set(chainId, handlersForChain);
|
|
91
|
+
}
|
|
92
|
+
for (const blockHandler of processor.blockHandlers) {
|
|
93
|
+
handlersForChain.push(blockHandler);
|
|
94
|
+
}
|
|
95
|
+
// Finish up a contract
|
|
96
|
+
this.contractConfigs.push(contractConfig);
|
|
88
97
|
}
|
|
89
|
-
|
|
90
|
-
|
|
98
|
+
}
|
|
99
|
+
if (globalThis.SolanaProcessors) {
|
|
100
|
+
for (const solanaProcessor of globalThis.SolanaProcessors) {
|
|
101
|
+
const contractConfig = {
|
|
102
|
+
contract: {
|
|
103
|
+
name: solanaProcessor.contractName,
|
|
104
|
+
chainId: 0,
|
|
105
|
+
address: solanaProcessor.address,
|
|
106
|
+
},
|
|
107
|
+
blockConfig: undefined,
|
|
108
|
+
logConfigs: [],
|
|
109
|
+
startBlock: solanaProcessor.config.startSlot,
|
|
110
|
+
endBlock: MAX_BLOCK,
|
|
111
|
+
chunkSize: 1,
|
|
112
|
+
instructionConfig: [],
|
|
113
|
+
transactionConfig: [],
|
|
114
|
+
};
|
|
115
|
+
this.contractConfigs.push(contractConfig);
|
|
91
116
|
}
|
|
92
|
-
// Finish up a contract
|
|
93
|
-
this.contractConfigs.push(contractConfig);
|
|
94
117
|
}
|
|
95
118
|
this.started = true;
|
|
96
119
|
return {};
|
|
@@ -127,7 +150,59 @@ class ProcessorServiceImpl {
|
|
|
127
150
|
};
|
|
128
151
|
}
|
|
129
152
|
async processTransaction(request, context) {
|
|
130
|
-
|
|
153
|
+
if (!this.started) {
|
|
154
|
+
throw new Error('Service not started.');
|
|
155
|
+
}
|
|
156
|
+
if (!request.transaction) {
|
|
157
|
+
throw new Error('Transaction cannot be empty');
|
|
158
|
+
}
|
|
159
|
+
// const txn = request.transaction.txHash
|
|
160
|
+
const result = {
|
|
161
|
+
histograms: [],
|
|
162
|
+
counters: [],
|
|
163
|
+
};
|
|
164
|
+
// Only have transaction handlers for solana processors
|
|
165
|
+
if (globalThis.SolanaProcessors) {
|
|
166
|
+
for (const processor of globalThis.SolanaProcessors) {
|
|
167
|
+
if (processor.address === request.transaction.programAccountId) {
|
|
168
|
+
for (const transactionHandler of processor.transactionHandlers) {
|
|
169
|
+
const res = await transactionHandler(request.transaction);
|
|
170
|
+
result.histograms = res.histograms;
|
|
171
|
+
result.counters = res.counters;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
return {
|
|
177
|
+
result,
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
async processInstruction(request, context) {
|
|
181
|
+
if (!this.started) {
|
|
182
|
+
throw new Error('Service not started.');
|
|
183
|
+
}
|
|
184
|
+
if (!request.instruction) {
|
|
185
|
+
throw new Error('instruction cannot be empty');
|
|
186
|
+
}
|
|
187
|
+
const result = {
|
|
188
|
+
histograms: [],
|
|
189
|
+
counters: [],
|
|
190
|
+
};
|
|
191
|
+
// Only have instruction handlers for solana processors
|
|
192
|
+
if (globalThis.SolanaProcessors) {
|
|
193
|
+
for (const processor of globalThis.SolanaProcessors) {
|
|
194
|
+
if (processor.address === request.instruction.programAccountId) {
|
|
195
|
+
for (const instructionHandler of processor.instructionHandlers) {
|
|
196
|
+
const res = await instructionHandler(request.instruction.instructionData);
|
|
197
|
+
result.histograms = res.histograms;
|
|
198
|
+
result.counters = res.counters;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
return {
|
|
204
|
+
result,
|
|
205
|
+
};
|
|
131
206
|
}
|
|
132
207
|
async processBlock(request, context) {
|
|
133
208
|
if (!this.started) {
|
package/dist/service.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service.js","sourceRoot":"","sources":["../src/service.ts"],"names":[],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"service.js","sourceRoot":"","sources":["../src/service.ts"],"names":[],"mappings":";;;;;;AAuBA,gDAAuB;AAEvB,MAAM,SAAS,GAAG,IAAI,cAAI,CAAC,CAAC,CAAC,CAAA;AAE7B,MAAa,oBAAoB;IACvB,aAAa,GAA4C,EAAE,CAAA;IAC3D,aAAa,GAAG,IAAI,G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AC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,KAAK,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;gBAC9F,MAAK;SACR;KACF;IAED,OAAO,GAAG,CAAA;AACZ,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { O11yResult, Transaction } from './gen/processor/protos/processor';
|
|
2
|
+
import { SolanaContext } from './context';
|
|
3
|
+
import { ParsedTransactionWithMeta, Connection } from '@solana/web3.js';
|
|
4
|
+
import Long from 'long';
|
|
5
|
+
declare type IndexConfigure = {
|
|
6
|
+
startSlot: Long;
|
|
7
|
+
endSlot?: Long;
|
|
8
|
+
};
|
|
9
|
+
export declare class SolanaBaseProcessor {
|
|
10
|
+
transactionHandlers: ((txn: Transaction) => Promise<O11yResult>)[];
|
|
11
|
+
instructionHandlers: ((instruction: string) => Promise<O11yResult>)[];
|
|
12
|
+
address: string;
|
|
13
|
+
endpoint: string;
|
|
14
|
+
connection: Connection;
|
|
15
|
+
contractName: string;
|
|
16
|
+
config: IndexConfigure;
|
|
17
|
+
constructor(contractName: string, address: string, endpoint: string);
|
|
18
|
+
bind(address: string): void;
|
|
19
|
+
onTransaction(handler: (txn: ParsedTransactionWithMeta, ctx: SolanaContext) => void): this;
|
|
20
|
+
onInstruction(handler: (instruction: string, ctx: SolanaContext) => void): this;
|
|
21
|
+
isBind(): boolean;
|
|
22
|
+
startSlot(startSlot: Long | number): this;
|
|
23
|
+
endBlock(endBlock: Long | number): this;
|
|
24
|
+
}
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.SolanaBaseProcessor = void 0;
|
|
7
|
+
const context_1 = require("./context");
|
|
8
|
+
const web3_js_1 = require("@solana/web3.js");
|
|
9
|
+
const long_1 = __importDefault(require("long"));
|
|
10
|
+
class SolanaBaseProcessor {
|
|
11
|
+
transactionHandlers = [];
|
|
12
|
+
instructionHandlers = [];
|
|
13
|
+
address;
|
|
14
|
+
endpoint;
|
|
15
|
+
connection;
|
|
16
|
+
contractName;
|
|
17
|
+
config = { startSlot: new long_1.default(0) };
|
|
18
|
+
constructor(contractName, address, endpoint) {
|
|
19
|
+
this.endpoint = endpoint;
|
|
20
|
+
this.address = address;
|
|
21
|
+
if (!globalThis.SolanaProcessors) {
|
|
22
|
+
globalThis.SolanaProcessors = [];
|
|
23
|
+
}
|
|
24
|
+
globalThis.SolanaProcessors.push(this);
|
|
25
|
+
this.connection = new web3_js_1.Connection(endpoint, 'confirmed');
|
|
26
|
+
this.contractName = contractName;
|
|
27
|
+
}
|
|
28
|
+
bind(address) {
|
|
29
|
+
this.address = address;
|
|
30
|
+
}
|
|
31
|
+
onTransaction(handler) {
|
|
32
|
+
if (!this.isBind()) {
|
|
33
|
+
throw new Error("Processor doesn't bind to an address");
|
|
34
|
+
}
|
|
35
|
+
this.transactionHandlers.push(async (transaction) => {
|
|
36
|
+
const ctx = new context_1.SolanaContext(this.address);
|
|
37
|
+
const parsedTransaction = await this.connection.getParsedTransaction(transaction.txHash);
|
|
38
|
+
if (parsedTransaction) {
|
|
39
|
+
await handler(parsedTransaction, ctx);
|
|
40
|
+
}
|
|
41
|
+
return {
|
|
42
|
+
histograms: ctx.histograms,
|
|
43
|
+
counters: ctx.counters,
|
|
44
|
+
};
|
|
45
|
+
});
|
|
46
|
+
return this;
|
|
47
|
+
}
|
|
48
|
+
onInstruction(handler) {
|
|
49
|
+
if (!this.isBind()) {
|
|
50
|
+
throw new Error("Processor doesn't bind to an address");
|
|
51
|
+
}
|
|
52
|
+
this.instructionHandlers.push(async (ins) => {
|
|
53
|
+
const ctx = new context_1.SolanaContext(this.address);
|
|
54
|
+
// const parsedTransaction = await this.connection.getParsedTransaction(ins)
|
|
55
|
+
if (ins) {
|
|
56
|
+
await handler(ins, ctx);
|
|
57
|
+
}
|
|
58
|
+
return {
|
|
59
|
+
histograms: ctx.histograms,
|
|
60
|
+
counters: ctx.counters,
|
|
61
|
+
};
|
|
62
|
+
});
|
|
63
|
+
return this;
|
|
64
|
+
}
|
|
65
|
+
isBind() {
|
|
66
|
+
return this.address !== null;
|
|
67
|
+
}
|
|
68
|
+
startSlot(startSlot) {
|
|
69
|
+
if (typeof startSlot === 'number') {
|
|
70
|
+
startSlot = long_1.default.fromNumber(startSlot);
|
|
71
|
+
}
|
|
72
|
+
this.config.startSlot = startSlot;
|
|
73
|
+
return this;
|
|
74
|
+
}
|
|
75
|
+
endBlock(endBlock) {
|
|
76
|
+
if (typeof endBlock === 'number') {
|
|
77
|
+
endBlock = long_1.default.fromNumber(endBlock);
|
|
78
|
+
}
|
|
79
|
+
this.config.endSlot = endBlock;
|
|
80
|
+
return this;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
exports.SolanaBaseProcessor = SolanaBaseProcessor;
|
|
84
|
+
//# sourceMappingURL=solana_processor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"solana_processor.js","sourceRoot":"","sources":["../src/solana_processor.ts"],"names":[],"mappings":";;;;;;AACA,uCAAyC;AACzC,6CAAuE;AACvE,gDAAuB;AAOvB,MAAa,mBAAmB;IAC9B,mBAAmB,GAAkD,EAAE,CAAA;IACvE,mBAAmB,GAAqD,EAAE,CAAA;IAC1E,OAAO,CAAQ;IACf,QAAQ,CAAQ;IAChB,UAAU,CAAY;IACtB,YAAY,CAAQ;IACpB,MAAM,GAAmB,EAAE,SAAS,EAAE,IAAI,cAAI,CAAC,CAAC,CAAC,EAAE,CAAA;IAEnD,YAAY,YAAoB,EAAE,OAAe,EAAE,QAAgB;QACjE,IAAI,CAAC,QAAQ,GAAG,QAAQ,C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AW,EAAE,EAAE;YAClD,MAAM,GAAG,GAAG,IAAI,uBAAa,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;YAC3C,4EAA4E;YAE5E,IAAI,GAAG,EAAE;gBACP,MAAM,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,CAAA;aACxB;YACD,OAAO;gBACL,UAAU,EAAE,GAAG,CAAC,UAAU;gBAC1B,QAAQ,EAAE,GAAG,CAAC,QAAQ;aACvB,CAAA;QACH,CAAC,CAAC,CAAA;QAEF,OAAO,IAAI,CAAA;IACb,CAAC;IAEM,MAAM;QACX,OAAO,IAAI,CAAC,OAAO,KAAK,IAAI,CAAA;IAC9B,CAAC;IAEM,SAAS,CAAC,SAAwB;QACvC,IAAI,OAAO,SAAS,KAAK,QAAQ,EAAE;YACjC,SAAS,GAAG,cAAI,CAAC,UAAU,CAAC,SAAS,CAAC,CAAA;SACvC;QACD,IAAI,CAAC,MAAM,CAAC,SAAS,GAAG,SAAS,CAAA;QACjC,OAAO,IAAI,CAAA;IACb,CAAC;IAEM,QAAQ,CAAC,QAAuB;QACrC,IAAI,OAAO,QAAQ,KAAK,QAAQ,EAAE;YAChC,QAAQ,GAAG,cAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAA;SACrC;QACD,IAAI,CAAC,MAAM,CAAC,OAAO,GAAG,QAAQ,CAAA;QAC9B,OAAO,IAAI,CAAA;IACb,CAAC;CACF;AApFD,kDAoFC"}
|
|
@@ -18,7 +18,7 @@ class EthersSentio extends ethers_v5_1.default {
|
|
|
18
18
|
const path = (0, path_1.relative)(this.cfg.inputDir, (0, typechain_1.shortenFullJsonFilePath)(file.path, this.cfg.allFiles));
|
|
19
19
|
const contract = (0, typechain_1.parse)(abi, path, documentation);
|
|
20
20
|
const files = super.transformAbiOrFullJsonFile(file);
|
|
21
|
-
if (files
|
|
21
|
+
if (files !== undefined) {
|
|
22
22
|
return [
|
|
23
23
|
...files,
|
|
24
24
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/target-ethers-sentio/index.ts"],"names":[],"mappings":";;;;;AAAA,qEAAyC;AACzC,yCAA6G;AAC7G,+BAA8C;AAC9C,uCAA6C;AAE7C,MAAqB,YAAa,SAAQ,mBAAM;IAC9C,kEAAkE;IACzD,0BAA0B,CAAC,IAAqB;QACvD,MAAM,GAAG,GAAG,IAAA,sBAAU,EAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;QACrC,IAAI,GAAG,CAAC,MAAM,KAAK,CAAC,EAAE;YACpB,OAAM;SACP;QAED,MAAM,aAAa,GAAG,IAAA,gCAAoB,EAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;QAEzD,MAAM,IAAI,GAAG,IAAA,eAAQ,EAAC,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,IAAA,mCAAuB,EAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAA;QAE/F,MAAM,QAAQ,GAAG,IAAA,iBAAK,EAAC,GAAG,EAAE,IAAI,EAAE,aAAa,CAAC,CAAA;QAEhD,MAAM,KAAK,GAAG,KAAK,CAAC,0BAA0B,CAAC,IAAI,CAAC,CAAA;QAEpD,IAAI,KAAK,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/target-ethers-sentio/index.ts"],"names":[],"mappings":";;;;;AAAA,qEAAyC;AACzC,yCAA6G;AAC7G,+BAA8C;AAC9C,uCAA6C;AAE7C,MAAqB,YAAa,SAAQ,mBAAM;IAC9C,kEAAkE;IACzD,0BAA0B,CAAC,IAAqB;QACvD,MAAM,GAAG,GAAG,IAAA,sBAAU,EAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;QACrC,IAAI,GAAG,CAAC,MAAM,KAAK,CAAC,EAAE;YACpB,OAAM;SACP;QAED,MAAM,aAAa,GAAG,IAAA,gCAAoB,EAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;QAEzD,MAAM,IAAI,GAAG,IAAA,eAAQ,EAAC,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,IAAA,mCAAuB,EAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAA;QAE/F,MAAM,QAAQ,GAAG,IAAA,iBAAK,EAAC,GAAG,EAAE,IAAI,EAAE,aAAa,CAAC,CAAA;QAEhD,MAAM,KAAK,GAAG,KAAK,CAAC,0BAA0B,CAAC,IAAI,CAAC,CAAA;QAEpD,IAAI,KAAK,KAAK,SAAS,EAAE;YACvB,OAAO;gBACL,GAAG,KAAK;gBACR;oBACE,IAAI,EAAE,IAAA,WAAI,EAAC,IAAA,cAAO,EAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,GAAG,QAAQ,CAAC,IAAI,CAAC,WAAW,EAAE,eAAe,CAAC;oBACjF,QAAQ,EAAE,IAAA,2BAAiB,EAAC,QAAQ,CAAC;iBACtC;aACF,CAAA;SACF;IACH,CAAC;CACF;AA1BD,+BA0BC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.MirrorWorldProcessor = void 0;
|
|
7
|
+
const solana_processor_1 = require("solana_processor");
|
|
8
|
+
const bs58_1 = __importDefault(require("bs58"));
|
|
9
|
+
const anchor_1 = require("@project-serum/anchor");
|
|
10
|
+
const game_wallet_1 = require("./types/game_wallet");
|
|
11
|
+
class MirrorWorldProcessor extends solana_processor_1.SolanaBaseProcessor {
|
|
12
|
+
static bind(address, endpoint, name = 'MirrorWorld') {
|
|
13
|
+
return new MirrorWorldProcessor(name, address, endpoint);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
exports.MirrorWorldProcessor = MirrorWorldProcessor;
|
|
17
|
+
MirrorWorldProcessor.bind('F78NhTC9XmP1DKsCBRz5LGdQc4n4yFbj2dURiv7T9gGZ', 'https://api.mainnet-beta.solana.com')
|
|
18
|
+
.onTransaction((txn, ctx) => {
|
|
19
|
+
const instructionCoder = new anchor_1.BorshInstructionCoder(game_wallet_1.game_wallet_idl);
|
|
20
|
+
for (const instruction of txn.transaction.message.instructions) {
|
|
21
|
+
const decodedData = instructionCoder.decode(Buffer.from(bs58_1.default.decode(instruction.data)));
|
|
22
|
+
console.log('instruction name: ' + decodedData?.name);
|
|
23
|
+
if (decodedData) {
|
|
24
|
+
handleDecodedInstruction(decodedData, ctx);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
})
|
|
28
|
+
.onInstruction((ins, ctx) => {
|
|
29
|
+
const instructionCoder = new anchor_1.BorshInstructionCoder(game_wallet_1.game_wallet_idl);
|
|
30
|
+
const decodedData = instructionCoder.decode(Buffer.from(bs58_1.default.decode(ins)));
|
|
31
|
+
if (decodedData) {
|
|
32
|
+
handleDecodedInstruction(decodedData, ctx);
|
|
33
|
+
}
|
|
34
|
+
})
|
|
35
|
+
.startSlot(111111);
|
|
36
|
+
function handleDecodedInstruction(instruction, ctx) {
|
|
37
|
+
const instructionName = instruction.name;
|
|
38
|
+
switch (instructionName) {
|
|
39
|
+
case 'distributeWithoutUser':
|
|
40
|
+
const amount = instruction.data.amount;
|
|
41
|
+
ctx.meter.Counter('distributeAmount').add(amount.toNumber());
|
|
42
|
+
break;
|
|
43
|
+
case 'deposit':
|
|
44
|
+
break;
|
|
45
|
+
case 'withdraw':
|
|
46
|
+
break;
|
|
47
|
+
case 'spend':
|
|
48
|
+
break;
|
|
49
|
+
case 'distribute':
|
|
50
|
+
break;
|
|
51
|
+
case 'spendWithoutUser':
|
|
52
|
+
break;
|
|
53
|
+
case 'addDistributeSupply':
|
|
54
|
+
break;
|
|
55
|
+
case 'updateTokenConfig':
|
|
56
|
+
break;
|
|
57
|
+
default:
|
|
58
|
+
break;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=mirrorworld.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mirrorworld.js","sourceRoot":"","sources":["../../src/test_case/mirrorworld.ts"],"names":[],"mappings":";;;;;;AAAA,uDAAsD;AAKtD,gDAAmC;AACnC,kDAA+E;AAE/E,qDAAqD;AAErD,MAAa,oBAAqB,SAAQ,sCAAmB;IAC3D,MAAM,CAAC,IAAI,CAAC,OAAe,EAAE,QAAgB,EAAE,IAAI,GAAG,aAAa;QACjE,OAAO,IAAI,oBAAoB,CAAC,IAAI,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAA;IAC1D,CAAC;CACF;AAJD,oDAIC;AAED,oBAAoB,CAAC,IAAI,CAAC,8CAA8C,EAAE,qCAAqC,CAAC;KAC7G,aAAa,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;IAC1B,MAAM,gBAAgB,GAAG,IAAI,8BAAqB,CAAC,6BAAsB,CAAC,CAAA;IAC1E,KAAK,MAAM,WAAW,IAAI,GAAG,CAAC,WAAW,CAAC,OAAO,CAAC,YAA6C,EAAE;QAC/F,MAAM,WAAW,GAAG,gBAAgB,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,cAAI,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;QACvF,OAAO,CAAC,GAAG,CAAC,oBAAoB,GAAG,WAAW,EAAE,IAAI,CAAC,CAAA;QACrD,IAAI,WAAW,EAAE;YACf,wBAAwB,CAAC,WAAW,EAAE,GAAG,CAAC,CAAA;SAC3C;KACF;AACH,CAAC,CAAC;KACD,aAAa,CAAC,CAAC,GAAW,EAAE,GAAG,EAAE,EAAE;IAClC,MAAM,gBAAgB,GAAG,IAAI,8BAAqB,CAAC,6BAAsB,CAAC,CAAA;IAC1E,MAAM,WAAW,GAAG,gBAAgB,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,cAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAA;IAC1E,IAAI,WAAW,EAAE;QACf,wBAAwB,CAAC,WAAW,EAAE,GAAG,CAAC,CAAA;KAC3C;AACH,CAAC,CAAC;KACD,SAAS,CAAC,MAAM,CAAC,CAAA;AAEpB,SAAS,wBAAwB,CAAC,WAAwB,EAAE,GAAkB;IAC5E,MAAM,eAAe,GAAG,WAAW,CAAC,IAAI,CAAA;IACxC,QAAQ,eAAe,EAAE;QACvB,KAAK,uBAAuB;YAC1B,MAAM,MAAM,GAAQ,WAAW,CAAC,IAAY,CAAC,MAAM,CAAA;YACnD,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAA;YAC5D,MAAK;QACP,KAAK,SAAS;YACZ,MAAK;QACP,KAAK,UAAU;YACb,MAAK;QACP,KAAK,OAAO;YACV,MAAK;QACP,KAAK,YAAY;YACf,MAAK;QACP,KAAK,kBAAkB;YACrB,MAAK;QACP,KAAK,qBAAqB;YACxB,MAAK;QACP,KAAK,mBAAmB;YACtB,MAAK;QAEP;YACE,MAAK;KACR;AACH,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
export declare const game_wallet_idl: {
|
|
2
|
+
version: string;
|
|
3
|
+
name: string;
|
|
4
|
+
instructions: {
|
|
5
|
+
name: string;
|
|
6
|
+
accounts: {
|
|
7
|
+
name: string;
|
|
8
|
+
isMut: boolean;
|
|
9
|
+
isSigner: boolean;
|
|
10
|
+
}[];
|
|
11
|
+
args: {
|
|
12
|
+
name: string;
|
|
13
|
+
type: string;
|
|
14
|
+
}[];
|
|
15
|
+
}[];
|
|
16
|
+
accounts: {
|
|
17
|
+
name: string;
|
|
18
|
+
type: {
|
|
19
|
+
kind: string;
|
|
20
|
+
fields: ({
|
|
21
|
+
name: string;
|
|
22
|
+
type: string;
|
|
23
|
+
} | {
|
|
24
|
+
name: string;
|
|
25
|
+
type: {
|
|
26
|
+
defined: string;
|
|
27
|
+
};
|
|
28
|
+
})[];
|
|
29
|
+
};
|
|
30
|
+
}[];
|
|
31
|
+
types: {
|
|
32
|
+
name: string;
|
|
33
|
+
type: {
|
|
34
|
+
kind: string;
|
|
35
|
+
variants: {
|
|
36
|
+
name: string;
|
|
37
|
+
}[];
|
|
38
|
+
};
|
|
39
|
+
}[];
|
|
40
|
+
errors: {
|
|
41
|
+
code: number;
|
|
42
|
+
name: string;
|
|
43
|
+
msg: string;
|
|
44
|
+
}[];
|
|
45
|
+
};
|