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

Add returnSignature Configuration Field #36

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

chainsona
Copy link

Add returnSignature Configuration Field

Problem

The build was failing due to a type error in buildWhirlpoolsSwap.ts where the code was trying to access a returnSignature configuration field that wasn't defined in the config schema. The specific error was:

Type error: Property 'returnSignature' does not exist on type '{ rpcUrl: string; maxSignatures: number; lamportsPerSignature: number; corsOrigin: boolean; endpoints: {...} }'

Solution

Added the returnSignature field to the configuration schema in config.json. The field is configured with allowAll type, which is one of the valid options defined in returnSignature.ts.

Changes

{
    "rpcUrl": "https://api.devnet.solana.com",
    "maxSignatures": 2,
    "lamportsPerSignature": 5000,
    "corsOrigin": true,
+   "returnSignature": {
+       "type": "allowAll"
+   },
    "endpoints": {
        // ... rest of config
    }
}

Testing

  • Build now completes successfully with yarn build
  • All ESLint checks pass with only non-critical warnings
  • The buildWhirlpoolsSwap endpoint can now properly handle signature returns based on configuration

Additional Notes

The returnSignature configuration supports two types:

  1. allowAll - Allows all signature returns without additional checks
  2. reCaptcha - Requires reCAPTCHA verification (not used in this PR)

For this fix, we used the allowAll type as it's the simplest configuration that resolves the build error while maintaining functionality.

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

Successfully merging this pull request may close these issues.

1 participant