You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am doing BTC transaction , use BTCTransaction class I just setFee:like this:
BTCTransaction *tx = [[BTCTransaction alloc] init];
long gas = [self caculateFee:fee andAmount:amount andUtxos:txouts];
tx.fee = gas;
(long)caculateFee:(NSString *)feeRate andAmount: (long)amount andUtxos:(NSArray )utxos{
long utxoAmount = 0L;
long utxoSize = 0L;
long fee = 0L;
for (BTCTransactionOutput txout in utxos) {
utxoSize++;
if(utxoAmount >= (amount + fee)){
break;
}else{
utxoAmount += txout.value;
fee = (utxoSize * 148 + 342+10) [feeRate longLongValue];
}
}
return fee;
}
The text was updated successfully, but these errors were encountered:
أنا أقوم بمعاملة BTC، وأستخدم فئة BTCTransaction، لقد قمت فقط بتعيين الرسوم: مثل هذا: BTCTransaction *tx = [[BTCTransaction alloc] init]; long gas = [self caculateFee:fee andAmount:amount andUtxos:txouts]; tx.fee = gas؛
(طويل) حساب الرسوم: (NSString *) معدل الرسوم والمبلغ: (طويل) المبلغ و Utxos: (NSArray ) utxos {
طويل utxoAmount = 0L؛
طويل utxoSize = 0L؛
طويل رسوم = 0L؛
ل ( إخراج معاملة BTC في utxos) {
utxoSize++؛
إذا (utxoAmount >= (المبلغ + الرسوم)) {
استراحة؛
} وإلا {
utxoAmount += قيمة الإخراج؛
الرسوم = (utxoSize * 148 + 34 2 + 10) [feeRate longLongValue]؛
}
}
رسوم الإرجاع؛
}
I am doing BTC transaction , use BTCTransaction class I just setFee:like this:
BTCTransaction *tx = [[BTCTransaction alloc] init];
long gas = [self caculateFee:fee andAmount:amount andUtxos:txouts];
tx.fee = gas;
long utxoAmount = 0L;
long utxoSize = 0L;
long fee = 0L;
for (BTCTransactionOutput txout in utxos) {
utxoSize++;
if(utxoAmount >= (amount + fee)){
break;
}else{
utxoAmount += txout.value;
fee = (utxoSize * 148 + 342+10) [feeRate longLongValue];
}
}
return fee;
}
The text was updated successfully, but these errors were encountered: