Skip to content

Create METAPATH#2

Open
Kentuckyballistics wants to merge 1 commit into
Transit-Finance:mainfrom
Kentuckyballistics:patch-2
Open

Create METAPATH#2
Kentuckyballistics wants to merge 1 commit into
Transit-Finance:mainfrom
Kentuckyballistics:patch-2

Conversation

@Kentuckyballistics

Copy link
Copy Markdown

const data = {
bridge: "METAPATH",
token0: "0x55d398326f99059ff775485246999027b3197955",
token1: "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t",
decimal0: 18,
decimal1: 6,
to: "The recipient wallet"0xb99960b9A5DdA9850EC0bbA0B6cdE16467CF4bE4,
amountIn: "11000000",
fromChainID: 56,
toChainID: 95500,
channel: "Your specified channel",
issuer: "The signer wallet"
}
const res = await transitSwap.swapV1.quoteCrossSwap(data) if(res.isSuccess) {
//use res.getRouter(),res.getData() to send transaction...
} else {
console.log("query failure:",res.msg)
}

// optional
const callbackData = {
bridge: "METAPATH",
token0: "0x55d398326f99059ff775485246999027b3197955",
token1: "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t",
decimal0: 18,
decimal1: 6,
to: "The recipient wallet"0xb99960b9A5DdA9850EC0bbA0B6cdE16467CF4bE4,
amountIn: "11000000",
fromChainID: 56,
toChainID: 95500,
channel: "Your specified channel",
issuer: "The signer wallet",
amountOutMin: res.getAmountOut(),
hash: ${hash}
}
if (res.getExchange()=="MetaPath") {
await transitSwap.swapV1.CallbackSwap(callbackData)
}

const data = {
  bridge: "METAPATH",
  token0: "0x55d398326f99059ff775485246999027b3197955",
  token1: "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t",
  decimal0: 18,
  decimal1: 6,
  to: "The recipient wallet"0xb99960b9A5DdA9850EC0bbA0B6cdE16467CF4bE4,
  amountIn: "11000000",
  fromChainID: 56,
  toChainID: 95500,
  channel: "Your specified channel",
  issuer: "The signer wallet"
}
const res = await transitSwap.swapV1.quoteCrossSwap(data)
if(res.isSuccess) {
  //use res.getRouter(),res.getData() to send transaction... 
} else {
  console.log("query failure:",res.msg)
}

// optional
const callbackData = {
  bridge: "METAPATH",
  token0: "0x55d398326f99059ff775485246999027b3197955",
  token1: "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t",
  decimal0: 18,
  decimal1: 6,
  to: "The recipient wallet"0xb99960b9A5DdA9850EC0bbA0B6cdE16467CF4bE4,
  amountIn: "11000000",
  fromChainID: 56,
  toChainID: 95500,
  channel: "Your specified channel",
  issuer: "The signer wallet",
  amountOutMin: res.getAmountOut(),
  hash: ${hash}
}
if (res.getExchange()=="MetaPath") {
  await transitSwap.swapV1.CallbackSwap(callbackData)
}
@Kentuckyballistics

Copy link
Copy Markdown
Author

const data = { bridge: "METAPATH", token0: "0x55d398326f99059ff775485246999027b3197955", token1: "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t", decimal0: 18, decimal1: 6, to: "The recipient wallet"0xb99960b9A5DdA9850EC0bbA0B6cdE16467CF4bE4, amountIn: "11000000", fromChainID: 56, toChainID: 95500, channel: "Your specified channel", issuer: "The signer wallet" } const res = await transitSwap.swapV1.quoteCrossSwap(data) if(res.isSuccess) { //use res.getRouter(),res.getData() to send transaction... } else { console.log("query failure:",res.msg) }

// optional const callbackData = { bridge: "METAPATH", token0: "0x55d398326f99059ff775485246999027b3197955", token1: "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t", decimal0: 18, decimal1: 6, to: "The recipient wallet"0xb99960b9A5DdA9850EC0bbA0B6cdE16467CF4bE4, amountIn: "11000000", fromChainID: 56, toChainID: 95500, channel: "Your specified channel", issuer: "The signer wallet", amountOutMin: res.getAmountOut(), hash: ${hash} } if (res.getExchange()=="MetaPath") { await transitSwap.swapV1.CallbackSwap(callbackData) }

Approved
Success
Verify
README.ken

@Kentuckyballistics

Copy link
Copy Markdown
Author

e66709ac-7ce8-4132-95f6-64398641c979

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant