Skip to main content
POST
Builds setDistributorApproval(distributor, approved) on the vault. On the current vault implementation a deposit may bind a new holder only to the vault owner or to an approved distributor. Approving a distributor lets deposits that name it bind new holders to it and credit it the distributor share on their shares. Withdrawing an approval stops new bindings only. Holders already bound to that distributor stay bound, and their shares keep crediting it. The API builds a deposit brought by an unapproved distributor without naming it. The deposit goes through, and the distributor share on an unbound holder’s shares goes to the vault operator. Only the vault owner can sign, and only the instance that operates the vault can build the call. The vault owner needs no approval of its own. A distributor instance finds the wallet to approve as distributor on Get Earnings, and the operator’s view there lists every approval in operator.approvedDistributors.

Path Parameters

string
required
Vault ID.

Body Parameters

string
The distributor wallet to approve or withdraw, as a 0x address. Required to build the calldata. Not the zero address and not the vault owner.
boolean
true to approve, false to withdraw the approval. Required to build the calldata.
string
The wallet that will sign. When given, it must be the vault owner. When omitted, the vault owner must be one of your instance’s verified wallets.
string
Hash of the mined transaction, 0x and 64 hex characters. Send it to confirm and record the result; nothing else is needed then. Omit it to receive the calldata.
The route validates every field of the schema it shares with the other distributor actions, even where this action ignores it.

Response Fields

The calldata response:
object
The confirmation response reads the DistributorApprovalSet event from the receipt, so distributor and approved state what the chain recorded, not what the request asked for:
object

Error Codes

Confirming with txHash can also return TX_NOT_FOUND (404), TX_REVERTED, TX_WRONG_TARGET or TX_WRONG_FUNCTION (400), and TX_NOT_VERIFIED (400) when the receipt carries no DistributorApprovalSet event from this vault. See transaction verification errors.