-
Notifications
You must be signed in to change notification settings - Fork 8
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
Implement new vechain sdk #276
Draft
Valazan
wants to merge
11
commits into
main-v2
Choose a base branch
from
implement-new-vechain-sdk
base: main-v2
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 10 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
14de4f9
feat: initial new SDK implementation
Valazan ca527b0
feat: renaming ConnexWallet
Valazan 84e91fa
feat: update core library
Valazan 604b16c
feat: reduce required coverage
Valazan 99acff9
feat: add SDK signer
Valazan 5da9fb9
feat: add SDK signer for every source
Valazan 6c79060
test: new SDK signer
Valazan fa84761
feat: update package name in sample-react-app/package.json
Valazan f736995
feat: upgrade typescript versions
Valazan 16bbb20
feat: update .nvmrc
Valazan 5eb9131
Darren/implement new vechain sdk (#310)
darrenvechain 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 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 +1 @@ | ||
v20.11.0 | ||
v20.17.0 |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
43 changes: 43 additions & 0 deletions
43
examples/sample-remix-app/vite.config.ts.timestamp-1725023832880-5fdf82ce4f35.mjs
This file contains 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,43 @@ | ||
// vite.config.ts | ||
import { vitePlugin as remix } from "file:///Users/federicoluigialfeo/developer-workdir/dapp/vechain-dapp-kit/examples/sample-remix-app/node_modules/@remix-run/dev/dist/index.js"; | ||
import { defineConfig } from "file:///Users/federicoluigialfeo/developer-workdir/dapp/vechain-dapp-kit/node_modules/vite/dist/node/index.js"; | ||
import tsconfigPaths from "file:///Users/federicoluigialfeo/developer-workdir/dapp/vechain-dapp-kit/node_modules/vite-tsconfig-paths/dist/index.mjs"; | ||
import { installGlobals } from "file:///Users/federicoluigialfeo/developer-workdir/dapp/vechain-dapp-kit/examples/sample-remix-app/node_modules/@remix-run/node/dist/index.js"; | ||
installGlobals(); | ||
var vite_config_default = defineConfig(({ mode }) => ({ | ||
plugins: [remix(), tsconfigPaths()], | ||
build: { | ||
commonjsOptions: { | ||
transformMixedEsModules: true | ||
} | ||
}, | ||
define: { | ||
// By default, Vite doesn't include shims for NodeJS/ | ||
// necessary for segment analytics lib to work | ||
global: {}, | ||
process: { | ||
env: { DEBUG: void 0 }, | ||
version: "" | ||
// to avoid undefined.slice error | ||
} | ||
}, | ||
resolve: { | ||
alias: { | ||
process: "process/browser", | ||
buffer: "buffer", | ||
crypto: "crypto-browserify", | ||
stream: "stream-browserify", | ||
assert: "assert", | ||
http: "stream-http", | ||
https: "https-browserify", | ||
os: "os-browserify", | ||
url: "url", | ||
util: "util" | ||
} | ||
}, | ||
base: mode === "production" ? "/vechain-dapp-kit/react/" : "/" | ||
})); | ||
export { | ||
vite_config_default as default | ||
}; | ||
//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsidml0ZS5jb25maWcudHMiXSwKICAic291cmNlc0NvbnRlbnQiOiBbImNvbnN0IF9fdml0ZV9pbmplY3RlZF9vcmlnaW5hbF9kaXJuYW1lID0gXCIvVXNlcnMvZmVkZXJpY29sdWlnaWFsZmVvL2RldmVsb3Blci13b3JrZGlyL2RhcHAvdmVjaGFpbi1kYXBwLWtpdC9leGFtcGxlcy9zYW1wbGUtcmVtaXgtYXBwXCI7Y29uc3QgX192aXRlX2luamVjdGVkX29yaWdpbmFsX2ZpbGVuYW1lID0gXCIvVXNlcnMvZmVkZXJpY29sdWlnaWFsZmVvL2RldmVsb3Blci13b3JrZGlyL2RhcHAvdmVjaGFpbi1kYXBwLWtpdC9leGFtcGxlcy9zYW1wbGUtcmVtaXgtYXBwL3ZpdGUuY29uZmlnLnRzXCI7Y29uc3QgX192aXRlX2luamVjdGVkX29yaWdpbmFsX2ltcG9ydF9tZXRhX3VybCA9IFwiZmlsZTovLy9Vc2Vycy9mZWRlcmljb2x1aWdpYWxmZW8vZGV2ZWxvcGVyLXdvcmtkaXIvZGFwcC92ZWNoYWluLWRhcHAta2l0L2V4YW1wbGVzL3NhbXBsZS1yZW1peC1hcHAvdml0ZS5jb25maWcudHNcIjtpbXBvcnQgeyB2aXRlUGx1Z2luIGFzIHJlbWl4IH0gZnJvbSAnQHJlbWl4LXJ1bi9kZXYnO1xuaW1wb3J0IHsgZGVmaW5lQ29uZmlnIH0gZnJvbSAndml0ZSc7XG5pbXBvcnQgdHNjb25maWdQYXRocyBmcm9tICd2aXRlLXRzY29uZmlnLXBhdGhzJztcbmltcG9ydCB7IGluc3RhbGxHbG9iYWxzIH0gZnJvbSAnQHJlbWl4LXJ1bi9ub2RlJztcblx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iOiBbXQp9Cg== |
This file contains 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
This file contains 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
This file contains 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
This file contains 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 |
---|---|---|
|
@@ -56,7 +56,7 @@ | |
"prettier": "^2.5.1", | ||
"punycode": "^1.4.1", | ||
"turbo": "latest", | ||
"typescript": "4.9.5" | ||
"typescript": "5.3.3" | ||
}, | ||
"packageManager": "[email protected]" | ||
} |
This file contains 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
This file contains 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
This file contains 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 |
---|---|---|
|
@@ -3,6 +3,8 @@ import type React from 'react'; | |
import type { ConnectResponse, WalletSource } from '@vechain/dapp-kit'; | ||
import { type DAppKitUIOptions } from '@vechain/dapp-kit-ui'; | ||
import { type Certificate } from '@vechain/sdk-core'; | ||
import type { ThorClient } from '@vechain/sdk-network'; | ||
import { VeChainSignerDAppKit } from '@vechain/dapp-kit/src/classes/vechain-signer'; | ||
|
||
export type { WalletConnectOptions, DAppKitOptions } from '@vechain/dapp-kit'; | ||
export type { DAppKitUIOptions } from '@vechain/dapp-kit-ui'; | ||
|
@@ -27,16 +29,16 @@ export type DAppKitProviderOptions = DAppKitUIOptions & { | |
*/ | ||
|
||
export interface DAppKitContext { | ||
connex: { | ||
thor: Connex.Thor; | ||
vendor: Connex.Vendor; | ||
sdk: { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. IMO just return export interface DAppKitContext {
thor: ThorClient; |
||
thor: ThorClient; | ||
}; | ||
wallet: { | ||
setSource: (source: WalletSource) => void; | ||
availableWallets: WalletSource[]; | ||
disconnect: () => void; | ||
connect: () => Promise<ConnectResponse>; | ||
account: string | null; | ||
signer: VeChainSignerDAppKit | undefined; | ||
source: WalletSource | null; | ||
connectionCertificate: Certificate | null; | ||
}; | ||
|
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Valazan why not
useThor
?useSDK().thor
doesn't type well IMO