Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

geyser: add TokenAccountState to accounts filter #154

Merged
merged 5 commits into from
Jun 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,17 @@ The minor version will be incremented upon a breaking change and the patch versi

## 2023-06-29

- @triton-one/yellowstone-grpc:0.1.3
- yellowstone-grpc-client-1.5.0+solana.1.16.1
- yellowstone-grpc-geyser-1.1.0+solana.1.16.1
- yellowstone-grpc-proto-1.5.0+solana.1.16.1

### Features

- geyser: support TokenAccountState in accounts filter ([#154](https://github.com/rpcpool/yellowstone-grpc/pull/154)).

## 2023-06-29

- @triton-one/yellowstone-grpc:0.1.2
- yellowstone-grpc-client-1.4.0+solana.1.16.1
- yellowstone-grpc-geyser-1.0.0+solana.1.16.1
Expand Down
159 changes: 148 additions & 11 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[workspace]
members = [
"examples/rust", # 1.4.0+solana.1.16.1
"yellowstone-grpc-client", # 1.4.0+solana.1.16.1
"yellowstone-grpc-geyser", # 1.0.0+solana.1.16.1
"yellowstone-grpc-proto", # 1.4.0+solana.1.16.1
"examples/rust", # 1.5.0+solana.1.16.1
"yellowstone-grpc-client", # 1.5.0+solana.1.16.1
"yellowstone-grpc-geyser", # 1.1.0+solana.1.16.1
"yellowstone-grpc-proto", # 1.5.0+solana.1.16.1
]

[profile.release]
Expand Down
2 changes: 1 addition & 1 deletion examples/rust/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "yellowstone-grpc-client-simple"
version = "1.4.0+solana.1.16.1"
version = "1.5.0+solana.1.16.1"
authors = ["Triton One"]
edition = "2021"
publish = false
Expand Down
9 changes: 9 additions & 0 deletions examples/rust/src/bin/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,10 @@ struct ActionSubscribe {
#[clap(long)]
accounts_datasize: Option<u64>,

/// Filter valid token accounts
#[clap(long)]
accounts_token_account_state: bool,

/// Receive only part of updated data account, format: `offset,size`
#[clap(long)]
accounts_data_slice: Vec<String>,
Expand Down Expand Up @@ -193,6 +197,11 @@ impl Action {
filter: Some(AccountsFilterDataOneof::Datasize(datasize)),
});
}
if args.accounts_token_account_state {
filters.push(SubscribeRequestFilterAccountsFilter {
filter: Some(AccountsFilterDataOneof::TokenAccountState(true)),
});
}

accounts.insert(
"client".to_owned(),
Expand Down
11 changes: 11 additions & 0 deletions examples/typescript/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,12 @@ async function subscribeCommand(client, args) {
}
}

if (args.accounts.tokenaccountstate) {
filters.push({
tokenAccountState: args.accounts.tokenaccountstate,
});
}

if (args.accounts.datasize) {
filters.push({ datasize: args.accounts.datasize });
}
Expand Down Expand Up @@ -238,6 +244,11 @@ function parseCommandLineArgs() {
describe: "filter by data size",
type: "number",
},
"accounts-tokenaccountstate": {
default: false,
describe: "filter valid token accounts",
type: "boolean",
},
"accounts-dataslice": {
default: [],
describe:
Expand Down
2 changes: 1 addition & 1 deletion yellowstone-grpc-client-nodejs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@triton-one/yellowstone-grpc",
"version": "0.1.2",
"version": "0.1.3",
"license": "Apache-2.0",
"author": "Triton One",
"description": "Yellowstone gRPC Geyser Node.js Client",
Expand Down
4 changes: 2 additions & 2 deletions yellowstone-grpc-client/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "yellowstone-grpc-client"
version = "1.4.0+solana.1.16.1"
version = "1.5.0+solana.1.16.1"
authors = ["Triton One"]
edition = "2021"
description = "Yellowstone gRPC Geyser Simple Client"
Expand All @@ -16,7 +16,7 @@ http = "0.2.8"
thiserror = "1.0"
tonic = { version = "0.9.2", features = ["gzip", "tls", "tls-roots"] }
tonic-health = "0.9.2"
yellowstone-grpc-proto = { path = "../yellowstone-grpc-proto", version = "1.4.0+solana.1.16.1" }
yellowstone-grpc-proto = { path = "../yellowstone-grpc-proto", version = "1.5.0+solana.1.16.1" }

[dev-dependencies]
tokio = { version = "1.21.2", features = ["macros"] }
3 changes: 2 additions & 1 deletion yellowstone-grpc-geyser/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "yellowstone-grpc-geyser"
version = "1.0.0+solana.1.16.1"
version = "1.1.0+solana.1.16.1"
authors = ["Triton One"]
edition = "2021"
description = "Yellowstone gRPC Geyser Plugin"
Expand Down Expand Up @@ -29,6 +29,7 @@ solana-geyser-plugin-interface = "=1.16.1"
solana-logger = "=1.16.1"
solana-sdk = "=1.16.1"
solana-transaction-status = "=1.16.1"
spl-token-2022 = "0.7.0"
tokio = { version = "1.21.2", features = ["rt-multi-thread", "macros", "time"] }
tokio-stream = "0.1.11"
tonic = { version = "0.9.2", features = ["gzip", "tls", "tls-roots"] }
Expand Down
Loading