Optional
args: { Optional
customOptional
debug?: booleanOptional
network?: LIT_NETWORKS_KEYSOptional
options?: { Optional
storeOptional
privateOptional
provider?: anyOptional
randomOptional
rpc?: anyOptional
rpcs?: anyOptional
signer?: anyOptional
customOptional
optionsa list of PKP NFTs
(IERC721Enumerable)
Get all PKPs by a given address
Get info of 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
103309008291725705563022469659474510532358692659842796086905702509072063991354
QmZKLGf3vgYsboM7WVUS9X56cJSdLzQVacNp841wmEDRkW
transaction
Check if an address is permitted
Add permitted action to a given PKP id & ipfsId
103309008291725705563022469659474510532358692659842796086905702509072063991354
QmZKLGf3vgYsboM7WVUS9X56cJSdLzQVacNp841wmEDRkW
transaction
TODO: add transaction type Add permitted action to a given PKP id & ipfsId
103309008291725705563022469659474510532358692659842796086905702509072063991354
0x3B5dD2605.....22aDC499A1
transaction
Revoke permitted action of a given PKP id & ipfsId
103309008291725705563022469659474510532358692659842796086905702509072063991354
QmZKLGf3vgYsboM7WVUS9X56cJSdLzQVacNp841wmEDRkW
transaction
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.
The index of the token.
Example:
const capacity = await getCapacityByIndex(1); this.log(capacity); // Output: { // requestsPerMillisecond: 100, // expiresAt: { // timestamp: 1623472800, // formatted: '2022-12-31', // }, // }
}
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.
The address of the owner.
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, // }, // ... // ]
}
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.
The index of the token.
Example:
const URI = await getTokenURIByIndex(1); this.log(URI); // Output: 'https://tokens.com/1'
}
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
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
0x1220baa0d1e91f2a22fef53659418ddc3ac92da2a76d994041b86ed62c0c999de477
QmZKLGf3vgYsboM7WVUS9X56cJSdLzQVacNp841wmEDRkW
Static
contractStatic
loggerAdds a permitted action to the PKP permissions contract.
A promise that resolves to the result of 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.
Mints a new token with customer authentication.
The parameters for minting a new token with customer authentication.
Static
getRetrieves the connection information for a given network.
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.
An object containing the staking contract, epoch number, minimum node count and an array of bootstrap URLs.
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 network key.
Optional
context: LitContractContext | LitContractResolverContextThe contract context or contract resolver context.
Optional
rpcUrl: stringThe RPC URL.
The Staking contract instance.
Static
getOptional
context: LitContractContext | LitContractResolverContextOptional
rpcUrl: stringOptional
nodeProtocol: "http://" | "https://"
(IERC721Enumerable)
Get the x latest number of tokens