Hierarchy

  • LitContracts

Constructors

  • Parameters

    • Optional args: {
          debug?: boolean;
          options?: {
              storeOrUseStorageKey?: boolean;
          };
          privateKey?: string;
          provider?: any;
          randomPrivatekey?: boolean;
          rpc?: any;
          rpcs?: any;
          signer?: any;
      }
      • Optional debug?: boolean
      • Optional options?: {
            storeOrUseStorageKey?: boolean;
        }
        • Optional storeOrUseStorageKey?: boolean
      • Optional privateKey?: string
      • Optional provider?: any
      • Optional randomPrivatekey?: boolean
      • Optional rpc?: any
      • Optional rpcs?: any
      • Optional signer?: any

    Returns LitContracts

Properties

accessControlConditionsContract: {
    read: ContractContext;
    write: ContractContext;
}

Type declaration

  • read: ContractContext
  • write: ContractContext
allowlistContract: {
    read: ContractContext;
    write: ContractContext;
}

Type declaration

  • read: ContractContext
  • write: ContractContext
connected: boolean = false
contractResolverContract: {
    read: ContractContext;
    write: ContractContext;
}

Type declaration

  • read: ContractContext
  • write: ContractContext
debug: boolean = false
isPKP: boolean = false
litTokenContract: {
    read: ContractContext;
    write: ContractContext;
}

Type declaration

  • read: ContractContext
  • write: ContractContext
multisenderContract: {
    read: ContractContext;
    write: ContractContext;
}

Type declaration

  • read: ContractContext
  • write: ContractContext
options?: {
    storeOrUseStorageKey?: boolean;
}

Type declaration

  • Optional storeOrUseStorageKey?: boolean
pkpHelperContract: {
    read: ContractContext;
    write: ContractContext;
}

Type declaration

  • read: ContractContext
  • write: ContractContext
pkpNftContract: {
    read: ContractContext;
    write: ContractContext;
}

Type declaration

  • read: ContractContext
  • write: ContractContext
pkpNftContractUtil: {
    read: {
        getTokens: ((latestNumberOfTokens: number) => Promise<string[]>);
        getTokensByAddress: ((ownerAddress: string) => Promise<string[]>);
        getTokensInfoByAddress: ((ownerAddress: string) => Promise<TokenInfo[]>);
    };
    write: {
        mint: (() => Promise<{
            res: any;
            tokenId: any;
            tx: any;
        }>);
    };
} = ...

Type declaration

  • read: {
        getTokens: ((latestNumberOfTokens: number) => Promise<string[]>);
        getTokensByAddress: ((ownerAddress: string) => Promise<string[]>);
        getTokensInfoByAddress: ((ownerAddress: string) => Promise<TokenInfo[]>);
    }
    • getTokens: ((latestNumberOfTokens: number) => Promise<string[]>)
        • (latestNumberOfTokens: number): Promise<string[]>
        • (IERC721Enumerable)

          Get the x latest number of tokens

          Returns

          a list of PKP NFTs

          Parameters

          • latestNumberOfTokens: number

          Returns Promise<string[]>

    • getTokensByAddress: ((ownerAddress: string) => Promise<string[]>)
        • (ownerAddress: string): Promise<string[]>
        • (IERC721Enumerable)

          Get all PKPs by a given address

          Retu

          Parameters

          • ownerAddress: string

          Returns Promise<string[]>

    • getTokensInfoByAddress: ((ownerAddress: string) => Promise<TokenInfo[]>)
        • (ownerAddress: string): Promise<TokenInfo[]>
        • Get info of all PKPs by a given address

          Parameters

          • ownerAddress: string

          Returns Promise<TokenInfo[]>

  • write: {
        mint: (() => Promise<{
            res: any;
            tokenId: any;
            tx: any;
        }>);
    }
    • mint: (() => Promise<{
          res: any;
          tokenId: any;
          tx: any;
      }>)
        • (): Promise<{
              res: any;
              tokenId: any;
              tx: any;
          }>
        • Returns Promise<{
              res: any;
              tokenId: any;
              tx: any;
          }>

pkpPermissionsContract: {
    read: ContractContext;
    write: ContractContext;
}

Type declaration

  • read: ContractContext
  • write: ContractContext
pkpPermissionsContractUtil: {
    read: {
        getPermittedActions: ((tokenId: any) => Promise<any[]>);
        getPermittedAddresses: ((tokenId: string) => Promise<string[]>);
        isPermittedAction: ((pkpId: string, ipfsId: string) => Promise<boolean>);
        isPermittedAddress: ((tokenId: string, address: string) => Promise<boolean>);
    };
    write: {
        addPermittedAction: ((pkpId: string, ipfsId: string) => Promise<any>);
        addPermittedAddress: ((pkpId: string, ownerAddress: string) => Promise<any>);
        revokePermittedAction: ((pkpId: string, ipfsId: string) => Promise<any>);
    };
} = ...

