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

Merge conflicts main v2 #323

Merged
merged 39 commits into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
959bc3b
266 use sdk instead of thor devkit (#267)
davidecarpini Jul 31, 2024
da645ce
Refactor inputs (#268)
fabiorigam Aug 1, 2024
79cdc48
Sonar integration (#254)
WaqarAhmedVC Aug 1, 2024
4471337
Bump 1.0.13 (#269)
davidecarpini Aug 19, 2024
d9b3bd2
Update README.md (#273)
fabiorigam Oct 2, 2024
acde52d
Adding signed typed data (#286)
Valazan Oct 9, 2024
d866b5b
build: v1.0.14 (#287)
davidecarpini Oct 9, 2024
7bae639
fix: strict mode issue (#288)
davidecarpini Oct 21, 2024
c699b4e
chore(deps): bump vite from 5.3.5 to 5.3.6 (#279)
dependabot[bot] Oct 21, 2024
ee79772
chore(deps): bump next in /examples/sample-next-app (#280)
dependabot[bot] Oct 21, 2024
85ad481
chore(deps): bump express from 4.19.2 to 4.21.0 (#281)
dependabot[bot] Oct 21, 2024
dc1c15c
chore(deps-dev): bump vite from 4.5.3 to 4.5.5 (#289)
dependabot[bot] Oct 21, 2024
76a4c96
chore: version bump 1.0.15 (#290)
davidecarpini Oct 25, 2024
8d38c7b
Add vechain domains (#293)
davidecarpini Oct 25, 2024
fa31cef
chore(deps): bump http-proxy-middleware from 2.0.6 to 2.0.7 (#294)
dependabot[bot] Oct 25, 2024
3eda951
feat: allow custom net injection (#257)
darrenvechain Oct 28, 2024
7c40e7d
feat: ping wallet connect on focus (#224)
darrenvechain Oct 28, 2024
639d7c2
Chore/v1.0.16 (#295)
davidecarpini Oct 28, 2024
3116b16
chore: sdk to beta 32
davidecarpini Oct 28, 2024
4708de1
fix: angular typescript version
davidecarpini Oct 28, 2024
2f66ea1
fix: typescript
davidecarpini Oct 28, 2024
64d1bdd
fix: add wallets filter
davidecarpini Oct 28, 2024
74d90cc
chore: review build process
davidecarpini Oct 28, 2024
8e0f5f6
fix: publish packages script
davidecarpini Oct 28, 2024
9157ded
fix: publish packages script
davidecarpini Oct 28, 2024
011abb0
fix: publish packages script
davidecarpini Oct 28, 2024
84a9356
V1.1.0 (#299)
davidecarpini Oct 28, 2024
baf26f6
fix: publish script
davidecarpini Oct 28, 2024
254bebd
fix: useVechainDomain
davidecarpini Oct 31, 2024
fda85b1
fix: decouple fetch vechain domain
davidecarpini Nov 4, 2024
c52d8c9
chore(release): v1.1.1
davidecarpini Nov 4, 2024
0034b6c
fix: prepare packages script (#306)
davidecarpini Nov 25, 2024
67371ae
chore(deps-dev): bump happy-dom from 14.12.3 to 15.10.2 (#309)
dependabot[bot] Nov 25, 2024
48a95d2
chore(deps): bump @eslint/plugin-kit from 0.2.1 to 0.2.3 (#312)
dependabot[bot] Nov 25, 2024
b6c85ee
fix: merge conflicts
fabiorigam Dec 16, 2024
bdee1b8
fix: merge conflicts
fabiorigam Dec 16, 2024
41c4cf0
fix: fix failing tests
fabiorigam Dec 16, 2024
ebad073
fix: remove duplicated constants
fabiorigam Dec 16, 2024
2efa08b
fix: remove unused files
fabiorigam Dec 16, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading