Skip to content

Commit

Permalink
document new stats param.
Browse files Browse the repository at this point in the history
  • Loading branch information
jpe7s committed Oct 7, 2024
1 parent bc8d21a commit 35df62c
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 16 deletions.
21 changes: 11 additions & 10 deletions solana/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,17 @@

Attempts to find one or more tables to help minimize the size of a transaction.

#### `/v0/alt/discover/*`

* **query**:
* **accountsOnly**:
* `true`: An array of base58 encoded lookup table public keys will be returned.
* `false`: (default) An array of objects including both the table public key and the base64 encoded program
account will be returned.
* **stats**:
* `true`: Include stats comparing the input tx and the resulting versioned tx, as well as stats per table used.
* `false`: (default)

#### POST `/v0/alt/discover/tx/raw`

Post a serialized and encoded, legacy or v0, transaction.
Expand All @@ -19,11 +30,6 @@ curl -H "X-BYTE-ENCODING: base64" -d 'AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
* **X-BYTE-ENCODING**: Encoding of the posted transaction.
* `hex`
* `base64`: default
* **query**:
* **accountsOnly**:
* `true`: An array of base58 encoded lookup table public keys will be returned.
* `false`: (default) An array of objects including both the table public key and the base64 encoded program
account will be returned.
* **body**: serialized and encoded transaction.

#### POST `/v0/alt/discover/accounts`
Expand All @@ -38,11 +44,6 @@ curl -d '["8UJgxaiQx5nTrdDgph5FiahMmzduuLTLf5WmsPegYA6W","2UZMvVTBQR9yWxrEdzEQzX
'http://localhost:4242/v0/alt/discover/accounts?accountsOnly=true';
```

* **query**:
* **accountsOnly**:
* `true`: An array of base58 encoded lookup table public keys will be returned.
* `false`: (default) An array of objects including both the table public key and the base64 encoded program
account will be returned.
* **body**: JSON array of base58 encoded accounts.

## Service Configuration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
import software.sava.services.solana.accounts.lookup.LookupTableDiscoveryService;

import static java.lang.System.Logger.Level.INFO;
import static software.sava.services.solana.accounts.lookup.http.OptimalTablesHandler.QueryParams.NONE;
import static software.sava.services.solana.accounts.lookup.http.DiscoverTablesHandler.QueryParams.NONE;

abstract class OptimalTablesHandler extends LookupTableDiscoveryServiceHandler {
abstract class DiscoverTablesHandler extends LookupTableDiscoveryServiceHandler {

private static final System.Logger logger = System.getLogger(OptimalTablesHandler.class.getName());
private static final System.Logger logger = System.getLogger(DiscoverTablesHandler.class.getName());

OptimalTablesHandler(final LookupTableDiscoveryService tableService, final LookupTableCache tableCache) {
DiscoverTablesHandler(final LookupTableDiscoveryService tableService, final LookupTableCache tableCache) {
super(tableService, tableCache);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

import java.util.HashSet;

final class FromAccountsHandler extends OptimalTablesHandler {
final class FromAccountsHandler extends DiscoverTablesHandler {

FromAccountsHandler(final LookupTableDiscoveryService tableService,
final LookupTableCache tableCache) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import java.util.*;
import java.util.stream.Collectors;

class FromRawTxHandler extends OptimalTablesHandler {
class FromRawTxHandler extends DiscoverTablesHandler {

private static final System.Logger logger = System.getLogger(FromRawTxHandler.class.getName());

Expand Down

0 comments on commit 35df62c

Please sign in to comment.