Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 15 |
|
0.00% |
0 / 1 |
CRAP | |
0.00% |
0 / 1 |
| MetaplexProgram | |
0.00% |
0 / 15 |
|
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 1 |
| getProgramAccounts | |
0.00% |
0 / 15 |
|
0.00% |
0 / 1 |
2 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace Attestto\SolanaPhpSdk\Programs; |
| 4 | |
| 5 | use Attestto\SolanaPhpSdk\Program; |
| 6 | |
| 7 | class MetaplexProgram extends Program |
| 8 | { |
| 9 | public const METAPLEX_PROGRAM_ID = 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s'; |
| 10 | |
| 11 | /** |
| 12 | * @param string $pubKey |
| 13 | * @return array|mixed |
| 14 | */ |
| 15 | public function getProgramAccounts(string $pubKey) |
| 16 | { |
| 17 | $magicOffsetNumber = 326; // 🤷♂️ |
| 18 | |
| 19 | return $this->client->call('getProgramAccounts', [ |
| 20 | self::METAPLEX_PROGRAM_ID, |
| 21 | [ |
| 22 | 'encoding' => 'base64', |
| 23 | 'filters' => [ |
| 24 | [ |
| 25 | 'memcmp' => [ |
| 26 | 'bytes' => $pubKey, |
| 27 | 'offset' => $magicOffsetNumber, |
| 28 | ], |
| 29 | ], |
| 30 | ], |
| 31 | ], |
| 32 | ]); |
| 33 | } |
| 34 | } |