Reference / @getenginex/sdk / PixKeysApi
PixKeysApi
The player's PIX keys, to choose the destination of withdrawals. All methods require login.
Methods
add()
add(
input,options?):Promise<PixKey>
Registers a PIX key. The response carries only the masked value.
Parameters
input
keyType
keyValue
string
options?
Returns
Promise<PixKey>
Example
const key = await enginex.pixKeys.add({ keyType: 'email', keyValue: 'ana@exemplo.com' })Throws
INVALID_ARGUMENT (400) without a type or value, or with an invalid key; an error from the payment service for a duplicate key; UNAUTHENTICATED without a session.
list()
list(
params?,options?):Promise<PixKey[]>
Registered PIX keys.
Parameters
params?
options?
Returns
Promise<PixKey[]>
Example
const keys = await enginex.pixKeys.list()
const preferred = keys.find((k) => k.isDefault)Throws
UNAUTHENTICATED without a session.
remove()
remove(
input,options?):Promise<void>
Removes a PIX key.
Parameters
input
keyId
string
options?
Returns
Promise<void>
Example
await enginex.pixKeys.remove({ keyId: key.id })Throws
NOT_FOUND if the id does not exist (or belongs to another player); UNAUTHENTICATED without a session.
setDefault()
setDefault(
input,options?):Promise<void>
Marks a key as the default for withdrawals.
Parameters
input
keyId
string
options?
Returns
Promise<void>
Example
await enginex.pixKeys.setDefault({ keyId: key.id })Throws
NOT_FOUND if the id does not exist (or belongs to another player); UNAUTHENTICATED without a session.