Disclosure policy
Example
WhenrecipientAddress is private, set to to the recipient stpl1 address from the registry lookup.
Seed state
const POOL = 'CBVQTSTSIJ4UZMN5FQBFHPUIYSW3ATGSP57BZDJNKTOBNQODQTRGE4K5';
const SENDER = 'GDSENDER7EXAMPLEPUBLICKEYAAAAAAAAAAAAAAAAAAAA';
const SENDER_PRIVATE = 'stpl1sender7exampleprivateaddress0000000000';
const RECIPIENT = 'GCRECIPIENT7EXAMPLEPUBLICKEYAAAAAAAAAAAAAAA';
const RECIPIENT_PRIVATE = 'stpl1recipient7exampleprivateaddress000000';
await client.upsertAssets([
{
id: 1,
assetId: 'usdc',
name: 'USDC',
logoUrl: null,
issuerAddress: null,
clientContract: 'CTOKENCONTRACTEXAMPLEAAAAAAAAAAAAAAAAAAAAAA',
poolContracts: [POOL],
poolContract: POOL,
mintable: false,
mintAmount: null,
},
]);
await client.saveRegistryLookup({
owner: RECIPIENT,
status: 'registered',
privateAddressStpl1: RECIPIENT_PRIVATE,
});
await client.setPoolMerkleState({
poolContract: POOL,
commitments: ['0xmerklecommitmenthexexample00000000000000000000000000000000'],
commitmentCount: 1,
merkleRootHex: '0xmerkleroothexexample000000000000000000000000000000000000',
updatedAt: Date.now(),
});
await client.saveWalletPrivateAddressScalar({
owner: SENDER,
nonce: '1',
scalarHex: '0xabc123scalarhexexample000000000000000000000000000000000000',
});
await client.upsertPrivateRecords([
{
id: '0xnotecommitmenthexexample000000000000000000000000000000000000',
owner: SENDER,
privateAddress: SENDER_PRIVATE,
asset: 'usdc',
amount: 100_0000000n,
consumed: false,
poolContract: POOL,
coinNote: {
value: '1000000000',
nullifier: '0xnullifierhexexample000000000000000000000000000000000000',
secret: '0xsecrethexexample0000000000000000000000000000000000000000',
commitment: '0xnotecommitmenthexexample000000000000000000000000000000000000',
asset_hi: '0xassethihexexample00000000000000000000000000000000000000',
asset_lo: '0xassetlohexexample00000000000000000000000000000000000000',
},
},
]);
Run operation
const operation = await client.transfer({
from: 'stpl1sender7exampleprivateaddress0000000000',
to: 'stpl1recipient7exampleprivateaddress000000',
asset: 'usdc',
amount: 25_0000000n,
disclosure: {
senderAddress: 'private',
recipientAddress: 'private',
assetAddress: 'private',
amount: 'private',
},
});
if (operation.status === 'rejected') {
throw new Error(operation.errors[0]?.message);
}
await operation.execute({});
Related
Operations — Transfer
Registered recipient transfer semantics.
Domain model
Registry cache and address types.
Data sources
Seed state is a doc fixture; production data flows.
Disclosure policy
Public vs private fields per route.