Skip to content

Commit

Permalink
Merge conflicts main v2 (#323)
Browse files Browse the repository at this point in the history
* 266 use sdk instead of thor devkit (#267)

* feat: working tests

* feat: remove thor-devkit

* fix: e2e tests

* fix: tests

* Refactor inputs (#268)

* fix: refactor inputs

* fix: improve inputs

* Sonar integration (#254)

* Create sonar-scan.yml

* Create sonar-project.properties

* remove test branch from workflow

---------

Co-authored-by: Fabio Rigamonti <[email protected]>

* Bump 1.0.13 (#269)

* chore: v1.0.13

* fix: versions

* Update README.md (#273)

* fix: update README.md

* fix: update LICENSE

* Adding signed typed data (#286)

* feat: adding signer typed data with connex

* feat: expose signedTypedData

* feat: revert changes to dappKit Driver

* test: sign typed data

* fix: linting

* refactor: simplify signTypedData method in certificate-wallet and wc-wallet

* build: v1.0.14 (#287)

* fix: strict mode issue (#288)

* chore(deps): bump vite from 5.3.5 to 5.3.6 (#279)

Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 5.3.5 to 5.3.6.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/v5.3.6/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v5.3.6/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Davide Carpini <[email protected]>

* chore(deps): bump next in /examples/sample-next-app (#280)

Bumps [next](https://github.com/vercel/next.js) from 14.1.4 to 14.2.10.
- [Release notes](https://github.com/vercel/next.js/releases)
- [Changelog](https://github.com/vercel/next.js/blob/canary/release.js)
- [Commits](vercel/next.js@v14.1.4...v14.2.10)

---
updated-dependencies:
- dependency-name: next
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Davide Carpini <[email protected]>

* chore(deps): bump express from 4.19.2 to 4.21.0 (#281)

Bumps [express](https://github.com/expressjs/express) from 4.19.2 to 4.21.0.
- [Release notes](https://github.com/expressjs/express/releases)
- [Changelog](https://github.com/expressjs/express/blob/4.21.0/History.md)
- [Commits](expressjs/express@4.19.2...4.21.0)

---
updated-dependencies:
- dependency-name: express
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Davide Carpini <[email protected]>

* chore(deps-dev): bump vite from 4.5.3 to 4.5.5 (#289)

Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 4.5.3 to 4.5.5.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/v4.5.5/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v4.5.5/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore: version bump 1.0.15 (#290)

* Add vechain domains (#293)

* feat: add vns domains on react

* fix: configs

* fix: vanilla button and modal

* fix: react stuff

* fix: improved tests

* fix: eslint

* fix: package json

* fix: yarn lock

* fix: build

* fix: eslint

* chore(deps): bump http-proxy-middleware from 2.0.6 to 2.0.7 (#294)

Bumps [http-proxy-middleware](https://github.com/chimurai/http-proxy-middleware) from 2.0.6 to 2.0.7.
- [Release notes](https://github.com/chimurai/http-proxy-middleware/releases)
- [Changelog](https://github.com/chimurai/http-proxy-middleware/blob/v2.0.7/CHANGELOG.md)
- [Commits](chimurai/http-proxy-middleware@v2.0.6...v2.0.7)

---
updated-dependencies:
- dependency-name: http-proxy-middleware
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Davide Carpini <[email protected]>

* feat: allow custom net injection (#257)

Co-authored-by: Fabio Rigamonti <[email protected]>
Co-authored-by: Davide Carpini <[email protected]>

* feat: ping wallet connect on focus (#224)

* feat: ping wallet connect on focus

* fix: if statement for ssr

* fix: update yarn.lock

---------

Co-authored-by: Fabio Rigamonti <[email protected]>
Co-authored-by: Davide Carpini <[email protected]>

* Chore/v1.0.16 (#295)

* chore: v1.0.16

* chore: v1.0.16

* chore: sdk to beta 32

* fix: angular typescript version

* fix: typescript

* fix: add wallets filter

* chore: review build process

* fix: publish packages script

* fix: publish packages script

* fix: publish packages script

* V1.1.0 (#299)

* chore: review build process

* fix: publish packages script

* fix: publish packages script

* chore(release): v1.1.0

* fix: publish script

* fix: useVechainDomain

* fix: decouple fetch vechain domain

* chore(release): v1.1.1

* fix: prepare packages script (#306)

* chore(deps-dev): bump happy-dom from 14.12.3 to 15.10.2 (#309)

Bumps [happy-dom](https://github.com/capricorn86/happy-dom) from 14.12.3 to 15.10.2.
- [Release notes](https://github.com/capricorn86/happy-dom/releases)
- [Commits](capricorn86/happy-dom@v14.12.3...v15.10.2)

---
updated-dependencies:
- dependency-name: happy-dom
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Fabio Rigamonti <[email protected]>

* chore(deps): bump @eslint/plugin-kit from 0.2.1 to 0.2.3 (#312)

Bumps [@eslint/plugin-kit](https://github.com/eslint/rewrite) from 0.2.1 to 0.2.3.
- [Release notes](https://github.com/eslint/rewrite/releases)
- [Changelog](https://github.com/eslint/rewrite/blob/main/release-please-config.json)
- [Commits](eslint/rewrite@plugin-kit-v0.2.1...plugin-kit-v0.2.3)

---
updated-dependencies:
- dependency-name: "@eslint/plugin-kit"
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Fabio Rigamonti <[email protected]>

* fix: merge conflicts

* fix: fix failing tests

* fix: remove duplicated constants

* fix: remove unused files

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: Davide Carpini <[email protected]>
Co-authored-by: WaqarAhmedVC <[email protected]>
Co-authored-by: Valazan <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Darren Kelly <[email protected]>
  • Loading branch information
6 people authored Dec 17, 2024
1 parent 81032f1 commit 5cbc56d
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ export const DAppKitProviderData = ({
const closeModal = useCallback(() => {
DAppKitUI.modal.close();
}, []);

const onModalConnected = useCallback(
(callback: (address: string | null) => void) =>
DAppKitUI.modal.onConnectionStatusChange(callback),
Expand Down Expand Up @@ -181,4 +180,4 @@ export const DAppKitProvider = ({
return (
<DAppKitProviderData dAppKit={dAppKit}>{children}</DAppKitProviderData>
);
};
};
22 changes: 22 additions & 0 deletions packages/dapp-kit-react/src/DAppKitProvider/hooks/useThor.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { describe, it, expect } from 'vitest';
import { renderHook } from '@testing-library/react';
import { useThor } from '../..';
import { wrapper } from '../../../test';

describe('useThor', () => {
it('Thor should get initialised', async () => {
const { result } = renderHook(() => useThor(), { wrapper });

expect(result.current).toBeDefined();
const genesisBlock = await result.current.blocks.getGenesisBlock();
expect(genesisBlock?.id).toBe(
'0x000000000b2bce3c70bc649a02749e8687721b09ed2e15997f466536b20bb127',
);
});

it('should throw an error when used outside of DAppKitProvider', () => {
expect(() => renderHook(() => useThor())).toThrow(
'"useThor" must be used within a DAppKitProvider',
);
});
});
1 change: 0 additions & 1 deletion packages/dapp-kit-react/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import type { CertificateData } from '@vechain/sdk-core';
import type { ThorClient } from '@vechain/sdk-network';

export type { WalletConnectOptions, DAppKitOptions } from '@vechain/dapp-kit';
export type { DAppKitUIOptions } from '@vechain/dapp-kit-ui';

export interface AccountState {
address: string | null;
Expand Down
1 change: 1 addition & 0 deletions packages/dapp-kit/src/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ export type {
WalletSource,
ConnectResponse,
WalletConfig,
BaseWallet,
WalletManagerState,
Genesis,
} from './types';
Expand Down
5 changes: 5 additions & 0 deletions packages/dapp-kit/src/types/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ interface DAppKitOptions {
allowedWallets?: WalletSource[];
}

type BaseWallet = ExpandedConnexSigner & {
disconnect?: () => Promise<void> | void;
};

interface WalletSigner {
signTx: (
msg: TransactionMessage[],
Expand Down Expand Up @@ -98,6 +102,7 @@ interface WalletManagerState {
}

export type {
BaseWallet,
DAppKitOptions,
VeChainWallet,
WalletConfig,
Expand Down
6 changes: 5 additions & 1 deletion packages/dapp-kit/src/utils/create-wallet.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import type { ThorClient } from '@vechain/sdk-network';
import type {
BaseWallet,
DAppKitOptions,
VeChainWallet,
WalletSource,
Expand Down Expand Up @@ -70,7 +71,10 @@ export const createWallet = ({
throw e;
});

return new CertificateBasedWallet(signer, connectionCertificate);
return new CertificateBasedWallet(
signer as BaseWallet,
connectionCertificate,
);
}
case 'wallet-connect': {
if (!walletConnectOptions) {
Expand Down
4 changes: 2 additions & 2 deletions scripts/prepare-packages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ const preparePackages = async () => {
console.log(' - ✅ Removed!');

console.log(' Build:');
console.log(' - 📦 Building packages...');
await exec('yarn install && yarn install:all');
console.log(' - 📦 Install dependencies and build packages...');
await exec('yarn install:all');
console.log(' - ✅ Built!');

console.log(' Test:');
Expand Down

0 comments on commit 5cbc56d

Please sign in to comment.