Skip to content

Answer a prepared v2 market buy’s transaction from its signed permit

POST
/wallets/privy/markets-v2/orders/{intentId}/permit
curl --request POST \
--url https://api.ethos.network/api/v2/wallets/privy/markets-v2/orders/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/permit \
--header 'Content-Type: application/json' \
--cookie ethos-access-token=<ethos-access-token> \
--data '{ "signature": "example" }'

Checks that the Ethos Everywhere wallet signed the buy’s permit, pre-flights openPositionWithPermit with it and answers that transaction. > ⚠️ Warning: This is a beta endpoint. It is not guaranteed to be stable and may change or break without notice.

intentId
required
string format: uuid
/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/
Media typeapplication/json
object
signature
required

The Ethos Everywhere wallet’s signature over the permit typed data the order answered.

string

Example generated

{
"signature": "example"
}

Successful response

Media typeapplication/json
object
chainId
required
number
expiresAt
required
string format: date-time
/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$/
floor
required

The floor the transaction carries, in wei: least position tokens a buy mints, least WHUF a sale returns.

string
intentId
required
string format: uuid
/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/
quotedOut
required

Echo’s quote, in wei: position tokens a buy mints, or WHUF a sale returns, at prepare time.

string
permit
required
null
transaction
required

The openPositionWithPermit transaction to send.

object
data
required

0x-prefixed hex string

string
gasLimit
required

0x-prefixed hex string

string
to
required

Ethereum address (0x-prefixed, 20 bytes)

string
value
required

0x-prefixed hex string

string
type
required
string
Allowed value: buy

Example

{
"type": "buy"
}

Invalid input data

Media typeapplication/json
Invalid input data error (400)

The error information

object
message
required

The error message

string
code
required

The error code

string
issues

An array of issues that were responsible for the error

Array<object>
object
message
required
string

Example

{
"code": "BAD_REQUEST",
"message": "Invalid input data",
"issues": []
}

Authorization not provided

Media typeapplication/json
Authorization not provided error (401)

The error information

object
message
required

The error message

string
code
required

The error code

string
issues

An array of issues that were responsible for the error

Array<object>
object
message
required
string

Example

{
"code": "UNAUTHORIZED",
"message": "Authorization not provided",
"issues": []
}

Insufficient access

Media typeapplication/json
Insufficient access error (403)

The error information

object
message
required

The error message

string
code
required

The error code

string
issues

An array of issues that were responsible for the error

Array<object>
object
message
required
string

Example

{
"code": "FORBIDDEN",
"message": "Insufficient access",
"issues": []
}

Internal server error

Media typeapplication/json
Internal server error error (500)

The error information

object
message
required

The error message

string
code
required

The error code

string
issues

An array of issues that were responsible for the error

Array<object>
object
message
required
string

Example

{
"code": "INTERNAL_SERVER_ERROR",
"message": "Internal server error",
"issues": []
}