@sentio/sdk-bundle 3.3.0-rc.1 → 3.3.0-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.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRequire as createRequireSdkShim } from 'module'; const require = createRequireSdkShim(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
SolanaBaseProcessor
|
|
4
|
-
} from "../../chunk-
|
|
4
|
+
} from "../../chunk-UEWIF4V3.js";
|
|
5
5
|
import "../../chunk-6UVWNOIX.js";
|
|
6
6
|
import "../../chunk-WYM4IYMI.js";
|
|
7
7
|
import "../../chunk-EZWWCMDA.js";
|
|
@@ -36,236 +36,236 @@ var SPLTokenProcessor = class _SPLTokenProcessor extends SolanaBaseProcessor {
|
|
|
36
36
|
}
|
|
37
37
|
};
|
|
38
38
|
}, "fromParsedInstruction");
|
|
39
|
-
onInitializeMint(handler) {
|
|
39
|
+
onInitializeMint(handler, handlerOptions) {
|
|
40
40
|
this.onInstruction("initializeMint", (ins, ctx) => {
|
|
41
41
|
if (ins) {
|
|
42
42
|
handler(ins.data, ctx);
|
|
43
43
|
}
|
|
44
|
-
});
|
|
44
|
+
}, handlerOptions);
|
|
45
45
|
return this;
|
|
46
46
|
}
|
|
47
|
-
onInitializeAccount(
|
|
47
|
+
onInitializeAccount(handler, handlerOptions) {
|
|
48
48
|
this.onInstruction("initializeAccount", (ins, ctx) => {
|
|
49
49
|
if (ins) {
|
|
50
|
-
|
|
50
|
+
handler(ins.data, ctx);
|
|
51
51
|
}
|
|
52
|
-
});
|
|
52
|
+
}, handlerOptions);
|
|
53
53
|
return this;
|
|
54
54
|
}
|
|
55
|
-
onInitializeAccount2(
|
|
55
|
+
onInitializeAccount2(handler, handlerOptions) {
|
|
56
56
|
this.onInstruction("initializeAccount2", (ins, ctx) => {
|
|
57
57
|
if (ins) {
|
|
58
|
-
|
|
58
|
+
handler(ins.data, ctx);
|
|
59
59
|
}
|
|
60
|
-
});
|
|
60
|
+
}, handlerOptions);
|
|
61
61
|
return this;
|
|
62
62
|
}
|
|
63
|
-
onInitializeAccount3(
|
|
63
|
+
onInitializeAccount3(handler, handlerOptions) {
|
|
64
64
|
this.onInstruction("initializeAccount3", (ins, ctx) => {
|
|
65
65
|
if (ins) {
|
|
66
|
-
|
|
66
|
+
handler(ins.data, ctx);
|
|
67
67
|
}
|
|
68
|
-
});
|
|
68
|
+
}, handlerOptions);
|
|
69
69
|
return this;
|
|
70
70
|
}
|
|
71
|
-
onInitializeMultisig(handler) {
|
|
71
|
+
onInitializeMultisig(handler, handlerOptions) {
|
|
72
72
|
this.onInstruction("initializeMultisig", (ins, ctx) => {
|
|
73
73
|
if (ins) {
|
|
74
74
|
handler(ins.data, ctx);
|
|
75
75
|
}
|
|
76
|
-
});
|
|
76
|
+
}, handlerOptions);
|
|
77
77
|
return this;
|
|
78
78
|
}
|
|
79
|
-
onTransfer(handler) {
|
|
79
|
+
onTransfer(handler, handlerOptions) {
|
|
80
80
|
this.onInstruction("transfer", (ins, ctx) => {
|
|
81
81
|
if (ins) {
|
|
82
82
|
handler(ins.data, ctx);
|
|
83
83
|
}
|
|
84
|
-
});
|
|
84
|
+
}, handlerOptions);
|
|
85
85
|
return this;
|
|
86
86
|
}
|
|
87
|
-
|
|
87
|
+
onApprove(handler, handlerOptions) {
|
|
88
88
|
this.onInstruction("approve", (ins, ctx) => {
|
|
89
89
|
if (ins) {
|
|
90
90
|
handler(ins.data, ctx);
|
|
91
91
|
}
|
|
92
|
-
});
|
|
92
|
+
}, handlerOptions);
|
|
93
93
|
return this;
|
|
94
94
|
}
|
|
95
|
-
onRevoke(handler) {
|
|
95
|
+
onRevoke(handler, handlerOptions) {
|
|
96
96
|
this.onInstruction("revoke", (ins, ctx) => {
|
|
97
97
|
if (ins) {
|
|
98
98
|
handler(ins.data, ctx);
|
|
99
99
|
}
|
|
100
|
-
});
|
|
100
|
+
}, handlerOptions);
|
|
101
101
|
return this;
|
|
102
102
|
}
|
|
103
|
-
onSetAuthority(handler) {
|
|
103
|
+
onSetAuthority(handler, handlerOptions) {
|
|
104
104
|
this.onInstruction("setAuthority", (ins, ctx) => {
|
|
105
105
|
if (ins) {
|
|
106
106
|
handler(ins.data, ctx);
|
|
107
107
|
}
|
|
108
|
-
});
|
|
108
|
+
}, handlerOptions);
|
|
109
109
|
return this;
|
|
110
110
|
}
|
|
111
|
-
onMintTo(handler) {
|
|
111
|
+
onMintTo(handler, handlerOptions) {
|
|
112
112
|
this.onInstruction("mintTo", (ins, ctx) => {
|
|
113
113
|
if (ins) {
|
|
114
114
|
handler(ins.data, ctx);
|
|
115
115
|
}
|
|
116
|
-
});
|
|
116
|
+
}, handlerOptions);
|
|
117
117
|
return this;
|
|
118
118
|
}
|
|
119
|
-
onBurn(handler) {
|
|
119
|
+
onBurn(handler, handlerOptions) {
|
|
120
120
|
this.onInstruction("burn", (ins, ctx) => {
|
|
121
121
|
if (ins) {
|
|
122
122
|
handler(ins.data, ctx);
|
|
123
123
|
}
|
|
124
|
-
});
|
|
124
|
+
}, handlerOptions);
|
|
125
125
|
return this;
|
|
126
126
|
}
|
|
127
|
-
onCloseAccount(handler) {
|
|
127
|
+
onCloseAccount(handler, handlerOptions) {
|
|
128
128
|
this.onInstruction("closeAccount", (ins, ctx) => {
|
|
129
129
|
if (ins) {
|
|
130
130
|
handler(ins.data, ctx);
|
|
131
131
|
}
|
|
132
|
-
});
|
|
132
|
+
}, handlerOptions);
|
|
133
133
|
return this;
|
|
134
134
|
}
|
|
135
|
-
onFreezeAccount(handler) {
|
|
135
|
+
onFreezeAccount(handler, handlerOptions) {
|
|
136
136
|
this.onInstruction("freezeAccount", (ins, ctx) => {
|
|
137
137
|
if (ins) {
|
|
138
138
|
handler(ins.data, ctx);
|
|
139
139
|
}
|
|
140
|
-
});
|
|
140
|
+
}, handlerOptions);
|
|
141
141
|
return this;
|
|
142
142
|
}
|
|
143
|
-
onThawAccount(handler) {
|
|
143
|
+
onThawAccount(handler, handlerOptions) {
|
|
144
144
|
this.onInstruction("thawAccount", (ins, ctx) => {
|
|
145
145
|
if (ins) {
|
|
146
146
|
handler(ins.data, ctx);
|
|
147
147
|
}
|
|
148
|
-
});
|
|
148
|
+
}, handlerOptions);
|
|
149
149
|
return this;
|
|
150
150
|
}
|
|
151
|
-
onTransferChecked(handler) {
|
|
151
|
+
onTransferChecked(handler, handlerOptions) {
|
|
152
152
|
this.onInstruction("transferChecked", (ins, ctx) => {
|
|
153
153
|
if (ins) {
|
|
154
154
|
handler(ins.data, ctx);
|
|
155
155
|
}
|
|
156
|
-
});
|
|
156
|
+
}, handlerOptions);
|
|
157
157
|
return this;
|
|
158
158
|
}
|
|
159
|
-
onApproveChecked(handler) {
|
|
159
|
+
onApproveChecked(handler, handlerOptions) {
|
|
160
160
|
this.onInstruction("approveChecked", (ins, ctx) => {
|
|
161
161
|
if (ins) {
|
|
162
162
|
handler(ins.data, ctx);
|
|
163
163
|
}
|
|
164
|
-
});
|
|
164
|
+
}, handlerOptions);
|
|
165
165
|
return this;
|
|
166
166
|
}
|
|
167
|
-
onMintToChecked(handler) {
|
|
167
|
+
onMintToChecked(handler, handlerOptions) {
|
|
168
168
|
this.onInstruction("mintToChecked", (ins, ctx) => {
|
|
169
169
|
if (ins) {
|
|
170
170
|
handler(ins.data, ctx);
|
|
171
171
|
}
|
|
172
|
-
});
|
|
172
|
+
}, handlerOptions);
|
|
173
173
|
return this;
|
|
174
174
|
}
|
|
175
|
-
onBurnChecked(handler) {
|
|
175
|
+
onBurnChecked(handler, handlerOptions) {
|
|
176
176
|
this.onInstruction("burnChecked", (ins, ctx) => {
|
|
177
177
|
if (ins) {
|
|
178
178
|
handler(ins.data, ctx);
|
|
179
179
|
}
|
|
180
|
-
});
|
|
180
|
+
}, handlerOptions);
|
|
181
181
|
return this;
|
|
182
182
|
}
|
|
183
|
-
onSyncNative(handler) {
|
|
183
|
+
onSyncNative(handler, handlerOptions) {
|
|
184
184
|
this.onInstruction("syncNative", (ins, ctx) => {
|
|
185
185
|
if (ins) {
|
|
186
186
|
handler(ins.data, ctx);
|
|
187
187
|
}
|
|
188
|
-
});
|
|
188
|
+
}, handlerOptions);
|
|
189
189
|
return this;
|
|
190
190
|
}
|
|
191
|
-
onGetAccountDataSize(handler) {
|
|
191
|
+
onGetAccountDataSize(handler, handlerOptions) {
|
|
192
192
|
this.onInstruction("getAccountDataSize", (ins, ctx) => {
|
|
193
193
|
if (ins) {
|
|
194
194
|
handler(ins.data, ctx);
|
|
195
195
|
}
|
|
196
|
-
});
|
|
196
|
+
}, handlerOptions);
|
|
197
197
|
return this;
|
|
198
198
|
}
|
|
199
|
-
onInitializeImmutableOwner(handler) {
|
|
199
|
+
onInitializeImmutableOwner(handler, handlerOptions) {
|
|
200
200
|
this.onInstruction("initializeImmutableOwner", (ins, ctx) => {
|
|
201
201
|
if (ins) {
|
|
202
202
|
handler(ins.data, ctx);
|
|
203
203
|
}
|
|
204
|
-
});
|
|
204
|
+
}, handlerOptions);
|
|
205
205
|
return this;
|
|
206
206
|
}
|
|
207
|
-
onAmountToUiAmount(handler) {
|
|
207
|
+
onAmountToUiAmount(handler, handlerOptions) {
|
|
208
208
|
this.onInstruction("amountToUiAmount", (ins, ctx) => {
|
|
209
209
|
if (ins) {
|
|
210
210
|
handler(ins.data, ctx);
|
|
211
211
|
}
|
|
212
|
-
});
|
|
212
|
+
}, handlerOptions);
|
|
213
213
|
return this;
|
|
214
214
|
}
|
|
215
|
-
onUiAmountToAmount(handler) {
|
|
215
|
+
onUiAmountToAmount(handler, handlerOptions) {
|
|
216
216
|
this.onInstruction("uiAmountToAmount", (ins, ctx) => {
|
|
217
217
|
if (ins) {
|
|
218
218
|
handler(ins.data, ctx);
|
|
219
219
|
}
|
|
220
|
-
});
|
|
220
|
+
}, handlerOptions);
|
|
221
221
|
return this;
|
|
222
222
|
}
|
|
223
|
-
onInitializeMintCloseAuthority(handler) {
|
|
223
|
+
onInitializeMintCloseAuthority(handler, handlerOptions) {
|
|
224
224
|
this.onInstruction("initializeMintCloseAuthority", (ins, ctx) => {
|
|
225
225
|
if (ins) {
|
|
226
226
|
handler(ins.data, ctx);
|
|
227
227
|
}
|
|
228
|
-
});
|
|
228
|
+
}, handlerOptions);
|
|
229
229
|
return this;
|
|
230
230
|
}
|
|
231
|
-
onTransferFeeExtension(handler) {
|
|
231
|
+
onTransferFeeExtension(handler, handlerOptions) {
|
|
232
232
|
this.onInstruction("transferFeeExtension", (ins, ctx) => {
|
|
233
233
|
if (ins) {
|
|
234
234
|
handler(ins.data, ctx);
|
|
235
235
|
}
|
|
236
|
-
});
|
|
236
|
+
}, handlerOptions);
|
|
237
237
|
return this;
|
|
238
238
|
}
|
|
239
|
-
onDefaultAccountStateExtension(handler) {
|
|
239
|
+
onDefaultAccountStateExtension(handler, handlerOptions) {
|
|
240
240
|
this.onInstruction("defaultAccountStateExtension", (ins, ctx) => {
|
|
241
241
|
if (ins) {
|
|
242
242
|
handler(ins.data, ctx);
|
|
243
243
|
}
|
|
244
|
-
});
|
|
244
|
+
}, handlerOptions);
|
|
245
245
|
return this;
|
|
246
246
|
}
|
|
247
|
-
onReallocate(handler) {
|
|
247
|
+
onReallocate(handler, handlerOptions) {
|
|
248
248
|
this.onInstruction("reallocate", (ins, ctx) => {
|
|
249
249
|
if (ins) {
|
|
250
250
|
handler(ins.data, ctx);
|
|
251
251
|
}
|
|
252
|
-
});
|
|
252
|
+
}, handlerOptions);
|
|
253
253
|
return this;
|
|
254
254
|
}
|
|
255
|
-
onMemoTransferExtension(handler) {
|
|
255
|
+
onMemoTransferExtension(handler, handlerOptions) {
|
|
256
256
|
this.onInstruction("memoTransferExtension", (ins, ctx) => {
|
|
257
257
|
if (ins) {
|
|
258
258
|
handler(ins.data, ctx);
|
|
259
259
|
}
|
|
260
|
-
});
|
|
260
|
+
}, handlerOptions);
|
|
261
261
|
return this;
|
|
262
262
|
}
|
|
263
|
-
onCreateNativeMint(handler) {
|
|
263
|
+
onCreateNativeMint(handler, handlerOptions) {
|
|
264
264
|
this.onInstruction("createNativeMint", (ins, ctx) => {
|
|
265
265
|
if (ins) {
|
|
266
266
|
handler(ins.data, ctx);
|
|
267
267
|
}
|
|
268
|
-
});
|
|
268
|
+
}, handlerOptions);
|
|
269
269
|
return this;
|
|
270
270
|
}
|
|
271
271
|
// Todo(pcxu): auto gen this file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/solana/builtin/spl-token-processor.ts","../../../src/solana/builtin/index.ts"],"sourcesContent":["import { SolanaBaseProcessor, SolanaContext, SolanaBindOptions } from \"../index.js\"\nimport { Instruction } from '@coral-xyz/anchor'\nimport { AmountToUiAmount, Approve, ApproveChecked, Burn, BurnChecked, CloseAccount, CreateNativeMint, DefaultAccountStateExtension, FreezeAccount, GetAccountDataSize, InitializeAccount, InitializeAccount2, InitializeAccount3, InitializeImmutableOwner, InitializeMint, InitializeMintCloseAuthority, InitializeMultisig, MemoTransferExtension, MintTo, MintToChecked, Reallocate, Revoke, SyncNative, ThawAccount, Transfer, TransferChecked, TransferFeeExtension, UiAmountToAmount } from './types.js';\n\nexport class SPLTokenProcessor extends SolanaBaseProcessor {\n static bind(options: SolanaBindOptions): SPLTokenProcessor {\n if (options && !options.name) {\n options.name = 'SPL Token Program'\n }\n return new SPLTokenProcessor(options)\n }\n\n fromParsedInstruction: (instruction: { type: string, info: any }) => Instruction | null = (instruction: { type: string, info: any }) => {\n const instructionType = instruction.type\n if (!instructionType) {\n return null\n }\n return {\n name: instruction.type,\n data: {\n ...instruction.info,\n },\n }\n }\n\n public onInitializeMint(\n handler: (data: InitializeMint, ctx: SolanaContext) => void\n ): SPLTokenProcessor {\n this.onInstruction('initializeMint', (ins: Instruction, ctx) => {\n if (ins) {\n handler(ins.data as InitializeMint, ctx)\n }\n })\n return this\n }\n\n public onInitializeAccount(\n hanlder: (data: InitializeAccount, ctx: SolanaContext) => void\n ): SPLTokenProcessor {\n this.onInstruction('initializeAccount', (ins: Instruction, ctx) => {\n if (ins) {\n hanlder(ins.data as InitializeAccount, ctx)\n }\n })\n return this\n }\n\n public onInitializeAccount2(\n hanlder: (data: InitializeAccount2, ctx: SolanaContext) => void\n ): SPLTokenProcessor {\n this.onInstruction('initializeAccount2', (ins: Instruction, ctx) => {\n if (ins) {\n hanlder(ins.data as InitializeAccount2, ctx)\n }\n })\n return this\n }\n\n public onInitializeAccount3(\n hanlder: (data: InitializeAccount3, ctx: SolanaContext) => void\n ): SPLTokenProcessor {\n this.onInstruction('initializeAccount3', (ins: Instruction, ctx) => {\n if (ins) {\n hanlder(ins.data as InitializeAccount3, ctx)\n }\n })\n return this\n }\n\n public onInitializeMultisig(\n handler: (data: InitializeMultisig, ctx: SolanaContext) => void\n ): SPLTokenProcessor {\n this.onInstruction('initializeMultisig', (ins: Instruction, ctx) => {\n if (ins) {\n handler(ins.data as InitializeMultisig, ctx)\n }\n })\n return this\n }\n\n public onTransfer(handler: (data: Transfer, ctx: SolanaContext) => void): SPLTokenProcessor {\n this.onInstruction('transfer', (ins: Instruction, ctx) => {\n if (ins) {\n handler(ins.data as Transfer, ctx)\n }\n })\n return this\n }\n\n public onApprovend(handler: (data: Approve, ctx: SolanaContext) => void): SPLTokenProcessor {\n this.onInstruction('approve', (ins: Instruction, ctx) => {\n if (ins) {\n handler(ins.data as Approve, ctx)\n }\n })\n return this\n }\n\n public onRevoke(handler: (data: Revoke, ctx: SolanaContext) => void): SPLTokenProcessor {\n this.onInstruction('revoke', (ins: Instruction, ctx) => {\n if (ins) {\n handler(ins.data as Revoke, ctx)\n }\n })\n return this\n }\n\n public onSetAuthority(handler: (data: any, ctx: SolanaContext) => void): SPLTokenProcessor {\n this.onInstruction('setAuthority', (ins: Instruction, ctx) => {\n if (ins) {\n handler(ins.data as any, ctx)\n }\n })\n return this\n }\n\n public onMintTo(handler: (data: MintTo, ctx: SolanaContext) => void): SPLTokenProcessor {\n this.onInstruction('mintTo', (ins: Instruction, ctx) => {\n if (ins) {\n handler(ins.data as MintTo, ctx)\n }\n })\n return this\n }\n\n public onBurn(handler: (data: Burn, ctx: SolanaContext) => void): SPLTokenProcessor {\n this.onInstruction('burn', (ins: Instruction, ctx) => {\n if (ins) {\n handler(ins.data as Burn, ctx)\n }\n })\n return this\n }\n\n public onCloseAccount(handler: (data: CloseAccount, ctx: SolanaContext) => void): SPLTokenProcessor {\n this.onInstruction('closeAccount', (ins: Instruction, ctx) => {\n if (ins) {\n handler(ins.data as CloseAccount, ctx)\n }\n })\n return this\n }\n\n public onFreezeAccount(handler: (data: FreezeAccount, ctx: SolanaContext) => void): SPLTokenProcessor {\n this.onInstruction('freezeAccount', (ins: Instruction, ctx) => {\n if (ins) {\n handler(ins.data as FreezeAccount, ctx)\n }\n })\n return this\n }\n\n public onThawAccount(handler: (data: ThawAccount, ctx: SolanaContext) => void): SPLTokenProcessor {\n this.onInstruction('thawAccount', (ins: Instruction, ctx) => {\n if (ins) {\n handler(ins.data as ThawAccount, ctx)\n }\n })\n return this\n }\n\n public onTransferChecked(handler: (data: TransferChecked, ctx: SolanaContext) => void): SPLTokenProcessor {\n this.onInstruction('transferChecked', (ins: Instruction, ctx) => {\n if (ins) {\n handler(ins.data as TransferChecked, ctx)\n }\n })\n return this\n }\n\n public onApproveChecked(handler: (data: ApproveChecked, ctx: SolanaContext) => void): SPLTokenProcessor {\n this.onInstruction('approveChecked', (ins: Instruction, ctx) => {\n if (ins) {\n handler(ins.data as ApproveChecked, ctx)\n }\n })\n return this\n }\n\n public onMintToChecked(handler: (data: MintToChecked, ctx: SolanaContext) => void): SPLTokenProcessor {\n this.onInstruction('mintToChecked', (ins: Instruction, ctx) => {\n if (ins) {\n handler(ins.data as MintToChecked, ctx)\n }\n })\n return this\n }\n\n public onBurnChecked(handler: (data: BurnChecked, ctx: SolanaContext) => void): SPLTokenProcessor {\n this.onInstruction('burnChecked', (ins: Instruction, ctx) => {\n if (ins) {\n handler(ins.data as BurnChecked, ctx)\n }\n })\n return this\n }\n\n public onSyncNative(handler: (data: SyncNative, ctx: SolanaContext) => void): SPLTokenProcessor {\n this.onInstruction('syncNative', (ins: Instruction, ctx) => {\n if (ins) {\n handler(ins.data as SyncNative, ctx)\n }\n })\n return this\n }\n\n public onGetAccountDataSize(handler: (data: GetAccountDataSize, ctx: SolanaContext) => void): SPLTokenProcessor {\n this.onInstruction('getAccountDataSize', (ins: Instruction, ctx) => {\n if (ins) {\n handler(ins.data as GetAccountDataSize, ctx)\n }\n })\n return this\n }\n\n public onInitializeImmutableOwner(handler: (data: InitializeImmutableOwner, ctx: SolanaContext) => void): SPLTokenProcessor {\n this.onInstruction('initializeImmutableOwner', (ins: Instruction, ctx) => {\n if (ins) {\n handler(ins.data as InitializeImmutableOwner, ctx)\n }\n })\n return this\n }\n\n public onAmountToUiAmount(handler: (data: AmountToUiAmount, ctx: SolanaContext) => void): SPLTokenProcessor {\n this.onInstruction('amountToUiAmount', (ins: Instruction, ctx) => {\n if (ins) {\n handler(ins.data as AmountToUiAmount, ctx)\n }\n })\n return this\n }\n\n public onUiAmountToAmount(handler: (data: UiAmountToAmount, ctx: SolanaContext) => void): SPLTokenProcessor {\n this.onInstruction('uiAmountToAmount', (ins: Instruction, ctx) => {\n if (ins) {\n handler(ins.data as UiAmountToAmount, ctx)\n }\n })\n return this\n }\n\n public onInitializeMintCloseAuthority(handler: (data: InitializeMintCloseAuthority, ctx: SolanaContext) => void): SPLTokenProcessor {\n this.onInstruction('initializeMintCloseAuthority', (ins: Instruction, ctx) => {\n if (ins) {\n handler(ins.data as InitializeMintCloseAuthority, ctx)\n }\n })\n return this\n }\n\n public onTransferFeeExtension(handler: (data: TransferFeeExtension, ctx: SolanaContext) => void): SPLTokenProcessor {\n this.onInstruction('transferFeeExtension', (ins: Instruction, ctx) => {\n if (ins) {\n handler(ins.data as TransferFeeExtension, ctx)\n }\n })\n return this\n }\n\n public onDefaultAccountStateExtension(handler: (data: DefaultAccountStateExtension, ctx: SolanaContext) => void): SPLTokenProcessor {\n this.onInstruction('defaultAccountStateExtension', (ins: Instruction, ctx) => {\n if (ins) {\n handler(ins.data as DefaultAccountStateExtension, ctx)\n }\n })\n return this\n }\n\n public onReallocate(handler: (data: Reallocate, ctx: SolanaContext) => void): SPLTokenProcessor {\n this.onInstruction('reallocate', (ins: Instruction, ctx) => {\n if (ins) {\n handler(ins.data as Reallocate, ctx)\n }\n })\n return this\n }\n\n public onMemoTransferExtension(handler: (data: MemoTransferExtension, ctx: SolanaContext) => void): SPLTokenProcessor {\n this.onInstruction('memoTransferExtension', (ins: Instruction, ctx) => {\n if (ins) {\n handler(ins.data as MemoTransferExtension, ctx)\n }\n })\n return this\n }\n\n public onCreateNativeMint(handler: (data: CreateNativeMint, ctx: SolanaContext) => void): SPLTokenProcessor {\n this.onInstruction('createNativeMint', (ins: Instruction, ctx) => {\n if (ins) {\n handler(ins.data as CreateNativeMint, ctx)\n }\n })\n return this\n }\n\n // Todo(pcxu): auto gen this file\n}\n;import(\"node:process\").then((p) => p.stdout.write(\"\"));","export * from './spl-token-processor.js';import(\"node:process\").then((p) => p.stdout.write(\"\"));"],"mappings":";;;;;;;;;;;;;;;;AAIO,IAAM,oBAAN,MAAM,2BAA0B,oBAAoB;AAAA,EAJ3D,OAI2D;AAAA;AAAA;AAAA,EACzD,OAAO,KAAK,SAA+C;AACzD,QAAI,WAAW,CAAC,QAAQ,MAAM;AAC5B,cAAQ,OAAO;AAAA,IACjB;AACA,WAAO,IAAI,mBAAkB,OAAO;AAAA,EACtC;AAAA,EAEA,wBAA0F,wBAAC,gBAA6C;AACtI,UAAM,kBAAkB,YAAY;AACpC,QAAI,CAAC,iBAAiB;AACpB,aAAO;AAAA,IACT;AACA,WAAO;AAAA,MACL,MAAM,YAAY;AAAA,MAClB,MAAM;AAAA,QACJ,GAAG,YAAY;AAAA,MACjB;AAAA,IACF;AAAA,EACF,GAX0F;AAAA,EAanF,iBACL,SACmB;AACnB,SAAK,cAAc,kBAAkB,CAAC,KAAkB,QAAQ;AAC9D,UAAI,KAAK;AACP,g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C3C;AAAA,IACF,CAAC;AACD,WAAO;AAAA,EACT;AAAA;AAGF;AACC,OAAO,cAAc,EAAE,KAAK,CAAC,MAAM,EAAE,OAAO,MAAM,EAAE,CAAC;;;AC1Sb,OAAO,cAAc,EAAE,KAAK,CAAC,MAAM,EAAE,OAAO,MAAM,EAAE,CAAC;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../../src/solana/builtin/spl-token-processor.ts","../../../src/solana/builtin/index.ts"],"sourcesContent":["import { SolanaBaseProcessor, SolanaContext, SolanaBindOptions, SolanaFetchConfig } from \"../index.js\"\nimport { Instruction } from '@coral-xyz/anchor'\nimport { AmountToUiAmount, Approve, ApproveChecked, Burn, BurnChecked, CloseAccount, CreateNativeMint, DefaultAccountStateExtension, FreezeAccount, GetAccountDataSize, InitializeAccount, InitializeAccount2, InitializeAccount3, InitializeImmutableOwner, InitializeMint, InitializeMintCloseAuthority, InitializeMultisig, MemoTransferExtension, MintTo, MintToChecked, Reallocate, Revoke, SyncNative, ThawAccount, Transfer, TransferChecked, TransferFeeExtension, UiAmountToAmount } from './types.js';\nimport { HandlerOptions } from '../../core/handler-options.js'\n\nexport class SPLTokenProcessor extends SolanaBaseProcessor {\n static bind(options: SolanaBindOptions): SPLTokenProcessor {\n if (options && !options.name) {\n options.name = 'SPL Token Program'\n }\n return new SPLTokenProcessor(options)\n }\n\n fromParsedInstruction: (instruction: { type: string, info: any }) => Instruction | null = (instruction: { type: string, info: any }) => {\n const instructionType = instruction.type\n if (!instructionType) {\n return null\n }\n return {\n name: instruction.type,\n data: {\n ...instruction.info,\n },\n }\n }\n\n public onInitializeMint(\n handler: (data: InitializeMint, ctx: SolanaContext) => void,\n handlerOptions?: HandlerOptions<SolanaFetchConfig, Instruction>\n ): SPLTokenProcessor {\n this.onInstruction('initializeMint', (ins: Instruction, ctx) => {\n if (ins) {\n handler(ins.data as InitializeMint, ctx)\n }\n }, handlerOptions)\n return this\n }\n\n public onInitializeAccount(\n handler: (data: InitializeAccount, ctx: SolanaContext) => void,\n handlerOptions?: HandlerOptions<SolanaFetchConfig, Instruction>\n ): SPLTokenProcessor {\n this.onInstruction('initializeAccount', (ins: Instruction, ctx) => {\n if (ins) {\n handler(ins.data as InitializeAccount, ctx)\n }\n }, handlerOptions)\n return this\n }\n\n public onInitializeAccount2(\n handler: (data: InitializeAccount2, ctx: SolanaContext) => void,\n handlerOptions?: HandlerOptions<SolanaFetchConfig, Instruction>\n ): SPLTokenProcessor {\n this.onInstruction('initializeAccount2', (ins: Instruction, ctx) => {\n if (ins) {\n handler(ins.data as InitializeAccount2, ctx)\n }\n }, handlerOptions)\n return this\n }\n\n public onInitializeAccount3(\n handler: (data: InitializeAccount3, ctx: SolanaContext) => void,\n handlerOptions?: HandlerOptions<SolanaFetchConfig, Instruction>\n ): SPLTokenProcessor {\n this.onInstruction('initializeAccount3', (ins: Instruction, ctx) => {\n if (ins) {\n handler(ins.data as InitializeAccount3, ctx)\n }\n }, handlerOptions)\n return this\n }\n\n public onInitializeMultisig(\n handler: (data: InitializeMultisig, ctx: SolanaContext) => void,\n handlerOptions?: HandlerOptions<SolanaFetchConfig, Instruction>\n ): SPLTokenProcessor {\n this.onInstruction('initializeMultisig', (ins: Instruction, ctx) => {\n if (ins) {\n handler(ins.data as InitializeMultisig, ctx)\n }\n }, handlerOptions)\n return this\n }\n\n public onTransfer(\n handler: (data: Transfer, ctx: SolanaContext) => void,\n handlerOptions?: HandlerOptions<SolanaFetchConfig, Instruction>\n ): SPLTokenProcessor {\n this.onInstruction('transfer', (ins: Instruction, ctx) => {\n if (ins) {\n handler(ins.data as Transfer, ctx)\n }\n }, handlerOptions)\n return this\n }\n\n public onApprove(\n handler: (data: Approve, ctx: SolanaContext) => void,\n handlerOptions?: HandlerOptions<SolanaFetchConfig, Instruction>\n ): SPLTokenProcessor {\n this.onInstruction('approve', (ins: Instruction, ctx) => {\n if (ins) {\n handler(ins.data as Approve, ctx)\n }\n }, handlerOptions)\n return this\n }\n\n public onRevoke(\n handler: (data: Revoke, ctx: SolanaContext) => void,\n handlerOptions?: HandlerOptions<SolanaFetchConfig, Instruction>\n ): SPLTokenProcessor {\n this.onInstruction('revoke', (ins: Instruction, ctx) => {\n if (ins) {\n handler(ins.data as Revoke, ctx)\n }\n }, handlerOptions)\n return this\n }\n\n public onSetAuthority(\n handler: (data: any, ctx: SolanaContext) => void,\n handlerOptions?: HandlerOptions<SolanaFetchConfig, Instruction>\n ): SPLTokenProcessor {\n this.onInstruction('setAuthority', (ins: Instruction, ctx) => {\n if (ins) {\n handler(ins.data as any, ctx)\n }\n }, handlerOptions)\n return this\n }\n\n public onMintTo(\n handler: (data: MintTo, ctx: SolanaContext) => void,\n handlerOptions?: HandlerOptions<SolanaFetchConfig, Instruction>\n ): SPLTokenProcessor {\n this.onInstruction('mintTo', (ins: Instruction, ctx) => {\n if (ins) {\n handler(ins.data as MintTo, ctx)\n }\n }, handlerOptions)\n return this\n }\n\n public onBurn(\n handler: (data: Burn, ctx: SolanaContext) => void,\n handlerOptions?: HandlerOptions<SolanaFetchConfig, Instruction>\n ): SPLTokenProcessor {\n this.onInstruction('burn', (ins: Instruction, ctx) => {\n if (ins) {\n handler(ins.data as Burn, ctx)\n }\n }, handlerOptions)\n return this\n }\n\n public onCloseAccount(\n handler: (data: CloseAccount, ctx: SolanaContext) => void,\n handlerOptions?: HandlerOptions<SolanaFetchConfig, Instruction>\n ): SPLTokenProcessor {\n this.onInstruction('closeAccount', (ins: Instruction, ctx) => {\n if (ins) {\n handler(ins.data as CloseAccount, ctx)\n }\n }, handlerOptions)\n return this\n }\n\n public onFreezeAccount(\n handler: (data: FreezeAccount, ctx: SolanaContext) => void,\n handlerOptions?: HandlerOptions<SolanaFetchConfig, Instruction>\n ): SPLTokenProcessor {\n this.onInstruction('freezeAccount', (ins: Instruction, ctx) => {\n if (ins) {\n handler(ins.data as FreezeAccount, ctx)\n }\n }, handlerOptions)\n return this\n }\n\n public onThawAccount(\n handler: (data: ThawAccount, ctx: SolanaContext) => void,\n handlerOptions?: HandlerOptions<SolanaFetchConfig, Instruction>\n ): SPLTokenProcessor {\n this.onInstruction('thawAccount', (ins: Instruction, ctx) => {\n if (ins) {\n handler(ins.data as ThawAccount, ctx)\n }\n }, handlerOptions)\n return this\n }\n\n public onTransferChecked(\n handler: (data: TransferChecked, ctx: SolanaContext) => void,\n handlerOptions?: HandlerOptions<SolanaFetchConfig, Instruction>\n ): SPLTokenProcessor {\n this.onInstruction('transferChecked', (ins: Instruction, ctx) => {\n if (ins) {\n handler(ins.data as TransferChecked, ctx)\n }\n }, handlerOptions)\n return this\n }\n\n public onApproveChecked(\n handler: (data: ApproveChecked, ctx: SolanaContext) => void,\n handlerOptions?: HandlerOptions<SolanaFetchConfig, Instruction>\n ): SPLTokenProcessor {\n this.onInstruction('approveChecked', (ins: Instruction, ctx) => {\n if (ins) {\n handler(ins.data as ApproveChecked, ctx)\n }\n }, handlerOptions)\n return this\n }\n\n public onMintToChecked(\n handler: (data: MintToChecked, ctx: SolanaContext) => void,\n handlerOptions?: HandlerOptions<SolanaFetchConfig, Instruction>\n ): SPLTokenProcessor {\n this.onInstruction('mintToChecked', (ins: Instruction, ctx) => {\n if (ins) {\n handler(ins.data as MintToChecked, ctx)\n }\n }, handlerOptions)\n return this\n }\n\n public onBurnChecked(\n handler: (data: BurnChecked, ctx: SolanaContext) => void,\n handlerOptions?: HandlerOptions<SolanaFetchConfig, Instruction>\n ): SPLTokenProcessor {\n this.onInstruction('burnChecked', (ins: Instruction, ctx) => {\n if (ins) {\n handler(ins.data as BurnChecked, ctx)\n }\n }, handlerOptions)\n return this\n }\n\n public onSyncNative(\n handler: (data: SyncNative, ctx: SolanaContext) => void,\n handlerOptions?: HandlerOptions<SolanaFetchConfig, Instruction>\n ): SPLTokenProcessor {\n this.onInstruction('syncNative', (ins: Instruction, ctx) => {\n if (ins) {\n handler(ins.data as SyncNative, ctx)\n }\n }, handlerOptions)\n return this\n }\n\n public onGetAccountDataSize(\n handler: (data: GetAccountDataSize, ctx: SolanaContext) => void,\n handlerOptions?: HandlerOptions<SolanaFetchConfig, Instruction>\n ): SPLTokenProcessor {\n this.onInstruction('getAccountDataSize', (ins: Instruction, ctx) => {\n if (ins) {\n handler(ins.data as GetAccountDataSize, ctx)\n }\n }, handlerOptions)\n return this\n }\n\n public onInitializeImmutableOwner(\n handler: (data: InitializeImmutableOwner, ctx: SolanaContext) => void,\n handlerOptions?: HandlerOptions<SolanaFetchConfig, Instruction>\n ): SPLTokenProcessor {\n this.onInstruction('initializeImmutableOwner', (ins: Instruction, ctx) => {\n if (ins) {\n handler(ins.data as InitializeImmutableOwner, ctx)\n }\n }, handlerOptions)\n return this\n }\n\n public onAmountToUiAmount(\n handler: (data: AmountToUiAmount, ctx: SolanaContext) => void,\n handlerOptions?: HandlerOptions<SolanaFetchConfig, Instruction>\n ): SPLTokenProcessor {\n this.onInstruction('amountToUiAmount', (ins: Instruction, ctx) => {\n if (ins) {\n handler(ins.data as AmountToUiAmount, ctx)\n }\n }, handlerOptions)\n return this\n }\n\n public onUiAmountToAmount(\n handler: (data: UiAmountToAmount, ctx: SolanaContext) => void,\n handlerOptions?: HandlerOptions<SolanaFetchConfig, Instruction>\n ): SPLTokenProcessor {\n this.onInstruction('uiAmountToAmount', (ins: Instruction, ctx) => {\n if (ins) {\n handler(ins.data as UiAmountToAmount, ctx)\n }\n }, handlerOptions)\n return this\n }\n\n public onInitializeMintCloseAuthority(\n handler: (data: InitializeMintCloseAuthority, ctx: SolanaContext) => void,\n handlerOptions?: HandlerOptions<SolanaFetchConfig, Instruction>\n ): SPLTokenProcessor {\n this.onInstruction('initializeMintCloseAuthority', (ins: Instruction, ctx) => {\n if (ins) {\n handler(ins.data as InitializeMintCloseAuthority, ctx)\n }\n }, handlerOptions)\n return this\n }\n\n public onTransferFeeExtension(\n handler: (data: TransferFeeExtension, ctx: SolanaContext) => void,\n handlerOptions?: HandlerOptions<SolanaFetchConfig, Instruction>\n ): SPLTokenProcessor {\n this.onInstruction('transferFeeExtension', (ins: Instruction, ctx) => {\n if (ins) {\n handler(ins.data as TransferFeeExtension, ctx)\n }\n }, handlerOptions)\n return this\n }\n\n public onDefaultAccountStateExtension(\n handler: (data: DefaultAccountStateExtension, ctx: SolanaContext) => void,\n handlerOptions?: HandlerOptions<SolanaFetchConfig, Instruction>\n ): SPLTokenProcessor {\n this.onInstruction('defaultAccountStateExtension', (ins: Instruction, ctx) => {\n if (ins) {\n handler(ins.data as DefaultAccountStateExtension, ctx)\n }\n }, handlerOptions)\n return this\n }\n\n public onReallocate(\n handler: (data: Reallocate, ctx: SolanaContext) => void,\n handlerOptions?: HandlerOptions<SolanaFetchConfig, Instruction>\n ): SPLTokenProcessor {\n this.onInstruction('reallocate', (ins: Instruction, ctx) => {\n if (ins) {\n handler(ins.data as Reallocate, ctx)\n }\n }, handlerOptions)\n return this\n }\n\n public onMemoTransferExtension(\n handler: (data: MemoTransferExtension, ctx: SolanaContext) => void,\n handlerOptions?: HandlerOptions<SolanaFetchConfig, Instruction>\n ): SPLTokenProcessor {\n this.onInstruction('memoTransferExtension', (ins: Instruction, ctx) => {\n if (ins) {\n handler(ins.data as MemoTransferExtension, ctx)\n }\n }, handlerOptions)\n return this\n }\n\n public onCreateNativeMint(\n handler: (data: CreateNativeMint, ctx: SolanaContext) => void,\n handlerOptions?: HandlerOptions<SolanaFetchConfig, Instruction>\n ): SPLTokenProcessor {\n this.onInstruction('createNativeMint', (ins: Instruction, ctx) => {\n if (ins) {\n handler(ins.data as CreateNativeMint, ctx)\n }\n }, handlerOptions)\n return this\n }\n\n // Todo(pcxu): auto gen this file\n}\n;import(\"node:process\").then((p) => p.stdout.write(\"\"));","export * from './spl-token-processor.js';import(\"node:process\").then((p) => p.stdout.write(\"\"));"],"mappings":";;;;;;;;;;;;;;;;AAKO,IAAM,oBAAN,MAAM,2BAA0B,oBAAoB;AAAA,EAL3D,OAK2D;AAAA;AAAA;AAAA,EACzD,OAAO,KAAK,SAA+C;AACzD,QAAI,WAAW,CAAC,QAA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;AAAA,EACT;AAAA,EAEO,+BACL,SACA,gBACmB;AACnB,SAAK,cAAc,gCAAgC,CAAC,KAAkB,QAAQ;AAC5E,UAAI,KAAK;AACP,gBAAQ,IAAI,MAAsC,GAAG;AAAA,MACvD;AAAA,IACF,GAAG,cAAc;AACjB,WAAO;AAAA,EACT;AAAA,EAEO,aACL,SACA,gBACmB;AACnB,SAAK,cAAc,cAAc,CAAC,KAAkB,QAAQ;AAC1D,UAAI,KAAK;AACP,gBAAQ,IAAI,MAAoB,GAAG;AAAA,MACrC;AAAA,IACF,GAAG,cAAc;AACjB,WAAO;AAAA,EACT;AAAA,EAEO,wBACL,SACA,gBACmB;AACnB,SAAK,cAAc,yBAAyB,CAAC,KAAkB,QAAQ;AACrE,UAAI,KAAK;AACP,gBAAQ,IAAI,MAA+B,GAAG;AAAA,MAChD;AAAA,IACF,GAAG,cAAc;AACjB,WAAO;AAAA,EACT;AAAA,EAEO,mBACL,SACA,gBACmB;AACnB,SAAK,cAAc,oBAAoB,CAAC,KAAkB,QAAQ;AAChE,UAAI,KAAK;AACP,gBAAQ,IAAI,MAA0B,GAAG;AAAA,MAC3C;AAAA,IACF,GAAG,cAAc;AACjB,WAAO;AAAA,EACT;AAAA;AAGF;AACC,OAAO,cAAc,EAAE,KAAK,CAAC,MAAM,EAAE,OAAO,MAAM,EAAE,CAAC;;;ACxXb,OAAO,cAAc,EAAE,KAAK,CAAC,MAAM,EAAE,OAAO,MAAM,EAAE,CAAC;","names":[]}
|
package/lib/solana/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sentio/sdk-bundle",
|
|
3
|
-
"version": "3.3.0-rc.
|
|
3
|
+
"version": "3.3.0-rc.2",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"@sentio/chain": "~3.4.22",
|
|
59
59
|
"graphql": "^16.11.0",
|
|
60
60
|
"piscina": "^5.1.3",
|
|
61
|
-
"@sentio/runtime": "^3.3.0-rc.
|
|
61
|
+
"@sentio/runtime": "^3.3.0-rc.2"
|
|
62
62
|
},
|
|
63
63
|
"peerDependencies": {},
|
|
64
64
|
"devDependencies": {},
|