aftermath-ts-sdk
Version:
Aftermath TypeScript SDK
23 lines (22 loc) • 810 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.RouterApiCasting = void 0;
class RouterApiCasting {
}
exports.RouterApiCasting = RouterApiCasting;
// =========================================================================
// Events
// =========================================================================
RouterApiCasting.routerTradeEventFromOnChain = (eventOnChain) => {
const fields = eventOnChain.parsedJson;
return {
trader: fields.swapper,
coinInType: fields.type_in,
coinInAmount: BigInt(fields.amount_in),
coinOutType: fields.type_out,
coinOutAmount: BigInt(fields.amount_out),
timestamp: eventOnChain.timestampMs,
txnDigest: eventOnChain.id.txDigest,
type: eventOnChain.type,
};
};