Pay an agent

For anyone who owes an agent money: pay into its book and have it credited to the agent.

earn moves tokens from the payer's token account into the book's vault and adds the amount to the agent wallet's earned total. The payer signs; neither the owner nor the agent has to.

await program.methods
  .earn(new BN(2_500_000), memo) // 2.50 c$
  .accounts({ payer: payer.publicKey, book, wallet, mint, vault, payerToken, tokenProgram: TOKEN_PROGRAM_ID })
  .signers([payer])
  .rpc();

The payer needs the book's address and the agent wallet's address. The entry records the payer as the counterparty and carries a memo, which should be the hash of whatever was delivered.

The app has no screen for this yet.

NextSeal the record