Kit
Type aliases

ProgramNotificationsApi

ProgramNotificationsApi = object

Methods

programNotifications()

Call Signature

programNotifications(programId, config): ProgramNotificationsApiNotificationBase<AccountInfoWithBase64EncodedData>

Subscribe for notifications when there is a change in the Lamports or data of any account owned by the program at the given address changes.

The notification format is the same as seen in the GetProgramAccountsApi.getProgramAccounts RPC HTTP method.

If the account has data, it will be returned in the response as a tuple whose first element is a base64-encoded string.

Parameters
ParameterType
programIdAddress
configReadonly<{ commitment?: Commitment; filters?: readonly Readonly<GetProgramAccountsDatasizeFilter | GetProgramAccountsMemcmpFilter>[]; }> & Readonly<{ encoding: "base64"; }>
Returns

ProgramNotificationsApiNotificationBase<AccountInfoWithBase64EncodedData>

See

https://solana.com/docs/rpc/websocket/programsubscribe

Call Signature

programNotifications(programId, config): ProgramNotificationsApiNotificationBase<AccountInfoWithBase64EncodedZStdCompressedData>

Subscribe for notifications when there is a change in the Lamports or data of any account owned by the program at the given address changes.

The notification format is the same as seen in the GetProgramAccountsApi.getProgramAccounts RPC HTTP method.

If the account has data, it will first be compressed using ZStandard and the result will be returned in the response as a tuple whose first element is a base64-encoded string.

Parameters
ParameterType
programIdAddress
configReadonly<{ commitment?: Commitment; filters?: readonly Readonly<GetProgramAccountsDatasizeFilter | GetProgramAccountsMemcmpFilter>[]; }> & Readonly<{ encoding: "base64+zstd"; }>
Returns

ProgramNotificationsApiNotificationBase<AccountInfoWithBase64EncodedZStdCompressedData>

See

https://solana.com/docs/rpc/websocket/programsubscribe

Call Signature

programNotifications(programId, config): ProgramNotificationsApiNotificationBase<AccountInfoWithJsonData>

Subscribe for notifications when there is a change in the Lamports or data of any account owned by the program at the given address changes.

The notification format is the same as seen in the GetProgramAccountsApi.getProgramAccounts RPC HTTP method.

If the account has data, the server will attempt to process it using a parser specific to the account's owning program. If successful, the parsed data will be returned in the response as JSON. Otherwise, the raw account data will be returned in the response as a tuple whose first element is a base64-encoded string.

Parameters
ParameterType
programIdAddress
configReadonly<{ commitment?: Commitment; filters?: readonly Readonly<GetProgramAccountsDatasizeFilter | GetProgramAccountsMemcmpFilter>[]; }> & Readonly<{ encoding: "jsonParsed"; }>
Returns

ProgramNotificationsApiNotificationBase<AccountInfoWithJsonData>

See

https://solana.com/docs/rpc/websocket/programsubscribe

Call Signature

programNotifications(programId, config): ProgramNotificationsApiNotificationBase<AccountInfoWithBase58EncodedData>

Subscribe for notifications when there is a change in the Lamports or data of any account owned by the program at the given address changes.

The notification format is the same as seen in the GetProgramAccountsApi.getProgramAccounts RPC HTTP method.

If the account has data, it will be returned in the response as a tuple whose first element is a base58-encoded string. If the account contains more than 129 bytes of data, the data field will materialize as the string "error: data too large for bs58 encoding".

Parameters
ParameterType
programIdAddress
configReadonly<{ commitment?: Commitment; filters?: readonly Readonly<GetProgramAccountsDatasizeFilter | GetProgramAccountsMemcmpFilter>[]; }> & Readonly<{ encoding: "base58"; }>
Returns

ProgramNotificationsApiNotificationBase<AccountInfoWithBase58EncodedData>

See

https://solana.com/docs/rpc/websocket/programsubscribe

Call Signature

programNotifications(programId, config?): ProgramNotificationsApiNotificationBase<AccountInfoWithBase58Bytes>

Subscribe for notifications when there is a change in the Lamports or data of any account owned by the program at the given address changes.

The notification format is the same as seen in the GetProgramAccountsApi.getProgramAccounts RPC HTTP method.

If the account has data, it will be returned in the response as a base58-encoded string. If the account contains more than 129 bytes of data, the data field will materialize as the string "error: data too large for bs58 encoding".

Parameters
ParameterType
programIdAddress
config?Readonly<{ commitment?: Commitment; filters?: readonly Readonly<GetProgramAccountsDatasizeFilter | GetProgramAccountsMemcmpFilter>[]; }>
Returns

ProgramNotificationsApiNotificationBase<AccountInfoWithBase58Bytes>

See

https://solana.com/docs/rpc/websocket/programsubscribe

On this page