Overtorment
5 years ago
9 changed files with 263 additions and 164 deletions
@ -0,0 +1,42 @@ |
|||
const https = require('https'); |
|||
|
|||
const auth = 'Basic ' + Buffer.from('Overtorment' + ':' + process.env.GITHUB).toString('base64'); |
|||
|
|||
const branch = require('child_process').execSync("git ls-remote --heads origin | grep $(git rev-parse HEAD) | cut -d / -f 3").toString().trim(); |
|||
|
|||
const req = https.request( |
|||
{ |
|||
hostname: 'api.github.com', |
|||
port: 443, |
|||
path: '/repos/BlueWallet/BlueWallet/pulls', |
|||
method: 'GET', |
|||
headers: { 'User-Agent': 'BlueWallet bot', Authorization: auth }, |
|||
}, |
|||
resp => { |
|||
let data = ''; |
|||
|
|||
resp.on('data', chunk => { |
|||
data += chunk; |
|||
}); |
|||
|
|||
resp.on('end', () => { |
|||
try { |
|||
const prs = JSON.parse(data); |
|||
for (let pr of prs) { |
|||
if (branch === pr.head.ref) { |
|||
console.log(pr.number); |
|||
} |
|||
} |
|||
} catch (err) { |
|||
console.log(err); |
|||
console.log('got json: ', data); |
|||
} |
|||
}); |
|||
}, |
|||
); |
|||
|
|||
req.on('error', e => { |
|||
console.error(e); |
|||
}); |
|||
|
|||
req.end(); |
@ -0,0 +1,19 @@ |
|||
#!/usr/bin/env bash |
|||
|
|||
echo Uploading to Appetize and publishing link to Github... |
|||
echo -n "Branch " |
|||
git ls-remote --heads origin | grep $(git rev-parse HEAD) | cut -d / -f 3 |
|||
# git log -n 1 --pretty=%d HEAD | awk '{print $2}' | sed 's/origin\///' | sed 's/)//' |
|||
|
|||
FILENAME="$APPCENTER_OUTPUT_DIRECTORY/app-release.apk" |
|||
|
|||
if [ -f $FILENAME ]; then |
|||
APTZ=`curl "https://$APPETIZE@api.appetize.io/v1/apps" -F "file=@$FILENAME" -F "platform=android"` |
|||
echo Apptezize response: |
|||
echo $APTZ |
|||
APPURL=`node -e "let e = JSON.parse('$APTZ'); console.log(e.publicURL);"` |
|||
echo App url: $APPURL |
|||
PR=`node appcenter-post-build-get-pr-number.js` |
|||
echo PR: $PR |
|||
curl -X POST --data "{\"body\":\"Test this build in browser:\n\n(ノ◕ヮ◕)ノ*:・゚✧ $APPURL\n\n(posted automatically)\"}" -u "Overtorment:$GITHUB" "https://api.github.com/repos/BlueWallet/BlueWallet/issues/$PR/comments" |
|||
fi |
@ -1,98 +0,0 @@ |
|||
/* global alert */ |
|||
import React, { Component } from 'react'; |
|||
import { TouchableOpacity, Linking, View } from 'react-native'; |
|||
import { BlueSpacingVariable, BlueNavigationStyle, SafeBlueArea, BlueCard } from '../../BlueComponents'; |
|||
import { ListItem } from 'react-native-elements'; |
|||
import PropTypes from 'prop-types'; |
|||
import { Chain } from '../../models/bitcoinUnits'; |
|||
/** @type {AppStorage} */ |
|||
let BlueApp = require('../../BlueApp'); |
|||
let loc = require('../../loc'); |
|||
|
|||
export default class ManageFunds extends Component { |
|||
static navigationOptions = ({ navigation }) => ({ |
|||
...BlueNavigationStyle(navigation, true), |
|||
title: loc.lnd.title, |
|||
headerLeft: null, |
|||
}); |
|||
|
|||
constructor(props) { |
|||
super(props); |
|||
this.onWalletSelect = this.onWalletSelect.bind(this); |
|||
if (!props.navigation.getParam('fromWallet')) throw new Error('Invalid param'); |
|||
|
|||
this.state = { fromWallet: props.navigation.getParam('fromWallet') }; |
|||
} |
|||
|
|||
async onWalletSelect(wallet) { |
|||
this.props.navigation.dismiss(); |
|||
/** @type {LightningCustodianWallet} */ |
|||
let toAddress = false; |
|||
if (this.state.fromWallet.refill_addressess.length > 0) { |
|||
toAddress = this.state.fromWallet.refill_addressess[0]; |
|||
} else { |
|||
try { |
|||
await this.state.fromWallet.fetchBtcAddress(); |
|||
toAddress = this.state.fromWallet.refill_addressess[0]; |
|||
} catch (Err) { |
|||
return alert(Err.message); |
|||
} |
|||
} |
|||
|
|||
if (wallet) { |
|||
setTimeout(() => { |
|||
this.props.navigation.navigate('SendDetails', { |
|||
memo: loc.lnd.refill_lnd_balance, |
|||
fromSecret: wallet.getSecret(), |
|||
address: toAddress, |
|||
fromWallet: wallet, |
|||
}); |
|||
}, 100); |
|||
} else { |
|||
return alert('Internal error'); |
|||
} |
|||
} |
|||
|
|||
render() { |
|||
return ( |
|||
<SafeBlueArea forceInset={{ horizontal: 'always' }} style={{ flex: 1 }}> |
|||
<BlueSpacingVariable /> |
|||
|
|||
<BlueCard> |
|||
<ListItem |
|||
titleStyle={{ color: BlueApp.settings.foregroundColor }} |
|||
component={TouchableOpacity} |
|||
onPress={a => { |
|||
this.props.navigation.navigate('SelectWallet', { onWalletSelect: this.onWalletSelect, chainType: Chain.ONCHAIN }); |
|||
}} |
|||
title={loc.lnd.refill} |
|||
/> |
|||
<ListItem |
|||
titleStyle={{ color: BlueApp.settings.foregroundColor }} |
|||
component={TouchableOpacity} |
|||
onPress={a => { |
|||
Linking.openURL('https://zigzag.io/?utm_source=integration&utm_medium=bluewallet&utm_campaign=withdrawLink'); |
|||
}} |
|||
title={loc.lnd.withdraw} |
|||
/> |
|||
|
|||
<View /> |
|||
</BlueCard> |
|||
</SafeBlueArea> |
|||
); |
|||
} |
|||
} |
|||
|
|||
ManageFunds.propTypes = { |
|||
navigation: PropTypes.shape({ |
|||
goBack: PropTypes.func, |
|||
dismiss: PropTypes.func, |
|||
navigate: PropTypes.func, |
|||
getParam: PropTypes.func, |
|||
state: PropTypes.shape({ |
|||
params: PropTypes.shape({ |
|||
fromSecret: PropTypes.string, |
|||
}), |
|||
}), |
|||
}), |
|||
}; |
Loading…
Reference in new issue