Exemplo n.º 1
0
        /// <summary>
        /// Creates the instanse of TezosRpc
        /// </summary>
        /// <param name="uri">Base URI of the node</param>
        /// <param name="timeout">Timeout in seconds for the requests</param>
        /// <param name="chain">Chain to work with</param>
        public TezosRpc(string uri, int timeout, Chain chain = Rpc.Chain.Main)
        {
            Client = new RpcClient(uri, timeout);
            Chain  = chain.ToString().ToLower();

            Blocks = new BlocksQuery(Client, $"chains/{Chain}/blocks/");
            Inject = new InjectionQuery(Client, $"injection/");
        }
Exemplo n.º 2
0
        /// <summary>
        /// Creates the instanse of TezosRpc
        /// </summary>
        /// <param name="client">HttpClient instanse that will be used for sending RPC requests.</param>
        /// <param name="chain">Chain to work with.
        /// Note: this is not a network (mainnet or testnet), but a chain of the network.
        /// In 99.99% cases you likely want to use Chain.Main, because Chain.Test is only relevant during the testing phase of the Tezos voting process.</param>
        public TezosRpc(HttpClient client, Chain chain = Rpc.Chain.Main)
        {
            Client = new RpcClient(client);
            Chain  = chain.ToString().ToLower();

            Blocks = new BlocksQuery(Client, $"chains/{Chain}/blocks/");
            Inject = new InjectionQuery(Client, $"injection/");
        }