public static string Serialize(RetrievedSecrets secrets)
        {
            var secretsList = secrets.Secrets
                              .Select(kvp => SecretData.FromSecret(kvp.Key, kvp.Value))
                              .OrderBy(s => s.Name)
                              .ToList();

            return(JsonSerializer.Serialize(secretsList));
        }
예제 #2
0
        public void Should_Parse_Secret()
        {
            var secretData = SecretData.FromSecret("9TaJJxTQ6uFYg4kabVag98KyF37KpgttZLrn2DtWj9LuwQi53urzHX4xAGJo6WU5VyoP2KH2XETbtc");

            Assert.Equal(secretData.WalletId.ToString(), "447ef7db-85e6-4aad-8547-a503c15c853b");
            var hexKey = System.BitConverter.ToString(secretData.WalletPrivateKey.ToBytes()).Replace("-", string.Empty);

            Assert.Equal(hexKey.ToLower(), "3c5b6a54a3412d5cd7bc7e54624a53ab0e30e9c5e914786bf9ac28887d68b476");
            Assert.Equal(secretData.Coin, "btc");
            Assert.Equal(secretData.Network, Network.TestNet);
        }
예제 #3
0
        static void Main(string[] args)
        {
            var s = SecretData.FromSecret("9TaJJxTQ6uFYg4kabVag98KyF37KpgttZLrn2DtWj9LuwQi53urzHX4xAGJo6WU5VyoP2KH2XETbtc");

            client = new Client();
            // client.credentials = Credentials.FromTestCredentials();
            client.credentials = Credentials.Create("gus", Network.TestNet);
            client.credentials.PopulateSecretData(s);

            Console.WriteLine("credentials");
            Console.WriteLine(client.credentials.walletPrivKey.ToString(Network.TestNet));

            // var walletId = CreateWallet();
            // JoinWallet(s.WalletId);
            // RequestNewAddress();
            // GetWalletAddresses();
            // CreateTxProposal();
            SubscribeToNotifications("TODO get from app");
        }
예제 #4
0
        static void Main(string[] args)
        {
            var s = SecretData.FromSecret("9TaJJxTQ6uFYg4kabVag98KyF37KpgttZLrn2DtWj9LuwQi53urzHX4xAGJo6WU5VyoP2KH2XETbtc");

            var signingClient = new Client();

            // client.credentials = Credentials.FromTestCredentials();
            signingClient.credentials = Credentials.Create("gus", Network.TestNet);
            signingClient.credentials.PopulateSecretData(s);

            var copayerClient = new Client();

            copayerClient.credentials = Credentials.Create("gus2", Network.TestNet);
            copayerClient.credentials.PopulateSecretData(s);

            var walletId = CreateWallet(signingClient);

            JoinWallet(signingClient, walletId);
            JoinWallet(copayerClient, walletId);
            RequestNewAddress(signingClient);
            // GetWalletAddresses();
            // CreateTxProposal();
            SubscribeToNotifications(signingClient, "TODO get from app");
        }