PHP WebShell

Текущая директория: /usr/lib/node_modules/bitgo/node_modules/@bitgo/sdk-coin-hbar/node_modules/@hashgraph/sdk/lib/token

Просмотр файла: CustomFee.cjs

"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;
var _AccountId = _interopRequireDefault(require("../account/AccountId.cjs"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/*-
 * ‌
 * Hedera JavaScript SDK
 * ​
 * Copyright (C) 2020 - 2022 Hedera Hashgraph, LLC
 * ​
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * ‍
 */

/**
 * @namespace proto
 * @typedef {import("@hashgraph/proto").proto.ICustomFee} HashgraphProto.proto.ICustomFee
 */

class CustomFee {
  /**
   * @param {object} props
   * @param {AccountId | string} [props.feeCollectorAccountId]
   * @param {boolean} [props.allCollectorsAreExempt]
   */
  constructor(props = {}) {
    /**
     * @type {?AccountId}
     */
    this._feeCollectorAccountId = null;
    this._allCollectorsAreExempt = false;
    if (props.feeCollectorAccountId != null) {
      this.setFeeCollectorAccountId(props.feeCollectorAccountId);
    }
    if (props.allCollectorsAreExempt != null) {
      this.setAllCollectorsAreExempt(props.allCollectorsAreExempt);
    }
  }

  /**
   * @returns {?AccountId}
   */
  get feeCollectorAccountId() {
    return this._feeCollectorAccountId;
  }

  /**
   * @param {AccountId | string} feeCollectorAccountId
   * @returns {this}
   */
  setFeeCollectorAccountId(feeCollectorAccountId) {
    this._feeCollectorAccountId = typeof feeCollectorAccountId === "string" ? _AccountId.default.fromString(feeCollectorAccountId) : feeCollectorAccountId;
    return this;
  }

  /**
   * @returns {boolean}
   */
  get allCollectorsAreExempt() {
    return this._allCollectorsAreExempt;
  }

  /**
   * @param {boolean} allCollectorsAreExempt
   * @returns {this}
   */
  setAllCollectorsAreExempt(allCollectorsAreExempt) {
    this._allCollectorsAreExempt = allCollectorsAreExempt;
    return this;
  }

  /**
   * @internal
   * @abstract
   * @param {HashgraphProto.proto.ICustomFee} info
   * @returns {CustomFee}
   */
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  static _fromProtobuf(info) {
    throw new Error("not implemented");
  }

  /**
   * @internal
   * @abstract
   * @returns {HashgraphProto.proto.ICustomFee}
   */
  _toProtobuf() {
    throw new Error("not implemented");
  }
}
exports.default = CustomFee;

Выполнить команду


Для локальной разработки. Не используйте в интернете!