Defined in: packages/enduser/src/CommunityClient.ts:27
Client for Community Managers (ROLE_COMMUNITY)
new CommunityClient(
config):CommunityClient
Defined in: packages/enduser/src/CommunityClient.ts:32
| Parameter | Type |
|---|---|
config |
CommunityClientConfig |
CommunityClient
client:
WalletClient
Defined in: packages/core/src/clients/BaseClient.ts:6
protectedoptionalentryPointAddress:`0x${string}`
Defined in: packages/core/src/clients/BaseClient.ts:12
optionalfactoryAddress:`0x${string}`
Defined in: packages/enduser/src/CommunityClient.ts:29
protectedoptionalgTokenAddress:`0x${string}`
Defined in: packages/core/src/clients/BaseClient.ts:9
protectedoptionalgTokenStakingAddress:`0x${string}`
Defined in: packages/core/src/clients/BaseClient.ts:10
BaseClient.gTokenStakingAddress
protectedoptionalpaymasterFactoryAddress:`0x${string}`
Defined in: packages/core/src/clients/BaseClient.ts:11
BaseClient.paymasterFactoryAddress
optionalpublicClient:PublicClient
Defined in: packages/core/src/clients/BaseClient.ts:7
protectedoptionalregistryAddress:`0x${string}`
Defined in: packages/core/src/clients/BaseClient.ts:8
optionalreputationAddress:`0x${string}`
Defined in: packages/enduser/src/CommunityClient.ts:30
optionalsbtAddress:`0x${string}`
Defined in: packages/enduser/src/CommunityClient.ts:28
airdropSBT(
users,roleId,options?):Promise<`0x${string}`>
Defined in: packages/enduser/src/CommunityClient.ts:309
Airdrop SBTs to users to make them members
| Parameter | Type |
|---|---|
users |
`0x${string}`[] |
roleId |
bigint |
options? |
TransactionOptions |
Promise<`0x${string}`>
createCommunityToken(
params,options?):Promise<`0x${string}`>
Defined in: packages/enduser/src/CommunityClient.ts:50
Create a new Community Token (xPNTs) and register it. Note: In the current architecture, creating a community often involves:
- Registering the ROLE_COMMUNITY on Registry (if not exists) -> usually manual or self-register
- Deploying a Token (xPNTs) via Factory
- Linking the Token to the Community in Registry
| Parameter | Type |
|---|---|
params |
CreateCommunityParams |
options? |
TransactionOptions |
Promise<`0x${string}`>
getAddress():
`0x${string}`
Defined in: packages/core/src/clients/BaseClient.ts:34
Get the account address of the connected wallet
`0x${string}`
getCommunityInfo(
communityAddress?):Promise<{description:string;ensName:string;logoURI:string;name:string;stakeAmount:bigint;website:string; }>
Defined in: packages/enduser/src/CommunityClient.ts:76
Get Community Details (Decodes Role Metadata)
| Parameter | Type | Description |
|---|---|---|
communityAddress? |
`0x${string}` |
The address of the community manager (defaults to self) |
Promise<{ description: string; ensName: string; logoURI: string; name: string; stakeAmount: bigint; website: string; }>
getStartPublicClient():
PublicClient|WalletClient<Transport,Chain|undefined,Account|undefined>
Defined in: packages/core/src/clients/BaseClient.ts:41
Helper to ensure public client exists or fallback to wallet client (if it supports read)
PublicClient | WalletClient<Transport, Chain | undefined, Account | undefined>
BaseClient.getStartPublicClient
registerAsCommunity(
params,options?):Promise<`0x${string}`>
Defined in: packages/enduser/src/CommunityClient.ts:166
Register self as a Community Manager. This method handles all necessary steps:
- Checks and approves GToken to GTokenStaking
- Encodes CommunityRoleData with provided parameters
- Calls registerRoleSelf on Registry
| Parameter | Type | Description |
|---|---|---|
params |
{ description?: string; ensName?: string; logoURI?: string; name: string; stakeAmount?: bigint; website?: string; } |
Community registration parameters |
params.description? |
string |
- |
params.ensName? |
string |
- |
params.logoURI? |
string |
- |
params.name? |
string |
- |
params.stakeAmount? |
bigint |
- |
params.website? |
string |
- |
options? |
TransactionOptions |
Transaction options |
Promise<`0x${string}`>
Transaction hash
protectedrequireEntryPoint():`0x${string}`
Defined in: packages/core/src/clients/BaseClient.ts:73
`0x${string}`
protectedrequireGToken():`0x${string}`
Defined in: packages/core/src/clients/BaseClient.ts:52
`0x${string}`
protectedrequireGTokenStaking():`0x${string}`
Defined in: packages/core/src/clients/BaseClient.ts:59
`0x${string}`
BaseClient.requireGTokenStaking
protectedrequirePaymasterFactory():`0x${string}`
Defined in: packages/core/src/clients/BaseClient.ts:66
`0x${string}`
BaseClient.requirePaymasterFactory
protectedrequireRegistry():`0x${string}`
Defined in: packages/core/src/clients/BaseClient.ts:45
`0x${string}`
revokeMembership(
userAddr,options?):Promise<`0x${string}`>
Defined in: packages/enduser/src/CommunityClient.ts:360
Revoke membership (Burn SBT)
| Parameter | Type |
|---|---|
userAddr |
`0x${string}` |
options? |
TransactionOptions |
Promise<`0x${string}`>
setReputationRule(
ruleId,ruleConfig,options?):Promise<`0x${string}`>
Defined in: packages/enduser/src/CommunityClient.ts:336
| Parameter | Type |
|---|---|
ruleId |
bigint |
ruleConfig |
any |
options? |
TransactionOptions |
Promise<`0x${string}`>
setupCommunity(
params,options?):Promise<{hashes:`0x${string}`[];tokenAddress:`0x${string}`; }>
Defined in: packages/enduser/src/CommunityClient.ts:234
One-click Setup: Register Community + Deploy Token Orchestrates the complete community initialization flow.
| Parameter | Type |
|---|---|
params |
{ description?: string; logoURI?: string; name: string; stakeAmount?: bigint; tokenName: string; tokenSymbol: string; website?: string; } |
params.description? |
string |
params.logoURI? |
string |
params.name? |
string |
params.stakeAmount? |
bigint |
params.tokenName? |
string |
params.tokenSymbol? |
string |
params.website? |
string |
options? |
TransactionOptions |
Promise<{ hashes: `0x${string}`[]; tokenAddress: `0x${string}`; }>
transferCommunityTokenOwnership(
tokenAddress,newOwner,options?):Promise<`0x${string}`>
Defined in: packages/enduser/src/CommunityClient.ts:377
Transfer ownership of the Community Token
| Parameter | Type |
|---|---|
tokenAddress |
`0x${string}` |
newOwner |
`0x${string}` |
options? |
TransactionOptions |
Promise<`0x${string}`>