Optional
args: { Optional
customOptional
debug?: booleanOptional
network?: LIT_NETWORKS_KEYSOptional
options?: { Optional
storeOptional
privateOptional
provider?: anyOptional
randomOptional
rpc?: anyOptional
rpcs?: anyOptional
signer?: anyOptional
customOptional
optionsOptional
store(IERC721Enumerable)
Get the x latest number of tokens
a list of PKP NFTs
(IERC721Enumerable)
Get all PKPs by a given address
Optional
param: GasLimitParamGet permitted action
Get permitted addresses
Check if an action is permitted given the pkpid and ipfsId
transaction
103309008291725705563022469659474510532358692659842796086905702509072063991354
QmZKLGf3vgYsboM7WVUS9X56cJSdLzQVacNp841wmEDRkW
Check if an address is permitted
Add permitted action to a given PKP id & ipfsId
transaction
103309008291725705563022469659474510532358692659842796086905702509072063991354
QmZKLGf3vgYsboM7WVUS9X56cJSdLzQVacNp841wmEDRkW
TODO: add transaction type Add permitted action to a given PKP id & ipfsId
transaction
103309008291725705563022469659474510532358692659842796086905702509072063991354
0x3B5dD2605.....22aDC499A1
Revoke permitted action of a given PKP id & ipfsId
transaction
103309008291725705563022469659474510532358692659842796086905702509072063991354
QmZKLGf3vgYsboM7WVUS9X56cJSdLzQVacNp841wmEDRkW
getCapacityByIndex: async (index: number): Promise
This function takes a token index as a parameter and returns the capacity of the token with the given index. The capacity is an object that contains the number of requests per millisecond that the token allows, and an object with the expiration timestamp and formatted expiration date of the token.
Example:
const capacity = await getCapacityByIndex(1); this.log(capacity); // Output: { // requestsPerMillisecond: 100, // expiresAt: { // timestamp: 1623472800, // formatted: '2022-12-31', // }, // }
}
The index of the token.
getTokenURIByIndex: async (index: number): Promise
This function takes a token index as a parameter and returns the URI of the token with the given index.
Example:
const URI = await getTokenURIByIndex(1); this.log(URI); // Output: 'https://tokens.com/1'
}
The index of the token.
getTokens: async (): Promise
This function returns an array of all tokens that have been minted.
Example:
const tokens = await getTokens(); this.log(tokens); // Output: [ // { // tokenId: 1, // URI: 'https://tokens.com/1', // capacity: 100, // isExpired: false, // }, // { // tokenId: 2, // URI: 'https://tokens.com/2', // capacity: 200, // isExpired: true, // }, // ... // ]
}
getTokensByOwnerAddress: async (ownerAddress: string): Promise
This function takes an owner address as a parameter and returns an array of tokens that are owned by the given address.
Example:
const tokens = await getTokensByOwnerAddress('0x1234...5678'); this.log(tokens); // Output: [ // { // tokenId: 1, // URI: 'https://tokens.com/1', // capacity: 100, // isExpired: false, // }, // { // tokenId: 2, // URI: 'https://tokens.com/2', // capacity: 200, // isExpired: true, // }, // ... // ]
}
The address of the owner.
Transfer RLI token from one address to another
void
NOTE: This function requires the "multiformats/cid" package in order to work
Partition multihash string into object representing multihash
const CID = require('multiformats/cid')
const ipfsId = 'QmZKLGf3vgYsboM7WVUS9X56cJSdLzQVacNp841wmEDRkW'
const bytes32 = getBytes32FromMultihash(ipfsId, CID)
console.log(bytes32)
A base58 encoded multihash string
The CID object from the "multiformats/cid" package
Partition multihash string into object representing multihash
A base58 encoded multihash string
Convert bytes32 to IPFS ID
QmZKLGf3vgYsboM7WVUS9X56cJSdLzQVacNp841wmEDRkW
0x1220baa0d1e91f2a22fef53659418ddc3ac92da2a76d994041b86ed62c0c999de477
Static
contractStatic
loggerPrivate
_callPrivate
_getAdds a permitted action to the PKP permissions contract.
A promise that resolves to the result of the write operation.
If an error occurs during the write operation.
Adds a permitted authentication method for a given PKP token.
The parameters for adding the permitted authentication method.
The ID of the authentication method.
The scopes of the authentication method.
The type of the authentication method.
The ID of the PKP token.
Optional
webThe public key for WebAuthn.
Mint a Capacity Credits NFT (RLI) token with the specified daily request rate and expiration period. The expiration date is calculated to be at midnight UTC, a specific number of days from now.
The minting context.
Mints a new token with authentication.
An object containing the PKP information and the transaction receipt.
Error if the contracts are not connected, the contract is not available, authMethodType or accessToken is missing, or permission scopes are required.
Mints a new token with customer authentication.
The parameters for minting a new token with customer authentication.
Static
Private
_getOptional
contractNames: (keyof ExclusiveLitContractContext)[]Static
Private
_resolveStatic
getRetrieves the connection information for a given network.
An object containing the staking contract, epoch number, minimum node count and an array of bootstrap URLs.
Error if the minimum validator count is not set or if the active validator set does not meet the threshold.
The key representing the network.
Optional
networkOptional network context for the contract.
Optional
nodeOptional protocol for the network node.
Optional
rpcOptional RPC URL for the network.
Static
getOptional
context: LitContractContext | LitContractResolverContextStatic
getOptional
context: LitContractContext | LitContractResolverContextOptional
rpcUrl: stringStatic
getRetrieves the Staking contract instance based on the provided network, context, and RPC URL. If a context is provided, it determines if a contract resolver is used for bootstrapping contracts. If a resolver address is present in the context, it retrieves the Staking contract from the contract resolver instance. Otherwise, it retrieves the Staking contract using the contract address and ABI from the contract context. Throws an error if required contract data is missing or if the Staking contract cannot be obtained.
The Staking contract instance.
Error if required contract data is missing or if the Staking contract cannot be obtained.
The network key.
Optional
context: LitContractContext | LitContractResolverContextThe contract context or contract resolver context.
Optional
rpcUrl: stringThe RPC URL.
Static
getOptional
context: LitContractContext | LitContractResolverContextOptional
rpcUrl: stringOptional
nodeProtocol: anyGenerated using TypeDoc
Returns