@swaptoshi/dex-module
Version:
Klayr decentralized exchange (dex) on-chain module
59 lines • 1.82 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.commandSwapContext = commandSwapContext;
exports.mutableHookSwapContext = mutableHookSwapContext;
exports.immutableHookSwapContext = immutableHookSwapContext;
exports.methodSwapContext = methodSwapContext;
exports.immutableMethodSwapContext = immutableMethodSwapContext;
exports.endpointSwapContext = endpointSwapContext;
exports.crossChainMethodSwapContext = crossChainMethodSwapContext;
function commandSwapContext(context) {
return {
context,
senderAddress: context.transaction.senderAddress,
timestamp: context.header.timestamp.toString(),
};
}
function mutableHookSwapContext(context) {
return {
context,
senderAddress: context.transaction.senderAddress,
timestamp: context.header.timestamp.toString(),
};
}
function immutableHookSwapContext(context) {
return {
context,
senderAddress: context.transaction.senderAddress,
timestamp: context.header.timestamp.toString(),
};
}
function methodSwapContext(context, senderAddress, timestamp) {
return {
context,
senderAddress,
timestamp: timestamp.toString(),
};
}
function immutableMethodSwapContext(context, senderAddress, timestamp) {
return {
context,
senderAddress,
timestamp: timestamp.toString(),
};
}
function endpointSwapContext(context) {
return {
context,
senderAddress: Buffer.alloc(0),
timestamp: context.header.timestamp.toString(),
};
}
function crossChainMethodSwapContext(context, senderAddress) {
return {
context: context.getMethodContext(),
senderAddress,
timestamp: context.header.timestamp.toString(),
};
}
//# sourceMappingURL=index.js.map