quipuswap-core icon indicating copy to clipboard operation
quipuswap-core copied to clipboard

Confused about transaction types

Open maltese opened this issue 3 years ago • 0 comments

Consider the following transactions. How come some transactions use the entry points tokenToTezPayment and tezToTokenPayment directly whereas others invoke the use entrypoint?

Are both kinds valid and why are there different kinds?

{
  kind: 'transaction',
  source: 'tz1UCNyJTaLK6xTRfQ9QxgE16bwSJhmsJ9Nj',
  fee: '3021',
  counter: '17464483',
  gas_limit: '17093',
  storage_limit: '0',
  amount: '0',
  destination: 'KT1X1LgNkQShpF9nRLYw3Dgdy4qp38MX617z',
  parameters: {
    entrypoint: 'use',
    value: {
      prim: 'Right',
      args: [
        {
          prim: 'Left',
          args: [
            {
              prim: 'Left',
              args: [
                {
                  prim: 'Pair',
                  args: [
                    {
                      prim: 'Pair',
                      args: [
                        { int: '362047367410630693806' },
                        { int: '140296127' }
                      ]
                    },
                    { string: 'tz1UCNyJTaLK6xTRfQ9QxgE16bwSJhmsJ9Nj' }
                  ]
                }
              ]
            }
          ]
        }
      ]
    }
  }
}
{
  kind: 'transaction',
  source: 'tz1KroYSGkPbXG6mTrtQfDSUjT31vthH7vYS',
  fee: '5917',
  counter: '25501077',
  gas_limit: '12564',
  storage_limit: '0',
  amount: '1000000',
  destination: 'KT1X1LgNkQShpF9nRLYw3Dgdy4qp38MX617z',
  parameters: {
    entrypoint: 'tezToTokenPayment',
    value: {
      prim: 'Pair',
      args: [
        { int: '2552269162349198031' },
        { string: 'tz1KroYSGkPbXG6mTrtQfDSUjT31vthH7vYS' }
      ]
    }
  }
}
{
  kind: 'transaction',
  source: 'tz1gTm7dAYGBNu8QUNYa34UUpiY7NBA7vUSL',
  fee: '0',
  counter: '18649062',
  gas_limit: '15193',
  storage_limit: '0',
  amount: '0',
  destination: 'KT1X1LgNkQShpF9nRLYw3Dgdy4qp38MX617z',
  parameters: {
    entrypoint: 'tokenToTezPayment',
    value: {
      prim: 'Pair',
      args: [
        {
          prim: 'Pair',
          args: [ { int: '208132155508027287121' }, { int: '81064446' } ]
        },
        { string: 'tz1gTm7dAYGBNu8QUNYa34UUpiY7NBA7vUSL' }
      ]
    }
  }
}

maltese avatar Sep 23 '21 08:09 maltese