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

fix: type definition for map abi #1608

Merged
merged 1 commit into from
Dec 17, 2023
Merged

Conversation

bestmike007
Copy link
Contributor

Description

Fix the type definition for maps in contract ABI. @zone117x

Breaking change?

Yes, current one doesn't work.

Example

curl -s https://api.hiro.so/v2/contracts/interface/SP3K8BC0PPEVCV7NZ6QSRWPQ2JE9E5B6N3PA0KBR9/token-abtc | jq .maps
[
  {
    "name": "approved-contracts",
    "key": "principal",
    "value": "bool"
  }
]
curl -s https://api.hiro.so/v2/contracts/interface/SP3K8BC0PPEVCV7NZ6QSRWPQ2JE9E5B6N3PA0KBR9/amm-swap-pool-v1-1 | jq .maps
[
  {
    "name": "pools-data-map",
    "key": {
      "tuple": [
        {
          "name": "factor",
          "type": "uint128"
        },
        {
          "name": "token-x",
          "type": "principal"
        },
        {
          "name": "token-y",
          "type": "principal"
        }
      ]
    },
    "value": {
      "tuple": [
        {
          "name": "balance-x",
          "type": "uint128"
        },
        {
          "name": "balance-y",
          "type": "uint128"
        },
        {
          "name": "end-block",
          "type": "uint128"
        },
        {
          "name": "fee-rate-x",
          "type": "uint128"
        },
        {
          "name": "fee-rate-y",
          "type": "uint128"
        },
        {
          "name": "fee-rebate",
          "type": "uint128"
        },
        {
          "name": "max-in-ratio",
          "type": "uint128"
        },
        {
          "name": "max-out-ratio",
          "type": "uint128"
        },
        {
          "name": "oracle-average",
          "type": "uint128"
        },
        {
          "name": "oracle-enabled",
          "type": "bool"
        },
        {
          "name": "oracle-resilient",
          "type": "uint128"
        },
        {
          "name": "pool-id",
          "type": "uint128"
        },
        {
          "name": "pool-owner",
          "type": "principal"
        },
        {
          "name": "start-block",
          "type": "uint128"
        },
        {
          "name": "threshold-x",
          "type": "uint128"
        },
        {
          "name": "threshold-y",
          "type": "uint128"
        },
        {
          "name": "total-supply",
          "type": "uint128"
        }
      ]
    }
  },
  {
    "name": "pools-id-map",
    "key": "uint128",
    "value": {
      "tuple": [
        {
          "name": "factor",
          "type": "uint128"
        },
        {
          "name": "token-x",
          "type": "principal"
        },
        {
          "name": "token-y",
          "type": "principal"
        }
      ]
    }
  }
]

Checklist

Signed-off-by: bestmike007 <i@bestmike007.com>
Copy link

vercel bot commented Dec 17, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
stacksjs-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 17, 2023 9:18am

@CLAassistant
Copy link

CLAassistant commented Dec 17, 2023

CLA assistant check
All committers have signed the CLA.

Copy link

codecov bot commented Dec 17, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (25b3994) 66.35% compared to head (65dc464) 66.35%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1608   +/-   ##
=======================================
  Coverage   66.35%   66.35%           
=======================================
  Files         119      119           
  Lines        8699     8699           
  Branches     1916     1916           
=======================================
  Hits         5772     5772           
  Misses       2802     2802           
  Partials      125      125           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@zone117x zone117x merged commit 39a30f2 into hirosystems:main Dec 17, 2023
10 checks passed
@bestmike007 bestmike007 deleted the fix/abi-map branch December 17, 2023 09:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

3 participants