-
Notifications
You must be signed in to change notification settings - Fork 3
feat: implement full SDK with REST API and WebSocket support #1
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
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
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 hidden or 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,80 @@ | ||
| name: Bug Report | ||
| description: Report a bug in the SDK | ||
| labels: ["bug"] | ||
| body: | ||
| - type: markdown | ||
| attributes: | ||
| value: | | ||
| Thanks for taking the time to report a bug! | ||
|
|
||
| - type: input | ||
| id: sdk-version | ||
| attributes: | ||
| label: SDK Version | ||
| description: What version of the SDK are you using? | ||
| placeholder: "0.0.3" | ||
| validations: | ||
| required: true | ||
|
|
||
| - type: input | ||
| id: node-version | ||
| attributes: | ||
| label: Node.js Version | ||
| description: What version of Node.js are you using? | ||
| placeholder: "20.10.0" | ||
| validations: | ||
| required: true | ||
|
|
||
| - type: dropdown | ||
| id: os | ||
| attributes: | ||
| label: Operating System | ||
| options: | ||
| - macOS | ||
| - Linux | ||
| - Windows | ||
| validations: | ||
| required: true | ||
|
|
||
| - type: textarea | ||
| id: description | ||
| attributes: | ||
| label: Description | ||
| description: A clear description of the bug | ||
| validations: | ||
| required: true | ||
|
|
||
| - type: textarea | ||
| id: reproduction | ||
| attributes: | ||
| label: Steps to Reproduce | ||
| description: Steps to reproduce the behavior | ||
| placeholder: | | ||
| 1. Initialize client with... | ||
| 2. Call method... | ||
| 3. See error | ||
| validations: | ||
| required: true | ||
|
|
||
| - type: textarea | ||
| id: expected | ||
| attributes: | ||
| label: Expected Behavior | ||
| description: What did you expect to happen? | ||
| validations: | ||
| required: true | ||
|
|
||
| - type: textarea | ||
| id: actual | ||
| attributes: | ||
| label: Actual Behavior | ||
| description: What actually happened? | ||
| validations: | ||
| required: true | ||
|
|
||
| - type: textarea | ||
| id: code | ||
| attributes: | ||
| label: Code Sample | ||
| description: Minimal code to reproduce the issue | ||
| render: typescript |
This file contains hidden or 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,8 @@ | ||
| blank_issues_enabled: false | ||
| contact_links: | ||
| - name: Documentation | ||
| url: https://docs.polymarket.us | ||
| about: Check the documentation for usage guides | ||
| - name: Discord | ||
| url: https://discord.gg/polymarket | ||
| about: Ask questions in our Discord community |
This file contains hidden or 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,36 @@ | ||
| name: Feature Request | ||
| description: Suggest a new feature | ||
| labels: ["enhancement"] | ||
| body: | ||
| - type: markdown | ||
| attributes: | ||
| value: | | ||
| Thanks for suggesting a feature! | ||
|
|
||
| - type: textarea | ||
| id: description | ||
| attributes: | ||
| label: Description | ||
| description: A clear description of the feature you'd like | ||
| validations: | ||
| required: true | ||
|
|
||
| - type: textarea | ||
| id: use-case | ||
| attributes: | ||
| label: Use Case | ||
| description: Why do you need this feature? What problem does it solve? | ||
| validations: | ||
| required: true | ||
|
|
||
| - type: textarea | ||
| id: alternatives | ||
| attributes: | ||
| label: Alternatives Considered | ||
| description: Any alternative solutions or workarounds you've considered | ||
|
|
||
| - type: textarea | ||
| id: additional | ||
| attributes: | ||
| label: Additional Context | ||
| description: Any other context, screenshots, or code samples |
This file contains hidden or 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,13 @@ | ||
| ## Changes | ||
|
|
||
| <!-- What does this PR do? --> | ||
|
|
||
| ## Testing | ||
|
|
||
| <!-- How was this tested? --> | ||
|
|
||
| ## Checklist | ||
|
|
||
| - [ ] Tests pass (`pnpm test`) | ||
| - [ ] Linting passes (`pnpm lint`) | ||
| - [ ] Types check (`pnpm build`) |
This file contains hidden or 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,75 @@ | ||
| name: CI | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main] | ||
| pull_request: | ||
| branches: [main] | ||
|
|
||
| jobs: | ||
| lint: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - uses: pnpm/action-setup@v4 | ||
|
|
||
| - uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '20' | ||
| cache: 'pnpm' | ||
|
|
||
| - run: pnpm install --frozen-lockfile | ||
|
|
||
| - run: pnpm lint | ||
|
|
||
| typecheck: | ||
|
||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - uses: pnpm/action-setup@v4 | ||
|
||
|
|
||
| - uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '20' | ||
| cache: 'pnpm' | ||
|
|
||
| - run: pnpm install --frozen-lockfile | ||
|
|
||
| - run: pnpm typecheck | ||
|
|
||
| build: | ||
|
||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - uses: pnpm/action-setup@v4 | ||
|
||
|
|
||
| - uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '20' | ||
| cache: 'pnpm' | ||
|
|
||
| - run: pnpm install --frozen-lockfile | ||
|
|
||
| - run: pnpm build | ||
|
|
||
| test: | ||
|
||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - uses: pnpm/action-setup@v4 | ||
|
||
|
|
||
| - uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '20' | ||
| cache: 'pnpm' | ||
|
|
||
| - run: pnpm install --frozen-lockfile | ||
|
|
||
| - run: pnpm test | ||
|
||
This file contains hidden or 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 |
|---|---|---|
| @@ -1,3 +1,32 @@ | ||
| /node_modules | ||
| /dist | ||
| /test | ||
| # Dependencies | ||
| node_modules/ | ||
|
|
||
| # Build output | ||
| dist/ | ||
|
|
||
| # Test coverage | ||
| coverage/ | ||
|
|
||
| # IDE | ||
| .idea/ | ||
| .vscode/ | ||
| *.swp | ||
| *.swo | ||
|
|
||
| # OS | ||
| .DS_Store | ||
| Thumbs.db | ||
|
|
||
| # Logs | ||
| *.log | ||
| npm-debug.log* | ||
| yarn-debug.log* | ||
| yarn-error.log* | ||
|
|
||
| # Environment | ||
| .env | ||
| .env.local | ||
| .env.*.local | ||
|
|
||
| # Package tarballs | ||
| *.tgz |
This file contains hidden or 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,64 @@ | ||
| # Contributing | ||
|
|
||
| ## Environment Setup | ||
|
|
||
| This project uses [`pnpm`](https://pnpm.io/) as its package manager. | ||
|
|
||
| ```sh | ||
| pnpm install | ||
| pnpm build | ||
| ``` | ||
|
|
||
| ## Development | ||
|
|
||
| ```sh | ||
| # Build the SDK | ||
| pnpm build | ||
|
|
||
| # Run tests | ||
| pnpm test | ||
|
|
||
| # Type check | ||
| pnpm typecheck | ||
|
|
||
| # Lint | ||
| pnpm lint | ||
|
|
||
| # Format | ||
| pnpm format | ||
| ``` | ||
|
|
||
| ## Running Tests | ||
|
|
||
| ```sh | ||
| pnpm test | ||
| ``` | ||
|
|
||
| Tests use Jest with mocked fetch calls. No API credentials are required for running tests. | ||
|
|
||
| ## Linting and Formatting | ||
|
|
||
| This project uses [Biome](https://biomejs.dev/) for linting and formatting. | ||
|
|
||
| ```sh | ||
| # Check for lint errors | ||
| pnpm lint | ||
|
|
||
| # Fix lint errors and format | ||
| pnpm lint:fix | ||
| ``` | ||
|
|
||
| ## Making Changes | ||
|
|
||
| 1. Create a new branch for your changes | ||
| 2. Make your changes | ||
| 3. Run `pnpm test` and `pnpm lint` to ensure everything passes | ||
| 4. Submit a pull request | ||
|
|
||
| ## Publishing | ||
|
|
||
| Releases are automated via GitHub Actions. When a PR is merged to `main`, the CI will automatically publish to npm based on conventional commit messages: | ||
|
|
||
| - `feat!:` or `BREAKING CHANGE` → major version bump | ||
| - `feat:` → minor version bump | ||
| - All other commits → patch version bump |
This file contains hidden or 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,21 @@ | ||
| MIT License | ||
|
|
||
| Copyright (c) 2026 Polymarket | ||
|
|
||
| Permission is hereby granted, free of charge, to any person obtaining a copy | ||
| of this software and associated documentation files (the "Software"), to deal | ||
| in the Software without restriction, including without limitation the rights | ||
| to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
| copies of the Software, and to permit persons to whom the Software is | ||
| furnished to do so, subject to the following conditions: | ||
|
|
||
| The above copyright notice and this permission notice shall be included in all | ||
| copies or substantial portions of the Software. | ||
|
|
||
| THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
| AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
| OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
| SOFTWARE. |
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.
Uh oh!
There was an error while loading. Please reload this page.