Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version 1.10.0 #89

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"homepage": "http://ryun1.github.io/cip95-cardano-wallet-connector",
"name": "cip95-cardano-wallet-connector",
"version": "1.9.2",
"version": "1.10.0",
"private": true,
"dependencies": {
"@blueprintjs/core": "^3.53.0",
Expand Down
45 changes: 40 additions & 5 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ import {
Language,
Int,
TxInputsBuilder,
WithdrawalsBuilder,
} from "@emurgo/cardano-serialization-lib-asmjs"
import "./App.css";
import {
Expand Down Expand Up @@ -150,6 +151,7 @@ class App extends React.Component {
govActionBuilder: undefined,
treasuryDonationAmount: undefined,
treasuryValueAmount: undefined,
withdrawalAmount: undefined,
// Certs
voteDelegationTarget: "",
voteDelegationStakeCred: "",
Expand Down Expand Up @@ -409,7 +411,7 @@ class App extends React.Component {
try {
const raw = await this.API.getChangeAddress();
let address = Address.from_bytes(Buffer.from(raw, "hex"))
const changeAddress = address.to_bech32(address.network_id == 0?"addr":"addr_test")
const changeAddress = address.to_bech32(address.network_id === 0?"addr":"addr_test")
this.setState({changeAddress})
} catch (err) {
console.log(err)
Expand Down Expand Up @@ -493,6 +495,7 @@ class App extends React.Component {
govActionBuilder: undefined,
treasuryDonationAmount: undefined,
treasuryValueAmount: undefined,
withdrawalAmount: undefined,
// Certs
voteDelegationTarget: "",
voteDelegationStakeCred: "",
Expand Down Expand Up @@ -765,6 +768,9 @@ class App extends React.Component {
this.setState({certBuilder : undefined});
this.setState({votingBuilder : undefined});
this.setState({govActionBuilder : undefined});
this.setState({treasuryDonationAmount : undefined});
this.setState({treasuryValueAmount : undefined});
this.setState({withdrawalAmount : undefined});
}

refreshErrorState = async () => {
Expand Down Expand Up @@ -863,6 +869,12 @@ class App extends React.Component {
if (this.state.treasuryValueAmount){
txBuilder.set_current_treasury_value(BigNum.from_str(this.state.treasuryValueAmount));
}
if (this.state.withdrawalAmount){
const rewardAddr = RewardAddress.from_address(Address.from_bech32(this.state.rewardAddress));
const withdrawalsBuilder = WithdrawalsBuilder.new()
withdrawalsBuilder.add(rewardAddr, BigNum.from_str(this.state.withdrawalAmount));
txBuilder.set_withdrawals_builder(withdrawalsBuilder);
}
if(this.state.guardrailScriptUsed){
try{
const scripts = PlutusScripts.new();
Expand Down Expand Up @@ -1746,7 +1758,7 @@ class App extends React.Component {
<div style={{margin: "20px"}}>

<h1>✨demos CIP-95 dApp✨</h1>
<h4>✨v1.9.2✨</h4>
<h4>✨v1.10.0✨</h4>

<input type="checkbox" checked={this.state.selectedCIP95} onChange={this.handleCIP95Select}/> Enable CIP-95?

Expand Down Expand Up @@ -2699,7 +2711,24 @@ class App extends React.Component {

</div>
} />
<Tab id="5" title="💸 MIR Transfer (depricated in Conway)" panel={
<Tab id="5" title="✍️ Rewards account withdrawal" panel={
<div style={{marginLeft: "20px"}}>

<FormGroup
helperText="(lovelace)"
label="Amount to withdraw from stake account"
style={{ paddingTop: "10px" }}
>
<InputGroup
disabled={false}
onChange={(event) => this.setState({withdrawalAmount : event.target.value})}
value={this.state.withdrawalAmount}
/>
</FormGroup>

</div>
} />
<Tab id="6" title="💸 MIR Transfer (deprecated in Conway)" panel={
<div style={{marginLeft: "20px"}}>

<FormGroup
Expand Down Expand Up @@ -2743,7 +2772,7 @@ class App extends React.Component {
</div>
} />

<Tab id="6" title="🧬 Genesis Delegation Certificate (depricated in Conway)" panel={
<Tab id="7" title="🧬 Genesis Delegation Certificate (deprecated in Conway)" panel={
<div style={{marginLeft: "20px"}}>

<FormGroup
Expand Down Expand Up @@ -2787,7 +2816,7 @@ class App extends React.Component {
</div>
} />

<Tab id="7" title=" 💯 Test Basic Transaction" panel={
<Tab id="8" title=" 💯 Test Basic Transaction" panel={
<div style={{marginLeft: "20px"}}>

<button style={{padding: "10px"}} onClick={ () => this.buildSubmitConwayTx(true) }>Build empty Tx</button>
Expand Down Expand Up @@ -2840,6 +2869,12 @@ class App extends React.Component {
</>
)}

{this.state.withdrawalAmount && (
<>
<p><span style={{fontWeight: "lighter"}}> Withdrawal Amount: </span>{this.state.withdrawalAmount}</p>
</>
)}

<button style={{padding: "10px"}} onClick={ () => this.buildSubmitConwayTx(true) }>.signTx() and .submitTx()</button>
<button style={{padding: "10px"}} onClick={this.refreshData}>Refresh</button>

Expand Down