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

notification.subscribe for Network.ETHEREUM_GOERLI does not append testnetType= query param #1046

Open
kazykenov opened this issue Jan 15, 2024 · 2 comments

Comments

@kazykenov
Copy link

kazykenov commented Jan 15, 2024

Describe the bug
Creating a subscription through Tatum SDK for Ethereum testnet does not append testnetType= query param to the outgoing request. Hence notification with no chain field in the root level is created, which is no longer triggered for any testnet transaction

To Reproduce
Steps to reproduce the behavior:

  1. Try creating a subscription like in the example https://docs.tatum.io/docs/notifications/notification-types/incoming-native-transactions#how-to-do-it for Network.ETHEREUM_GOERLI
  2. Now create a similar subscription using https://apidoc.tatum.io/tag/Notification-subscriptions#operation/createSubscription also for testnetType=ethereum-goerli
  3. The subscription on step 1 does not notify events. Subscription on step 2 does
  4. Goto https://dashboard.tatum.io/notifications/subscriptions , open devtools and see the response of
    https://dashboard.tatum.io/api/sdk/notifications . The subscription created by step 1 does not have "chain": "ethereum-goerli", field

Expected behavior
https://github.com/tatumio/tatum-js/blob/master/src/service/notification/subscribe.ts:38 should append testnetType query param how https://apidoc.tatum.io/tag/Notification-subscriptions#operation/createSubscription does it

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

@Hathoriel
Copy link
Member

Can you please @kazykenov provide information on how you created the notification via Tatum SDK?
If you created a subscription directly as an API call without the Tatum SDK, I would suggest you contact us on Discord https://discord.com/invite/tatum.
I appreciate your patience!

@kazykenov
Copy link
Author

  1. Try creating a subscription like in the example https://docs.tatum.io/docs/notifications/notification-types/incoming-native-transactions#how-to-do-it for Network.ETHEREUM_GOERLI

So, here is the code snippet that your documentation provides on how to create a subscription:

import { TatumSDK, Ethereum, Network } from '@tatumio/tatum'

(async () => {
    const tatum = await TatumSDK.init<Ethereum>({network: Network.ETHEREUM})
    
    const monitoredAddress = '0xF64E82131BE01618487Da5142fc9d289cbb60E9d'
    
    const subscription = await tatum.notification.subscribe.incomingNativeTx({
        address: monitoredAddress,
        url: 'https://<YOUR_WEBHOOK_URL>' // replace with your handler URL
    })
    console.log(`Now you will be notified about all incoming ETH transactions on ${monitoredAddress}`)
})()

Now for the above example use Network.ETHEREUM_GOERLI as an argument for your TatumSDK.init
The created subscription will not track ANY events

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

No branches or pull requests

2 participants