Is there any complete client side integration example of predicates using fuels ts-sdk?

Went through the documentation but can’t find a thorough example for the same !

Hey @dharmikjethva30,

After taking a good look, I can see we’re lacking a thorough example for predicates, and have created an issue to resolve this.

In the mean time - have you checked out the npm create fuels CLI tool?

This will allow you to bootstrap a dApp - which has a working example of a predicate.

3 Likes

Predicates Guide here:

Predicates Guide in the TS SDK:

Do these not suffice?

1 Like

Just trying it out and I am getting the error below

npm run fuels:dev

npm create fuels

Hey @crypt0mate :wave:,

Could you send me the output to the following command:

fuelup show

Also the contents of your package.json:

cat package.json
1 Like

@p.s there you go …

{
  "name": "template-nextjs",
  "version": "0.1.3",
  "private": true,
  "scripts": {
    "prebuild": "fuels build",
    "fuels:dev": "fuels dev",
    "dev": "next dev",
    "build": "npm run prebuild && next build",
    "start": "next start",
    "lint": "next lint"
  },
  "dependencies": {
    "@fuels/connectors": "^0.5.0",
    "@fuels/react": "^0.20.0",
    "fuels": "0.90.0",
    "@tanstack/react-query": "^5.29.2",
    "dotenv": "^16.4.5",
    "next": "14.2.2",
    "react": "^18.2",
    "react-dom": "^18.2",
    "react-hot-toast": "^2.4.1",
    "react-use": "^17.5.0"
  },
  "devDependencies": {
    "@types/node": "^20",
    "@types/react": "^18.2",
    "@types/react-dom": "^18.2",
    "autoprefixer": "^10.0.1",
    "eslint": "^8",
    "eslint-config-next": "14.0.1",
    "postcss": "^8",
    "tailwindcss": "^3.3.0",
    "typescript": "^5"
  }
}

Apologies for the inconvenience caused - there appears to be an issue with our latest toolchain (a fix should arrive shortly).

You can to resolve this by adding a new toolchain and using a compatible version of fuel-core and forc:

fuelup toolchain new toolchain-name
fuelup component add fuel-core@0.30.0
fuelup component add forc@0.60.0

We have a feature to alleviate these issues in the future, that is awaiting release.

1 Like

Sure thanks .it works now.

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.