bitbadgesjs-sdk - v0.22.7
    Preparing search index...

    Class BitBadgesAPI<T>

    This is the BitBadgesAPI class which provides all typed API calls to the BitBadges API. See official documentation for more details and examples. Must pass in a valid API key. , iGetDeveloperAppsPayload convertFunction is used to convert any responses returned by the API to your desired NumberType.

    import { BigIntify, Stringify, Numberify, BitBadgesAPI } from "bitbadgesjs-sdk";
    const BitBadgesApi = new BitBadgesAPI({ convertFunction: BigIntify, ....})
    const collections = await BitBadgesApi.getCollections(...);

    By default, we use the official API URL (https://api.bitbadges.io). You can override this by passing in a custom apiUrl.

    Type Parameters

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    Methods

    assertPositiveCollectionId assertPositiveInteger broadcastTx calculatePoints checkClaimSuccess checkIfSignedIn completeClaim createApplication createClaims createDeveloperApp createDynamicDataStore createSIWBBRequest createUtilityPage deleteApplication deleteClaims deleteDeveloperApp deleteDynamicDataStore deleteSIWBBRequest deleteUtilityPage exchangeSIWBBAuthorizationCode FilterTokensInCollection getAccount getAccounts getApplication getApplications getAttemptDataFromRequestBin getBalanceByAddress getBalanceByAddressSpecificToken getClaim getClaimActivityForUser getClaimAttempts getClaimAttemptStatus getClaims getCollection getCollectionAmountTrackerById getCollectionAmountTrackers getCollectionChallengeTrackerById getCollectionChallengeTrackers getCollectionClaims getCollectionListings getCollectionOwners getCollections getCollectionTransferActivity getDeveloperApp getDeveloperApps getDynamicDataActivity getDynamicDataStore getDynamicDataStores getDynamicDataStoreValue getDynamicDataStoreValuesPaginated getGatedContentForClaim getMap getMaps getMapValue getMapValues getOwners getPlugin getPlugins getPointsActivity getPointsActivityForUser getRefreshStatus getReservedClaimCodes getSearchResults getSIWBBRequestsForDeveloperApp getSiwbbRequestsForUser getStatus getTokenActivity getTokenMetadata getTokensViewForUser getTransferActivityForUser getUtilityPage getUtilityPages handleApiError performBatchStoreAction performStoreAction refreshMetadata revokeOauthAuthorization rotateSIWBBRequest searchApplications searchClaims searchDeveloperApps searchDynamicDataStores searchUtilityPages setAccessToken simulateClaim simulateTx unsetAccessToken updateApplication updateClaims updateDeveloperApp updateDynamicDataStore updateUtilityPage verifyOwnershipRequirements

    Constructors

    Properties

    accessToken: string = ''
    apiKey: undefined | string = process.env.BITBADGES_API_KEY
    appendedHeaders: Record<string, string> = {}
    axios: AxiosInstance = ...
    BACKEND_URL: string = ...
    ConvertFunction: (num: NumberType) => T

    Methods

    • For password based approvals, we hand out codes behind the scenes whenever a user requests a password. This is to prevent replay attacks on the blockchain. This API call will return a valid code if a valid password is provided.

      Each address is limited to one code per password. If the password is provided again, they will receive the same code.

      Parameters

      Returns Promise<CompleteClaimSuccessResponse>

      • API Route: POST /api/v0/claims/complete/:claimId/:address
      • SDK Function Call: await BitBadgesApi.completeClaim(claimId, address, { ...body });
      • Authentication: Must be signed in.
      const res = await BitBadgesApi.completeClaim(claimId, address, { ...body });
      console.log(res);