UNPKG

@btc-vision/btc-runtime

Version:

Bitcoin L1 Smart Contract Runtime for OP_NET. Build decentralized applications on Bitcoin using AssemblyScript and WebAssembly. Fully audited.

19 lines (16 loc) 683 B
import { u256 } from '@btc-vision/as-bignum/assembly'; import { BytesWriter } from '../../buffer/BytesWriter'; import { Address } from '../../types/Address'; import { ADDRESS_BYTE_LENGTH, U256_BYTE_LENGTH } from '../../utils'; import { NetEvent } from '../NetEvent'; @final export class OP721TransferredEvent extends NetEvent { constructor(operator: Address, from: Address, to: Address, tokenId: u256) { const data: BytesWriter = new BytesWriter(ADDRESS_BYTE_LENGTH * 3 + U256_BYTE_LENGTH); data.writeAddress(operator); data.writeAddress(from); data.writeAddress(to); data.writeU256(tokenId); super('Transferred', data); } }