Skip to content

Commit

Permalink
feat: add coinbase international support
Browse files Browse the repository at this point in the history
  • Loading branch information
thaaddeus committed Nov 8, 2024
1 parent da0bc1e commit 51178fd
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"debug": "^4.3.4",
"find-my-way": "^6.3.0",
"is-docker": "^2.2.1",
"tardis-dev": "^13.31.2",
"tardis-dev": "^13.32.0",
"uWebSockets.js": "github:uNetworking/uWebSockets.js#v20.42.0",
"yargs": "^17.5.1"
},
Expand Down
17 changes: 16 additions & 1 deletion src/ws/subscriptionsmappers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -620,6 +620,20 @@ const bitgetMapper: SubscriptionMapper = {
})
}
}
const coinbaseInternationalMapper: SubscriptionMapper = {
canHandle: (message: any) => {
return message.type === 'SUBSCRIBE'
},

map: (message: any) => {
return message.channels.map((channel: string) => {
return {
channel,
symbols: message.product_ids
}
})
}
}

export const subscriptionsMappers: { [key in Exchange]: SubscriptionMapper } = {
bitmex: bitmexMapper,
Expand Down Expand Up @@ -678,7 +692,8 @@ export const subscriptionsMappers: { [key in Exchange]: SubscriptionMapper } = {
'okex-spreads': okexMapper,
'kucoin-futures': kucoinMapper,
bitget: bitgetMapper,
'bitget-futures': bitgetMapper
'bitget-futures': bitgetMapper,
'coinbase-international': coinbaseInternationalMapper
}

export type SubscriptionMapper = {
Expand Down

0 comments on commit 51178fd

Please sign in to comment.