Ancient8 Connect UMD library.
This is the browser APIs version. The implementation below will be only valid when in browser environment.
For detail of browser APIs please refer the docs.
For detail of server APIs please refer the docs.
For detail of adapter APIs please refer the docs.
$ yarn add @ancient8/connect
Please see the demo here
Three main usages of A8Connect
.
import {
init,
closeModal,
openModal,
Types
} from "@ancient8/connect"
// Remember to import css stylesheet
import "@ancient8/connect/lib.css";
await init({
chainType: Types.Adapters.ChainType.ALL,
networkType:
Types.Providers.NetworkType.testnet ||
Types.Providers.NetworkType.mainnet,
disableCloseButton: true,
cleanWalletCache: false, // Enable this option to `true` to always show connect wallet popup.
onClose: () => {
// do something
},
onAuth: (payload) => {
// do something
console.log({payload});
},
onLoggedOut: () => {
// do something
},
onConnected: (payload) => {
// do something
console.log({payload});
},
onDisconnected: () => {
// do something
}
}).then(() => {
openModal();
});
import {
init,
closeModal,
openModal,
Types
} from "@ancient8/connect"
// Remember to import css stylesheet
import "@ancient8/connect/lib.css";
await init({
chainType: Types.Adapters.ChainType.ALL,
networkType:
Types.Providers.NetworkType.testnet ||
Types.Providers.NetworkType.mainnet,
initAppFlow: Types.Router.AppFlow.ADD_WALLET_FLOW,
cleanWalletCache: true,
onClose: () => {
// do something
},
onAuth: (payload) => {
// do something
console.log({payload});
},
onLoggedOut: () => {
// do something
},
onConnected: (payload) => {
// do something
console.log({payload});
},
onDisconnected: () => {
// do something
}
}).then(() => {
openModal();
});
import {
init,
closeModal,
openModal,
Types
} from "@ancient8/connect"
// Remember to import css stylesheet
import "@ancient8/connect/lib.css";
await init({
chainType: Types.Adapters.ChainType.ALL,
networkType:
Types.Providers.NetworkType.testnet ||
Types.Providers.NetworkType.mainnet,
initAppFlow: Types.Router.AppFlow.LOST_WALLET_FLOW,
withCredential: authToken as string,
cleanWalletCache: true,
onClose: () => {
// do something
},
onAuth: (payload) => {
// do something
console.log({payload});
},
onLoggedOut: () => {
// do something
},
onConnected: (payload) => {
// do something
console.log({payload});
},
onDisconnected: () => {
// do something
}
}).then(() => {
openModal();
});
This library is still in beta development. Significant changes may happen anytime.
If you have any inquiries please send emails to [email protected].
Copyright (c) 2022 Ancient8.
Licensed under the GPL-3.0
Generated using TypeDoc