Skip to content

Commit

Permalink
fix: remove chainId from ws api params (#49)
Browse files Browse the repository at this point in the history
  • Loading branch information
vbrvk authored Nov 26, 2024
1 parent 8b5d3e3 commit 02a4328
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 104 deletions.
13 changes: 9 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,16 @@
},
"devDependencies": {
"@1inch/eslint-config": "3.0.6",
"@1inch/tsconfig": "1.0.7",
"@eslint/compat": "1.1.0",
"@eslint/eslintrc": "^3.1.0",
"@eslint/js": "^9.5.0",
"@jest/types": "29.6.3",
"@1inch/tsconfig": "1.0.7",
"@swc/core": "1.5.25",
"@swc/jest": "0.2.36",
"@types/jest": "29.5.12",
"@types/node": "^18.16.0",
"@types/ws": "^8.5.12",
"@typescript-eslint/eslint-plugin": "^7.14.1",
"@typescript-eslint/parser": "^7.14.1",
"eslint": "9.6",
Expand All @@ -75,9 +76,8 @@
"jest": "29.7.0",
"prettier": "^3.3.2",
"ts-mockito": "2.6.1",
"typescript": "5.5.2",
"@types/ws": "^8.5.12",
"type-fest": "4.23.0"
"type-fest": "4.23.0",
"typescript": "5.5.2"
},
"peerDependencies": {
"assert": "^2.0.0"
Expand All @@ -92,5 +92,10 @@
},
"volta": {
"node": "18.16.0"
},
"pnpm": {
"overrides": {
"cross-spawn@>=7.0.0 <7.0.5": ">=7.0.5"
}
}
}
29 changes: 16 additions & 13 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 2 additions & 27 deletions src/ws-api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import {WebSocketApi, NetworkEnum} from '@1inch/cross-chain-sdk'

const wsSdk = new WebSocketApi({
url: 'wss://api.1inch.dev/fusion-plus/ws',
network: NetworkEnum.ETHEREUM,
authKey: 'your-auth-key'
})

Expand All @@ -27,7 +26,6 @@ import {WebSocketApi, NetworkEnum} from '@1inch/cross-chain-sdk'

const ws = new WebSocketApi({
url: 'wss://api.1inch.dev/fusion/ws',
network: NetworkEnum.ETHEREUM,
authKey: 'your-auth-key'
})
```
Expand Down Expand Up @@ -56,7 +54,6 @@ import {WebSocketApi, NetworkEnum} from '@1inch/cross-chain-sdk'

const ws = WebSocketApi.new({
url: 'wss://api.1inch.dev/fusion-plus/ws',
network: NetworkEnum.ETHEREUM
})
```

Expand Down Expand Up @@ -96,7 +93,6 @@ import {WebSocketApi, NetworkEnum} from '@1inch/cross-chain-sdk'

const ws = new WebSocketApi({
url: 'wss://api.1inch.dev/fusion-plus/ws',
network: NetworkEnum.ETHEREUM
})

ws.on(WebSocketEvent.Error, console.error)
Expand Down Expand Up @@ -126,7 +122,6 @@ import {WebSocketApi, NetworkEnum} from '@1inch/cross-chain-sdk'

const ws = new WebSocketApi({
url: 'wss://api.1inch.dev/fusion-plus/ws',
network: NetworkEnum.ETHEREUM
})

ws.on(WebSocketEvent.Error, console.error)
Expand Down Expand Up @@ -159,7 +154,6 @@ import {WebSocketApi, NetworkEnum} from '@1inch/cross-chain-sdk'

const ws = new WebSocketApi({
url: 'wss://api.1inch.dev/fusion-plus/ws',
network: NetworkEnum.ETHEREUM
})

