All files / src/contract escrow.ts

100% Statements 5/5
100% Branches 0/0
100% Functions 2/2
100% Lines 4/4

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 5827x 27x                                                           2x                                             1x      
export { EscrowApproval, EscrowTransfer };
import { Field, Struct, UInt64 } from "o1js";
 
/**
 * EscrowTransfer is the data for transfer of the NFT from one owner to another
 * @property oldOwner The old owner of the NFT
 * @property newOwner The new owner of the NFT
 * @property name The name of the NFT
 * @property escrow The escrow of the NFT - Poseidon hash of the escrow public key
 * @property version The new version of the NFT, increases by one with the changing of the metadata or owner
 * @property price The price of the NFT
 * @property tokenId The tokenId of the NFT, Field(0) for MINA payments
 */
class EscrowTransfer extends Struct({
  oldOwner: Field,
  newOwner: Field,
  name: Field,
  escrow: Field,
  version: UInt64,
  price: UInt64,
  tokenId: Field, // Field(0) for MINA payments
}) {
  constructor(value: {
    oldOwner: Field;
    newOwner: Field;
    name: Field;
    escrow: Field;
    version: UInt64;
    price: UInt64;
    tokenId: Field;
  }) {
    super(value);
  }
}
 
/**
 * EscrowApproval is the data for approval of the escrow change
 * @property name The name of the NFT
 * @property escrow The escrow of the NFT - Poseidon hash of the escrow public key
 * @property owner The owner of the NFT - Poseidon hash of the owner public key
 * @property version The new version of the NFT, increases by one with the changing of the metadata or owner
 */
class EscrowApproval extends Struct({
  name: Field,
  escrow: Field,
  owner: Field,
  version: UInt64,
}) {
  constructor(value: {
    name: Field;
    escrow: Field;
    owner: Field;
    version: UInt64;
  }) {
    super(value);
  }
}