-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
feat: ABI refactor #3085
Draft
petertonysmith94
wants to merge
53
commits into
master
Choose a base branch
from
np/feat/abi-refactor
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+9,905
−440
Draft
feat: ABI refactor #3085
Changes from all commits
Commits
Show all changes
53 commits
Select commit
Hold shift + click to select a range
c041f20
chore: added @fuel-ts/abi package
petertonysmith94 cb48d9c
chore: added basic folder structure
petertonysmith94 74a6f50
chore: added ignore to changeset
petertonysmith94 0736344
chore: changeset
petertonysmith94 584d354
chore: changeset
petertonysmith94 f63a171
chore: added missing index file
petertonysmith94 a618c89
scaffold cleanup
nedsalk d74786a
Merge branch 'master' of https://github.com/FuelLabs/fuels-ts into np…
petertonysmith94 8e58b23
chore: added basic test infrastructure (#3090)
petertonysmith94 a5eeaef
Merge branch 'master' into np/feat/abi-refactor
petertonysmith94 ed8e598
Merge remote-tracking branch 'origin/master' into np/feat/abi-refactor
nedsalk 882a0a2
feat: sway type matchers (#3137)
nedsalk c3a9b6f
chore: added start of line to ABI regex matchers (#3163)
petertonysmith94 09cddf0
Merge branch 'master' of https://github.com/FuelLabs/fuels-ts into np…
petertonysmith94 8eb9316
chore: consolidate all ABI Sway programs (#3171)
petertonysmith94 8235b4e
chore: separate minor and major versions (#3170)
petertonysmith94 5e55da8
chore: inform users if their `fuels` version is outdated (#3108)
Dhaiwat10 7096791
fix: some assets got assetId, contractId and decimals incorrect (#3167)
LuizAsFight dc0db20
build(deps): bump the deps-patch group (#3173)
dependabot[bot] e6b6af9
fix: add missing receipts properties (#3156)
Torres-ssf 7e3b66c
Merge remote-tracking branch 'origin/master' into np/feat/abi-refactor
nedsalk bd79318
Merge remote-tracking branch 'origin/master' into np/feat/abi-refactor
nedsalk 540d4e2
Merge remote-tracking branch 'origin/master' into np/feat/abi-refactor
nedsalk 3659e50
update proxy contract
nedsalk 976c1bd
feat: add missing matcher (#3247)
nedsalk 3605a1c
Merge remote-tracking branch 'origin/master' into np/feat/abi-refactor
nedsalk 052e7d7
Merge remote-tracking branch 'origin/master' into np/feat/abi-refactor
nedsalk 43e6c6e
Merge remote-tracking branch 'origin/master' into np/feat/abi-refactor
nedsalk 0e5e9cb
Merge branch 'master' into np/feat/abi-refactor
nedsalk 691f3c0
Merge branch 'master' into np/feat/abi-refactor
petertonysmith94 bd647b3
Merge branch 'master' of github.com:FuelLabs/fuels-ts into np/feat/ab…
petertonysmith94 7611c55
Merge remote-tracking branch 'origin/master' into np/feat/abi-refactor
nedsalk 97c03f4
chore: added errors for matchers
petertonysmith94 ee79c21
chore: added matcher to spell check
petertonysmith94 c5bfa0a
chore: added errors dep
petertonysmith94 fb5e04d
Merge branch 'master' of github.com:FuelLabs/fuels-ts into np/feat/ab…
petertonysmith94 0d33661
Merge branch 'master' of github.com:FuelLabs/fuels-ts into np/feat/ab…
petertonysmith94 8ce4810
Merge branch 'master' of github.com:FuelLabs/fuels-ts into np/feat/ab…
petertonysmith94 57014d5
Merge branch 'master' of github.com:FuelLabs/fuels-ts into np/feat/ab…
petertonysmith94 7ca0689
Merge branch 'master' of github.com:FuelLabs/fuels-ts into np/feat/ab…
petertonysmith94 ed95764
Merge remote-tracking branch 'origin/master' into np/feat/abi-refactor
nedsalk bff8061
Merge remote-tracking branch 'origin/master' into np/feat/abi-refactor
nedsalk 1390116
Merge remote-tracking branch 'origin/master' into np/feat/abi-refactor
nedsalk 74ad20c
Merge branch 'master' into np/feat/abi-refactor
nedsalk 31ddb12
Merge remote-tracking branch 'origin/master' into np/feat/abi-refactor
nedsalk 508991b
Merge remote-tracking branch 'origin/master' into np/feat/abi-refactor
nedsalk 5bd8378
Merge remote-tracking branch 'origin/master' into np/feat/abi-refactor
nedsalk 86b7109
Merge remote-tracking branch 'origin/master' into np/feat/abi-refactor
nedsalk 9a86b31
remove unused dependency
nedsalk 21ac698
fix lock file
nedsalk 6962abb
Merge branch 'master' of github.com:FuelLabs/fuels-ts into np/feat/ab…
petertonysmith94 44f6590
feat: ABI parser (#3089)
nedsalk 9ec45f9
feat!: ABI Gen (#3249)
petertonysmith94 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
--- | ||
--- | ||
|
||
feat: ABI refactor | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
"@fuel-ts/abi": minor | ||
"fuels": minor | ||
--- | ||
|
||
feat!: ABI Gen |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
"@fuel-ts/abi": patch | ||
"fuels": patch | ||
"@fuel-ts/errors": patch | ||
--- | ||
|
||
feat: ABI parser |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -343,4 +343,5 @@ Workspaces | |
WSL | ||
XOR | ||
XORs | ||
YAML | ||
YAML | ||
matcher |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// #region full | ||
import { AbiParser } from 'fuels'; | ||
import type { Abi, AbiSpecificationV1 } from 'fuels'; | ||
|
||
import { Counter } from '../../../typegend'; | ||
|
||
const parsedAbi: Abi = AbiParser.parse(Counter.abi as AbiSpecificationV1); | ||
// #endregion full | ||
console.log('Parsed ABI:', parsedAbi); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Working with the ABI | ||
|
||
Building a Sway program with `forc build` outputs multiple files, one of which is a JSON representation of the program's ABI. Because ABI specifications can change from one `forc` version to another, working directly with the ABI is cumbersome due to having to manage all ABI specification versions in order to ensure proper functionality. | ||
|
||
<!-- TODO: fix links once it's live --> | ||
<!-- AbiParser: https://fuels-ts-docs-api.vercel.app/classes/_fuel_ts_abi.AbiParser.html--> | ||
<!-- ABI: https://fuels-ts-docs-api.vercel.app/interfaces/_fuel_ts_abi.Abi.html --> | ||
|
||
To mitigate this, The SDK provides [`AbiParser`](#working-with-the-abi) which can parse all ABI specification versions and output an object that conforms to the [`Abi`](#working-with-the-abi) interface. The SDK also internally uses this `Abi` interface for implementing its encoding/decoding and TS type generation. | ||
|
||
<<< @./snippets/parsing-the-abi.ts#full{ts:line-numbers} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,9 +3,6 @@ | |
"version": "0.98.0", | ||
"description": "Generates Typescript definitions from Sway ABI Json files", | ||
"author": "Fuel Labs <[email protected]> (https://fuel.network/)", | ||
"bin": { | ||
"fuels-typegen": "typegen.js" | ||
}, | ||
"main": "dist/index.js", | ||
"module": "dist/index.mjs", | ||
"types": "dist/index.d.ts", | ||
|
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note
This is not to be merged until we've concluded development