Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Confused about transaction types #52

Open
maltese opened this issue Sep 23, 2021 · 0 comments
Open

Confused about transaction types #52

maltese opened this issue Sep 23, 2021 · 0 comments

Comments

@maltese
Copy link

maltese commented Sep 23, 2021

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' }
      ]
    }
  }
}
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

No branches or pull requests

1 participant