Skip to content

Commit

Permalink
Merge branch 'master' into shubham/CurrencyConvertor
Browse files Browse the repository at this point in the history
  • Loading branch information
shubhamkmr04 authored Feb 16, 2024
2 parents 7e2e94a + 9f3b0af commit 8f7aabb
Show file tree
Hide file tree
Showing 25 changed files with 891 additions and 133 deletions.
7 changes: 6 additions & 1 deletion Navigation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@ import LspExplanationRouting from './views/Explanations/LspExplanationRouting';
import LspExplanationWrappedInvoices from './views/Explanations/LspExplanationWrappedInvoices';
import LspExplanationOverview from './views/Explanations/LspExplanationOverview';

import RawTxHex from './views/RawTxHex';

const AppScenes = {
Wallet: {
screen: Wallet
Expand Down Expand Up @@ -252,7 +254,7 @@ const AppScenes = {
screen: NetworkInfo
},
NodeInfo: {
screen: NodeInfo
screen: NodeInfocffff

Check failure on line 257 in Navigation.ts

View workflow job for this annotation

GitHub Actions / lint

'NodeInfocffff' is not defined
},
Routing: {
screen: Routing
Expand Down Expand Up @@ -424,6 +426,9 @@ const AppScenes = {
},
CurrencyConverter: {
screen: CurrencyConverter
},
RawTxHex: {
screen: RawTxHex
}
};

Expand Down
4 changes: 3 additions & 1 deletion components/CopyButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ interface CopyButtonProps {
title?: string;
copyValue: string;
icon?: any;
noUppercase?: boolean;
}

interface CopyButtonState {
Expand Down Expand Up @@ -51,7 +52,7 @@ export default class CopyButton extends React.Component<

render() {
const { copied } = this.state;
const { title, icon } = this.props;
const { title, icon, noUppercase } = this.props;

const buttonTitle = copied
? localeString('components.CopyButton.copied')
Expand All @@ -74,6 +75,7 @@ export default class CopyButton extends React.Component<
}}
onPress={() => this.copyToClipboard()}
secondary
noUppercase={noUppercase}
/>
);
}
Expand Down
5 changes: 2 additions & 3 deletions components/KeyValue.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ export default class KeyValue extends React.Component<KeyValueProps, {}> {
const styles = StyleSheet.create({
key: {
paddingRight: 35,
maxWidth: '50%'
maxWidth: '70%'
},
value: {
flex: 1,
Expand All @@ -135,7 +135,6 @@ const styles = StyleSheet.create({
justifyContent: 'flex-end'
},
rtlValue: {
paddingRight: 10,
maxWidth: '50%'
paddingRight: 10
}
});
36 changes: 29 additions & 7 deletions components/SuccessErrorMessage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,43 @@ interface MessageProps {
link?: string;
mainStyle?: any;
dismissable?: boolean;
onPress?: () => void;
}

const Message = ({
message,
fontSize,
link,
mainStyle,
dismissable
dismissable,
onPress
}: MessageProps) => {
const [isDismissed, setDismissed] = useState(false);
if (isDismissed) return;
return dismissable ? (
<TouchableOpacity onPress={() => setDismissed(true)}>
return onPress ? (
<TouchableOpacity style={[styles.field]} onPress={onPress}>
<Text
style={[styles.field, mainStyle, { fontSize: fontSize || 20 }]}
>
{message}
</Text>
</TouchableOpacity>
) : dismissable ? (
<TouchableOpacity
style={[styles.field]}
onPress={() => setDismissed(true)}
>
<Text
style={[styles.field, mainStyle, { fontSize: fontSize || 20 }]}
>
{message}
</Text>
</TouchableOpacity>
) : link ? (
<TouchableOpacity onPress={() => UrlUtils.goToUrl(link)}>
<TouchableOpacity
style={[styles.field]}
onPress={() => UrlUtils.goToUrl(link)}
>
<Text
style={[styles.field, mainStyle, { fontSize: fontSize || 20 }]}
>
Expand All @@ -46,44 +62,50 @@ const SuccessMessage = ({
message,
fontSize,
link,
dismissable
dismissable,
onPress
}: MessageProps) => (
<Message
message={message}
fontSize={fontSize}
link={link}
mainStyle={styles.successField}
dismissable={dismissable}
onPress={onPress}
/>
);

const WarningMessage = ({
message,
fontSize,
link,
dismissable
dismissable,
onPress
}: MessageProps) => (
<Message
message={message}
fontSize={fontSize}
link={link}
mainStyle={styles.warningField}
dismissable={dismissable}
onPress={onPress}
/>
);

const ErrorMessage = ({
message,
fontSize,
link,
dismissable
dismissable,
onPress
}: MessageProps) => (
<Message
message={message}
fontSize={fontSize}
link={link}
mainStyle={styles.errorField}
dismissable={dismissable}
onPress={onPress}
/>
);

Expand Down
6 changes: 3 additions & 3 deletions fetch-libraries.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
VERSION=v0.17.3-beta-zeus
VERSION=v0.17.4-beta-zeus

ANDROID_FILE=Lndmobile.aar
IOS_FILE=Lndmobile.xcframework

ANDROID_SHA256='d9c10e6aa733e077ea903e09ce4b203a70e650897c220d2cdf7170867397a451'
IOS_SHA256='08a091aaf654faf2cb2d78bdc85805e5ca7ccaa908bb69335f93e0ea4d5ab645'
ANDROID_SHA256='af5339cb61d4f76461779a11f5c6e416b1faaefc935661ed59a54173575153fe'
IOS_SHA256='17f4e38f9e1b06e40d62e11c5eda0450aecf202919b2a90ed358f13111caf7b1'

FILE_PATH=https://github.com/ZeusLN/lnd/releases/download/$VERSION/

Expand Down
4 changes: 4 additions & 0 deletions locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@
"components.QRCodeScanner.chooseFromGallery": "Choose from gallery",
"components.QRCodeScanner.flashOn": "Flash on",
"components.QRCodeScanner.flashOff": "Flash off",
"views.RawTxHex.broadcastToMempoolSpace": "Broadcast to Mempool.space",
"models.Channel.unknownId": "Unknown Channel ID",
"models.Invoice.noMemo": "No memo",
"models.Invoice.seconds": "seconds",
Expand Down Expand Up @@ -489,6 +490,7 @@
"views.Payment.fee": "Fee",
"views.Payment.paymentHash": "Payment Hash",
"views.Payment.paymentPreimage": "Payment Preimage",
"views.Payment.destination": "Destination",
"views.Payment.creationDate": "Creation Date",
"views.Payment.path": "Path",
"views.Payment.paths": "Paths",
Expand Down Expand Up @@ -847,6 +849,8 @@
"views.Transaction.timestamp": "Timestamp",
"views.Transaction.destAddress": "Destination Address",
"views.Transaction.destAddresses": "Destination Addresses",
"views.Transaction.rawTxHex": "Raw transaction hex",
"views.Transaction.copyRawTxHex": "Copy raw TX hex",
"views.Activity.noActivity": "No activity yet",
"views.Activity.expired": "Expired",
"views.Activity.youSent": "You sent",
Expand Down
31 changes: 30 additions & 1 deletion models/Payment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,21 @@ export default class Payment extends BaseModel {
return this.payment_request || this.bolt11;
}

@computed public get getDestination(): string | undefined {
if (this.destination) return this.destination;
const pay_req = this.getPaymentRequest;
if (pay_req) {
try {
const decoded = bolt11.decode(pay_req);
return decoded.payeeNodeKey;
} catch {
return undefined;
}
} else {
return undefined;
}
}

@computed public get getMemo(): string | undefined {
if (this.getPaymentRequest) {
const decoded: any = bolt11.decode(this.getPaymentRequest);
Expand All @@ -74,7 +89,21 @@ export default class Payment extends BaseModel {
}

@computed public get getPreimage(): string {
return this.preimage || this.payment_preimage;
if (this.preimage) {
if (this.preimage?.type === 'Buffer') {
this.preimage = Base64Utils.bytesToHex(this.preimage.data);
}
return this.preimage;
}
if (this.payment_preimage) {
if (this.payment_preimage?.type === 'Buffer') {
this.payment_preimage = Base64Utils.bytesToHex(
this.payment_preimage.data
);
}
return this.payment_preimage;
}
return '';
}

@computed public get isIncomplete(): boolean {
Expand Down
1 change: 1 addition & 0 deletions models/Transaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export default class Transaction extends BaseModel {
public total_fees: string;
public output_details: Array<OutputDetail>;
public previous_outpoints: Array<PreviousOutpoint>;
public raw_tx_hex: string;
// c-lightning
public value: number | string;
public blockheight: number;
Expand Down
Loading

0 comments on commit 8f7aabb

Please sign in to comment.