コード例 #1
0
        /// <summary>
        /// Creates middleware that adds a nonce to transactions for given public key.
        /// </summary>
        /// <param name="publicKey">Public key for which the nonce should be set.</param>
        /// <param name="client">Client that should be used to retrieve the nonce.</param>
        public NonceTxMiddleware(byte[] publicKey, DAppChainClient client)
        {
            PublicKey = publicKey;
            Client    = client;

            publicKeyHex = CryptoUtils.BytesToHexString(this.PublicKey);
        }
コード例 #2
0
ファイル: Contract.cs プロジェクト: wl-tsui/unity3d-sdk
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="client">Client to use to communicate with the contract.</param>
 /// <param name="contractAddr">Address of a contract on the Loom DAppChain.</param>
 /// <param name="contractName">Name of the contract.</param>
 /// <param name="callerAddr">Address of the caller, generated from the public key of the tx signer.</param>
 public Contract(DAppChainClient client, Address contractAddr, string contractName, Address callerAddr)
 {
     this.client  = client;
     this.Address = contractAddr;
     this.Name    = contractName;
     this.Caller  = callerAddr;
 }
コード例 #3
0
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="client">Client to use to communicate with the contract.</param>
 /// <param name="contractAddr">Address of a contract on the Loom DAppChain.</param>
 /// <param name="callerAddr">Address of the caller, generated from the public key of the tx signer.</param>
 /// <param name="abi">Contract Application Binary Interface as JSON object string.</param>
 public EvmContract(DAppChainClient client, Address contractAddr, Address callerAddr, string abi) : base(client, contractAddr, callerAddr)
 {
     this.contractBuilder  = new ContractBuilder(abi, contractAddr.LocalAddressHexString);
     this.topicToEventName = new Dictionary <byte[], string>(new ByteArrayComparer());
     foreach (EventABI eventAbi in this.contractBuilder.ContractABI.Events)
     {
         this.topicToEventName.Add(CryptoUtils.HexStringToBytes(eventAbi.Sha33Signature), eventAbi.Name);
     }
 }
コード例 #4
0
ファイル: EvmContract.cs プロジェクト: void-main/LoomDice
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="client">Client to use to communicate with the contract.</param>
 /// <param name="contractAddr">Address of a contract on the Loom DAppChain.</param>
 /// <param name="callerAddr">Address of the caller, generated from the public key of the transaction signer.</param>
 /// <param name="abi">Contract Application Binary Interface as JSON object string.</param>
 public EvmContract(DAppChainClient client, Address contractAddr, Address callerAddr, string abi) : base(client, contractAddr, callerAddr)
 {
     this.contractBuilder  = new ContractBuilder(abi, contractAddr.LocalAddress);
     this.topicToEventName = new Dictionary <string, string>();
     foreach (EventABI eventAbi in this.contractBuilder.ContractABI.Events)
     {
         this.topicToEventName.Add(eventAbi.Sha33Signature, eventAbi.Name);
     }
 }
コード例 #5
0
ファイル: Contract.cs プロジェクト: nanomobile/unity3d-sdk
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="client">Client to use to communicate with the contract.</param>
 /// <param name="contractAddr">Address of a contract on the Loom DAppChain.</param>
 /// <param name="callerAddr">Address of the caller, generated from the public key of the tx signer.</param>
 public Contract(DAppChainClient client, Address contractAddr, Address callerAddr)
 {
     this.client  = client;
     this.Address = contractAddr;
     this.Caller  = callerAddr;
 }
コード例 #6
0
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="client">Client to use to communicate with the contract.</param>
 /// <param name="contractAddr">Address of a contract on the Loom DAppChain.</param>
 /// <param name="callerAddr">Address of the caller, generated from the public key of the transaction signer.</param>
 public Contract(DAppChainClient client, Address contractAddr, Address callerAddr) : base(client, contractAddr, callerAddr)
 {
 }
コード例 #7
0
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="client">Client to use to communicate with the contract.</param>
 /// <param name="contractAddr">Address of a contract on the Loom DAppChain.</param>
 /// <param name="callerAddr">Address of the caller, generated from the public key of the tx signer.</param>
 /// <param name="abi">Contract Application Binary Interface as JSON object string.</param>
 public EvmContract(DAppChainClient client, Address contractAddr, Address callerAddr, string abi) : base(client, contractAddr, callerAddr)
 {
     this.contractBuilder = new ContractBuilder(abi, contractAddr.LocalAddressHexString);
 }
コード例 #8
0
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="client">Client to use to communicate with the contract.</param>
 /// <param name="contractAddr">Address of a contract on the Loom DAppChain.</param>
 /// <param name="callerAddr">Address of the caller, generated from the public key of the transaction signer.</param>
 protected ContractBase(DAppChainClient client, Address contractAddr, Address callerAddr)
 {
     this.client  = client;
     this.Address = contractAddr;
     this.Caller  = callerAddr;
 }