Type declaration

  • read: {
        getPermittedActions: ((tokenId: any) => Promise<any[]>);
        getPermittedAddresses: ((tokenId: string) => Promise<string[]>);
        isPermittedAction: ((pkpId: string, ipfsId: string) => Promise<boolean>);
        isPermittedAddress: ((tokenId: string, address: string) => Promise<boolean>);
    }
    • getPermittedActions: ((tokenId: any) => Promise<any[]>)
        • (tokenId: any): Promise<any[]>
        • Get permitted action

          Returns

          Parameters

          • tokenId: any

          Returns Promise<any[]>

    • getPermittedAddresses: ((tokenId: string) => Promise<string[]>)
        • (tokenId: string): Promise<string[]>
        • Parameters

          • tokenId: string

          Returns Promise<string[]>

    • isPermittedAction: ((pkpId: string, ipfsId: string) => Promise<boolean>)
        • (pkpId: string, ipfsId: string): Promise<boolean>
        • Check if an action is permitted given the pkpid and ipfsId

          Returns

          transaction

          Parameters

          • pkpId: string

            103309008291725705563022469659474510532358692659842796086905702509072063991354

          • ipfsId: string

            QmZKLGf3vgYsboM7WVUS9X56cJSdLzQVacNp841wmEDRkW

          Returns Promise<boolean>

    • isPermittedAddress: ((tokenId: string, address: string) => Promise<boolean>)
        • (tokenId: string, address: string): Promise<boolean>
        • Check if an address is permitted

          Returns

          Parameters

          • tokenId: string
          • address: string

          Returns Promise<boolean>

  • write: {
        addPermittedAction: ((pkpId: string, ipfsId: string) => Promise<any>);
        addPermittedAddress: ((pkpId: string, ownerAddress: string) => Promise<any>);
        revokePermittedAction: ((pkpId: string, ipfsId: string) => Promise<any>);
    }
    • addPermittedAction: ((pkpId: string, ipfsId: string) => Promise<any>)
        • (pkpId: string, ipfsId: string): Promise<any>
        • Add permitted action to a given PKP id & ipfsId

          Returns

          transaction

          Parameters

          • pkpId: string

            103309008291725705563022469659474510532358692659842796086905702509072063991354

          • ipfsId: string

            QmZKLGf3vgYsboM7WVUS9X56cJSdLzQVacNp841wmEDRkW

          Returns Promise<any>

    • addPermittedAddress: ((pkpId: string, ownerAddress: string) => Promise<any>)
        • (pkpId: string, ownerAddress: string): Promise<any>
        • TODO: add transaction type Add permitted action to a given PKP id & ipfsId

          Returns

          transaction

          Parameters

          • pkpId: string

            103309008291725705563022469659474510532358692659842796086905702509072063991354

          • ownerAddress: string

            0x3B5dD2605.....22aDC499A1

          Returns Promise<any>

    • revokePermittedAction: ((pkpId: string, ipfsId: string) => Promise<any>)
        • (pkpId: string, ipfsId: string): Promise<any>
        • Revoke permitted action of a given PKP id & ipfsId

          Returns

          transaction

          Parameters

          • pkpId: string

            103309008291725705563022469659474510532358692659842796086905702509072063991354

          • ipfsId: string

            QmZKLGf3vgYsboM7WVUS9X56cJSdLzQVacNp841wmEDRkW

          Returns Promise<any>

privateKey: string
provider: any
pubkeyRouterContract: {
    read: ContractContext;
    write: ContractContext;
}

Type declaration

  • read: ContractContext
  • write: ContractContext
randomPrivateKey: boolean = false
rateLimitNftContract: {
    read: ContractContext;
    write: ContractContext;
}

Type declaration

  • read: ContractContext
  • write: ContractContext
rateLimitNftContractUtil: {
    read: {
        getCapacityByIndex: ((index: number) => Promise<any>);
        getTokenURIByIndex: ((index: number) => Promise<string>);
        getTokens: (() => Promise<any>);
        getTokensByOwnerAddress: ((ownerAddress: string) => Promise<any>);
    };
    write: {
        mint: ((__namedParameters: {
            mintCost: {
                value: any;
            };
            timestamp: number;
        }) => Promise<{
            tokenId: any;
            tx: any;
        }>);
        transfer: ((__namedParameters: {
            RLITokenAddress: string;
            fromAddress: string;
            toAddress: string;
        }) => Promise<any>);
    };
} = ...

