Party A is always the address that creates the agreement. They are the initiator.When you call createAgreement(), the partyA field should be your own address. Party A can:
Party B is the counterparty. They can be set at creation time or updated later (before they deposit) using setPartyB().Allowing setPartyB() before deposit is useful when the counterparty is not known at creation time — for example, a marketplace listing where any buyer can fill the order.Party B can do everything Party A can do, except cancel in the Created state (only the creator can cancel before both parties are active).
By default, funds go back to the depositing party on settlement. Party A’s funds go to party A. Party B’s funds go to party B.Your app can override this at the protocol level by calling extract_coin_balance() with custom recipient logic — but this is an advanced composability pattern for protocols building on top of Pacta.
await pacta.createAgreement(signer, { partyA: signer.address, // you partyB: "0xCOUNTERPARTY...", // the other side arbiter: "0xARBITER...", // dispute resolver, or "0x0" for none releaseConditions: ConditionPreset.FullConsent, termsHash: "0xHASH...", expiryMs: 0n, unlockTimeMs: 0n,})