Skip to content

Commit

Permalink
feat: add Walnut SDK for starknet debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
barabanovro committed Nov 9, 2023
1 parent 625bb4e commit b2e4562
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 1 deletion.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
"@uniswap/token-lists": "^1.0.0-beta.30",
"@uniswap/v2-sdk": "^3.0.1",
"@uniswap/v3-sdk": "^3.8.2",
"@walnuthq/sdk": "^1.0.3",
"@web3-react/core": "^6.1.9",
"@web3-react/injected-connector": "^6.0.7",
"ajv": "^8.11.0",
Expand Down
5 changes: 4 additions & 1 deletion src/hooks/useSyncWidgetSettings.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Web3Provider } from '@ethersproject/providers'
import { addWalnutLogs } from '@walnuthq/sdk'
import { atom } from 'jotai'
import { useAtomValue, useUpdateAtom } from 'jotai/utils'
import { useEffect, useState } from 'react'
Expand Down Expand Up @@ -53,7 +54,9 @@ export default function useSyncWidgetSettings({
useEffect(() => {
updateWidgetSettingsAtom({
ethProvider,
snAccount,
snAccount: snAccount
? addWalnutLogs({ account: snAccount, apiKey: 'walnut_ZFqJep8VrMB_LfUXdSeKxJAxNz9AC6rdLK' })
: snAccount,
toTokens,
fromTokens,
presetToToken,
Expand Down
24 changes: 24 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4310,6 +4310,13 @@
dependencies:
"@walletconnect/window-getters" "^1.0.0"

"@walnuthq/sdk@^1.0.3":
version "1.0.3"
resolved "https://registry.yarnpkg.com/@walnuthq/sdk/-/sdk-1.0.3.tgz#1d1dea51dba8bbd6c718950e6ce2e9db92467ad4"
integrity sha512-4rJzFFQ6xYXJIKq55LaoOb3htLhvmPCxcQXfoSFJ8ROPuW5eijqFsDYCWXS/W5CuQpSIiSLU5uNV+2LQqSQmkg==
dependencies:
starknet "^4.0"

"@web3-react/abstract-connector@^6.0.7":
version "6.0.7"
resolved "https://registry.yarnpkg.com/@web3-react/abstract-connector/-/abstract-connector-6.0.7.tgz#401b3c045f1e0fab04256311be49d5144e9badc6"
Expand Down Expand Up @@ -14035,6 +14042,23 @@ stacktrace-parser@^0.1.10:
dependencies:
type-fest "^0.7.1"

starknet@^4.0:
version "4.22.0"
resolved "https://registry.yarnpkg.com/starknet/-/starknet-4.22.0.tgz#8d0c628e2a8e868ee9b4757afe89f07b05ec55ff"
integrity sha512-jC9Taxb6a/ht9zmS1LU/DSLfwJKpgCJnE9AktVksc5SE/+jQMpqxsq6fm7PRiqupjiqRC1DOS8N47cj+KaGv4Q==
dependencies:
"@ethersproject/bytes" "^5.6.1"
bn.js "^5.2.1"
elliptic "^6.5.4"
ethereum-cryptography "^1.0.3"
hash.js "^1.1.7"
isomorphic-fetch "^3.0.0"
json-bigint "^1.0.0"
minimalistic-assert "^1.0.1"
pako "^2.0.4"
ts-custom-error "^3.3.1"
url-join "^4.0.1"

starknet@^4.17.1:
version "4.17.1"
resolved "https://registry.yarnpkg.com/starknet/-/starknet-4.17.1.tgz#2aa429a9b07afd10d2b9a059dfc8cadd4982f6e3"
Expand Down

1 comment on commit b2e4562

@vercel
Copy link

@vercel vercel bot commented on b2e4562 Nov 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

wido-widget – ./

wido-widget.vercel.app
wido-widget-wido.vercel.app
wido-widget-git-main-wido.vercel.app

Please sign in to comment.