Creates the Instance PDA that anchors the escrow. Must be called before any
other operation.
PDA Seeds
instance -> ["instance", instance_seed: Pubkey]allowed_mint -> ["allowed_mint", instance_pda: Pubkey, mint: Pubkey]operator -> ["operator", instance_pda: Pubkey, operator: Pubkey]event_authority -> ["event_authority"]
Accounts
| Account | Writable | Signer | Description |
|---|---|---|---|
payer | ✓ | ✓ | Fee payer and rent payer |
admin | ✓ | Initial admin of the instance | |
instance_seed | ✓ | Throwaway keypair used only for PDA derivation; its pubkey becomes the seed | |
instance | ✓ | Instance PDA (derived from ["instance", instance_seed.pubkey]) | |
system_program | System Program | ||
event_authority | Event authority PDA | ||
private_channel_escrow_program | Escrow Program |
Parameters
| Parameter | Type | Description |
|---|---|---|
bump | u8 | Bump seed for the instance PDA. Optional: the Async client auto-derives it if omitted |
The IDL contains a
discriminator: u8argument (value0) that is auto-set by the generated client and should not be passed manually.
Important Notes
instance_seedis a throwaway keypair, used only to derive theInstancePDA. Its pubkey becomes the seed; the keypair itself is not stored or reused.- Use
getCreateInstanceInstructionAsync; it auto-derivesbumpandinstancefrominstance_seedwhen they are not provided. Pass your ownbumponly if you already computed it viaPubkey::find_program_address(&[b"instance", instance_seed_pubkey.as_ref()], &PROGRAM_ID) - Emits an event via
EmitEventCPI
Is this page helpful?