Integrating AdminDriver

How to use the AdminDriver in nodejs based app (goerli testnet)

import { AdminDriver } from 'mto-metamask-backend-driver';


const MTO_API = 'Backend server url';
const MTO_APPKEY = 'test';
      
const bkdDriver = new AdminDriver({
    appKey: MTO_APPKEY,
    baseUrl: MTO_API
});

await bkdDriver.init();
     
// get dispute list
const data = await bkdDriver.getDisputes();
console.log('disputes', data);

Method List

getStats

Get stats by admin.

getStats()

getProducts

Get the product list.

getProducts(query: IProductFilterQuery)

getProductById

Get a single product.

getProductById(id: number)

merchants

Get the merchant list.

merchants(query: IMerchantFilterQuery)

merchant

Get a single merchant.

merchant(id: number)

getProductsByMerchantId

Get the product list from a merchant.

getProductsByMerchantId(id: number)

orders

Get the order lis.

orders(query: IOrderFilterQuery)

getOrderById

Get a single order.

getOrderById(id: number)

getDisputes

Get the dispute list.

getDisputes(query: IDisputeFilterQuery)

getDisputeById

Get a dispute by database id.

getDisputeById(id: number)

getDisputeByDisputeId

Get a dispute by dispute id generated in blockchain.

getDisputeByDisputeId(id: number)

agents

Get the agent list.

agents(query: IAgentFilterQuery)

getAgentById

Get a single agnt.

getAgentById(id: number)