How to use the fabric-contract-api.Asset function in fabric-contract-api

To help you get started, we’ve selected a few fabric-contract-api examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ampretia / fabric-application-examples / contracts / cp-ts-extended / src / papernet / paper.ts View on Github external
import { Asset, Property } from 'fabric-contract-api';
import State from '../ledger-api/state';

// Enumerate commercial paper state values
enum cpState  {
    ISSUED,
    TRADING,
    REDEEMED,
}

/**
 * CommercialPaper class extends State class
 * Class will be used by application and smart contract to define a paper
 */
@Asset()
export class CommercialPaper extends State {

    public static getType( ) {
        return 'org.papernet.commercialpaper';
    }

    @Property()
    public issuer: string;

    @Property()
    public owner: string;

    @Property()
    public currentState: any;

    @Property()