@hashgraph/hedera-wallet-connect 1.3.7-canary.de9fb58.0 → 1.3.7
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/{src/lib → lib}/dapp/DAppSigner.d.ts +18 -2
- package/dist/{src/lib → lib}/dapp/DAppSigner.js +109 -30
- package/dist/{src/lib → lib}/dapp/index.d.ts +4 -0
- package/dist/{src/lib → lib}/dapp/index.js +39 -40
- package/dist/{src/lib → lib}/shared/logger.d.ts +1 -0
- package/dist/{src/lib → lib}/shared/logger.js +3 -0
- package/dist/{src/lib → lib}/shared/utils.d.ts +8 -2
- package/dist/{src/lib → lib}/shared/utils.js +10 -2
- package/package.json +4 -3
- package/dist/test/_helpers.d.ts +0 -38
- package/dist/test/_helpers.js +0 -95
- package/dist/test/dapp/DAppConnector.test.d.ts +0 -1
- package/dist/test/dapp/DAppConnector.test.js +0 -232
- package/dist/test/dapp/DAppSigner.test.d.ts +0 -1
- package/dist/test/dapp/DAppSigner.test.js +0 -625
- package/dist/test/shared/logger.test.d.ts +0 -1
- package/dist/test/shared/logger.test.js +0 -129
- package/dist/test/utils.test.d.ts +0 -1
- package/dist/test/utils.test.js +0 -201
- package/dist/test/wallet/methods/wallet-executeTransaction.test.d.ts +0 -1
- package/dist/test/wallet/methods/wallet-executeTransaction.test.js +0 -43
- package/dist/test/wallet/methods/wallet-getNodeAddresses.test.d.ts +0 -1
- package/dist/test/wallet/methods/wallet-getNodeAddresses.test.js +0 -40
- package/dist/test/wallet/methods/wallet-signAndExecuteQuery.test.d.ts +0 -1
- package/dist/test/wallet/methods/wallet-signAndExecuteQuery.test.js +0 -41
- package/dist/test/wallet/methods/wallet-signAndExecuteTransaction.test.d.ts +0 -1
- package/dist/test/wallet/methods/wallet-signAndExecuteTransaction.test.js +0 -48
- package/dist/test/wallet/methods/wallet-signMessage.test.d.ts +0 -1
- package/dist/test/wallet/methods/wallet-signMessage.test.js +0 -60
- package/dist/test/wallet/methods/wallet-signTransaction.test.d.ts +0 -1
- package/dist/test/wallet/methods/wallet-signTransaction.test.js +0 -47
- package/dist/test/wallet/wallet-init.test.d.ts +0 -1
- package/dist/test/wallet/wallet-init.test.js +0 -53
- /package/dist/{src/index.d.ts → index.d.ts} +0 -0
- /package/dist/{src/index.js → index.js} +0 -0
- /package/dist/{src/lib → lib}/index.d.ts +0 -0
- /package/dist/{src/lib → lib}/index.js +0 -0
- /package/dist/{src/lib → lib}/shared/chainIds.d.ts +0 -0
- /package/dist/{src/lib → lib}/shared/chainIds.js +0 -0
- /package/dist/{src/lib → lib}/shared/errors.d.ts +0 -0
- /package/dist/{src/lib → lib}/shared/errors.js +0 -0
- /package/dist/{src/lib → lib}/shared/events.d.ts +0 -0
- /package/dist/{src/lib → lib}/shared/events.js +0 -0
- /package/dist/{src/lib → lib}/shared/extensionController.d.ts +0 -0
- /package/dist/{src/lib → lib}/shared/extensionController.js +0 -0
- /package/dist/{src/lib → lib}/shared/index.d.ts +0 -0
- /package/dist/{src/lib → lib}/shared/index.js +0 -0
- /package/dist/{src/lib → lib}/shared/methods.d.ts +0 -0
- /package/dist/{src/lib → lib}/shared/methods.js +0 -0
- /package/dist/{src/lib → lib}/shared/payloads.d.ts +0 -0
- /package/dist/{src/lib → lib}/shared/payloads.js +0 -0
- /package/dist/{src/lib → lib}/wallet/index.d.ts +0 -0
- /package/dist/{src/lib → lib}/wallet/index.js +0 -0
- /package/dist/{src/lib → lib}/wallet/provider.d.ts +0 -0
- /package/dist/{src/lib → lib}/wallet/provider.js +0 -0
- /package/dist/{src/lib → lib}/wallet/types.d.ts +0 -0
- /package/dist/{src/lib → lib}/wallet/types.js +0 -0
@@ -1,53 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
*
|
3
|
-
* Hedera Wallet Connect
|
4
|
-
*
|
5
|
-
* Copyright (C) 2023 Hedera Hashgraph, LLC
|
6
|
-
*
|
7
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
8
|
-
* you may not use this file except in compliance with the License.
|
9
|
-
* You may obtain a copy of the License at
|
10
|
-
*
|
11
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
12
|
-
*
|
13
|
-
* Unless required by applicable law or agreed to in writing, software
|
14
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
15
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
16
|
-
* See the License for the specific language governing permissions and
|
17
|
-
* limitations under the License.
|
18
|
-
*
|
19
|
-
*/
|
20
|
-
import { Wallet as HederaWallet, LedgerId } from '@hashgraph/sdk';
|
21
|
-
import { HederaChainId, Wallet } from '../../src';
|
22
|
-
import { defaultAccountNumber, projectId, testPrivateKeyECDSA, walletMetadata, } from '../_helpers';
|
23
|
-
describe(Wallet.name, () => {
|
24
|
-
describe('create', () => {
|
25
|
-
let wallet;
|
26
|
-
beforeAll(async () => {
|
27
|
-
wallet = await Wallet.create(projectId, walletMetadata);
|
28
|
-
});
|
29
|
-
it('should create Wallet instance with a projectId and walletMetadata', async () => {
|
30
|
-
expect(wallet).toBeInstanceOf(Wallet);
|
31
|
-
expect(wallet.metadata).toBe(walletMetadata);
|
32
|
-
expect(wallet.core.projectId).toBe(projectId);
|
33
|
-
});
|
34
|
-
describe('getHederaWallet', () => {
|
35
|
-
// [HederaChainId, accountId, LedgerId]
|
36
|
-
const testCases = [
|
37
|
-
[HederaChainId.Mainnet, defaultAccountNumber, LedgerId.MAINNET],
|
38
|
-
[HederaChainId.Previewnet, defaultAccountNumber, LedgerId.PREVIEWNET],
|
39
|
-
[HederaChainId.Testnet, defaultAccountNumber, LedgerId.TESTNET],
|
40
|
-
[HederaChainId.Mainnet, `0.0.${defaultAccountNumber}`, LedgerId.MAINNET],
|
41
|
-
[HederaChainId.Previewnet, `0.0.${defaultAccountNumber}`, LedgerId.PREVIEWNET],
|
42
|
-
[HederaChainId.Testnet, `0.0.${defaultAccountNumber}`, LedgerId.TESTNET],
|
43
|
-
];
|
44
|
-
test.each(testCases)('it should initialize HederaWallet with %p chainId and %p accountId', async (chainId, accountId, ledgerId) => {
|
45
|
-
const hederaWallet = wallet.getHederaWallet(chainId, accountId.toString(), testPrivateKeyECDSA);
|
46
|
-
expect(wallet).toBeInstanceOf(Wallet);
|
47
|
-
expect(hederaWallet).toBeInstanceOf(HederaWallet);
|
48
|
-
expect(hederaWallet.accountId.toString()).toBe(`0.0.${defaultAccountNumber}`);
|
49
|
-
expect(hederaWallet.provider.getLedgerId()).toBe(ledgerId);
|
50
|
-
});
|
51
|
-
});
|
52
|
-
});
|
53
|
-
});
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|