From e94c22358c4d85dd885228c5d1051177065352cc Mon Sep 17 00:00:00 2001 From: Ryan Williams Date: Sun, 5 Jan 2025 16:58:48 +0000 Subject: [PATCH 1/4] init 1.10 --- package.json | 2 +- src/App.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index e7dce7ce..96ef3f73 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/App.js b/src/App.js index 23145cb8..65b89e3a 100644 --- a/src/App.js +++ b/src/App.js @@ -1746,7 +1746,7 @@ class App extends React.Component {

✨demos CIP-95 dApp✨

-

✨v1.9.2✨

+

✨v1.10.1✨

Enable CIP-95? From f5bee30ddf4935d186d2fbd875b264929b485323 Mon Sep 17 00:00:00 2001 From: Ryan Williams Date: Sun, 5 Jan 2025 16:59:28 +0000 Subject: [PATCH 2/4] fix version typo --- src/App.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/App.js b/src/App.js index 65b89e3a..48f3f6b1 100644 --- a/src/App.js +++ b/src/App.js @@ -1746,7 +1746,7 @@ class App extends React.Component {

✨demos CIP-95 dApp✨

-

✨v1.10.1✨

+

✨v1.10.0✨

Enable CIP-95? From ad4719e2078d4057aa25ceffb43f227cfa8cae4a Mon Sep 17 00:00:00 2001 From: Ryan Williams Date: Sun, 5 Jan 2025 16:59:53 +0000 Subject: [PATCH 3/4] update in lock --- package-lock.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package-lock.json b/package-lock.json index b5b12cfd..95574c48 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "cip95-cardano-wallet-connector", - "version": "1.9.2", + "version": "1.10.0", "lockfileVersion": 2, "requires": true, "packages": { From 4ed7ec6b3aad87cf7490e49e861ed53dec2a10f5 Mon Sep 17 00:00:00 2001 From: Ryan Williams Date: Tue, 4 Feb 2025 14:23:36 +0000 Subject: [PATCH 4/4] feat: add ability to add withdrawals to txs --- src/App.js | 43 +++++++++++++++++++++++++++++++++++++++---- 1 file changed, 39 insertions(+), 4 deletions(-) diff --git a/src/App.js b/src/App.js index 48f3f6b1..33676395 100644 --- a/src/App.js +++ b/src/App.js @@ -70,6 +70,7 @@ import { Language, Int, TxInputsBuilder, + WithdrawalsBuilder, } from "@emurgo/cardano-serialization-lib-asmjs" import "./App.css"; import { @@ -150,6 +151,7 @@ class App extends React.Component { govActionBuilder: undefined, treasuryDonationAmount: undefined, treasuryValueAmount: undefined, + withdrawalAmount: undefined, // Certs voteDelegationTarget: "", voteDelegationStakeCred: "", @@ -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) @@ -493,6 +495,7 @@ class App extends React.Component { govActionBuilder: undefined, treasuryDonationAmount: undefined, treasuryValueAmount: undefined, + withdrawalAmount: undefined, // Certs voteDelegationTarget: "", voteDelegationStakeCred: "", @@ -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 () => { @@ -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(); @@ -2699,7 +2711,24 @@ class App extends React.Component {
} /> - + + + this.setState({withdrawalAmount : event.target.value})} + value={this.state.withdrawalAmount} + /> + + +
+ } /> + } /> - } /> - @@ -2840,6 +2869,12 @@ class App extends React.Component { )} + {this.state.withdrawalAmount && ( + <> +

Withdrawal Amount: {this.state.withdrawalAmount}

+ + )} +