Esempio n. 1
0
        /// Performs a transaction opening a new CDP [openCdp] as being
        /// associated with the address present inside the specified [wallet].
        /// Optionally [fee] and broadcasting [mode] parameters can be specified.
        public static async Task <TransactionResult> openCdpSingle(OpenCdp openCdp, Wallet wallet, StdFee fee = null, BroadcastingMode mode = BroadcastingMode.SYNC)
        {
            MsgOpenCdp msg = new MsgOpenCdp(openCdp: openCdp);

            // Careful here, Eugene: we are passing a list of BaseType containing the derived MsgSetDidDocument msg
            return(await TxHelper.createSignAndSendTx(new List <StdMsg> {
                msg
            }, wallet, fee : fee, mode : mode));
        }
Esempio n. 2
0
        /// Opens a new CDP depositing the given Commercio Token [amount].
        /// Optionally [fee] and broadcasting [mode] parameters can be specified.
        public static async Task <TransactionResult> openCdp(int amount, Wallet wallet, StdFee fee = null, BroadcastingMode mode = BroadcastingMode.SYNC)
        {
            List <StdCoin> depositAmount = new List <StdCoin> {
                new StdCoin("ucommercio", amount.ToString())
            };

            OpenCdp openCdp = OpenCdpHelper.fromWallet(wallet, depositAmount);

            MsgOpenCdp msg = new MsgOpenCdp(openCdp: openCdp);

            // Careful here, Eugene: we are passing a list of BaseType containing the derived MsgSetDidDocument msg
            return(await TxHelper.createSignAndSendTx(new List <StdMsg> {
                msg
            }, wallet, fee : fee, mode : mode));
        }