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
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
loggerAdds 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.
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.
const customAuthMethodOwnedPkp =
await alice.contractsClient.mintWithCustomAuth({
authMethodId: 'custom-app-user-id',
authMethod: customAuthMethod,
scopes: [AuthMethodScope.SignAnything],
});
Static
Private
_getOptional
contractNames: (keyof LitContractContext)[]Static
Private
_resolveStatic
getOptional
context: LitContractContext | LitContractResolverContextStatic
getOptional
context: LitContractContext | LitContractResolverContextOptional
rpcUrl: stringStatic
getOptional
context: LitContractContext | LitContractResolverContextOptional
rpcUrl: stringStatic
getOptional
context: LitContractContext | LitContractResolverContextOptional
rpcUrl: stringOptional
nodeProtocol: anyGenerated using TypeDoc
Returns