Type declaration

  • read: {
        getCapacityByIndex: ((index: number) => Promise<any>);
        getTokenURIByIndex: ((index: number) => Promise<string>);
        getTokens: (() => Promise<any>);
        getTokensByOwnerAddress: ((ownerAddress: string) => Promise<any>);
    }
    • getCapacityByIndex: ((index: number) => Promise<any>)
        • (index: number): Promise<any>
        • 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.

          Returns

          • A promise that resolves to the capacity of the token.

          Example:

          const capacity = await getCapacityByIndex(1); this.log(capacity); // Output: { // requestsPerMillisecond: 100, // expiresAt: { // timestamp: 1623472800, // formatted: '2022-12-31', // }, // }

          }

          Parameters

          • index: number

            The index of the token.

          Returns Promise<any>

    • getTokenURIByIndex: ((index: number) => Promise<string>)
        • (index: number): Promise<string>
        • 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.

          Returns

          • A promise that resolves to the URI of the token.

          Example:

          const URI = await getTokenURIByIndex(1); this.log(URI); // Output: 'https://tokens.com/1'

          }

          Parameters

          • index: number

            The index of the token.

          Returns Promise<string>

    • getTokens: (() => Promise<any>)
        • (): Promise<any>
        • getTokens: async (): Promise => {

          This function returns an array of all tokens that have been minted.

          Returns

          • A promise that resolves to an array of token objects.

          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, // }, // ... // ]

          }

          Returns Promise<any>

    • getTokensByOwnerAddress: ((ownerAddress: string) => Promise<any>)
        • (ownerAddress: string): Promise<any>
        • 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.

          Returns

          • A promise that resolves to an array of token objects.

          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, // }, // ... // ]

          }

          Parameters

          • ownerAddress: string

            The address of the owner.

          Returns Promise<any>

  • write: {
        mint: ((__namedParameters: {
            mintCost: {
                value: any;
            };
            timestamp: number;
        }) => Promise<{
            tokenId: any;
            tx: any;
        }>);
        transfer: ((__namedParameters: {
            RLITokenAddress: string;
            fromAddress: string;
            toAddress: string;
        }) => Promise<any>);
    }
    • mint: ((__namedParameters: {
          mintCost: {
              value: any;
          };
          timestamp: number;
      }) => Promise<{
          tokenId: any;
          tx: any;
      }>)
        • (__namedParameters: {
              mintCost: {
                  value: any;
              };
              timestamp: number;
          }): Promise<{
              tokenId: any;
              tx: any;
          }>
        • Parameters

          • __namedParameters: {
                mintCost: {
                    value: any;
                };
                timestamp: number;
            }
            • mintCost: {
                  value: any;
              }
              • value: any
            • timestamp: number

          Returns Promise<{
              tokenId: any;
              tx: any;
          }>

    • transfer: ((__namedParameters: {
          RLITokenAddress: string;
          fromAddress: string;
          toAddress: string;
      }) => Promise<any>)
        • (__namedParameters: {
              RLITokenAddress: string;
              fromAddress: string;
              toAddress: string;
          }): Promise<any>
        • Transfer RLI token from one address to another

          Property

          Property

          Property

          Returns

          void

          Parameters

          • __namedParameters: {
                RLITokenAddress: string;
                fromAddress: string;
                toAddress: string;
            }
            • RLITokenAddress: string
            • fromAddress: string
            • toAddress: string

          Returns Promise<any>

routerContractUtil: {
    read: {};
    write: {};
} = ...

Type declaration

  • read: {}
    • write: {}
      rpc: string
      rpcs: string[]
      signer: Signer | Wallet
      stakingContract: {
          read: ContractContext;
          write: ContractContext;
      }

      Type declaration

      • read: ContractContext
      • write: ContractContext
      utils: {
          decToHex: any;
          getBytes32FromMultihash: ((ipfsId: string) => any);
          getBytesFromMultihash: ((multihash: string) => string);
          getMultihashFromBytes: ((byte32: string) => string);
          hexToDec: any;
          timestamp2Date: ((timestamp: string) => string);
      } = ...

      Type declaration

      • decToHex: any
      • getBytes32FromMultihash: ((ipfsId: string) => any)
          • (ipfsId: string): any
          • Partition multihash string into object representing multihash

            Returns

            Parameters

            • ipfsId: string

            Returns any

      • getBytesFromMultihash: ((multihash: string) => string)
          • (multihash: string): string
          • Partition multihash string into object representing multihash

            Returns

            Parameters

            • multihash: string

              A base58 encoded multihash string

            Returns string

      • getMultihashFromBytes: ((byte32: string) => string)
          • (byte32: string): string
          • Convert bytes32 to IPFS ID

            Returns

            QmZKLGf3vgYsboM7WVUS9X56cJSdLzQVacNp841wmEDRkW

            Parameters

            • byte32: string

              0x1220baa0d1e91f2a22fef53659418ddc3ac92da2a76d994041b86ed62c0c999de477

            Returns string

      • hexToDec: any
      • timestamp2Date: ((timestamp: string) => string)
          • (timestamp: string): string
          • Parameters

            • timestamp: string

            Returns string

      Methods

      Generated using TypeDoc