This library provides Veramo plugins to manage DIDs and verifiable credentials on LTO Network.
To install the library, you can use npm or yarn:
npm install @ltonetwork/veramo-pluginor
yarn add @ltonetwork/veramo-pluginThe LTO DID provider allows you to manage DIDs on the LTO Network blockchain.
import { createAgent } from '@veramo/core'
import { DIDManager } from '@veramo/did-manager'
import { LtoDidProvider } from '@lto-network/veramo-plugin'
const agent = createAgent<DIDManager>({
plugins: [
new DIDManager({
defaultProvider: 'did:lto',
providers: {
'did:lto': new LtoDidProvider({
nodeAddress: 'https://testnet.lto.network',
networkId: 'T',
}),
},
}),
],
})The LTO DID provider accepts the following options:
| Name | Type | Description |
|---|---|---|
| defaultKms | string | The default key management system (KMS). |
| lto | LTO | Optional. The LTO instance. |
| networkId | string | T for testnet or L for mainnet. Defaults to L |
| nodeAddress | string | Optional. URL of your LTO public node. |
| nodeApiKey | string | Optional. The node API key. |
| sponsor | Account | Optional. The sponsor account or information. |
In case an LTO instance is not provided, the provider will create one using the networkId, nodeAddress and
nodeApiKey options.
The sponsor option can be used to automatically sponsor the transaction fees for new DIDs. It can be either an
Account object or account settings.
new LtoDidProvider({
nodeAddress: 'https://testnet.lto.network',
networkId: 'T',
sponsor: {
seed: 'my seed',
keyType: 'ed25519',
address: '3JfLsayRvWbJh2JjEhCnfr6hKv8L1xUkH9p',
},
});Only seed or privateKey is required.
Contributions are welcome! If you encounter any issues or have suggestions for improvements, please create an issue or submit a pull request on the GitHub repository.
This library is licensed under the MIT License.
