How to use @0xcert/ethereum-asset-ledger - 6 common examples

To help you get started, we’ve selected a few @0xcert/ethereum-asset-ledger 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 0xcert / framework / packages / 0xcert-ethereum-deploy-gateway / src / lib / deploy.ts View on Github external
      capabilities: deploy.assetLedgerData.capabilities.map((c) => { return getInterfaceCode(c); }),
      owner: deploy.assetLedgerData.owner,
github 0xcert / framework / packages / 0xcert-ethereum-deploy-gateway / src / lib / deploy.ts View on Github external
deploy.assetLedgerData.capabilities.forEach((c) => {
    capabilities = capabilities + rightPad(getInterfaceCode(c), 64, '0', false);
  });
github 0xcert / framework / packages / 0xcert-ethereum-gateway / src / lib / asset-ledger-deploy-order.ts View on Github external
      capabilities: order.assetLedgerData.capabilities.map((c) => { return getInterfaceCode(c); }),
      owner: order.assetLedgerData.ownerId,
github 0xcert / framework / packages / 0xcert-ethereum-gateway / src / lib / actions-order.ts View on Github external
export function getActionParams(action: ActionsOrderAction, signers: string[]) {
  let params = '';
  const signerIndex = signers.indexOf(action['senderId']);
  if (signerIndex === -1) {
    throw new ProviderError(ProviderIssue.WRONG_INPUT, 'SenderId not a signer.');
  }
  if (action.kind == ActionsOrderActionKind.CREATE_ASSET) {
    params = rightPad(`0x${action['assetImprint']}`, 64);
    params += leftPad(bigNumberify(action['assetId']).toHexString(), 64, '0', false);
    params += action['receiverId'].substr(2);
    params += leftPad(bigNumberify(signerIndex).toHexString(), 2, '0', false);
  } else if (action.kind == ActionsOrderActionKind.SET_ABILITIES) {
    const bitAbilities = getBitfieldFromAbilities(action.abilities);
    params =  leftPad(bitAbilities, 64, '0', true);
    params += action['receiverId'].substr(2);
    params += leftPad(bigNumberify(signerIndex).toHexString(), 2, '0', false);
  } else if (action.kind == ActionsOrderActionKind.TRANSFER_ASSET) {
    params = leftPad(bigNumberify(action['assetId']).toHexString(), 64, '0', true);
    params += action['receiverId'].substr(2);
    params += leftPad(bigNumberify(signerIndex).toHexString(), 2, '0', false);
  } else if (action.kind == ActionsOrderActionKind.TRANSFER_VALUE) {
    params = leftPad(bigNumberify(action['value']).toHexString(), 64, '0', true);
    params += action['receiverId'].substr(2);
    params += leftPad(bigNumberify(signerIndex).toHexString(), 2, '0', false);
  } else if (action.kind == ActionsOrderActionKind.UPDATE_ASSET_IMPRINT) {
    params = rightPad(`0x${action['assetImprint']}`, 64);
    params += leftPad(bigNumberify(action['assetId']).toHexString(), 64, '0', false);
    params += leftPad(bigNumberify(signerIndex).toHexString(), 2, '0', false);
  } else if (action.kind == ActionsOrderActionKind.DESTROY_ASSET) {
github 0xcert / framework / packages / 0xcert-wanchain-asset-ledger / src / core / ledger.ts View on Github external
import * as ethereum from '@0xcert/ethereum-asset-ledger';

/**
 * Wanchain asset ledger implementation.
 */
export class AssetLedger extends ethereum.AssetLedger { }

@0xcert/ethereum-asset-ledger

Asset ledger module for asset management on the Ethereum blockchain.

MIT
Latest version published 3 years ago

Package Health Score

48 / 100
Full package analysis