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

Add mock wallet & Implement mock wallet extension injection into wind… #750

Merged
merged 17 commits into from
Apr 19, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
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
6,862 changes: 6,862 additions & 0 deletions tests/cardano-test-wallet/index.js

Large diffs are not rendered by default.

23 changes: 23 additions & 0 deletions tests/cardano-test-wallet/index.js.LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*!
*
* /*!
* * The cardano-test-wallet module for browser environments.
* *
* * @author Nabin Kawan
* * @license MIT
* * /
*
*/

/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <https://feross.org>
* @license MIT
*/

/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */

/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */

/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
55 changes: 55 additions & 0 deletions tests/cardano-test-wallet/types.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
export type HexString = string;
export interface CIP30Provider {
apiVersion: string;
enable: () => Promise<CIP30Instance | Cip95Instance>;
icon: string;
isEnabled: () => Promise<Boolean>;
name: string;
supportedExtensions: Record<string, number>[];
}
export interface CIP30Instance {
submitTx: (tx: string) => Promise<string>;
signTx: (tx: string, partial?: Boolean) => Promise<HexString>;
getChangeAddress: () => Promise<HexString>;
getNetworkId: () => Promise<number>;
getRewardAddresses: () => Promise<HexString[]>;
getUnusedAddresses: () => Promise<HexString[]>;
getUsedAddresses: () => Promise<Array<HexString>>;
getUtxos: (amount?: object, paginate?: any) => Promise<Array<HexString>>;
getCollateral?: () => Promise<Array<HexString>>;
signData: (address: string, payload: HexString) => Promise<HexString>;
getBalance: () => Promise<string>;
}
export interface Cip95Instance extends CIP30Instance {
cip95: {
getPubDRepKey: () => Promise<HexString>;
getUnregisteredPubStakeKeys: () => Promise<HexString[]>;
getRegisteredPubStakeKeys: () => Promise<HexString[]>;
};
getActivePubStakeKeys: () => Promise<HexString[]>;
getExtensions: () => Record<string, number>[];
}
export type CardanoTestWallet = {
payment: {
private: string;
public: string;
pkh: string;
};
stake: {
private: string;
public: string;
pkh: string;
};
};
export type CardanoTestWalletConfig = {
networkId?: number;
walletName?: string;
enableStakeSigning?: boolean;
extraRegisteredPubStakeKeys?: string[];
extraRewardAddresses?: string[];
kuberApiUrl: string;
kuberApiKey: string;
};
export type KuberValue = {
[policyId: string]: Record<string, BigInt | number> | BigInt | number;
};
13 changes: 0 additions & 13 deletions tests/govtool-frontend/playwright/.gitignore

This file was deleted.

6 changes: 0 additions & 6 deletions tests/govtool-frontend/playwright/.prettierignore

This file was deleted.

Loading
Loading