const c = await ensc.conversions.create({
type: 'crypto-issue', chain: 'celo', wallet, pair: 'USDC', amount: '100',
reference: 'op:crypto-issue:' + crypto.randomUUID(),
});
// c.voucher.approvalTransaction, c.voucher.transaction: { from, to, data, value: '0', chainId }{
"v": 1,
"enc": "<string>",
"ciphertext": "<string>"
}{
"v": 1,
"enc": "<string>",
"ciphertext": "<string>"
}{
"v": 1,
"enc": "<string>",
"ciphertext": "<string>"
}{
"error": {
"code": "ENSC_VALIDATION_FAILED",
"message": "<string>",
"requestId": "<string>",
"details": {}
}
}{
"error": {
"code": "ENSC_VALIDATION_FAILED",
"message": "<string>",
"requestId": "<string>",
"details": {}
}
}{
"error": {
"code": "ENSC_VALIDATION_FAILED",
"message": "<string>",
"requestId": "<string>",
"details": {}
}
}{
"error": {
"code": "ENSC_VALIDATION_FAILED",
"message": "<string>",
"requestId": "<string>",
"details": {}
}
}{
"error": {
"code": "ENSC_VALIDATION_FAILED",
"message": "<string>",
"requestId": "<string>",
"details": {}
}
}{
"error": {
"code": "ENSC_VALIDATION_FAILED",
"message": "<string>",
"requestId": "<string>",
"details": {}
}
}Create a conversion
Quotes (crypto legs), screens the transaction, and returns either a signed voucher with the calldata the merchant wallet must sign (crypto legs, fiat-redeem) or bank-transfer instructions (fiat-issue). 201 created, 202 when on a screening hold, 200 when the same reference is re-posted. Request body is an EncryptedRequestEnvelope whose plaintext is CreateConversionRequest; response is a SealedResponseEnvelope whose plaintext is Conversion.
const c = await ensc.conversions.create({
type: 'crypto-issue', chain: 'celo', wallet, pair: 'USDC', amount: '100',
reference: 'op:crypto-issue:' + crypto.randomUUID(),
});
// c.voucher.approvalTransaction, c.voucher.transaction: { from, to, data, value: '0', chainId }{
"v": 1,
"enc": "<string>",
"ciphertext": "<string>"
}{
"v": 1,
"enc": "<string>",
"ciphertext": "<string>"
}{
"v": 1,
"enc": "<string>",
"ciphertext": "<string>"
}{
"error": {
"code": "ENSC_VALIDATION_FAILED",
"message": "<string>",
"requestId": "<string>",
"details": {}
}
}{
"error": {
"code": "ENSC_VALIDATION_FAILED",
"message": "<string>",
"requestId": "<string>",
"details": {}
}
}{
"error": {
"code": "ENSC_VALIDATION_FAILED",
"message": "<string>",
"requestId": "<string>",
"details": {}
}
}{
"error": {
"code": "ENSC_VALIDATION_FAILED",
"message": "<string>",
"requestId": "<string>",
"details": {}
}
}{
"error": {
"code": "ENSC_VALIDATION_FAILED",
"message": "<string>",
"requestId": "<string>",
"details": {}
}
}{
"error": {
"code": "ENSC_VALIDATION_FAILED",
"message": "<string>",
"requestId": "<string>",
"details": {}
}
}Authorizations
Your secret key, generated in the ProsperaVest dashboard (Sandbox or Live). Send as: Authorization: Bearer ensc_live_sk_...
Headers
Unix seconds. Must be within ±300s of server time.
"1714579200"
128-bit random nonce, base64url. Rejected if reused within 10 min.
"fGV3...8Y"
ID of the registered signing public key.
"sig_01HXY..."
Ed25519 signature over the canonical request string (ENSC-V1). The body hash in that string is the SHA-256 of the encrypted envelope bytes (encrypt-then-sign).
"ed25519=<base64url>"
Caller-supplied idempotency key (8 to 64 chars, [A-Za-z0-9_-]). Idempotency-Key is accepted as an alias.
"01HXY1ZQK5R..."
Body
ENSC-ENC-V1. AES-256-GCM of the plaintext JSON body under the merchant encryption key named by encKeyId. AAD = "ENSC-ENC-V1\n{METHOD}\n{path}\n{merchantId}\n{encKeyId}". iv is 12 bytes, tag 16 bytes, all base64url. The Ed25519 request signature is computed over these envelope bytes.
Response
Sealed response
ENSC-RESP-V1. HPKE (RFC 9180; DHKEM(X25519, HKDF-SHA256), HKDF-SHA256, ChaCha20-Poly1305) seal of the plaintext JSON response to the merchant signing key named by X-ENSC-Key-Id (Ed25519 key converted to X25519). info = "ENSC-RESP-V1\n{requestId}". The body is signed by ENSC: X-ENSC-Signature over "ENSC-RESP-V1\n{requestId}\n{timestamp}\n{sha256(body)}". Returned for sk/rk merchant keys only.