Beispiel #1
0
        public void Should_Sign_Request()
        {
            var expected = "304402204762c4fe40378120dbfcec95d7dd7f2e5b134d58b84f5fc877eeef910af0cad7022010fd000c45b9a3321cbaeb34ba2ace19e44decf91f5570071958ebf467827fe1";
            var url      = Client.BWS_INSTANCE_URL + "/v2/proposals";
            var args     = new TransactionProposal.Options {
                txProposalId = "723bcc40-2da4-4b89-8856-6ef61d1f5ee9",
                outputs      = new List <TransactionProposal.Options.Output>
                {
                    new TransactionProposal.Options.Output
                    {
                        toAddress = "TODO",
                        amount    = 10,
                        message   = "Hello Output"
                    }
                },
                message                 = "lx045OIjl+qyxxPFLf+jDtmjTCHcQfiDNeTuDxjnpAc=",
                feeLevel                = null,
                feePerKb                = 0,
                changeAddress           = null,
                sendMax                 = false,
                payProUrl               = null,
                excludeUnconfirmedUtxos = false,
                dryRun = false
            };
            var xkey   = NBitcoin.ExtKey.Parse("xprv9s21ZrQH143K4QfiqFa9SfBhBhcCUmBjNZ3JbovDKiz7jADZhok1rXLVozgoicjX9WPytAco48GNTJeDUtu5eiU8DV2kznJ1KBv7xUc1Jda");
            var der    = xkey.Derive(CoPay.Constants.REQUEST_PATH);
            var actual = Utils.SignRequest("post", url, args, der.PrivateKey);

            Assert.Equal(expected, actual);
        }
Beispiel #2
0
        public async Task Should_Create_Tx_Proposal()
        {
            this.client.credentials = Credentials.FromTestCredentials();
            var response = await this.client.createWallet("test", "test", 1, 1);

            var opts = new TransactionProposal.Options
            {
                txProposalId = Guid.NewGuid().ToString(),
                outputs      = new List <TransactionProposal.Options.Output>
                {
                    new TransactionProposal.Options.Output
                    {
                        toAddress = "mqmc1EiKHHoi1dqZQgstfAAj8qajpVwagf",
                        amount    = 10000,
                        message   = "Hello Output"
                    }
                },
                message = "Hello Options"
            };

            await this.client.createTransactionProposal(opts);
        }
Beispiel #3
0
        static void CreateTxProposal(Client client)
        {
            var opts = new TransactionProposal.Options
            {
                txProposalId = Guid.NewGuid().ToString(),
                outputs      = new List <TransactionProposal.Options.Output>
                {
                    new TransactionProposal.Options.Output
                    {
                        toAddress = "mqmc1EiKHHoi1dqZQgstfAAj8qajpVwagf",
                        amount    = 10000,
                        message   = "Hello Output"
                    }
                },
                message = "Hello Options"
            };

            var task = client.createTransactionProposal(opts);

            task.Wait();

            Console.Out.WriteLine(task.Result);
        }