-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix: Dynamic add and delete members string array * chore: Release zk crypto
- Loading branch information
Showing
8 changed files
with
108 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@bnb-chain/greenfield-js-sdk': patch | ||
--- | ||
|
||
fix: Dynamic add and delete members string array |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@bnb-chain/greenfield-zk-crypto': patch | ||
--- | ||
|
||
chore: Release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import { client } from '@/client'; | ||
import { useState } from 'react'; | ||
import { zeroAddress } from 'viem'; | ||
import { useAccount } from 'wagmi'; | ||
|
||
export const GroupUpdate = () => { | ||
const { address } = useAccount(); | ||
const [groupName, setGroupName] = useState(''); | ||
|
||
return ( | ||
<div> | ||
<h3>group update</h3> | ||
<input | ||
placeholder="group name" | ||
onChange={(e) => { | ||
setGroupName(e.target.value); | ||
}} | ||
/> | ||
<button | ||
onClick={async () => { | ||
if (!address) return; | ||
|
||
const updateGroupTx = await client.group.updateGroupMember({ | ||
operator: address, | ||
groupOwner: address, | ||
groupName: groupName, | ||
membersToAdd: [], | ||
membersToDelete: ['0x903904936a4328fac5477c0d96acf2E2bCaCD33d'], | ||
}); | ||
|
||
const simulateInfo = await updateGroupTx.simulate({ | ||
denom: 'BNB', | ||
}); | ||
|
||
console.log(simulateInfo); | ||
|
||
const res = await updateGroupTx.broadcast({ | ||
denom: 'BNB', | ||
gasLimit: Number(simulateInfo.gasLimit), | ||
gasPrice: simulateInfo.gasPrice, | ||
payer: address, | ||
granter: '', | ||
}); | ||
|
||
console.log('res', res); | ||
}} | ||
> | ||
update group | ||
</button> | ||
</div> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters