File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ package spl
2+
3+ import (
4+ bin "github.com/gagliardetto/binary"
5+ "github.com/gagliardetto/solana-go"
6+ )
7+
8+ type AddressLookupTableMeta struct {
9+ DeactivationSlot uint64
10+ LastExtendedSlot uint64
11+ LastExtendedSlotStartIndex uint8
12+ Authority []solana.PublicKey
13+ }
14+
15+ type AddressLookupTable struct {
16+ State uint32
17+ Meta AddressLookupTableMeta
18+ Addresses []solana.PublicKey
19+ }
20+
21+ func (inst * AddressLookupTable ) UnmarshalWithDecoder (decoder * bin.Decoder ) error {
22+ err := decoder .Decode (& inst .State )
23+ if err != nil {
24+ return err
25+ }
26+ err = decoder .Decode (& inst .Meta )
27+ if err != nil {
28+ return err
29+ }
30+ err = decoder .SetPosition (56 )
31+ if err != nil {
32+ return err
33+ }
34+ for decoder .HasRemaining () {
35+ pub := & solana.PublicKey {}
36+ err = decoder .Decode (pub )
37+ if err != nil {
38+ return err
39+ }
40+ inst .Addresses = append (inst .Addresses , * pub )
41+ }
42+ return err
43+ }
You can’t perform that action at this time.
0 commit comments