ws.onOpen(() => {
Expand All @@ -182,7 +176,6 @@ import {WebSocketApi, NetworkEnum} from '@1inch/cross-chain-sdk'

const ws = new WebSocketApi({
url: 'wss://api.1inch.dev/fusion-plus/ws',
network: NetworkEnum.ETHEREUM
})

ws.send('my message')
Expand All @@ -199,7 +192,6 @@ import {WebSocketApi, NetworkEnum} from '@1inch/cross-chain-sdk'

const ws = new WebSocketApi({
url: 'wss://api.1inch.dev/fusion-plus/ws',
network: NetworkEnum.ETHEREUM
})

ws.close()
Expand All @@ -220,7 +212,6 @@ import {WebSocketApi, NetworkEnum} from '@1inch/cross-chain-sdk'

const ws = new WebSocketApi({
url: 'wss://api.1inch.dev/fusion-plus/ws',
network: NetworkEnum.ETHEREUM
})

ws.onMessage((data) => {
Expand All @@ -239,7 +230,6 @@ import {WebSocketApi, NetworkEnum} from '@1inch/cross-chain-sdk'

const ws = new WebSocketApi({
url: 'wss://api.1inch.dev/fusion-plus/ws',
network: NetworkEnum.ETHEREUM
})

ws.onClose(() => {
Expand All @@ -262,7 +252,6 @@ import {WebSocketApi, NetworkEnum} from '@1inch/cross-chain-sdk'

const ws = new WebSocketApi({
url: 'wss://api.1inch.dev/fusion-plus/ws',
network: NetworkEnum.ETHEREUM
})

ws.onError((error) => {
Expand All @@ -287,7 +276,6 @@ import {WebSocketApi, NetworkEnum} from '@1inch/cross-chain-sdk'

const ws = new WebSocketApi({
url: 'wss://api.1inch.dev/fusion-plus/ws',
network: NetworkEnum.ETHEREUM
})

ws.order.onOrder((data) => {
Expand Down Expand Up @@ -315,7 +303,6 @@ import {WebSocketApi, NetworkEnum} from '@1inch/cross-chain-sdk'

const ws = new WebSocketApi({
url: 'wss://api.1inch.dev/fusion-plus/ws',
network: NetworkEnum.ETHEREUM
})

ws.order.onOrderCreated((data) => {
Expand All @@ -338,7 +325,6 @@ import {WebSocketApi, NetworkEnum} from '@1inch/cross-chain-sdk'

const ws = new WebSocketApi({
url: 'wss://api.1inch.dev/fusion-plus/ws',
network: NetworkEnum.ETHEREUM
})

ws.order.onOrderInvalid((data) => {
Expand All @@ -361,7 +347,6 @@ import {WebSocketApi, NetworkEnum} from '@1inch/cross-chain-sdk'

const ws = new WebSocketApi({
url: 'wss://api.1inch.dev/fusion-plus/ws',
network: NetworkEnum.ETHEREUM
})

ws.order.onOrderBalanceChange((data) => {
Expand All @@ -384,7 +369,6 @@ import {WebSocketApi, NetworkEnum} from '@1inch/cross-chain-sdk'

const ws = new WebSocketApi({
url: 'wss://api.1inch.dev/fusion-plus/ws',
network: NetworkEnum.ETHEREUM
})

ws.order.onOrderAllowanceChange((data) => {
Expand All @@ -407,7 +391,6 @@ import {WebSocketApi, NetworkEnum} from '@1inch/cross-chain-sdk'

const ws = new WebSocketApi({
url: 'wss://api.1inch.dev/fusion-plus/ws',
network: NetworkEnum.ETHEREUM
})

ws.order.onOrderFilled((data) => {
Expand All @@ -430,7 +413,6 @@ import {WebSocketApi, NetworkEnum} from '@1inch/cross-chain-sdk'

const ws = new WebSocketApi({
url: 'wss://api.1inch.dev/fusion-plus/ws',
network: NetworkEnum.ETHEREUM
})

ws.order.onOrderFilledPartially((data) => {
Expand All @@ -453,7 +435,6 @@ import {WebSocketApi, NetworkEnum} from '@1inch/cross-chain-sdk'

const ws = new WebSocketApi({
url: 'wss://api.1inch.dev/fusion-plus/ws',
network: NetworkEnum.ETHEREUM
})

ws.order.onOrderCancelled((data) => {
Expand All @@ -478,7 +459,6 @@ import {WebSocketApi, NetworkEnum} from '@1inch/cross-chain-sdk'

const ws = new WebSocketApi({
url: 'wss://api.1inch.dev/fusion-plus/ws',
network: NetworkEnum.ETHEREUM
})

ws.rpc.onPong((data) => {
Expand All @@ -497,7 +477,6 @@ import {WebSocketApi, NetworkEnum} from '@1inch/cross-chain-sdk'

const ws = new WebSocketApi({
url: 'wss://api.1inch.dev/fusion-plus/ws',
network: NetworkEnum.ETHEREUM
})

ws.rpc.ping()
Expand All @@ -514,7 +493,6 @@ import {WebSocketApi, NetworkEnum} from '@1inch/cross-chain-sdk'

const ws = new WebSocketApi({
url: 'wss://api.1inch.dev/fusion-plus/ws',
network: NetworkEnum.ETHEREUM
})

ws.rpc.getAllowedMethods()
Expand All @@ -535,7 +513,6 @@ import {WebSocketApi, NetworkEnum} from '@1inch/cross-chain-sdk'

const ws = new WebSocketApi({
url: 'wss://api.1inch.dev/fusion-plus/ws',
network: NetworkEnum.ETHEREUM
})

ws.rpc.onGetAllowedMethods((data) => {
Expand All @@ -553,8 +530,7 @@ ws.rpc.onGetAllowedMethods((data) => {
import {WebSocketApi, NetworkEnum} from '@1inch/cross-chain-sdk'

const ws = new WebSocketApi({
url: 'wss://api.1inch.dev/fusion-plus/ws',
network: NetworkEnum.ETHEREUM
url: 'wss://api.1inch.dev/fusion-plus/ws'
})

ws.rpc.getActiveOrders()
Expand All @@ -574,8 +550,7 @@ ws.rpc.getActiveOrders()
import {WebSocketApi, NetworkEnum} from '@1inch/cross-chain-sdk'

const ws = new WebSocketApi({
url: 'wss://api.1inch.dev/fusion-plus/ws',
network: NetworkEnum.ETHEREUM
url: 'wss://api.1inch.dev/fusion-plus/ws'
})

ws.rpc.onGetActiveOrders((data) => {
Expand Down
Loading

0 comments on commit 02a4328

Please sign in to comment.