How to use the @0xcert/scaffold.ActionsOrderActionKind.UPDATE_ASSET_IMPRINT function in @0xcert/scaffold

To help you get started, we’ve selected a few @0xcert/scaffold 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-gateway / src / lib / actions-order.ts View on Github external
export function getActionProxy(gateway: Gateway, action: ActionsOrderAction) {
  if (action.kind == ActionsOrderActionKind.TRANSFER_VALUE) {
    return ProxyId.TOKEN_TRANSFER;
  } else if (action.kind == ActionsOrderActionKind.TRANSFER_ASSET) {
    return gateway.provider.unsafeRecipientIds.indexOf(action.ledgerId) === -1
      ? ProxyId.NFTOKEN_SAFE_TRANSFER
      : ProxyId.NFTOKEN_TRANSFER;
  } else if (action.kind == ActionsOrderActionKind.CREATE_ASSET) {
    return ProxyId.XCERT_CREATE;
  } else if (action.kind == ActionsOrderActionKind.SET_ABILITIES) {
    return ProxyId.MANAGE_ABILITIES;
  } else if (action.kind == ActionsOrderActionKind.UPDATE_ASSET_IMPRINT) {
    return ProxyId.XCERT_UPDATE;
  } else if (action.kind == ActionsOrderActionKind.DESTROY_ASSET) {
    return ProxyId.XCERT_BURN;
  } else {
    throw new ProviderError(ProviderIssue.WRONG_INPUT, 'Not implemented.');
  }
}