Background
scripts/setup/usdcx-registry.go currently only serves the sender-side endpoint:
POST /registry/transfer-instruction/v1/transfer-factory
It returns choiceContext: null always.
On Canton devnet, DA's registrar also serves the receiver-side endpoint:
POST /api/token-standard/v0/registrars/{registrarParty}/registry/transfer-instruction/v1/{cid}/choice-contexts/accept
This endpoint returns:
choiceContextData — Map Text AnyValue (e.g., TransferRule CID, InstrumentConfig CID as AV_ContractId values)
disclosedContracts — array of { contractId, createdEventBlob (base64), templateId, synchronizerId } for the contracts referenced in the choiceContext
Without this endpoint, the receiver cannot call TransferInstruction_Accept (the Splice interface choice requires choiceContext + disclosed contracts).
Depends On
#257 (must know the exact choiceContextData field names and which ACS contracts to include)
Changes
File: scripts/setup/usdcx-registry.go
Add handler for:
POST /api/token-standard/v0/registrars/{registrarParty}/registry/transfer-instruction/v1/{cid}/choice-contexts/accept
Request body (from accept-via-interface.go reference):
{"meta": {}, "excludeDebugFields": false}
Response body:
{
"choiceContextData": {
"values": {
"<key>": {"tag": "AV_ContractId", "value": "<contract-id>"},
...
}
},
"disclosedContracts": [
{
"contractId": "...",
"createdEventBlob": "<base64>",
"templateId": "<pkg>:<module>:<entity>",
"synchronizerId": "..."
}
]
}
Implementation: Query P2's ACS for the TransferRule and InstrumentConfig (or equivalent) contracts relevant to the instrument in the TransferOffer referenced by {cid}. Build the choiceContext from their contract IDs.
docker-compose.yaml: The usdcx-registry service is already on port 8090 — no structural change needed.
tests/e2e/docker-compose.e2e.yaml: Add usdcx-registry service entry (see #263).
Verification
curl -X POST http://localhost:8090/api/token-standard/v0/registrars/{issuer}/registry/transfer-instruction/v1/{offerCID}/choice-contexts/accept \
-H 'Content-Type: application/json' \
-d '{"meta":{},"excludeDebugFields":false}'
Response should have non-null choiceContextData with at least one AV_ContractId entry.
Background
scripts/setup/usdcx-registry.gocurrently only serves the sender-side endpoint:It returns
choiceContext: nullalways.On Canton devnet, DA's registrar also serves the receiver-side endpoint:
This endpoint returns:
choiceContextData—Map Text AnyValue(e.g.,TransferRuleCID,InstrumentConfigCID asAV_ContractIdvalues)disclosedContracts— array of{ contractId, createdEventBlob (base64), templateId, synchronizerId }for the contracts referenced in the choiceContextWithout this endpoint, the receiver cannot call
TransferInstruction_Accept(the Splice interface choice requires choiceContext + disclosed contracts).Depends On
#257 (must know the exact
choiceContextDatafield names and which ACS contracts to include)Changes
File:
scripts/setup/usdcx-registry.goAdd handler for:
Request body (from
accept-via-interface.goreference):{"meta": {}, "excludeDebugFields": false}Response body:
{ "choiceContextData": { "values": { "<key>": {"tag": "AV_ContractId", "value": "<contract-id>"}, ... } }, "disclosedContracts": [ { "contractId": "...", "createdEventBlob": "<base64>", "templateId": "<pkg>:<module>:<entity>", "synchronizerId": "..." } ] }Implementation: Query P2's ACS for the
TransferRuleandInstrumentConfig(or equivalent) contracts relevant to the instrument in theTransferOfferreferenced by{cid}. Build the choiceContext from their contract IDs.docker-compose.yaml: Theusdcx-registryservice is already on port 8090 — no structural change needed.tests/e2e/docker-compose.e2e.yaml: Addusdcx-registryservice entry (see #263).Verification
curl -X POST http://localhost:8090/api/token-standard/v0/registrars/{issuer}/registry/transfer-instruction/v1/{offerCID}/choice-contexts/accept \ -H 'Content-Type: application/json' \ -d '{"meta":{},"excludeDebugFields":false}'Response should have non-null
choiceContextDatawith at least oneAV_ContractIdentry.