Skip to content

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 ​

PixKeyType

keyValue ​

string

options? ​

CallOptions

Returns ​

Promise<PixKey>

Example ​

ts
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? ​

NoParams

options? ​

CallOptions

Returns ​

Promise<PixKey[]>

Example ​

ts
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? ​

CallOptions

Returns ​

Promise<void>

Example ​

ts
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? ​

CallOptions

Returns ​

Promise<void>

Example ​

ts
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.