Get Started
Requirements
Install the DOSafe SDK
Creating your wallet SDK
1
2
const walletSDK = new DOSafeSDK({
appName: "Your App Name",
appLogoUrl: "Your App Logo URL",
backendUrl: " Our Authentication Endpoint", // Backend URL
walletUrl: " Our Wallet Endpoint", // Production URL
ecosystemId: "Your Ecosystem ID",
tokens: tokens,
contractNFTs: contractNFTs,
chainsSupported: [43113, 3939],
policies: policyConfigurations,
webPublicKey: "Your_Web_Public_Key",
typeSDK: "popup", // 'sdk' or 'popup'
explorerUrl: "https://testnet.snowtrace.io",
chainDefault: 43113,
});3
4
const tokenConfigurations = {
"43113": { // Avalanche Fuji Testnet
"AVAX": {
symbol: "AVAX",
decimals: 18,
contract: "", // Empty for native tokens
provider: "https://avalanche-fuji-c-chain-rpc.publicnode.com",
type: "native",
abi: [],
},
"SECOND": {
symbol: "SECOND",
decimals: 18,
contract: "0x10627F7D8117c4BdB9409813b47da5B21CAB5F9b",
provider: "https://avalanche-fuji-c-chain-rpc.publicnode.com",
type: "erc20",
abi: [],
},
},
"3939": { // DOS Chain Testnet
"DOS": {
symbol: "DOS",
decimals: 18,
contract: "",
provider: "https://test.doschain.com",
type: "native",
abi: [],
},
"SECOND": {
symbol: "SECOND",
decimals: 18,
contract: "0x17a11Dd7095555E26275F2DE38Ba4548229f5bbc",
provider: "https://test.doschain.com",
type: "erc20",
abi: [],
},
}
};
NFT configuration (contractNFTs)
The contractNFTs parameter accepts an array of objects:
const nftConfigurations = [
{
chainId: 43113,
contract: "0x7979c2815CD58184Bd91082CDe5E001f18b22368",
abi: [],
},
{
chainId: 3939,
contract: "0x5f33e2db1448933f8e3B5a630E01D8E357bFe62F",
abi: [],
}
];
Policy configuration (policies)
The policies parameter requires an object mapping chain IDs to policy identifiers:
const policyConfigurations = {
"43113": "pol_avalanche_policy_id",
"3939": "pol_dos_chain_policy_id",
};SDK methods
Last updated
Was this helpful?