Skip to content

Get session by payment transaction

Retrieve a session by its payment transaction

Import

import { getSessionByPaymentTransaction } from "@paywithglide/glide-js";

Usage

Parameters

chainId*
number

The EIP-155 chain ID of the chain where the payment transaction was made.

hash*
string

The payment transaction hash.

Return Type

sessionId*
string
The unique identifier of the session.
expiresAt*
string
The timestamp at which the session will expire. Generally, this will be 10 minutes after the session is created.
expired*
boolean
A boolean indicating whether the session has expired.
paymentStatus*
PaymentStatus
The current status of the payment for the session. The session begins in the unpaid state and transitions to paid when the user completes their payment transaction.
paymentChainId*
CAIP2
The chain id on which the user will pay for the transaction.
paymentChainName*
string
The chain name on which the user will pay for the transaction.
paymentChainLogoUrl*
string
The chain logo URL on which the user will pay for the transaction.
paymentCurrency*
CAIP19
The currency in which the user pays in the CAIP-19 format.
paymentCurrencySymbol*
string
The currency symbol in which the user pays.
paymentCurrencyLogoUrl*
string
The currency logo URL in which the user pays.
paymentAmount*
string
The amount of the payment required by the user to complete the transaction in a human-readable format.
paymentAmountUSD*
string
The amount of the payment required by the user to complete the transaction in USD.
paymentTransactionHash
nullable Hex | null
The hash of the transaction that the user made to complete the payment.
paymentAction*
'signAndSendTransaction' | 'signTypedData'
The action that the user must take to complete the payment.
unsignedTransaction
nullable EVMTransactionResponse | null
The transaction that the user must sign and send to the chain to complete the payment. It is set when the `paymentAction` is set to `signAndSendTransaction`.
unsignedTypedData
nullable PermitTypedData<Hex> | null
The typed data that the user must sign to complete the payment. It is set when the `paymentAction` is set to `signTypedData`.
sponsoredTransactionChainId*
CAIP2
The chain id on which the transaction will be executed.
sponsoredTransactionChainName*
string
The chain name on which the transaction will be executed.
sponsoredTransactionChainLogoUrl*
string
The chain logo URL on which the transaction will be executed.
sponsoredTransactionStatus*
TransactionStatus
The current status of the transaction that Glide is sending to the chain on behalf of the user.
sponsoredTransactionHash
nullable Hex | null
The hash of the transaction that Glide sent to the chain on behalf of the user.
sponsoredTransaction
nullable EVMTransaction | null
The transaction that Glide sent to the chain on behalf of the user.
sponsoredTransactionAmount*
string
The amount required by the sponsored transaction, in a human-readable format.
sponsoredTransactionCurrency*
CAIP19
The currency in which the sponsored transaction is executed, in CAIP-19 format.
sponsoredTransactionCurrencySymbol*
string
The currency symbol in which the sponsored transaction will be executed.
sponsoredTransactionCurrencyLogoUrl*
string
The currency logo URL in which the sponsored transaction will be executed.
sponsoredTransactionAmountUSD*
string
The amount required by the sponsored transaction, in USD.
totalFeeUSD*
string
The total fee covers the relayer fee and the destination transaction gas cost paid by the relayer.