RPC Reference
All Cocoon RPC methods are available via the standard JSON-RPC 2.0 interface at the backend proxy endpoint (http://localhost:8546 by default). Every method follows the same envelope format:
{
"jsonrpc": "2.0",
"id": 1,
"method": "namespace_methodName",
"params": [...]
}Standard Ethereum namespaces (eth_, net_, web3_) are also available and behave as per the Ethereum JSON-RPC specification.
All addresses are checksummed hex strings (0x...). All amounts are QUANTITY values (hex-encoded integers) unless otherwise noted. All hashes are DATA values (hex-encoded byte arrays).
token_ — Permissioned Tokens
token_ — Permissioned TokensThe token_ namespace provides the full lifecycle for ERC-3643 permissioned tokens: deployment, minting, transfers, compliance, NAV publishing, and document management.
Most write methods on this namespace require an authenticated session. Pass a valid bearer token in the Authorization header when calling the backend proxy, or set AUTH_MODE=advisory for development.
Deployment
token_deploy
token_deployDeploy a new ERC-3643 permissioned token contract.
Params
[deployParams: TokenDeployParams]
Returns
{ address: ADDRESS, txHash: HASH }
assetType defaults to fund. denominatedCcy defaults to USD for funds, and to the token symbol for stablecoins.
Minting and Burning
token_mint
token_mintMint tokens to a single address. Requires the caller to have the Operator or Admin role.
Params
[token: ADDRESS, to: ADDRESS, amount: QUANTITY]
Returns
{ txHash: HASH }
token_batchMint
token_batchMintMint tokens to multiple addresses in a single transaction.
Params
[token: ADDRESS, recipients: ADDRESS[], amounts: QUANTITY[]]
Returns
{ txHash: HASH }
token_burn
token_burnBurn tokens from an address. The caller must own the tokens or have an approved allowance.
Params
[token: ADDRESS, from: ADDRESS, amount: QUANTITY]
Returns
{ txHash: HASH }
Token Controls
token_pause
token_pausePause all transfers on a token. Only callable by the token owner.
Params
[token: ADDRESS]
Returns
{ txHash: HASH }
token_freeze
token_freezeFreeze transfers to or from a specific address.
Params
[token: ADDRESS, address: ADDRESS, frozen: boolean]
Returns
{ txHash: HASH }
token_forcedTransfer
token_forcedTransferExecute a forced transfer between two addresses, bypassing standard compliance checks. Requires Admin role. Used for regulatory recovery scenarios.
Params
[token: ADDRESS, from: ADDRESS, to: ADDRESS, amount: QUANTITY]
Returns
{ txHash: HASH }
token_recovery
token_recoveryRecover tokens from a lost wallet by transferring the full balance to a new address. Both the old and new addresses must have verified identities linked to the same investor record.
Params
[token: ADDRESS, lostWallet: ADDRESS, newWallet: ADDRESS, investorOnchainId: ADDRESS]
Returns
{ txHash: HASH }
token_canTransfer
token_canTransferDry-run a transfer to check whether compliance rules permit it, without submitting a transaction.
Params
[token: ADDRESS, from: ADDRESS, to: ADDRESS, amount: QUANTITY]
Returns
{ allowed: boolean, reason: string | null }
Investor Onboarding
token_onboardInvestor
token_onboardInvestorRegister an investor address against the token's identity registry. The investor must already have an on-chain identity (see id_createIdentity).
Params
[token: ADDRESS, investor: ADDRESS, identity: ADDRESS]
Returns
{ txHash: HASH }
token_getHolders
token_getHoldersReturn a paginated list of current token holders with their balances.
Params
[token: ADDRESS, offset?: QUANTITY, limit?: QUANTITY]
Returns
{ holders: [{ address: ADDRESS, balance: QUANTITY }], total: QUANTITY }
token_getHolder
token_getHolderReturn detailed information for a single holder.
Params
[token: ADDRESS, address: ADDRESS]
Returns
{ address: ADDRESS, balance: QUANTITY, frozen: boolean, identity: ADDRESS | null }
token_getTokenInfo
token_getTokenInfoReturn static and dynamic metadata for a token.
Params
[token: ADDRESS]
Returns
{ name: string, symbol: string, decimals: QUANTITY, totalSupply: QUANTITY, paused: boolean, owner: ADDRESS, compliance: ADDRESS, identityRegistry: ADDRESS, assetType: string, denominatedCcy: string, holderCount: QUANTITY }
NAV and Pricing
token_publishNAV
token_publishNAVPublish a new Net Asset Value for a fund token. The NAV is stored on-chain and used by subscription/redemption calculations.
Params
[token: ADDRESS, navPerShare: QUANTITY, timestamp: QUANTITY]
Returns
{ txHash: HASH }
token_publishPrice
token_publishPricePublish a generic price feed entry for a token (used for non-NAV instruments such as bonds or stablecoins with FX rates).
Params
[token: ADDRESS, price: QUANTITY, currency: string, timestamp: QUANTITY]
Returns
{ txHash: HASH }
token_getFeedHistory
token_getFeedHistoryRetrieve historical NAV or price feed entries.
Params
[token: ADDRESS, fromTimestamp: QUANTITY, toTimestamp: QUANTITY, limit?: QUANTITY]
Returns
{ entries: [{ value: QUANTITY, currency: string, timestamp: QUANTITY, txHash: HASH }] }
Fund Balance Sheet
token_getFundBalanceSheet
token_getFundBalanceSheetReturn a snapshot of a fund token's balance sheet, showing liabilities (shares outstanding, NAV, AUM) and assets (stablecoin reserves, DBC bridge reserves, and bank cash).
Params
[token: ADDRESS]
Returns
{ liabilities: { sharesOutstanding: QUANTITY, nav: QUANTITY, aum: QUANTITY }, assets: { stablecoins: { [symbol: string]: string }, dbcReserves: { [symbol: string]: string }, bankCash: string } }
Compliance Modules
token_addComplianceModule
token_addComplianceModuleAttach a compliance module contract to a token. Modules are called on every transfer and can block or modify it.
Params
[token: ADDRESS, module: ADDRESS]
Returns
{ txHash: HASH }
token_setCountryAllowList
token_setCountryAllowListConfigure the country allow-list compliance module. Only investors with identity claims matching an allowed country code can hold the token.
Params
[token: ADDRESS, allowedCountryCodes: QUANTITY[]]
Returns
{ txHash: HASH }
token_setMaxBalance
token_setMaxBalanceSet the maximum token balance any single investor may hold.
Params
[token: ADDRESS, maxBalance: QUANTITY]
Returns
{ txHash: HASH }
Document Management
token_publishDocument
token_publishDocumentAttach a document to a token. The document content is stored via the torrent layer; only the content hash and metadata are stored on-chain.
Params
[token: ADDRESS, name: string, docType: string, uri: string, contentHash: HASH]
Returns
{ txHash: HASH, docId: HASH }
token_getDocument
token_getDocumentRetrieve a document record by ID.
Params
[token: ADDRESS, docId: HASH]
Returns
{ name: string, docType: string, uri: string, contentHash: HASH, publishedAt: QUANTITY }
token_listDocuments
token_listDocumentsList all documents attached to a token.
Params
[token: ADDRESS]
Returns
{ documents: [{ docId: HASH, name: string, docType: string, uri: string, publishedAt: QUANTITY }] }
Subscriptions and Redemptions
token_subscribe
token_subscribeSubscribe to a fund token by exchanging a stablecoin amount for token shares at the current NAV.
Params
[token: ADDRESS, stableAmount: QUANTITY]
Returns
{ txHash: HASH, sharesIssued: QUANTITY }
token_redeem
token_redeemRedeem token shares for the underlying stablecoin at the current NAV.
Params
[token: ADDRESS, shares: QUANTITY]
Returns
{ txHash: HASH, stableReturned: QUANTITY }
id_ — Identity
id_ — IdentityThe id_ namespace manages on-chain identities, claims, and claim access control using the OnchainID / ERC-734/735 standard.
id_createIdentity
id_createIdentityDeploy a new on-chain identity contract for an investor address.
Params
[owner: ADDRESS, managementKeys?: HASH[]]
Returns
{ identity: ADDRESS, txHash: HASH }
id_issueClaim
id_issueClaimIssue a signed claim to an identity. The caller must be a trusted claim issuer registered in the TrustedIssuersRegistry.
Params
[identity: ADDRESS, topic: QUANTITY, scheme: QUANTITY, data: DATA, uri: string]
Returns
{ claimId: HASH, txHash: HASH }
The topic field uses the ERC-735 claim topic registry. Registered topics:
1
KYC
Identity verification
2
AML
Anti-money-laundering screening
3
Accreditation
Accredited / qualified investor status
4
Sanctions Clear
Continuous sanctions screening (30-day rolling)
5
Tax Residency
CRS / FATCA tax residency declaration
6
UBO
Ultimate Beneficial Owner declaration
7
PEP Status
Politically Exposed Person check (30-day rolling)
8
Travel Rule Profile
Originator information for payment disclosures
id_getClaim
id_getClaimRetrieve a claim by its ID.
Params
[identity: ADDRESS, claimId: HASH]
Returns
{ claimId: HASH, topic: QUANTITY, scheme: QUANTITY, issuer: ADDRESS, data: DATA, uri: string, signature: DATA }
id_grantClaimAccess
id_grantClaimAccessGrant a third party (e.g. a regulator or auditor) read access to an encrypted claim document stored via the torrent layer.
Params
[identity: ADDRESS, claimId: HASH, grantee: ADDRESS, encryptedKey: DATA]
Returns
{ txHash: HASH }
id_revokeClaim
id_revokeClaimRevoke a previously issued claim.
Params
[identity: ADDRESS, claimId: HASH]
Returns
{ txHash: HASH }
id_getIdentity
id_getIdentityLook up the on-chain identity address for a wallet address.
Params
[address: ADDRESS]
Returns
{ identity: ADDRESS | null, owner: ADDRESS | null }
id_submitKycApplication
id_submitKycApplicationSubmit a KYC application for a given identity and claim topic, attaching supporting documents for issuer review.
Params
[identity: ADDRESS, topic: QUANTITY, documents: DATA[]]
Returns
{ applicationId: string }
id_getKycApplication
id_getKycApplicationReturn the current status and metadata of a previously submitted KYC application.
Params
[applicationId: string]
Returns
{ applicationId: string, status: string, topic: QUANTITY, submittedAt: QUANTITY, reviewedAt: QUANTITY | null }
status values: pending, approved, rejected.
id_reviewKycApplication
id_reviewKycApplicationApprove or reject a KYC application. Caller must be the trusted claim issuer for the relevant topic. Approving the application issues the claim on-chain.
Params
[applicationId: string, decision: "approve" | "reject", notes?: string]
Returns
{ txHash: HASH | null }
id_renewClaim
id_renewClaimRenew an expiring claim. The issuer re-runs verification and replaces the old claim with a new one carrying an extended expiry.
Params
[identity: ADDRESS, claimId: HASH]
Returns
{ claimId: HASH, txHash: HASH }
dbc_ — Confidential Cash
dbc_ — Confidential CashThe dbc_ namespace provides the full lifecycle for Digital Bearer Certificate (DBC) confidential value transfer: minting from ERC-20, private transfers, melting back to ERC-20, and regulated payment envelopes for institutional compliance.
DBC write methods require an authenticated session and appropriate UCAN capability. See the ## UCAN Capabilities section in the Confidential Cash component guide for the full capability namespace.
dbc_mint
dbc_mintLock ERC-20 tokens in the bridge and create a confidential DBC note.
Params
[token: ADDRESS, amount: QUANTITY, receiverPublicKey: DATA]
Returns
{ txHash: HASH, noteCommitment: DATA }
dbc_melt
dbc_meltSpend a DBC note and release the corresponding ERC-20 amount from the bridge.
Params
[noteId: DATA, keyImage: DATA, proof: DATA, to: ADDRESS]
Returns
{ txHash: HASH, amount: QUANTITY }
dbc_transfer
dbc_transferSpend input notes and create output notes using a ring signature and range proof.
Params
[inputs: DATA[], outputs: DATA[], ringSignature: DATA, rangeProof: DATA]
Returns
{ txHash: HASH }
dbc_getBalance
dbc_getBalanceScan the note pool for outputs belonging to the caller's view key and return the spendable balance.
Params
[viewKey: DATA]
Returns
{ balance: QUANTITY, noteCount: QUANTITY }
dbc_getEscrow
dbc_getEscrowReturn the aggregate DBC bridge escrow holdings across all token symbols. Intended for fund manager use to monitor DBC reserves backing the fund.
Params
[]
Returns
{ [tokenSymbol: string]: string }
dbc_sendRegulatedPayment
dbc_sendRegulatedPaymentSend a UCAN-wrapped DBC payment envelope with per-recipient selective disclosures and optional Travel Rule attachments.
Params
[envelope: RegulatedDBCPayment]
Returns
{ txHash: HASH, paymentId: string }
dbc_getPaymentReceipt
dbc_getPaymentReceiptReturn the status and signed receipt for a regulated DBC payment once the counterparty has confirmed it.
Params
[paymentId: string]
Returns
{ paymentId: string, status: string, receipt: DATA | null }
status values: pending, confirmed, rejected, refunded.
auth_ — Authorization
auth_ — AuthorizationThe auth_ namespace exposes the UCAN capability system and session management. UCAN delegations are encoded as JWTs and attached to transactions via EIP-8141 frame envelopes.
auth_login
auth_loginVerify a Sign-In with Ethereum (SIWE) signature, discover the caller's on-chain roles, and return a UCAN session token.
Params
[siweMessage: string, signature: DATA]
Returns
{ ucan: string, address: ADDRESS, roles: RoleSet, expiresAt: string }
RoleSet structure:
auth_getSession
auth_getSessionCheck the validity and remaining lifetime of an existing session token.
Params
[ucan: string]
Returns
{ valid: boolean, address: ADDRESS, roles: RoleSet, expiresAt: string, remainingSeconds: QUANTITY }
auth_refreshRoles
auth_refreshRolesRe-discover on-chain roles for the authenticated user without requiring a new SIWE sign-in. Useful when on-chain role assignments change while a session is active.
Params
[ucan: string]
Returns
{ roles: RoleSet, changed: boolean }
auth_createDelegation
auth_createDelegationCreate a UCAN capability delegation, granting an audience address the ability to invoke specified methods on behalf of the issuer.
Params
[issuer: ADDRESS, audience: ADDRESS, capabilities: Capability[], expiration?: QUANTITY]
Returns
{ delegation: string, cid: HASH }
auth_verify
auth_verifyVerify that a delegation JWT is valid, unexpired, and not revoked.
Params
[delegation: string]
Returns
{ valid: boolean, issuer: ADDRESS, audience: ADDRESS, capabilities: Capability[], expiration: QUANTITY | null }
auth_inspect
auth_inspectDecode and return the contents of a delegation JWT without verifying chain or revocation status.
Params
[delegation: string]
Returns
{ issuer: ADDRESS, audience: ADDRESS, capabilities: Capability[], expiration: QUANTITY | null, notBefore: QUANTITY | null }
auth_revoke
auth_revokeRevoke a previously issued delegation. Writes the delegation CID to the on-chain revocation registry.
Params
[cid: HASH]
Returns
{ txHash: HASH }
qm_ — QMTree State
qm_ — QMTree StateThe qm_ namespace exposes the QMTree Merkle state commitment. QMTree is the core data structure used to generate ZK proofs and verify state transitions.
qm_getRoot
qm_getRootReturn the current QMTree root hash at a given block.
Params
[blockNumber?: QUANTITY]
Returns
{ root: HASH, blockNumber: QUANTITY, txNum: QUANTITY }
qm_getLeaf
qm_getLeafReturn the value and position of a leaf node in the QMTree.
Params
[key: DATA, blockNumber?: QUANTITY]
Returns
{ key: DATA, value: DATA, leafIndex: QUANTITY, twig: HASH }
qm_getProof
qm_getProofReturn a Merkle inclusion proof for a leaf node.
Params
[key: DATA, blockNumber?: QUANTITY]
Returns
{ proof: HASH[], root: HASH, leafIndex: QUANTITY, value: DATA }
qm_call
qm_callExecute a read-only contract call against the QMTree state at a given root (without requiring the full chain state). Used for off-chain verification workflows.
Params
[to: ADDRESS, data: DATA, root: HASH]
Returns
{ result: DATA }
qm_callProof
qm_callProofExecute a contract call and return both the result and a proof of correct execution against the given QMTree root.
Params
[to: ADDRESS, data: DATA, root: HASH]
Returns
{ result: DATA, proof: ExecutionProof }
qm_verifyProof
qm_verifyProofVerify an execution proof against a given QMTree root without re-executing the call.
Params
[root: HASH, proof: ExecutionProof]
Returns
{ valid: boolean }
qm_getKeyProof
qm_getKeyProofReturn a proof of the current value bound to a key, suitable for use in a SNARK circuit.
Params
[key: DATA, blockNumber?: QUANTITY]
Returns
{ proof: HASH[], root: HASH, key: DATA, value: DATA }
qm_getExclusionProof
qm_getExclusionProofReturn a proof that a key does not exist in the QMTree (non-membership proof).
Params
[key: DATA, blockNumber?: QUANTITY]
Returns
{ proof: HASH[], root: HASH, key: DATA }
proof_ — ZK Proofs
proof_ — ZK ProofsThe proof_ namespace manages ZK proof generation, batching, and status queries. Proofs are generated by the Zilkworm prover and posted to Ethereum by the proof pipeline.
proof_getProof
proof_getProofReturn the ZK proof for a specific block.
Params
[blockNumber: QUANTITY]
Returns
{ blockNumber: QUANTITY, proof: DATA, status: ProofStatus, postedAt: QUANTITY | null, ethTxHash: HASH | null }
ProofStatus values: pending, generating, ready, posted, failed.
proof_getProofStatus
proof_getProofStatusReturn only the status of a proof, without the proof data itself.
Params
[blockNumber: QUANTITY]
Returns
{ blockNumber: QUANTITY, status: ProofStatus, generatedAt: QUANTITY | null }
proof_getBatchProof
proof_getBatchProofReturn the aggregate ZK proof for a batch of blocks.
Params
[fromBlock: QUANTITY, toBlock: QUANTITY]
Returns
{ fromBlock: QUANTITY, toBlock: QUANTITY, proof: DATA, root: HASH, status: ProofStatus }
proof_getLatestProved
proof_getLatestProvedReturn the block number and state root of the most recently proved (and Ethereum-posted) block.
Params
[]
Returns
{ blockNumber: QUANTITY, stateRoot: HASH, ethTxHash: HASH, postedAt: QUANTITY }
erigon_ — Storage and WebF Extensions
erigon_ — Storage and WebF ExtensionsThe erigon_ namespace exposes Cocoon's extended storage and web hosting capabilities: torrent-backed document storage and on-chain web site publishing via WebF.
Torrent Storage
erigon_resolveTorrent
erigon_resolveTorrentResolve a torrent-ccip content reference to its current download metadata.
Params
[infoHash: HASH]
Returns
{ infoHash: HASH, name: string, files: [{ name: string, size: QUANTITY, path: string }], trackers: string[], magnetURI: string }
erigon_publishTorrent
erigon_publishTorrentPublish a new torrent and write its on-chain content reference. The file data must be accessible to the node's torrent storage backend.
Params
[files: [{ name: string, data: DATA }], announce?: string[]]
Returns
{ infoHash: HASH, magnetURI: string, txHash: HASH }
erigon_getInscription
erigon_getInscriptionRetrieve an on-chain inscription (small content blob written directly into a transaction's calldata via EIP-8141 frame).
Params
[txHash: HASH]
Returns
{ txHash: HASH, contentType: string, data: DATA, size: QUANTITY }
WebF — On-Chain Web Hosting
erigon_publishWebSite
erigon_publishWebSitePublish a static web site by bundling its files into a torrent and writing the content root on-chain. The site is then accessible via the WebF gateway.
Params
[name: string, files: [{ path: string, data: DATA, contentType: string }], owner: ADDRESS]
Returns
{ siteId: HASH, infoHash: HASH, txHash: HASH, gatewayURL: string }
erigon_getWebSite
erigon_getWebSiteRetrieve metadata for a published web site.
Params
[siteId: HASH]
Returns
{ siteId: HASH, name: string, owner: ADDRESS, infoHash: HASH, publishedAt: QUANTITY, lastUpdated: QUANTITY, gatewayURL: string }
erigon_listWebSites
erigon_listWebSitesList all published web sites, optionally filtered by owner.
Params
[owner?: ADDRESS, offset?: QUANTITY, limit?: QUANTITY]
Returns
{ sites: [{ siteId: HASH, name: string, owner: ADDRESS, publishedAt: QUANTITY }], total: QUANTITY }
fx_ — FX Oracle
fx_ — FX OracleThe fx_ namespace provides foreign exchange rate management for the Cocoon platform. Supported pairs: EUR/USD, EUR/CHF, EUR/GBP, GBP/USD, USD/CHF, GBP/CHF.
fx_getRates
fx_getRatesReturn all current FX rates from the oracle.
Params
[]
Returns
{ rates: [{ from: string, to: string, rate: string, updatedAt: QUANTITY }] }
fx_getRate
fx_getRateReturn the current FX rate for a single currency pair.
Params
[from: string, to: string]
Returns
{ from: string, to: string, rate: string, updatedAt: QUANTITY }
fx_setRate
fx_setRateSet the FX rate for a currency pair. Requires Admin or Oracle role.
Params
[from: string, to: string, rate: string]
Returns
{ txHash: HASH }
fx_convert
fx_convertConvert an amount from one currency to another using the current oracle rate.
Params
[amount: string, from: string, to: string]
Returns
{ result: string, rate: string, from: string, to: string }
events_ — Event Stream
events_ — Event StreamThe events_ and stats_ methods listed in this section are mock-phase only. They are available in the local development and POC environment but are not yet part of the production RPC surface. Method signatures and return shapes may change before general availability.
events_getLatest
events_getLatestReturn the most recent chain events up to the requested count.
Params
[count: QUANTITY]
Returns
Event[]
events_getLogs
events_getLogsReturn events matching a filter (block range, address, topics).
Params
[filter: { fromBlock?: QUANTITY, toBlock?: QUANTITY, address?: ADDRESS, topics?: DATA[] }]
Returns
Event[]
stats_getChainStats
stats_getChainStatsReturn aggregated chain-level statistics.
Params
[]
Returns
{ blockNumber: QUANTITY, tps: QUANTITY, gasPrice: QUANTITY, totalTransactions: QUANTITY, dailyCounts: { date: string, count: QUANTITY }[] }
stats_getFundStats
stats_getFundStatsReturn fund-level statistics for a specific token.
Params
[tokenAddress: ADDRESS]
Returns
{ totalSupply: QUANTITY, aum: QUANTITY, subscribers24h: QUANTITY, redeemers24h: QUANTITY, netFlow7d: QUANTITY }
HTTP REST API
The backend proxy (port 8546) exposes REST endpoints alongside the JSON-RPC interface for IBAN account lookups, audit log queries, and permission management. These are not JSON-RPC methods — they are standard HTTP endpoints.
Health
GET /health
GET /healthReturns the backend's operational status.
Response: { "status": "ok", "chainReachable": true }
IBAN Registry
IBAN endpoints enable bidirectional lookup between Ethereum addresses and Swiss-style IBANs (format: CH + 2 check digits + chain ID + 12-digit account = 21 characters).
GET /api/ibans
GET /api/ibansReturn all registered IBAN accounts.
Response:
GET /api/iban/:code
GET /api/iban/:codeResolve an IBAN to its registered Ethereum address and display name.
Response: { "iban": "CH5200033000000000002", "address": "0x70997970...", "name": "Alice" }
Returns HTTP 404 if the IBAN is not registered.
GET /api/address/:addr/iban
GET /api/address/:addr/ibanReverse lookup: resolve an Ethereum address to its IBAN.
Response: { "address": "0x70997970...", "iban": "CH5200033000000000002", "name": "Alice" }
Returns HTTP 404 if the address has no registered IBAN.
Audit Log
Audit endpoints allow querying the audit log of all proxied RPC calls. Requires Admin, Compliance, or Auditor role.
GET /api/audit
GET /api/auditQuery the audit log with optional filters.
Query parameters:
address
string
Filter by Ethereum address
user_id
string
Filter by user UUID
method
string
Filter by RPC method (prefix match)
status
string
success, error, or blocked
from
ISO 8601
Start of time range
to
ISO 8601
End of time range
offset
integer
Pagination offset
limit
integer
Page size (default 50, max 500)
Response:
GET /api/audit/:id
GET /api/audit/:idReturn a single audit entry by ID.
GET /api/audit/export
GET /api/audit/exportExport filtered audit entries as a CSV file. Accepts the same query parameters as GET /api/audit.
Permission Rules
GET /api/permissions
GET /api/permissionsList all active permission rules in the PermissionRegistry.
Response:
POST /api/permissions
POST /api/permissionsAdd a new permission rule. Writes to the PermissionRegistry contract on-chain. Requires Admin role.
Request:
DELETE /api/permissions/:id
DELETE /api/permissions/:idRemove a permission rule. Requires Admin role.
Error Codes
All JSON-RPC methods return standard JSON-RPC errors. Cocoon-specific error codes:
-32001
TransferNotAllowed
A token_* write was blocked by a compliance rule. The message field contains the reason.
-32002
IdentityNotFound
The target address has no registered on-chain identity.
-32003
ClaimMissing
A required claim (KYC, accreditation, etc.) is absent or expired.
-32004
DelegationInvalid
A UCAN delegation is malformed, expired, or revoked.
-32005
ProofNotReady
The requested ZK proof has not been generated yet.
-32006
TorrentUnavailable
The requested torrent content is not available from any peer.
-32007
Unauthorized
The request lacks a valid session token and AUTH_MODE=strict is set.
-32008
PaymentPending
A regulated DBC payment is awaiting receipt confirmation from the counterparty.
-32009
ClaimApplicationPending
A KYC application has been submitted but not yet reviewed by the issuer.
Last updated