Links

Litecoin

Develop Litecoin dApps

Transfer request

window.xfi.litecoin.request(
{
method: "transfer",
params: [
{
feeRate,
from,
recipient,
amount,
memo,
},
],
},
(error, result) => {
console.debug(error, result);
this.lastResult = { error, result };
}
);

Accounts request

if (window.xfi && window.xfi.litecoin) {
window.xfi.request(
{method: 'request_accounts', params: []},
(error, accounts) => console.log(`Litecoin accounts ${accounts}`)
);
}

Result example

{
"error": null,
"result": [ "ltc1qsl07yp7x8997762pdqwmncs7ej84lsxae83yjt" ]
}

Events

chainChanged

if (window.xfi && window.xfi.litecoin) {
const provider = window.xfi.litecoin;
provider.on("chainChanged", (obj) => {
console.log(`chainChanged::${obj.chainId}`, obj);
});
}

accountsChanged

if (window.xfi && window.xfi.litecoin) {
const provider = window.xfi.litecoin
provider.on("accountsChanged", (obj) => {
console.log(`accountsChanged::${obj.chainId}`, obj);
});
}
Last modified 11mo ago
XDEFI Technologies 2024