How to use the @0xcert/ethereum-gateway.ActionsOrderActionKind.DESTROY_ASSET function in @0xcert/ethereum-gateway

To help you get started, we’ve selected a few @0xcert/ethereum-gateway 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-client / src / core / controllers / orders-controller.ts View on Github external
break;
        }
        case (ActionKind.SET_ABILITIES): {
          orderActions.push({
            kind: ActionsOrderActionKind.SET_ABILITIES,
            receiverId: action.receiverId,
            senderId: action.senderId,
            ledgerId: action.assetLedgerId,
            abilities: action.abilities,
          } as FrameworkActionsOrderAction);
          paymentAmount += this.context.payment.setAbilitiesCost;
          break;
        }
        case (ActionKind.DESTROY_ASSET): {
          orderActions.push({
            kind: ActionsOrderActionKind.DESTROY_ASSET,
            senderId: action.senderId,
            ledgerId: action.assetLedgerId,
            assetId: action.id,
          } as FrameworkActionsOrderAction);
          paymentAmount += this.context.payment.assetDestroyCost;
          break;
        }
        default: {
          break;
        }
      }
    }

    // Add order payment action.
    const value = new BigNumber(paymentAmount).multipliedBy(multiplier);
    const expiration = Date.now() + 172800000; // 2 days