Closed ahonn closed 1 year ago
You can try the getOffChainLocks or getOnChainLocks
await window.ckb.request({
method: 'wallet_fullOwnership_getOffChainLocks',
params: { change: 'internal' }
});
To parse a lock to an address, we can use the @ckb-lumos/helpers
import { encodeToAddress } from '@ckb-lumos/helpers'
console.log(encodeToAddress(fetchedScript))
Thanks, And it would be even better if encodeToAddress or method like wallet_getAddress
could be built-in.
Thanks, And it would be even better if encodeToAddress or method like
wallet_getAddress
could be built-in.
Address is indeed easier to understand with, but the address is relative, the mainnet address is different from other networks, so to keep return of getXLocks
be correct, lock may be a better choice. Even more, we recommend to de-emphasize the concept of the address in dApp and use nickname instead, because in the UTxO model, addresses can easily change over time
It seems that the CKB address is not displayed in the extension, and no method for returning the address was found in the provided RPC interface.