Smart Contracts API
Beam Escrow
Claim tokens from EscrowContract

Claim tokens as a recipient

To claim tokens as a recipient, you need to call the creatorClaimByPrincipal function on the BeamEscrow service canister using the recipient's identity principal and the Escrow ID you get from createBeamEscrow or queryMyBeams.

public shared ({ caller }) func creatorClaimByPrincipal(
  escrowId : EscrowId,
  tokenType : TokenType,
  creatorPrinciapl : Principal
) : async Result<Text, EscrowType.ErrorCode>

Switch to the recipient1 identity in dfx:

dfx identity use recipient1

Run the following in the command line to claim tokens:

dfx canister call beamescrow creatorClaimByPrincipal "(0, variant { icp }, principal \"om674-h2bcd-bhoxu-2deg5-lqfv5-w7kea-oqsa2-rhtqu-o5jih-5xfc7-qae\")"

Check your ICP balance:

dfx ledger balance --ledger-canister-id $(dfx canister id ledger)

It should return an arbitrary number of ICP, not 10 ICP because the ICP tokens are still being streamed to the recipient1 identity.

To check the streaming status of the recipient1 identity, use Beam queryBeamByEscrowIds.