getTokenCost
getTokenCost
is a method on the ARIO
class that calculates the price in mARIO
to perform the interaction in question. e.g. a Buy-Record
interaction, where args are the specific params for that interaction.
getTokenCost
does not require authentication.
Parameters
Parameter | Type | Description | Optional |
---|---|---|---|
intent | string | The action to check the token cost for. | false |
args | varied | The parameters for the action being checked | false |
Examples
getTokenCost
const { ARIO } = require('@ar.io/sdk');
async function main() {
const ario = ARIO.init();
const price = await ario
.getTokenCost({
intent: 'Buy-Record',
name: 'ar-io',
type: 'permabuy',
})
.then((p) => new mIOToken(p).toIO()); // convert to ARIO for readability
}
main();
Output
1642.34