AVMWebClient
diff --git a/api-reference/avm-web-provider.html b/api-reference/avm-web-provider.html index 884e5dd..b874c2a 100644 --- a/api-reference/avm-web-provider.html +++ b/api-reference/avm-web-provider.html @@ -4,8 +4,8 @@AVMWebProvider
diff --git a/api-reference/errors.html b/api-reference/errors.html index 01f26a6..10d1942 100644 --- a/api-reference/errors.html +++ b/api-reference/errors.html @@ -4,8 +4,8 @@Errors
diff --git a/api-reference/types.html b/api-reference/types.html index 10cea68..1587bb2 100644 --- a/api-reference/types.html +++ b/api-reference/types.html @@ -4,8 +4,8 @@Types
diff --git a/assets/js/2f03465d.063e0da1.js b/assets/js/2f03465d.063e0da1.js new file mode 100644 index 0000000..211ef98 --- /dev/null +++ b/assets/js/2f03465d.063e0da1.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_agoralabs_sh_avm_web_provider=self.webpackChunk_agoralabs_sh_avm_web_provider||[]).push([[524],{848:function(e,r,n){n.r(r),n.d(r,{assets:function(){return p},contentTitle:function(){return l},default:function(){return v},frontMatter:function(){return d},metadata:function(){return c},toc:function(){return h}});var o=n(7624),a=n(4552),i=n(3500),t=n(6568),s=n(6200);const d={},l="Throwing An Error",c={id:"providers/throwing-an-error",title:"Throwing An Error",description:"Clients
diff --git a/clients/disabling-a-client.html b/clients/disabling-a-client.html index a4109f8..776dff7 100644 --- a/clients/disabling-a-client.html +++ b/clients/disabling-a-client.html @@ -4,8 +4,8 @@Disabling A Client
@@ -19,11 +19,11 @@cautionIf any providers do not support the disable
method, then a MethodNotSupportedError
should be returned.
If any providers do not support the disable
method, then a MethodNotSupportedError
should be returned.
Disabling the client with a specific provider and network​
If you want to target a specific provider and network, you can simply pass the ID of the provider and the genesis hash of the network in the params:
-- Javascript
- TypeScript
// initialized client
client.onDisable(({ error, result }) => {
if (error) {
console.error('error:', error);
return;
}
console.log(result);
/*
genesisHash: 'SGO1GKSzyE7IEPItTxCByw9x8FmnrCDexi9/cOUJOiI=',
genesisId: 'testnet-v1.0',
providerId: '02657eaf-be17-4efc-b0a4-19d654b2448e',
}
*/
});
// send a disable request
client.disable({
genesisHash: 'SGO1GKSzyE7IEPItTxCByw9x8FmnrCDexi9/cOUJOiI=',
providerId: '02657eaf-be17-4efc-b0a4-19d654b2448e',
});
import { IAVMWebClientCallbackOptions } from '@agoralabs-sh/avm-web-provider';
const providerId: string = '02657eaf-be17-4efc-b0a4-19d654b2448e';
// initialized client
client.onEnable(({ error, result }: IAVMWebClientCallbackOptions) => {
if (error) {
console.error('error:', error);
return;
}
console.log(result);
/*
{
genesisHash: 'SGO1GKSzyE7IEPItTxCByw9x8FmnrCDexi9/cOUJOiI=',
genesisId: 'testnet-v1.0',
providerId: '02657eaf-be17-4efc-b0a4-19d654b2448e',
}
*/
});
// send a disable request
client.disable({
genesisHash: 'SGO1GKSzyE7IEPItTxCByw9x8FmnrCDexi9/cOUJOiI=',
providerId: '02657eaf-be17-4efc-b0a4-19d654b2448e',
});
- Javascript
- TypeScript
// initialized client
client.onDisable(({ error, result }) => {
if (error) {
console.error('error:', error);
return;
}
console.log(result);
/*
genesisHash: 'SGO1GKSzyE7IEPItTxCByw9x8FmnrCDexi9/cOUJOiI=',
genesisId: 'testnet-v1.0',
providerId: '02657eaf-be17-4efc-b0a4-19d654b2448e',
}
*/
});
// send a disable request
client.disable({
genesisHash: 'SGO1GKSzyE7IEPItTxCByw9x8FmnrCDexi9/cOUJOiI=',
providerId: '02657eaf-be17-4efc-b0a4-19d654b2448e',
});
import { IAVMWebClientCallbackOptions } from '@agoralabs-sh/avm-web-provider';
const providerId: string = '02657eaf-be17-4efc-b0a4-19d654b2448e';
// initialized client
client.onDisable(({ error, result }: IAVMWebClientCallbackOptions) => {
if (error) {
console.error('error:', error);
return;
}
console.log(result);
/*
{
genesisHash: 'SGO1GKSzyE7IEPItTxCByw9x8FmnrCDexi9/cOUJOiI=',
genesisId: 'testnet-v1.0',
providerId: '02657eaf-be17-4efc-b0a4-19d654b2448e',
}
*/
});
// send a disable request
client.disable({
genesisHash: 'SGO1GKSzyE7IEPItTxCByw9x8FmnrCDexi9/cOUJOiI=',
providerId: '02657eaf-be17-4efc-b0a4-19d654b2448e',
});
If the network and the provider ID is specified, and the provider does not support the network, then a NetworkNotSupportedError
should be thrown.
Disabling a client for a specific session​
If you want to remove a specific session, you can provide the session ID(s) in the params:
-- Javascript
- TypeScript
// initialized client
client.onDisable(({ error, result }) => {
if (error) {
console.error('error:', error);
return;
}
console.log(result);
/*
{
genesisHash: 'SGO1GKSzyE7IEPItTxCByw9x8FmnrCDexi9/cOUJOiI=',
genesisId: 'testnet-v1.0',
providerId: '02657eaf-be17-4efc-b0a4-19d654b2448e',
sessionIds: ['ab192498-0c63-4028-80fd-f148710611d8'],
}
*/
});
// send a disable request
client.disable({
sessionIds: ['ab192498-0c63-4028-80fd-f148710611d8'],
});
import { IAVMWebClientCallbackOptions } from '@agoralabs-sh/avm-web-provider';
// initialized client
client.onEnable(({ error, result }: IAVMWebClientCallbackOptions) => {
if (error) {
console.error('error:', error);
return;
}
console.log(result);
/*
{
genesisHash: 'SGO1GKSzyE7IEPItTxCByw9x8FmnrCDexi9/cOUJOiI=',
genesisId: 'testnet-v1.0',
providerId: '02657eaf-be17-4efc-b0a4-19d654b2448e',
sessionIds: ['ab192498-0c63-4028-80fd-f148710611d8'],
}
*/
});
// send a disable request
client.disable({
sessionIds: ['ab192498-0c63-4028-80fd-f148710611d8'],
});