Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
aryzing committed Jul 16, 2024
1 parent e439065 commit 5a41746
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 1 addition & 3 deletions example/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,18 +64,16 @@ function AppWithProviders() {
console.error(res2);
return;
}

setBtcAddressInfo(res2.result.addresses);
const res3 = await Wallet.request('stx_getAddresses', null);

const res3 = await Wallet.request('stx_getAddresses', null);
if (res3.status === 'error') {
alert(
'Error retrieving stacks addresses after having requested permissions. Details in terminal.'
);
console.error(res3);
return;
}

setStxAddressInfo(res3.result.addresses);
})().catch(console.error);
}, [setBtcAddressInfo, setStxAddressInfo]);
Expand Down
5 changes: 4 additions & 1 deletion example/src/components/stacks/signTransaction/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ function SignTransaction(props: Props) {

const response = await request('stx_signTransaction', {
transaction: bytesToHex(transaction.serialize()),
broadcast,
});

if (response.status === 'error') {
Expand All @@ -60,6 +61,7 @@ function SignTransaction(props: Props) {

const response = await request('stx_signTransaction', {
transaction: bytesToHex(transaction.serialize()),
broadcast,
});

if (response.status === 'error') {
Expand All @@ -83,6 +85,7 @@ function SignTransaction(props: Props) {

const response = await request('stx_signTransaction', {
transaction: bytesToHex(transaction.serialize()),
broadcast,
});

if (response.status === 'error') {
Expand Down Expand Up @@ -127,7 +130,7 @@ function SignTransaction(props: Props) {
}

if (contractCallMutation.isSuccess) {
console.log(contractCallMutation.data);
console.log('Signed transaction:', contractCallMutation.data);
return <p>Transaction signed successfully. Check console for details.</p>;
}
})()}
Expand Down

0 comments on commit 5a41746

Please sign in to comment.