Function useConsent

This hook returns helper functions for working with consent

  • Returns {
        allow: ((addresses: string[], skipPublish?: boolean) => Promise<void>);
        consentState: ((address: string) => Promise<ConsentState>);
        deny: ((addresses: string[], skipPublish?: boolean) => Promise<void>);
        entries: Partial<CachedConsentEntryMap>;
        isAllowed: ((address: string) => Promise<boolean>);
        isDenied: ((address: string) => Promise<boolean>);
        loadConsentList: ((startTime?: Date) => Promise<Map<string, ConsentState>>);
        refreshConsentList: (() => Promise<Map<string, ConsentState>>);
    }

    • allow: ((addresses: string[], skipPublish?: boolean) => Promise<void>)
        • (addresses, skipPublish?): Promise<void>
        • Parameters

          • addresses: string[]
          • skipPublish: boolean = false

          Returns Promise<void>

    • consentState: ((address: string) => Promise<ConsentState>)
        • (address): Promise<ConsentState>
        • Parameters

          • address: string

          Returns Promise<ConsentState>

    • deny: ((addresses: string[], skipPublish?: boolean) => Promise<void>)
        • (addresses, skipPublish?): Promise<void>
        • Parameters

          • addresses: string[]
          • skipPublish: boolean = false

          Returns Promise<void>

    • entries: Partial<CachedConsentEntryMap>
    • isAllowed: ((address: string) => Promise<boolean>)
        • (address): Promise<boolean>
        • Parameters

          • address: string

          Returns Promise<boolean>

    • isDenied: ((address: string) => Promise<boolean>)
        • (address): Promise<boolean>
        • Parameters

          • address: string

          Returns Promise<boolean>

    • loadConsentList: ((startTime?: Date) => Promise<Map<string, ConsentState>>)
        • (startTime?): Promise<Map<string, ConsentState>>
        • Parameters

          • OptionalstartTime: Date

          Returns Promise<Map<string, ConsentState>>

    • refreshConsentList: (() => Promise<Map<string, ConsentState>>)
        • (): Promise<Map<string, ConsentState>>
        • Returns Promise<Map<string, ConsentState>>