Torkus
// selling 0.1 XLM, 2.5 XCN/XLM
{
selling: new StellarSdk.Asset.native(),
buying: new StellarSdk.Asset('XCN', 'GCNY5OXYSY4FKHOPT2SPOQZAOEIGXB5LBYW3HVU3OWSTQITS65M5RCNY'),
amount: '0.1',
price: '2.5'
}
// buying 0.1 XLM, 2.5 XCN/XLM
{
selling: new StellarSdk.Asset('XCN', 'GCNY5OXYSY4FKHOPT2SPOQZAOEIGXB5LBYW3HVU3OWSTQITS65M5RCNY'),
buying: new StellarSdk.Asset.native(),
amount: '0.25', // amount * price => 0.1 * 2.5 = 0.25
price: '0.4' // 1 / price => 1 / 2.5 = 0.4
}
I hope it helps you.