Ejemplo n.º 1
0
 /// <summary>
 /// Removes a file from the network via Administrative Delete
 /// </summary>
 /// <param name="file">
 /// The address of the file to delete.
 /// </param>
 /// <param name="signatory">
 /// Typically private key, keys or signing callback method that
 /// are needed to delete the file as per the requirements in the
 /// associated Endorsement.
 /// </param>
 /// <param name="configure">
 /// Optional callback method providing an opportunity to modify
 /// the execution configuration for just this method call.
 /// It is executed prior to submitting the request to the network.
 /// </param>
 /// <returns>
 /// A transaction receipt indicating success of the file deletion.
 /// </returns>
 /// <exception cref="ArgumentOutOfRangeException">If required arguments are missing.</exception>
 /// <exception cref="InvalidOperationException">If required context configuration is missing.</exception>
 /// <exception cref="PrecheckException">If the gateway node create rejected the request upon submission.</exception>
 /// <exception cref="ConsensusException">If the network was unable to come to consensus before the duration of the transaction expired.</exception>
 /// <exception cref="TransactionException">If the network rejected the create request as invalid or had missing data.</exception>
 public async Task <TransactionReceipt> SystemDeleteFileAsync(Address file, Signatory signatory, Action <IContext>?configure = null)
 {
     return(new TransactionReceipt(await ExecuteTransactionAsync(SystemDeleteTransactionBody.FromFile(file), configure, false, signatory).ConfigureAwait(false)));
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Restores a contract to the network via Administrative Restore
 /// </summary>
 /// <param name="contractToRestore">
 /// The address of the contract to restore.
 /// </param>
 /// <param name="signatory">
 /// Typically private key, keys or signing callback method that
 /// are needed to delete the contract as per the requirements in the
 /// associated Endorsement.
 /// </param>
 /// <param name="configure">
 /// Optional callback method providing an opportunity to modify
 /// the execution configuration for just this method call.
 /// It is executed prior to submitting the request to the network.
 /// </param>
 /// <returns>
 /// A transaction receipt indicating success of the contract deletion.
 /// </returns>
 /// <exception cref="ArgumentOutOfRangeException">If required arguments are missing.</exception>
 /// <exception cref="InvalidOperationException">If required context configuration is missing.</exception>
 /// <exception cref="PrecheckException">If the gateway node create rejected the request upon submission.</exception>
 /// <exception cref="ConsensusException">If the network was unable to come to consensus before the duration of the transaction expired.</exception>
 /// <exception cref="TransactionException">If the network rejected the create request as invalid or had missing data.</exception>
 public async Task <TransactionReceipt> SytemRestoreContractAsync(Address contractToRestore, Signatory signatory, Action <IContext>?configure = null)
 {
     return(new TransactionReceipt(await ExecuteTransactionAsync(SystemUndeleteTransactionBody.FromContract(contractToRestore), configure, false, signatory).ConfigureAwait(false)));
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Deletes an account from the network returning the remaining
 /// crypto balance to the specified account.  Must be signed
 /// by the account being deleted.
 /// </summary>
 /// <param name="addressToDelete">
 /// The address for account that will be deleted.
 /// </param>
 /// <param name="transferToAddress">
 /// The account that will receive any remaining balance from the deleted account.
 /// </param>
 /// <param name="signatory">
 /// The signatory containing any additional private keys or callbacks
 /// to meet the requirements for deleting the account and transferring
 /// the remaining crypto balance.
 /// </param>
 /// <param name="configure">
 /// Optional callback method providing an opportunity to modify
 /// the execution configuration for just this method call.
 /// It is executed prior to submitting the request to the network.
 /// </param>
 /// <returns>
 /// A transaction receipt indicating a successful operation.
 /// </returns>
 /// <exception cref="ArgumentOutOfRangeException">If required arguments are missing.</exception>
 /// <exception cref="InvalidOperationException">If required context configuration is missing.</exception>
 /// <exception cref="PrecheckException">If the gateway node create rejected the request upon submission.</exception>
 /// <exception cref="ConsensusException">If the network was unable to come to consensus before the duration of the transaction expired.</exception>
 /// <exception cref="TransactionException">If the network rejected the create request as invalid or had missing data.</exception>
 public Task <TransactionReceipt> DeleteAccountAsync(Address addressToDelete, Address transferToAddress, Signatory signatory, Action <IContext>?configure = null)
 {
     return(DeleteAccountImplementationAsync(addressToDelete, transferToAddress, signatory, configure));
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Grants KYC status to the associated account's relating to the specified token.
 /// </summary>
 /// <param name="token">
 /// The identifier (Address/Symbol) of the token to grant KYC.
 /// </param>
 /// <param name="address">
 /// Address of the account to suspend.
 /// </param>
 /// <param name="signatory">
 /// Additional signing key matching the administrative endorsements
 /// associated with this token (if not already added in the context).
 /// </param>
 /// <param name="configure">
 /// Optional callback method providing an opportunity to modify
 /// the execution configuration for just this method call.
 /// It is executed prior to submitting the request to the network.
 /// </param>
 /// <returns>
 /// A transaction receipt indicating a successful operation.
 /// </returns>
 /// <exception cref="ArgumentOutOfRangeException">If required arguments are missing.</exception>
 /// <exception cref="InvalidOperationException">If required context configuration is missing.</exception>
 /// <exception cref="PrecheckException">If the gateway node create rejected the request upon submission, for example of the token is already deleted.</exception>
 /// <exception cref="ConsensusException">If the network was unable to come to consensus before the duration of the transaction expired.</exception>
 /// <exception cref="TransactionException">If the network rejected the create request as invalid or had missing data.</exception>
 public Task <TransactionReceipt> GrantTokenKycAsync(Address token, Address address, Signatory signatory, Action <IContext>?configure = null)
 {
     return(GrantTokenKycImplementationAsync <TransactionReceipt>(token, address, signatory, configure));
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Deletes a topic instance from the network. Must be signed
 /// by the admin key.
 /// </summary>
 /// <param name="topicToDelete">
 /// The Topic instance that will be deleted.
 /// </param>
 /// <param name="signatory">
 /// Additional signing key/callback matching the administrative endorsements
 /// associated with this topic (if not already added in the context).
 /// </param>
 /// <param name="configure">
 /// Optional callback method providing an opportunity to modify
 /// the execution configuration for just this method call.
 /// It is executed prior to submitting the request to the network.
 /// </param>
 /// <returns>
 /// A transaction receipt indicating a successful operation.
 /// </returns>
 /// <exception cref="ArgumentOutOfRangeException">If required arguments are missing.</exception>
 /// <exception cref="InvalidOperationException">If required context configuration is missing.</exception>
 /// <exception cref="PrecheckException">If the gateway node create rejected the request upon submission, for example of the topic is already deleted.</exception>
 /// <exception cref="ConsensusException">If the network was unable to come to consensus before the duration of the transaction expired.</exception>
 /// <exception cref="TransactionException">If the network rejected the create request as invalid or had missing data.</exception>
 public Task <TransactionReceipt> DeleteTopicAsync(Address topicToDelete, Signatory signatory, Action <IContext>?configure = null)
 {
     return(DeleteTopicImplementationAsync(topicToDelete, signatory, configure));
 }
Ejemplo n.º 6
0
        public Task <TransactionRecord> TransferWithRecordAsync(IEnumerable <KeyValuePair <Address, long> > transfers, Signatory signatory, Action <IContext>?configure = null)
        {
            var cryptoTransfers = RequireInputParameter.CryptoTransferList(transfers);

            return(TransferImplementationAsync <TransactionRecord>(cryptoTransfers, null, signatory, configure));
        }
Ejemplo n.º 7
0
 /// <summary>
 /// Transfer tinybars from one account to another.
 /// </summary>
 /// <param name="fromAddress">
 /// The address to transfer the tinybars from.  Ensure that
 /// a signatory either in the context or passed with this
 /// call can fulfill the signing requrements to transfer
 /// crypto out of the account identified by this address.
 /// </param>
 /// <param name="toAddress">
 /// The address receiving the tinybars.
 /// </param>
 /// <param name="amount">
 /// The amount of tinybars to transfer.
 /// </param>
 /// <param name="signatory">
 /// The signatory containing any additional private keys or callbacks
 /// to meet the requirements for the sending and receiving accounts.
 /// </param>
 /// <param name="configure">
 /// Optional callback method providing an opportunity to modify
 /// the execution configuration for just this method call.
 /// It is executed prior to submitting the request to the network.
 /// </param>
 /// <returns>
 /// A transfer receipt indicating success of the operation.
 /// </returns>
 /// <exception cref="ArgumentOutOfRangeException">If required arguments are missing.</exception>
 /// <exception cref="InvalidOperationException">If required context configuration is missing.</exception>
 /// <exception cref="PrecheckException">If the gateway node create rejected the request upon submission.</exception>
 /// <exception cref="ConsensusException">If the network was unable to come to consensus before the duration of the transaction expired.</exception>
 /// <exception cref="TransactionException">If the network rejected the create request as invalid or had missing data.</exception>
 public Task <TransactionReceipt> TransferAsync(Address fromAddress, Address toAddress, long amount, Signatory signatory, Action <IContext>?configure = null)
 {
     return(TransferImplementationAsync <TransactionReceipt>(fromAddress, toAddress, amount, signatory, configure));
 }
Ejemplo n.º 8
0
 /// <summary>
 /// Transfer tinybars from one account to another.
 /// </summary>
 /// <param name="fromAddress">
 /// The address to transfer the tinybars from.  Ensure that
 /// a signatory either in the context or passed with this
 /// call can fulfill the signing requrements to transfer
 /// crypto out of the account identified by this address.
 /// </param>
 /// <param name="toAddress">
 /// The address receiving the tinybars.
 /// </param>
 /// <param name="amount">
 /// The amount of tinybars to transfer.
 /// </param>
 /// <param name="signatory">
 /// The signatory containing any additional private keys or callbacks
 /// to meet the requirements for the sending and receiving accounts.
 /// </param>
 /// <param name="configure">
 /// Optional callback method providing an opportunity to modify
 /// the execution configuration for just this method call.
 /// It is executed prior to submitting the request to the network.
 /// </param>
 /// <returns>
 /// A transfer receipt indicating success of the operation.
 /// </returns>
 /// <exception cref="ArgumentOutOfRangeException">If required arguments are missing.</exception>
 /// <exception cref="InvalidOperationException">If required context configuration is missing.</exception>
 /// <exception cref="PrecheckException">If the gateway node create rejected the request upon submission.</exception>
 /// <exception cref="ConsensusException">If the network was unable to come to consensus before the duration of the transaction expired.</exception>
 /// <exception cref="TransactionException">If the network rejected the create request as invalid or had missing data.</exception>
 public async Task <TransactionReceipt> TransferAsync(Address fromAddress, Address toAddress, long amount, Signatory signatory, Action <IContext>?configure = null)
 {
     return(new TransactionReceipt(await ExecuteTransactionAsync(new CryptoTransferTransactionBody(fromAddress, toAddress, amount), configure, false, signatory).ConfigureAwait(false)));
 }
Ejemplo n.º 9
0
 /// <summary>
 /// Adds token coins to the treasury.
 /// </summary>
 /// <param name="token">
 /// The identifier (Address/Symbol) of the token to add coins to.
 /// </param>
 /// <param name="amount">
 /// The amount of coins to add (of the divisible denomination)
 /// </param>
 /// <param name="signatory">
 /// Additional signing key matching the administrative endorsements
 /// associated with this token (if not already added in the context).
 /// </param>
 /// <param name="configure">
 /// Optional callback method providing an opportunity to modify
 /// the execution configuration for just this method call.
 /// It is executed prior to submitting the request to the network.
 /// </param>
 /// <returns>
 /// A transaction receipt indicating a successful operation.
 /// </returns>
 /// <exception cref="ArgumentOutOfRangeException">If required arguments are missing.</exception>
 /// <exception cref="InvalidOperationException">If required context configuration is missing.</exception>
 /// <exception cref="PrecheckException">If the gateway node create rejected the request upon submission, for example of the token is already deleted.</exception>
 /// <exception cref="ConsensusException">If the network was unable to come to consensus before the duration of the transaction expired.</exception>
 /// <exception cref="TransactionException">If the network rejected the create request as invalid or had missing data.</exception>
 public Task <TokenReceipt> MintTokenAsync(Address token, ulong amount, Signatory signatory, Action <IContext>?configure = null)
 {
     return(MintTokenImplementationAsync <TokenReceipt>(token, amount, signatory, configure));
 }
Ejemplo n.º 10
0
        /// <summary>
        /// Provisions Storage associated with the Account for maintaining
        /// token balances for the listed tokens.
        /// </summary>
        /// <remarks>
        /// Since this action will result in higher account renewal costs, it must be signed
        /// by the account's key.
        /// </remarks>
        /// <param name="tokens">
        /// The identifier Addresses of the tokens to associate with the account.
        /// </param>
        /// <param name="account">
        /// Address of the account to provision token balance storage.
        /// </param>
        /// <param name="signatory">
        /// Additional signing key matching the administrative endorsements
        /// associated with this token (if not already added in the context).
        /// </param>
        /// <param name="configure">
        /// Optional callback method providing an opportunity to modify
        /// the execution configuration for just this method call.
        /// It is executed prior to submitting the request to the network.
        /// </param>
        /// <returns>
        /// A transaction record indicating a successful operation.
        /// </returns>
        /// <exception cref="ArgumentOutOfRangeException">If required arguments are missing.</exception>
        /// <exception cref="InvalidOperationException">If required context configuration is missing.</exception>
        /// <exception cref="PrecheckException">If the gateway node create rejected the request upon submission, for example of the token is already deleted.</exception>
        /// <exception cref="ConsensusException">If the network was unable to come to consensus before the duration of the transaction expired.</exception>
        /// <exception cref="TransactionException">If the network rejected the create request as invalid or had missing data.</exception>
        public Task <TransactionRecord> AssociateTokensWithRecordAsync(IEnumerable <Address> tokens, Address account, Signatory signatory, Action <IContext>?configure = null)
        {
            var list = RequireInputParameter.Tokens(tokens);

            return(AssociateTokenImplementationAsync <TransactionRecord>(list, account, signatory, configure));
        }
Ejemplo n.º 11
0
        /// <summary>
        /// Provisions Storage associated with the Account for maintaining token balances
        /// for this account.
        /// </summary>
        /// <remarks>
        /// Since this action will result in higher account renewal costs, it must be signed
        /// by the account's key.
        /// </remarks>
        /// <param name="token">
        /// The identifier Address of the token to associate with the account.
        /// </param>
        /// <param name="account">
        /// Address of the account to provision token balance storage.
        /// </param>
        /// <param name="signatory">
        /// Additional signing key matching the administrative endorsements
        /// associated with this token (if not already added in the context).
        /// </param>
        /// <param name="configure">
        /// Optional callback method providing an opportunity to modify
        /// the execution configuration for just this method call.
        /// It is executed prior to submitting the request to the network.
        /// </param>
        /// <returns>
        /// A transaction record indicating a successful operation.
        /// </returns>
        /// <exception cref="ArgumentOutOfRangeException">If required arguments are missing.</exception>
        /// <exception cref="InvalidOperationException">If required context configuration is missing.</exception>
        /// <exception cref="PrecheckException">If the gateway node create rejected the request upon submission, for example of the token is already deleted.</exception>
        /// <exception cref="ConsensusException">If the network was unable to come to consensus before the duration of the transaction expired.</exception>
        /// <exception cref="TransactionException">If the network rejected the create request as invalid or had missing data.</exception>
        public Task <TransactionRecord> AssociateTokenWithRecordAsync(Address token, Address account, Signatory signatory, Action <IContext>?configure = null)
        {
            var list = new TokenID[] { new TokenID(RequireInputParameter.Token(token)) };

            return(AssociateTokenImplementationAsync <TransactionRecord>(list, account, signatory, configure));
        }
Ejemplo n.º 12
0
 /// <summary>
 /// Sends a message to the network for a given consensus topic.
 /// </summary>
 /// <param name="topic">
 /// The address of the topic for the message.
 /// </param>
 /// <param name="message">
 /// The value of the message, limited to the 4K total Network Transaction Size.
 /// </param>
 /// <param name="signatory">
 /// The signatory containing any additional private keys or callbacks
 /// to meet the key signing requirements for participants.
 /// </param>
 /// <param name="configure">
 /// Optional callback method providing an opportunity to modify
 /// the execution configuration for just this method call.
 /// It is executed prior to submitting the request to the network.
 /// </param>
 /// <returns>
 /// A Submit Message Receipt indicating success, includes information
 /// about the sequence number of the message and its running hash.
 /// </returns>
 /// <exception cref="ArgumentOutOfRangeException">If required arguments are missing.</exception>
 /// <exception cref="InvalidOperationException">If required context configuration is missing.</exception>
 /// <exception cref="PrecheckException">If the gateway node create rejected the request upon submission.</exception>
 /// <exception cref="ConsensusException">If the network was unable to come to consensus before the duration of the transaction expired.</exception>
 /// <exception cref="TransactionException">If the network rejected the create request as invalid or had missing data.</exception>
 public Task <SubmitMessageReceipt> SubmitMessageAsync(Address topic, ReadOnlyMemory <byte> message, Signatory signatory, Action <IContext>?configure = null)
 {
     return(SubmitMessageImplementationAsync <SubmitMessageReceipt>(topic, message, false, null, 0, 0, signatory, configure));
 }
Ejemplo n.º 13
0
 /// <summary>
 /// Grants KYC status to the associated account's relating to the specified token.
 /// </summary>
 /// <param name="token">
 /// The identifier (Address/Symbol) of the token to grant KYC.
 /// </param>
 /// <param name="address">
 /// Address of the account to suspend.
 /// </param>
 /// <param name="signatory">
 /// Additional signing key matching the administrative endorsements
 /// associated with this token (if not already added in the context).
 /// </param>
 /// <param name="configure">
 /// Optional callback method providing an opportunity to modify
 /// the execution configuration for just this method call.
 /// It is executed prior to submitting the request to the network.
 /// </param>
 /// <returns>
 /// A transaction receipt indicating a successful operation.
 /// </returns>
 /// <exception cref="ArgumentOutOfRangeException">If required arguments are missing.</exception>
 /// <exception cref="InvalidOperationException">If required context configuration is missing.</exception>
 /// <exception cref="PrecheckException">If the gateway node create rejected the request upon submission, for example of the token is already deleted.</exception>
 /// <exception cref="ConsensusException">If the network was unable to come to consensus before the duration of the transaction expired.</exception>
 /// <exception cref="TransactionException">If the network rejected the create request as invalid or had missing data.</exception>
 public async Task <TransactionReceipt> GrantTokenKycAsync(Address token, Address address, Signatory signatory, Action <IContext>?configure = null)
 {
     return(new TransactionReceipt(await ExecuteTransactionAsync(new TokenGrantKycTransactionBody(token, address), configure, false, signatory).ConfigureAwait(false)));
 }
Ejemplo n.º 14
0
 /// <summary>
 /// Deletes a token from the network. Must be signed by the admin key.
 /// </summary>
 /// <param name="token">
 /// The identifier (Address/Symbol) of the token instance that will be deleted.
 /// </param>
 /// <param name="signatory">
 /// Additional signing key matching the administrative endorsements
 /// associated with this token (if not already added in the context).
 /// </param>
 /// <param name="configure">
 /// Optional callback method providing an opportunity to modify
 /// the execution configuration for just this method call.
 /// It is executed prior to submitting the request to the network.
 /// </param>
 /// <returns>
 /// A transaction receipt indicating a successful operation.
 /// </returns>
 /// <exception cref="ArgumentOutOfRangeException">If required arguments are missing.</exception>
 /// <exception cref="InvalidOperationException">If required context configuration is missing.</exception>
 /// <exception cref="PrecheckException">If the gateway node create rejected the request upon submission, for example of the token is already deleted.</exception>
 /// <exception cref="ConsensusException">If the network was unable to come to consensus before the duration of the transaction expired.</exception>
 /// <exception cref="TransactionException">If the network rejected the create request as invalid or had missing data.</exception>
 public async Task <TransactionReceipt> DeleteTokenAsync(Address token, Signatory signatory, Action <IContext>?configure = null)
 {
     return(new TransactionReceipt(await ExecuteTransactionAsync(new TokenDeleteTransactionBody(token), configure, false, signatory).ConfigureAwait(false)));
 }