Class Client<ContentTypes>
Constructors
constructor
new Client < ContentTypes > ( publicKeyBundle , apiClient , backupClient , keystore ) : Client < ContentTypes >
Returns Client < ContentTypes >
Properties
contacts
contacts : Set < string >
Accessors
backup Type
get backupType( ) : BackupType
Returns BackupType
Methods
can Message
can Message ( peerAddress ) : Promise < boolean >
Returns Promise < boolean >
can Message ( peerAddress ) : Promise < boolean [] >
Returns Promise < boolean [] >
close
close ( ) : Promise < void >
Returns Promise < void >
decode Content
decode Content ( contentBytes ) : Promise < { content : ContentTypes ; contentFallback ?: string ; contentType : ContentTypeId ; error ?: Error ; } >
Returns Promise < { content : ContentTypes ; contentFallback ?: string ; contentType : ContentTypeId ; error ?: Error ; } >
encode Content
encode Content ( content , options ? ) : Promise < Uint8Array >
Returns Promise < Uint8Array >
forget Contact
forget Contact ( peerAddress ) : void
Returns void
list Envelopes
list Envelopes < Out > ( topic , mapper , opts ? ) : Promise < Out [] >
Parameters
topic : string
mapper : EnvelopeMapper < Out >
Returns Promise < Out [] >
list Envelopes Paginated
list Envelopes Paginated < Out > ( contentTopic , mapper , opts ? ) : AsyncGenerator < Out [] , any , unknown >
Parameters
contentTopic : string
mapper : EnvelopeMapper < Out >
Returns AsyncGenerator < Out [] , any , unknown >
list Invitations
list Invitations ( opts ? ) : Promise < Envelope [] >
Returns Promise < Envelope [] >
publish Envelopes
publish Envelopes ( envelopes ) : Promise < void >
Returns Promise < void >
publish User Contact
publish User Contact ( legacy ? ) : Promise < void >
Returns Promise < void >
Static
can Message
can Message ( peerAddress , opts ? ) : Promise < boolean >
Returns Promise < boolean >
can Message ( peerAddress , opts ? ) : Promise < boolean [] >
Returns Promise < boolean [] >
Static
create
create < ContentCodecs > ( wallet , opts ? ) : Promise < Client < undefined | ExtractDecodedType < [ ... ContentCodecs [] , TextCodec ] [ number ] > > >
Parameters
wallet : null | { account : undefined | Account ; addChain : ( ( args ) => Promise < void > ) ; batch ?: { multicall ?: boolean | ( { batchSize?: number | undefined; wait?: number | undefined; }) ; } ; cacheTime : number ; chain : undefined | Chain ; deployContract : ( < const TAbi , TChainOverride > ( args ) => Promise < ` 0x ${ string } ` > ) ; extend : ( < const client > ( fn ) => Client < Transport , undefined | Chain , undefined | Account , WalletRpcSchema , ( { [K in keyof client]: client[K]; }) & WalletActions < undefined | Chain , undefined | Account > > ) ; getAddresses : ( ( ) => Promise < GetAddressesReturnType > ) ; getChainId : ( ( ) => Promise < number > ) ; getPermissions : ( ( ) => Promise < GetPermissionsReturnType > ) ; key : string ; name : string ; pollingInterval : number ; prepareTransactionRequest : ( < TChainOverride > ( args ) => Promise < PrepareTransactionRequestReturnType > ) ; request : EIP1193RequestFn < WalletRpcSchema > ; requestAddresses : ( ( ) => Promise < RequestAddressesReturnType > ) ; requestPermissions : ( ( args ) => Promise < RequestPermissionsReturnType > ) ; sendRawTransaction : ( ( args ) => Promise < ` 0x ${ string } ` > ) ; sendTransaction : ( < TChainOverride > ( args ) => Promise < ` 0x ${ string } ` > ) ; signMessage : ( ( args ) => Promise < ` 0x ${ string } ` > ) ; signTransaction : ( < TChainOverride > ( args ) => Promise < ` 0x ${ string } ` > ) ; signTypedData : ( < const TTypedData , TPrimaryType > ( args ) => Promise < ` 0x ${ string } ` > ) ; switchChain : ( ( args ) => Promise < void > ) ; transport : TransportConfig < string , EIP1193RequestFn > & Record < string , any > ; type : string ; uid : string ; watchAsset : ( ( args ) => Promise < boolean > ) ; writeContract : ( < const TAbi , TFunctionName , TChainOverride > ( args ) => Promise < ` 0x ${ string } ` > ) ; } | Signer
Static
get Keys
get Keys < U > ( wallet , opts ? ) : Promise < Uint8Array >
Parameters
wallet : null | { account : undefined | Account ; addChain : ( ( args ) => Promise < void > ) ; batch ?: { multicall ?: boolean | ( { batchSize?: number | undefined; wait?: number | undefined; }) ; } ; cacheTime : number ; chain : undefined | Chain ; deployContract : ( < const TAbi , TChainOverride > ( args ) => Promise < ` 0x ${ string } ` > ) ; extend : ( < const client > ( fn ) => Client < Transport , undefined | Chain , undefined | Account , WalletRpcSchema , ( { [K in keyof client]: client[K]; }) & WalletActions < undefined | Chain , undefined | Account > > ) ; getAddresses : ( ( ) => Promise < GetAddressesReturnType > ) ; getChainId : ( ( ) => Promise < number > ) ; getPermissions : ( ( ) => Promise < GetPermissionsReturnType > ) ; key : string ; name : string ; pollingInterval : number ; prepareTransactionRequest : ( < TChainOverride > ( args ) => Promise < PrepareTransactionRequestReturnType > ) ; request : EIP1193RequestFn < WalletRpcSchema > ; requestAddresses : ( ( ) => Promise < RequestAddressesReturnType > ) ; requestPermissions : ( ( args ) => Promise < RequestPermissionsReturnType > ) ; sendRawTransaction : ( ( args ) => Promise < ` 0x ${ string } ` > ) ; sendTransaction : ( < TChainOverride > ( args ) => Promise < ` 0x ${ string } ` > ) ; signMessage : ( ( args ) => Promise < ` 0x ${ string } ` > ) ; signTransaction : ( < TChainOverride > ( args ) => Promise < ` 0x ${ string } ` > ) ; signTypedData : ( < const TTypedData , TPrimaryType > ( args ) => Promise < ` 0x ${ string } ` > ) ; switchChain : ( ( args ) => Promise < void > ) ; transport : TransportConfig < string , EIP1193RequestFn > & Record < string , any > ; type : string ; uid : string ; watchAsset : ( ( args ) => Promise < boolean > ) ; writeContract : ( < const TAbi , TFunctionName , TChainOverride > ( args ) => Promise < ` 0x ${ string } ` > ) ; } | Signer
Returns Promise < Uint8Array >
Static
is Snaps Ready
is Snaps Ready ( ) : Promise < boolean >
Returns Promise < boolean >
Client class initiates connection to the XMTP network. Should be created with
await Client.create(options)