@sentio/sdk 3.9.0-rc.4 → 3.9.0-rc.5
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/solana/builtin/index.d.ts +1 -0
- package/lib/solana/builtin/index.d.ts.map +1 -1
- package/lib/solana/builtin/index.js +1 -0
- package/lib/solana/builtin/index.js.map +1 -1
- package/lib/solana/builtin/spl-token-2022-processor.d.ts +46 -0
- package/lib/solana/builtin/spl-token-2022-processor.d.ts.map +1 -0
- package/lib/solana/builtin/spl-token-2022-processor.js +132 -0
- package/lib/solana/builtin/spl-token-2022-processor.js.map +1 -0
- package/lib/solana/builtin/spl-token-processor.d.ts +30 -30
- package/lib/solana/builtin/spl-token-processor.d.ts.map +1 -1
- package/lib/solana/builtin/types.d.ts +1699 -81
- package/lib/solana/builtin/types.d.ts.map +1 -1
- package/lib/solana/builtin/types.js +520 -72
- package/lib/solana/builtin/types.js.map +1 -1
- package/lib/solana/codegen/codegen.js +2 -2
- package/lib/solana/codegen/codegen.js.map +1 -1
- package/lib/solana/index.d.ts +1 -1
- package/lib/solana/index.js +1 -1
- package/lib/solana/solana-context.d.ts +1 -1
- package/lib/solana/solana-context.d.ts.map +1 -1
- package/lib/solana/solana-processor.d.ts +2 -2
- package/lib/solana/solana-processor.d.ts.map +1 -1
- package/lib/solana/solana-rpc-types.d.ts +75 -0
- package/lib/solana/solana-rpc-types.d.ts.map +1 -0
- package/lib/solana/solana-rpc-types.js +2 -0
- package/lib/solana/solana-rpc-types.js.map +1 -0
- package/package.json +6 -6
- package/src/solana/builtin/index.ts +2 -1
- package/src/solana/builtin/spl-token-2022-processor.ts +324 -0
- package/src/solana/builtin/spl-token-processor.ts +30 -30
- package/src/solana/builtin/types.ts +659 -144
- package/src/solana/codegen/codegen.ts +6 -6
- package/src/solana/index.ts +1 -1
- package/src/solana/solana-context.ts +1 -1
- package/src/solana/solana-plugin.ts +1 -1
- package/src/solana/solana-processor.ts +2 -2
- package/src/solana/solana-rpc-types.ts +73 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SolanaBaseProcessor, SolanaContext, SolanaBindOptions, SolanaFetchConfig } from "../index.js"
|
|
2
|
-
import { Instruction } from '@
|
|
2
|
+
import { Instruction } from '@anchor-lang/core'
|
|
3
3
|
import { 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';
|
|
4
4
|
import { HandlerOptions } from '../../core/handler-options.js'
|
|
5
5
|
|
|
@@ -27,7 +27,7 @@ export class SPLTokenProcessor extends SolanaBaseProcessor {
|
|
|
27
27
|
public onInitializeMint(
|
|
28
28
|
handler: (data: InitializeMint, ctx: SolanaContext) => void,
|
|
29
29
|
handlerOptions?: HandlerOptions<SolanaFetchConfig, Instruction>
|
|
30
|
-
):
|
|
30
|
+
): this {
|
|
31
31
|
this.onInstruction('initializeMint', (ins: Instruction, ctx) => {
|
|
32
32
|
if (ins) {
|
|
33
33
|
handler(ins.data as InitializeMint, ctx)
|
|
@@ -39,7 +39,7 @@ export class SPLTokenProcessor extends SolanaBaseProcessor {
|
|
|
39
39
|
public onInitializeAccount(
|
|
40
40
|
handler: (data: InitializeAccount, ctx: SolanaContext) => void,
|
|
41
41
|
handlerOptions?: HandlerOptions<SolanaFetchConfig, Instruction>
|
|
42
|
-
):
|
|
42
|
+
): this {
|
|
43
43
|
this.onInstruction('initializeAccount', (ins: Instruction, ctx) => {
|
|
44
44
|
if (ins) {
|
|
45
45
|
handler(ins.data as InitializeAccount, ctx)
|
|
@@ -51,7 +51,7 @@ export class SPLTokenProcessor extends SolanaBaseProcessor {
|
|
|
51
51
|
public onInitializeAccount2(
|
|
52
52
|
handler: (data: InitializeAccount2, ctx: SolanaContext) => void,
|
|
53
53
|
handlerOptions?: HandlerOptions<SolanaFetchConfig, Instruction>
|
|
54
|
-
):
|
|
54
|
+
): this {
|
|
55
55
|
this.onInstruction('initializeAccount2', (ins: Instruction, ctx) => {
|
|
56
56
|
if (ins) {
|
|
57
57
|
handler(ins.data as InitializeAccount2, ctx)
|
|
@@ -63,7 +63,7 @@ export class SPLTokenProcessor extends SolanaBaseProcessor {
|
|
|
63
63
|
public onInitializeAccount3(
|
|
64
64
|
handler: (data: InitializeAccount3, ctx: SolanaContext) => void,
|
|
65
65
|
handlerOptions?: HandlerOptions<SolanaFetchConfig, Instruction>
|
|
66
|
-
):
|
|
66
|
+
): this {
|
|
67
67
|
this.onInstruction('initializeAccount3', (ins: Instruction, ctx) => {
|
|
68
68
|
if (ins) {
|
|
69
69
|
handler(ins.data as InitializeAccount3, ctx)
|
|
@@ -75,7 +75,7 @@ export class SPLTokenProcessor extends SolanaBaseProcessor {
|
|
|
75
75
|
public onInitializeMultisig(
|
|
76
76
|
handler: (data: InitializeMultisig, ctx: SolanaContext) => void,
|
|
77
77
|
handlerOptions?: HandlerOptions<SolanaFetchConfig, Instruction>
|
|
78
|
-
):
|
|
78
|
+
): this {
|
|
79
79
|
this.onInstruction('initializeMultisig', (ins: Instruction, ctx) => {
|
|
80
80
|
if (ins) {
|
|
81
81
|
handler(ins.data as InitializeMultisig, ctx)
|
|
@@ -87,7 +87,7 @@ export class SPLTokenProcessor extends SolanaBaseProcessor {
|
|
|
87
87
|
public onTransfer(
|
|
88
88
|
handler: (data: Transfer, ctx: SolanaContext) => void,
|
|
89
89
|
handlerOptions?: HandlerOptions<SolanaFetchConfig, Instruction>
|
|
90
|
-
):
|
|
90
|
+
): this {
|
|
91
91
|
this.onInstruction('transfer', (ins: Instruction, ctx) => {
|
|
92
92
|
if (ins) {
|
|
93
93
|
handler(ins.data as Transfer, ctx)
|
|
@@ -99,7 +99,7 @@ export class SPLTokenProcessor extends SolanaBaseProcessor {
|
|
|
99
99
|
public onApprove(
|
|
100
100
|
handler: (data: Approve, ctx: SolanaContext) => void,
|
|
101
101
|
handlerOptions?: HandlerOptions<SolanaFetchConfig, Instruction>
|
|
102
|
-
):
|
|
102
|
+
): this {
|
|
103
103
|
this.onInstruction('approve', (ins: Instruction, ctx) => {
|
|
104
104
|
if (ins) {
|
|
105
105
|
handler(ins.data as Approve, ctx)
|
|
@@ -111,7 +111,7 @@ export class SPLTokenProcessor extends SolanaBaseProcessor {
|
|
|
111
111
|
public onRevoke(
|
|
112
112
|
handler: (data: Revoke, ctx: SolanaContext) => void,
|
|
113
113
|
handlerOptions?: HandlerOptions<SolanaFetchConfig, Instruction>
|
|
114
|
-
):
|
|
114
|
+
): this {
|
|
115
115
|
this.onInstruction('revoke', (ins: Instruction, ctx) => {
|
|
116
116
|
if (ins) {
|
|
117
117
|
handler(ins.data as Revoke, ctx)
|
|
@@ -123,7 +123,7 @@ export class SPLTokenProcessor extends SolanaBaseProcessor {
|
|
|
123
123
|
public onSetAuthority(
|
|
124
124
|
handler: (data: any, ctx: SolanaContext) => void,
|
|
125
125
|
handlerOptions?: HandlerOptions<SolanaFetchConfig, Instruction>
|
|
126
|
-
):
|
|
126
|
+
): this {
|
|
127
127
|
this.onInstruction('setAuthority', (ins: Instruction, ctx) => {
|
|
128
128
|
if (ins) {
|
|
129
129
|
handler(ins.data as any, ctx)
|
|
@@ -135,7 +135,7 @@ export class SPLTokenProcessor extends SolanaBaseProcessor {
|
|
|
135
135
|
public onMintTo(
|
|
136
136
|
handler: (data: MintTo, ctx: SolanaContext) => void,
|
|
137
137
|
handlerOptions?: HandlerOptions<SolanaFetchConfig, Instruction>
|
|
138
|
-
):
|
|
138
|
+
): this {
|
|
139
139
|
this.onInstruction('mintTo', (ins: Instruction, ctx) => {
|
|
140
140
|
if (ins) {
|
|
141
141
|
handler(ins.data as MintTo, ctx)
|
|
@@ -147,7 +147,7 @@ export class SPLTokenProcessor extends SolanaBaseProcessor {
|
|
|
147
147
|
public onBurn(
|
|
148
148
|
handler: (data: Burn, ctx: SolanaContext) => void,
|
|
149
149
|
handlerOptions?: HandlerOptions<SolanaFetchConfig, Instruction>
|
|
150
|
-
):
|
|
150
|
+
): this {
|
|
151
151
|
this.onInstruction('burn', (ins: Instruction, ctx) => {
|
|
152
152
|
if (ins) {
|
|
153
153
|
handler(ins.data as Burn, ctx)
|
|
@@ -159,7 +159,7 @@ export class SPLTokenProcessor extends SolanaBaseProcessor {
|
|
|
159
159
|
public onCloseAccount(
|
|
160
160
|
handler: (data: CloseAccount, ctx: SolanaContext) => void,
|
|
161
161
|
handlerOptions?: HandlerOptions<SolanaFetchConfig, Instruction>
|
|
162
|
-
):
|
|
162
|
+
): this {
|
|
163
163
|
this.onInstruction('closeAccount', (ins: Instruction, ctx) => {
|
|
164
164
|
if (ins) {
|
|
165
165
|
handler(ins.data as CloseAccount, ctx)
|
|
@@ -171,7 +171,7 @@ export class SPLTokenProcessor extends SolanaBaseProcessor {
|
|
|
171
171
|
public onFreezeAccount(
|
|
172
172
|
handler: (data: FreezeAccount, ctx: SolanaContext) => void,
|
|
173
173
|
handlerOptions?: HandlerOptions<SolanaFetchConfig, Instruction>
|
|
174
|
-
):
|
|
174
|
+
): this {
|
|
175
175
|
this.onInstruction('freezeAccount', (ins: Instruction, ctx) => {
|
|
176
176
|
if (ins) {
|
|
177
177
|
handler(ins.data as FreezeAccount, ctx)
|
|
@@ -183,7 +183,7 @@ export class SPLTokenProcessor extends SolanaBaseProcessor {
|
|
|
183
183
|
public onThawAccount(
|
|
184
184
|
handler: (data: ThawAccount, ctx: SolanaContext) => void,
|
|
185
185
|
handlerOptions?: HandlerOptions<SolanaFetchConfig, Instruction>
|
|
186
|
-
):
|
|
186
|
+
): this {
|
|
187
187
|
this.onInstruction('thawAccount', (ins: Instruction, ctx) => {
|
|
188
188
|
if (ins) {
|
|
189
189
|
handler(ins.data as ThawAccount, ctx)
|
|
@@ -195,7 +195,7 @@ export class SPLTokenProcessor extends SolanaBaseProcessor {
|
|
|
195
195
|
public onTransferChecked(
|
|
196
196
|
handler: (data: TransferChecked, ctx: SolanaContext) => void,
|
|
197
197
|
handlerOptions?: HandlerOptions<SolanaFetchConfig, Instruction>
|
|
198
|
-
):
|
|
198
|
+
): this {
|
|
199
199
|
this.onInstruction('transferChecked', (ins: Instruction, ctx) => {
|
|
200
200
|
if (ins) {
|
|
201
201
|
handler(ins.data as TransferChecked, ctx)
|
|
@@ -207,7 +207,7 @@ export class SPLTokenProcessor extends SolanaBaseProcessor {
|
|
|
207
207
|
public onApproveChecked(
|
|
208
208
|
handler: (data: ApproveChecked, ctx: SolanaContext) => void,
|
|
209
209
|
handlerOptions?: HandlerOptions<SolanaFetchConfig, Instruction>
|
|
210
|
-
):
|
|
210
|
+
): this {
|
|
211
211
|
this.onInstruction('approveChecked', (ins: Instruction, ctx) => {
|
|
212
212
|
if (ins) {
|
|
213
213
|
handler(ins.data as ApproveChecked, ctx)
|
|
@@ -219,7 +219,7 @@ export class SPLTokenProcessor extends SolanaBaseProcessor {
|
|
|
219
219
|
public onMintToChecked(
|
|
220
220
|
handler: (data: MintToChecked, ctx: SolanaContext) => void,
|
|
221
221
|
handlerOptions?: HandlerOptions<SolanaFetchConfig, Instruction>
|
|
222
|
-
):
|
|
222
|
+
): this {
|
|
223
223
|
this.onInstruction('mintToChecked', (ins: Instruction, ctx) => {
|
|
224
224
|
if (ins) {
|
|
225
225
|
handler(ins.data as MintToChecked, ctx)
|
|
@@ -231,7 +231,7 @@ export class SPLTokenProcessor extends SolanaBaseProcessor {
|
|
|
231
231
|
public onBurnChecked(
|
|
232
232
|
handler: (data: BurnChecked, ctx: SolanaContext) => void,
|
|
233
233
|
handlerOptions?: HandlerOptions<SolanaFetchConfig, Instruction>
|
|
234
|
-
):
|
|
234
|
+
): this {
|
|
235
235
|
this.onInstruction('burnChecked', (ins: Instruction, ctx) => {
|
|
236
236
|
if (ins) {
|
|
237
237
|
handler(ins.data as BurnChecked, ctx)
|
|
@@ -243,7 +243,7 @@ export class SPLTokenProcessor extends SolanaBaseProcessor {
|
|
|
243
243
|
public onSyncNative(
|
|
244
244
|
handler: (data: SyncNative, ctx: SolanaContext) => void,
|
|
245
245
|
handlerOptions?: HandlerOptions<SolanaFetchConfig, Instruction>
|
|
246
|
-
):
|
|
246
|
+
): this {
|
|
247
247
|
this.onInstruction('syncNative', (ins: Instruction, ctx) => {
|
|
248
248
|
if (ins) {
|
|
249
249
|
handler(ins.data as SyncNative, ctx)
|
|
@@ -255,7 +255,7 @@ export class SPLTokenProcessor extends SolanaBaseProcessor {
|
|
|
255
255
|
public onGetAccountDataSize(
|
|
256
256
|
handler: (data: GetAccountDataSize, ctx: SolanaContext) => void,
|
|
257
257
|
handlerOptions?: HandlerOptions<SolanaFetchConfig, Instruction>
|
|
258
|
-
):
|
|
258
|
+
): this {
|
|
259
259
|
this.onInstruction('getAccountDataSize', (ins: Instruction, ctx) => {
|
|
260
260
|
if (ins) {
|
|
261
261
|
handler(ins.data as GetAccountDataSize, ctx)
|
|
@@ -267,7 +267,7 @@ export class SPLTokenProcessor extends SolanaBaseProcessor {
|
|
|
267
267
|
public onInitializeImmutableOwner(
|
|
268
268
|
handler: (data: InitializeImmutableOwner, ctx: SolanaContext) => void,
|
|
269
269
|
handlerOptions?: HandlerOptions<SolanaFetchConfig, Instruction>
|
|
270
|
-
):
|
|
270
|
+
): this {
|
|
271
271
|
this.onInstruction('initializeImmutableOwner', (ins: Instruction, ctx) => {
|
|
272
272
|
if (ins) {
|
|
273
273
|
handler(ins.data as InitializeImmutableOwner, ctx)
|
|
@@ -279,7 +279,7 @@ export class SPLTokenProcessor extends SolanaBaseProcessor {
|
|
|
279
279
|
public onAmountToUiAmount(
|
|
280
280
|
handler: (data: AmountToUiAmount, ctx: SolanaContext) => void,
|
|
281
281
|
handlerOptions?: HandlerOptions<SolanaFetchConfig, Instruction>
|
|
282
|
-
):
|
|
282
|
+
): this {
|
|
283
283
|
this.onInstruction('amountToUiAmount', (ins: Instruction, ctx) => {
|
|
284
284
|
if (ins) {
|
|
285
285
|
handler(ins.data as AmountToUiAmount, ctx)
|
|
@@ -291,7 +291,7 @@ export class SPLTokenProcessor extends SolanaBaseProcessor {
|
|
|
291
291
|
public onUiAmountToAmount(
|
|
292
292
|
handler: (data: UiAmountToAmount, ctx: SolanaContext) => void,
|
|
293
293
|
handlerOptions?: HandlerOptions<SolanaFetchConfig, Instruction>
|
|
294
|
-
):
|
|
294
|
+
): this {
|
|
295
295
|
this.onInstruction('uiAmountToAmount', (ins: Instruction, ctx) => {
|
|
296
296
|
if (ins) {
|
|
297
297
|
handler(ins.data as UiAmountToAmount, ctx)
|
|
@@ -303,7 +303,7 @@ export class SPLTokenProcessor extends SolanaBaseProcessor {
|
|
|
303
303
|
public onInitializeMintCloseAuthority(
|
|
304
304
|
handler: (data: InitializeMintCloseAuthority, ctx: SolanaContext) => void,
|
|
305
305
|
handlerOptions?: HandlerOptions<SolanaFetchConfig, Instruction>
|
|
306
|
-
):
|
|
306
|
+
): this {
|
|
307
307
|
this.onInstruction('initializeMintCloseAuthority', (ins: Instruction, ctx) => {
|
|
308
308
|
if (ins) {
|
|
309
309
|
handler(ins.data as InitializeMintCloseAuthority, ctx)
|
|
@@ -315,7 +315,7 @@ export class SPLTokenProcessor extends SolanaBaseProcessor {
|
|
|
315
315
|
public onTransferFeeExtension(
|
|
316
316
|
handler: (data: TransferFeeExtension, ctx: SolanaContext) => void,
|
|
317
317
|
handlerOptions?: HandlerOptions<SolanaFetchConfig, Instruction>
|
|
318
|
-
):
|
|
318
|
+
): this {
|
|
319
319
|
this.onInstruction('transferFeeExtension', (ins: Instruction, ctx) => {
|
|
320
320
|
if (ins) {
|
|
321
321
|
handler(ins.data as TransferFeeExtension, ctx)
|
|
@@ -327,7 +327,7 @@ export class SPLTokenProcessor extends SolanaBaseProcessor {
|
|
|
327
327
|
public onDefaultAccountStateExtension(
|
|
328
328
|
handler: (data: DefaultAccountStateExtension, ctx: SolanaContext) => void,
|
|
329
329
|
handlerOptions?: HandlerOptions<SolanaFetchConfig, Instruction>
|
|
330
|
-
):
|
|
330
|
+
): this {
|
|
331
331
|
this.onInstruction('defaultAccountStateExtension', (ins: Instruction, ctx) => {
|
|
332
332
|
if (ins) {
|
|
333
333
|
handler(ins.data as DefaultAccountStateExtension, ctx)
|
|
@@ -339,7 +339,7 @@ export class SPLTokenProcessor extends SolanaBaseProcessor {
|
|
|
339
339
|
public onReallocate(
|
|
340
340
|
handler: (data: Reallocate, ctx: SolanaContext) => void,
|
|
341
341
|
handlerOptions?: HandlerOptions<SolanaFetchConfig, Instruction>
|
|
342
|
-
):
|
|
342
|
+
): this {
|
|
343
343
|
this.onInstruction('reallocate', (ins: Instruction, ctx) => {
|
|
344
344
|
if (ins) {
|
|
345
345
|
handler(ins.data as Reallocate, ctx)
|
|
@@ -351,7 +351,7 @@ export class SPLTokenProcessor extends SolanaBaseProcessor {
|
|
|
351
351
|
public onMemoTransferExtension(
|
|
352
352
|
handler: (data: MemoTransferExtension, ctx: SolanaContext) => void,
|
|
353
353
|
handlerOptions?: HandlerOptions<SolanaFetchConfig, Instruction>
|
|
354
|
-
):
|
|
354
|
+
): this {
|
|
355
355
|
this.onInstruction('memoTransferExtension', (ins: Instruction, ctx) => {
|
|
356
356
|
if (ins) {
|
|
357
357
|
handler(ins.data as MemoTransferExtension, ctx)
|
|
@@ -363,7 +363,7 @@ export class SPLTokenProcessor extends SolanaBaseProcessor {
|
|
|
363
363
|
public onCreateNativeMint(
|
|
364
364
|
handler: (data: CreateNativeMint, ctx: SolanaContext) => void,
|
|
365
365
|
handlerOptions?: HandlerOptions<SolanaFetchConfig, Instruction>
|
|
366
|
-
):
|
|
366
|
+
): this {
|
|
367
367
|
this.onInstruction('createNativeMint', (ins: Instruction, ctx) => {
|
|
368
368
|
if (ins) {
|
|
369
369
|
handler(ins.data as CreateNativeMint, ctx)
|