Skip to main content
Paying a bank account address, on Solana or an EVM chain, needs no API call, which also means there is no order to poll afterwards. To know what happened to a transfer you sent, subscribe to its transaction signature on the deposit socket. You get its current state straight away, then a message each time it moves forward, until the naira reaches the bank account. The socket runs on Socket.IO, on the same host as the REST API, in the tx-pool namespace:

Connecting

The socket takes the same API key as the REST API. Send it in the handshake as auth.apiKey, or as an x-api-key header if your client sets headers.
A connection without a valid key is refused during the handshake and never opens. The first two messages are permanent: fix the key rather than retrying. The third means the key could not be checked at that moment, and Socket.IO’s own reconnection will try again.
This is your API key, and the same rules apply as anywhere else: connect from your backend, never from a browser bundle or a mobile app a user can read. Relay what your users need to see through your own servers.

Subscribing to a transfer

Once you have sent a transfer, subscribe with what identifies it on its chain: the transaction signature for a transfer to address on Solana, or the transaction hash for a transfer to evmAddress on an EVM chain. The field is called signature either way:
Subscribe as soon as you have the signature, before Paj has seen the transfer. That is the normal case: the subscription waits, and the first TX_POOL_UPDATE arrives when the deposit is picked up, usually within seconds of confirmation. Subscribing late is also fine. A transfer that has already been paid out is still found, and the acknowledgement carries its final state. EVM hashes are matched whatever their letter case, so a checksummed hash from a wallet works as-is. Solana signatures are case-sensitive and must be sent exactly.

The acknowledgement

The callback you pass to subscribe receives:
boolean
required
Whether you are now subscribed.
string
The signature you subscribed to, trimmed.
object | null
Where the transfer stands now, in the same shape as a TX_POOL_UPDATE, or null when Paj has not seen it yet.
string
Why the subscription was refused, when ok is false. The same message is also sent as an ERROR event.
A subscription is refused when signature is missing or longer than 128 characters, or when the connection already watches 50 signatures. Unsubscribe from transfers that have completed to stay under the limit, or open a second connection.

Updates

Every TX_POOL_UPDATE carries the whole current state of one transfer, not just what changed, so you can handle each one on its own.
string
required
The transfer you subscribed to.
string
required
The chain it was sent on.
string
required
Where it stands. Build on this field. See Stages.
string
required
Paj’s own processing step, finer than stage. Useful for logs and support, but the values may change, so don’t branch on them.
string
required
The token that was sent: its mint or contract address.
number
required
How much of it was sent, in whole tokens rather than base units.
number
What the transfer was worth in USDC, once it has been swapped or priced.
number
The naira paid out, in kobo, once known.
string
The on-chain transaction that moved the funds from the address into Paj’s treasury, once made.
string
The on-chain swap into USDC, for tokens that needed one.
string
Where the bank transfer stands while one is in flight.
string
When the transfer last changed, as an ISO 8601 timestamp.
Updates carry no bank details and nothing about who sent the transfer. To match a transfer to one of your users, look its address up with GET /pub/v2/bank-account.

Stages

These follow the steps in what happens after a deposit: Treat only completed as the end of a transfer. If a transfer stays in error, contact Paj with its signature.
A transfer worth less than 0.40 USDC is too small to pay out and is never picked up, so its subscription gets no updates.

Staying connected

Subscriptions belong to the connection. When a connection drops, its subscriptions go with it, and Socket.IO reconnects with a fresh connection and none of them. Subscribe again on every connect, not just the first:
Updates sent while you were disconnected are not replayed. The acknowledgement of each new subscription carries the current state, so after reconnecting you are back in step without anything else.