Chainge Finance
  • The Most Liquid Web 3 Trading Venue
  • 🟑Introduction
    • πŸ’‘What Is Chainge?
    • About Chainge
      • πŸ₯‡Executive Board
      • πŸ“ˆPerformance Metrics
      • ⛓️Integrated DEXs, Aggregators, and Blockchains
  • 🟑Getting Started
    • 🧭Navigating the Chainge dApp
    • ▢️Video Walkthroughs
    • 🏦Chainge Wallet
  • 🟑Technology
    • πŸ“„Overview
    • πŸ”ΊKey Differentiators
    • πŸ›‘οΈSecurity
      • 🧩How DCRM Works
  • 🟑Core Features
    • πŸ”€Cross-Chain Swaps
    • πŸŒ‰Bridge To Everywhere
    • πŸ”‘Self-Custodial Wallet
    • ⏱️Limit Orders
    • πŸ€–AI-Powered Features (Coming Soon)
  • 🟑Governance
    • πŸ›οΈChainge DAO
  • 🟑Economics
    • πŸͺ™Token (XCHNG)
      • πŸ› οΈUtilities and Functions
      • πŸ“ŠTokenomics
      • πŸ”ΌStaking
      • πŸ’΅Profit Share
  • 🟑Developer Tools
    • πŸ“ƒChainge 2.0 API Documentation
      • 🟑Get Chains and Tokens
      • πŸ’²Get Price Quote API
      • πŸ”—Aggregate Swap
      • πŸ“Submit order
      • 🎟️Submit Ticket
      • Submit order by Kaspa
      • πŸ’»Github Examples
      • πŸ’°Fee Channel
      • ⚑Earn feature API
    • πŸ“–Knot.meme API Document
      • Get KRC20 Tickers
      • Base API
      • Core API
  • 🟑Official resources
    • πŸ“‚Github repositories
    • 🌐Social networks
Powered by GitBook
On this page
  • Header
  • Body

Was this helpful?

  1. Developer Tools
  2. Chainge 2.0 API Documentation

Submit Ticket

Ticket system is a way to report problematic transactions to our system to resolve. Here is a detailed explanation of the parameters for the submitTicket API:

Header

Fields
Description

Evmaddress

The current address of the user's connected wallet.

Signature

The user's signature of the post body

Body

Fields
Description

hash

Problematic transaction hash

chain

From chain nickName

Signature:

To obtain a correct interface signature, we need to follow these 5 steps:

  1. Construct the body parameter object correctly according to the requirements.

  2. Concatenate the parameters of the complete body parameter object, sorted alphabetically, using '&' as a separator. For example: chan=FSN&hash=0x4190dc4627cb4e97292...

  3. Prefix the string generated in step 2 with EvmAddress=...&{result of step 2}, for example: EvmAddress=0x42a6685ef29886Cbcb595Aa903f00dea0d1787d8&chan=FSN&hash=0x4190dc4627...

  4. Apply keccak256 hashing to the result of step 3.

  5. Sign the result of step 4 with the wallet.

get Signature examples:

sortParams = (params, evmAddress) => {
    let keys = Object.keys(params)
    if(!keys.length) return undefined
    keys = keys.sort();
    const keyValList = []
    for (const key of keys) {
        const val = params[key];
        if(val) {
            keyValList.push(`${key}=${val}`)
        }
    }
    const data = keyValList.join('&')
    const raw = `EvmAddress=${evmAddress}&${data}`
    return raw
}

// step 1
const bodyParams = {
    chain: "FSN",
    hash: "0x4190dc4627cb4e97292b6b718d718d3c3af93f14477346efc181ff549f69f794"
}

// step 2 & setp3
let raw = sortParams(bodyParams, '0x42a6685ef29886Cbcb595Aa903f00dea0d1787d8') as string;
console.log(raw) // EvmAddress=0x42a6685ef29886Cbcb595Aa903f00dea0d1787d8&chan=FSN&hash=0x4190dc4627cb4e97292b6b718d718d3c3af93f14477346efc181ff549f69f794

// step4
raw = keccak256(toHex(raw));
console.log(raw) // 0x86a444bc2c6104a3aadcf82c00dc6328fea2bd3472298369dedcbdb592ad257d

// step5 Calling wallet message signing
// Calculates an Ethereum-specific signature in EIP-191 format: keccak256("\x19Ethereum Signed Message:\n" + len(message) + message)).
// Note: The signature should not include the prefix '0x'.
let signature = wallet.signMessage(raw)
PreviousSubmit orderNextSubmit order by Kaspa

Last updated 9 months ago

Was this helpful?

🟑
πŸ“ƒ
🎟️