Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
'0x',
deploy.tokenTransferData.ledgerId.substr(2),
deploy.tokenTransferData.receiverId.substr(2),
getValue(deploy.tokenTransferData.value).substr(2),
].join('')),
);
return keccak256(
hexToBytes([
'0x',
gateway.id.substr(2),
deploy.makerId.substr(2),
deploy.takerId.substr(2),
xcertData.substr(2),
transferData.substr(2),
leftPad(toInteger(deploy.seed), 64, '0', false),
leftPad(toSeconds(deploy.expiration), 64, '0', false),
].join('')),
);
}
maker: deploy.makerId,
taker: deploy.takerId,
xcertData: {
name: deploy.assetLedgerData.name,
symbol: deploy.assetLedgerData.symbol,
uriBase: deploy.assetLedgerData.uriBase,
schemaId: deploy.assetLedgerData.schemaId,
capabilities: deploy.assetLedgerData.capabilities.map((c) => { return getInterfaceCode(c); }),
owner: deploy.assetLedgerData.owner,
},
transferData: {
token: deploy.tokenTransferData.ledgerId,
to: deploy.tokenTransferData.receiverId,
value: getValue(deploy.tokenTransferData.value),
},
seed: toInteger(deploy.seed),
expirationTimestamp: toSeconds(deploy.expiration),
};
return toTuple(recipeData);
}
export function createRecipeTuple(gateway: Gateway, order: ActionsOrder) {
const actions = (order.actions as ActionsOrderAction[]).map((action) => {
return {
proxyId: getActionProxy(gateway, action),
contractAddress: action.ledgerId,
params: getActionParams(action, order.signers),
};
});
const recipeData = {
signers: order.signers,
actions,
seed: toInteger(order.seed),
expirationTimestamp: toSeconds(order.expiration),
};
return toTuple(recipeData);
}
taker: order.takerId,
xcertData: {
name: order.assetLedgerData.name,
symbol: order.assetLedgerData.symbol,
uriPrefix: order.assetLedgerData.uriPrefix,
uriPostfix: order.assetLedgerData.uriPostfix,
schemaId: `0x${order.assetLedgerData.schemaId}`,
capabilities: order.assetLedgerData.capabilities.map((c) => { return getInterfaceCode(c); }),
owner: order.assetLedgerData.ownerId,
},
transferData: {
token: order.tokenTransferData.ledgerId,
to: order.tokenTransferData.receiverId,
value: getValue(order.tokenTransferData.value),
},
seed: toInteger(order.seed),
expirationTimestamp: toSeconds(order.expiration),
};
return toTuple(recipeData);
}
'0x',
order.tokenTransferData.ledgerId.substr(2),
order.tokenTransferData.receiverId.substr(2),
getValue(order.tokenTransferData.value).substr(2),
].join('')),
);
return keccak256(
hexToBytes([
'0x',
gateway.config.valueLedgerDeployOrderId.substr(2),
order.makerId.substr(2),
order.takerId.substr(2),
tokenData.substr(2),
transferData.substr(2),
leftPad(toInteger(order.seed), 64, '0', false),
leftPad(toSeconds(order.expiration), 64, '0', false),
].join('')),
);
}
'0x',
actionsHash.substr(2),
`0000000${getActionProxy(gateway, action)}`,
action.ledgerId.substr(2),
getActionParams(action, order.signers).substr(2),
].join('')),
);
}
return keccak256(
hexToBytes([
'0x',
gateway.config.actionsOrderId.substr(2),
parseAddresses(order.signers),
actionsHash.substr(2),
leftPad(toInteger(order.seed), 64, '0', false),
leftPad(toSeconds(order.expiration), 64, '0', false),
].join('')),
);
}
const recipeData = {
maker: order.makerId,
taker: order.takerId,
tokenData: {
name: order.valueLedgerData.name,
symbol: order.valueLedgerData.symbol,
supply: order.valueLedgerData.supply,
decimals: order.valueLedgerData.decimals,
owner: order.valueLedgerData.ownerId,
},
transferData: {
token: order.tokenTransferData.ledgerId,
to: order.tokenTransferData.receiverId,
value: getValue(order.tokenTransferData.value),
},
seed: toInteger(order.seed),
expirationTimestamp: toSeconds(order.expiration),
};
return toTuple(recipeData);
}
'0x',
order.tokenTransferData.ledgerId.substr(2),
order.tokenTransferData.receiverId.substr(2),
getValue(order.tokenTransferData.value).substr(2),
].join('')),
);
return keccak256(
hexToBytes([
'0x',
gateway.config.assetLedgerDeployOrderId.substr(2),
order.makerId.substr(2),
order.takerId.substr(2),
xcertData.substr(2),
transferData.substr(2),
leftPad(toInteger(order.seed), 64, '0', false),
leftPad(toSeconds(order.expiration), 64, '0', false),
].join('')),
);
}