All Downloads are FREE. Search and download functionalities are using the official Maven repository.

shgraph.hapi.0.54.1.source-code.crypto_approve_allowance.proto Maven / Gradle / Ivy

There is a newer version: 0.54.0
Show newest version
syntax = "proto3";

package proto;

/*-
 * ‌
 * Hedera Network Services Protobuf
 * ​
 * Copyright (C) 2018 - 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.
 * ‍
 */

option java_package = "com.hederahashgraph.api.proto.java";
// <<>> This comment is special code for setting PBJ Compiler java package
option java_multiple_files = true;

import "basic_types.proto";
import "google/protobuf/wrappers.proto";

/**
 * Creates one or more hbar/token approved allowances relative to the owner account specified in the allowances of
 * this transaction. Each allowance grants a spender the right to transfer a pre-determined amount of the owner's
 * hbar/token to any other account of the spender's choice. If the owner is not specified in any allowance, the payer
 * of transaction is considered to be the owner for that particular allowance.
 * Setting the amount to zero in CryptoAllowance or TokenAllowance will remove the respective allowance for the spender.
 * 
 * (So if account 0.0.X pays for this transaction and owner is not specified in the allowance,
 * then at consensus each spender account will have new allowances to spend hbar or tokens from 0.0.X).
 */
message CryptoApproveAllowanceTransactionBody {
  /**
   * List of hbar allowances approved by the account owner.
   */
  repeated CryptoAllowance cryptoAllowances = 1;

  /**
   * List of non-fungible token allowances approved by the account owner.
   */
  repeated NftAllowance nftAllowances = 2;

  /**
   * List of fungible token allowances approved by the account owner.
   */
  repeated TokenAllowance tokenAllowances = 3;
}

/**
 * An approved allowance of hbar transfers for a spender.
 */
message CryptoAllowance {
  /**
   * The account ID of the hbar owner (ie. the grantor of the allowance).
   */
  AccountID owner = 1;

  /**
   * The account ID of the spender of the hbar allowance.
   */
  AccountID spender = 2;

  /**
   * The amount of the spender's allowance in tinybars.
   */
  int64 amount = 3;
}

/**
 * An approved allowance of non-fungible token transfers for a spender.
 */
message NftAllowance {
  /**
   * The NFT token type that the allowance pertains to.
   */
  TokenID tokenId = 1;

  /**
   * The account ID of the token owner (ie. the grantor of the allowance).
   */
  AccountID owner = 2;

  /**
   * The account ID of the token allowance spender.
   */
  AccountID spender = 3;

  /**
   * The list of serial numbers that the spender is permitted to transfer.
   */
  repeated int64 serial_numbers = 4;

  /**
   * If true, the spender has access to all of the owner's NFT units of type tokenId (currently
   * owned and any in the future).
   */
  google.protobuf.BoolValue approved_for_all = 5;

  /**
   * The account ID of the spender who is granted approvedForAll allowance and granting
   * approval on an NFT serial to another spender.
   */
  AccountID delegating_spender = 6;
}

/**
 * An approved allowance of fungible token transfers for a spender.
 */
message TokenAllowance {
  /**
   * The token that the allowance pertains to.
   */
  TokenID tokenId = 1;

  /**
   * The account ID of the token owner (ie. the grantor of the allowance).
   */
  AccountID owner = 2;

  /**
   * The account ID of the token allowance spender.
   */
  AccountID spender = 3;

  /**
   * The amount of the spender's token allowance.
   */
  int64 amount = 4;
}





© 2015 - 2024 Weber Informatics LLC | Privacy Policy