Back to Top

node-cheeze-wizards-api master

Cheeze Wizards API Node Wrapper

ALCHEMY_API_URL()

Cheeze Wizards Alchemy API url

Returns

String

Returns Cheeze Wizards Alchemy API url https://cheezewizards.alchemyapi.io

WIZARDS_BASE_PATH()

Wizards path

Returns

String

Returns '/wizards/' path

DUELS_BASE_PATH()

Duels path

Returns

String

Returns '/duels/' path

CheezeWizardsAPI(email, apiToken)

Cheeze Wizards API Client

Parameters

Name Type Description
email String

Email used to get API token

apiToken String

API token

Examples

const cheezeWizardsAPI = new CheezeWizardsAPI('[email protected]', 'your-api-token');
cheezeWizardsAPI
    .wizard(1)
    .then(response => {
        console.log(response.data);
        console.log(response.status);
    })
    .catch(error => {
        console.log(error);
    });

Returns

Function

Returns an empty function

CheezeWizardsAPI._get(url, params)

GET method for Cheeze Wizards API

Parameters

Name Type Description
url String

GET request url

params Object

GET request params

Returns

Promise

Returns a promise

CheezeWizardsAPI.duel([duelId])

Method to get a duel by id Fallback to get all duels if you forget id

Parameters

Name Type Description
duelId Integer

Duel Id

Optional

Examples

cheezeWizardsAPI.duel();
cheezeWizardsAPI.duel(1);

Returns

Promise

Returns a promise

CheezeWizardsAPI.duels(params)

Method to get duels by block, wizard, status, ... Fallback to get all wizards if you forget params

Parameters

Name Type Description
params Object

Query parameters

params.startsAfter Integer

Duels that start after this block number

params.startsBefore Integer

Duels that start before this block number

params.endsAfter Integer

Duels that end after this block number

params.endsBefore Integer

Duels that end before this block number

params.wizardIds Array

Duels involving these wizards (coma separated list of wizardIds)

params.excludeInProgress Boolean

True for completed duels, false for all duels (default)

params.excludeFinished Boolean

True for duels in progress, false for all duels (default)

Examples

cheezeWizardsAPI.duels();
cheezeWizardsAPI.duels({
 startsAfter: 8262502,
 wizardIds: [3, 4],
});

Returns

Promise

Returns a promise

CheezeWizardsAPI.wizard([wizardId])

Method to get a wizard by id Fallback to get all wizards if you forget id

Parameters

Name Type Description
wizardId Integer

Wizard Id

Optional

Examples

cheezeWizardsAPI.wizard();
cheezeWizardsAPI.wizard(1);

Returns

Promise

Returns a promise

CheezeWizardsAPI.wizards(params)

Method to get wizards by affinity, power, owner, ... Fallback to get all wizards if you forget params

Parameters

Name Type Description
params Object

Query parameters

params.owner String

Wizards owned by this address

params.affinity Integer

Wizards with this affinity: 0 = NOTSET, 1 = NEUTRAL, 2 = FIRE, 3 = WIND, 4 = WATER

params.minPower Integer

Wizards whose power is greater than or equal to minPower

params.maxPower Integer

Wizards whose power is less than or equal to maxPower

Examples

cheezeWizardsAPI.wizards();
cheezeWizardsAPI.wizards({
 affinity: 4,
 owner: '0xF0128825b0c518858971d8521498769148137936',
 minPower: 100000,
 maxPower: 900000000000000,
});

Returns

Promise

Returns a promise