@marigoldlabs/web3-tester 0.1.2 → 0.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. package/.env.example +26 -17
  2. package/LICENSE +21 -0
  3. package/README.md +480 -48
  4. package/dist/anvil.d.ts +90 -2
  5. package/dist/anvil.d.ts.map +1 -1
  6. package/dist/anvil.js +215 -13
  7. package/dist/anvil.js.map +1 -1
  8. package/dist/benchmark.d.ts +55 -0
  9. package/dist/benchmark.d.ts.map +1 -0
  10. package/dist/benchmark.js +168 -0
  11. package/dist/benchmark.js.map +1 -0
  12. package/dist/contracts/test-erc20.d.ts +227 -0
  13. package/dist/contracts/test-erc20.d.ts.map +1 -0
  14. package/dist/contracts/test-erc20.js +8 -0
  15. package/dist/contracts/test-erc20.js.map +1 -0
  16. package/dist/erc20.d.ts +38 -0
  17. package/dist/erc20.d.ts.map +1 -0
  18. package/dist/erc20.js +229 -0
  19. package/dist/erc20.js.map +1 -0
  20. package/dist/fixtures.d.ts +44 -2
  21. package/dist/fixtures.d.ts.map +1 -1
  22. package/dist/fixtures.js +162 -17
  23. package/dist/fixtures.js.map +1 -1
  24. package/dist/index.d.ts +26 -5
  25. package/dist/index.d.ts.map +1 -1
  26. package/dist/index.js +11 -1
  27. package/dist/index.js.map +1 -1
  28. package/dist/injected-provider.d.ts.map +1 -1
  29. package/dist/injected-provider.js +863 -77
  30. package/dist/injected-provider.js.map +1 -1
  31. package/dist/live-fixtures.d.ts +32 -3
  32. package/dist/live-fixtures.d.ts.map +1 -1
  33. package/dist/live-fixtures.js +64 -27
  34. package/dist/live-fixtures.js.map +1 -1
  35. package/dist/matchers.d.ts +90 -0
  36. package/dist/matchers.d.ts.map +1 -0
  37. package/dist/matchers.js +268 -0
  38. package/dist/matchers.js.map +1 -0
  39. package/dist/metamask-extension.d.ts +34 -0
  40. package/dist/metamask-extension.d.ts.map +1 -0
  41. package/dist/metamask-extension.js +97 -0
  42. package/dist/metamask-extension.js.map +1 -0
  43. package/dist/mock-wallet-controller.d.ts +354 -4
  44. package/dist/mock-wallet-controller.d.ts.map +1 -1
  45. package/dist/mock-wallet-controller.js +1444 -58
  46. package/dist/mock-wallet-controller.js.map +1 -1
  47. package/dist/private-key-rpc-client.d.ts +1744 -2
  48. package/dist/private-key-rpc-client.d.ts.map +1 -1
  49. package/dist/private-key-rpc-client.js +245 -30
  50. package/dist/private-key-rpc-client.js.map +1 -1
  51. package/dist/real-wallet-cache.d.ts +103 -0
  52. package/dist/real-wallet-cache.d.ts.map +1 -0
  53. package/dist/real-wallet-cache.js +331 -0
  54. package/dist/real-wallet-cache.js.map +1 -0
  55. package/dist/real-wallet-extension-fixtures.d.ts +35 -0
  56. package/dist/real-wallet-extension-fixtures.d.ts.map +1 -0
  57. package/dist/real-wallet-extension-fixtures.js +96 -0
  58. package/dist/real-wallet-extension-fixtures.js.map +1 -0
  59. package/dist/real-wallet-extension.d.ts +86 -0
  60. package/dist/real-wallet-extension.d.ts.map +1 -0
  61. package/dist/real-wallet-extension.js +245 -0
  62. package/dist/real-wallet-extension.js.map +1 -0
  63. package/dist/real-wallet-fixtures.d.ts +52 -0
  64. package/dist/real-wallet-fixtures.d.ts.map +1 -0
  65. package/dist/real-wallet-fixtures.js +88 -0
  66. package/dist/real-wallet-fixtures.js.map +1 -0
  67. package/dist/real-wallet.d.ts +119 -19
  68. package/dist/real-wallet.d.ts.map +1 -1
  69. package/dist/real-wallet.js +1656 -144
  70. package/dist/real-wallet.js.map +1 -1
  71. package/dist/safe.d.ts +311 -0
  72. package/dist/safe.d.ts.map +1 -0
  73. package/dist/safe.js +743 -0
  74. package/dist/safe.js.map +1 -0
  75. package/dist/transactions.d.ts +118 -0
  76. package/dist/transactions.d.ts.map +1 -0
  77. package/dist/transactions.js +207 -0
  78. package/dist/transactions.js.map +1 -0
  79. package/dist/types.d.ts +36 -1
  80. package/dist/types.d.ts.map +1 -1
  81. package/dist/wallet-personas.d.ts +99 -0
  82. package/dist/wallet-personas.d.ts.map +1 -0
  83. package/dist/wallet-personas.js +666 -0
  84. package/dist/wallet-personas.js.map +1 -0
  85. package/dist/walletconnect.d.ts +373 -0
  86. package/dist/walletconnect.d.ts.map +1 -0
  87. package/dist/walletconnect.js +799 -0
  88. package/dist/walletconnect.js.map +1 -0
  89. package/examples/live-sepolia.spec.ts +20 -1
  90. package/examples/playwright.config.ts +8 -0
  91. package/package.json +90 -8
  92. package/docs/API.md +0 -223
  93. package/docs/ARCHITECTURE.md +0 -81
  94. package/docs/CONSUMING_FROM_FJORD.md +0 -123
  95. package/docs/FJORD_LIVE_QA.md +0 -87
  96. package/docs/RELEASE_CHECKLIST.md +0 -55
@@ -1,123 +0,0 @@
1
- # Consuming Web3 Tester From Fjord V4
2
-
3
- This guide covers adding the published package to Fjord v4 as a dependency.
4
-
5
- ## Install
6
-
7
- ```bash
8
- npm install --save-dev @marigoldlabs/web3-tester
9
- ```
10
-
11
- For a pinned dependency, use an exact package version:
12
-
13
- ```bash
14
- npm install --save-dev @marigoldlabs/web3-tester@<version>
15
- ```
16
-
17
- ## Playwright Config
18
-
19
- Use Fjord's existing Playwright config if it already exists. The important parts are:
20
-
21
- ```ts
22
- import { defineConfig, devices } from '@playwright/test';
23
-
24
- export default defineConfig({
25
- fullyParallel: true,
26
- retries: process.env.CI ? 2 : 0,
27
- use: {
28
- baseURL: process.env.DAPP_URL ?? 'http://localhost:3000',
29
- trace: 'on-first-retry',
30
- },
31
- projects: [
32
- {
33
- name: 'chromium',
34
- use: { ...devices['Desktop Chrome'] },
35
- },
36
- ],
37
- });
38
- ```
39
-
40
- ## Local Deterministic Tests
41
-
42
- ```ts
43
- import { expect, test } from '@marigoldlabs/web3-tester/fixtures';
44
-
45
- test('connects through the injected provider', async ({ page, wallet }) => {
46
- await page.goto('/');
47
-
48
- await page.getByRole('button', { name: /connect wallet/i }).click();
49
- await page.getByText('Mock Wallet').click();
50
-
51
- await expect(page.getByText(wallet.primaryAccount.slice(0, 6))).toBeVisible();
52
- });
53
- ```
54
-
55
- ## Test Options
56
-
57
- Customize provider identity for wallet selector coverage:
58
-
59
- ```ts
60
- test.use({
61
- walletOptions: {
62
- providerInfo: { name: 'MetaMask', rdns: 'io.metamask' },
63
- additionalProviders: [
64
- { name: 'Rabby', rdns: 'io.rabby' },
65
- { name: 'Rainbow', rdns: 'me.rainbow' },
66
- ],
67
- },
68
- });
69
- ```
70
-
71
- Customize Anvil:
72
-
73
- ```ts
74
- test.use({
75
- anvilOptions: {
76
- runtime: 'docker',
77
- chainId: 31337,
78
- forkUrl: process.env.ANVIL_FORK_URL,
79
- },
80
- });
81
- ```
82
-
83
- ## Live Sepolia Tests
84
-
85
- ```ts
86
- import { expect, test } from '@marigoldlabs/web3-tester/live-fixtures';
87
-
88
- test.skip(!process.env.FJORD_PRIVATE_KEY, 'FJORD_PRIVATE_KEY is required.');
89
-
90
- test('loads the Sepolia account', async ({ page, wallet }) => {
91
- await page.goto('/');
92
- await expect(page.getByText(wallet.primaryAccount.slice(0, 6))).toBeVisible();
93
- });
94
- ```
95
-
96
- Run with:
97
-
98
- ```powershell
99
- $env:FJORD_PRIVATE_KEY = '<runtime-only-key>'
100
- $env:SEPOLIA_RPC_URL = '<optional-rpc-url>'
101
- npm test
102
- ```
103
-
104
- ## Mutation Gates
105
-
106
- Use explicit flags for anything that spends funds or mutates backend state:
107
-
108
- ```powershell
109
- $env:FJORD_RUN_TRANSACTIONS = 'true'
110
- $env:FJORD_MUTATE_STATE = 'true'
111
- $env:FJORD_PUBLISH_SALES = 'true'
112
- $env:FJORD_ADMIN_MUTATE = 'true'
113
- ```
114
-
115
- Keep destructive or expensive tests behind separate flags so normal CI remains read-only.
116
-
117
- ## CI Recommendations
118
-
119
- - Run deterministic Anvil tests on every PR.
120
- - Run live Sepolia read-only tests on a scheduled job or protected branch.
121
- - Run live mutation tests manually with approval.
122
- - Store `FJORD_PRIVATE_KEY` and `SEPOLIA_RPC_URL` only as CI secrets.
123
- - Pin the npm dependency to an exact version once Fjord depends on it.
@@ -1,87 +0,0 @@
1
- # Fjord V4 Live QA
2
-
3
- The Fjord QA specs in `tests/fjord*.spec.ts` are the working executable version of the manual QA document.
4
-
5
- Target:
6
-
7
- ```text
8
- https://v4.fjordfoundry.com
9
- ```
10
-
11
- Network:
12
-
13
- ```text
14
- Sepolia
15
- ```
16
-
17
- Any legacy "mainnet" wording in the manual QA doc is treated as Sepolia for this test harness.
18
-
19
- ## Test Categories
20
-
21
- | Category | Specs | Default behavior |
22
- | --- | --- | --- |
23
- | Public read-only | `fjord-public`, `fjord`, public parts of other specs | Runs without private key where possible. |
24
- | Live wallet read-only | `fjord-live-sepolia`, `fjord-auth-edge`, `fjord-partials-live` | Requires `FJORD_PRIVATE_KEY`. |
25
- | Live transaction | `fjord-live-transaction` | Requires `FJORD_RUN_TRANSACTIONS=true`. |
26
- | Live mutations | `fjord-live-mutations` | Requires `FJORD_MUTATE_STATE=true`. |
27
- | Sale publishing | `fjord-live-mutations` publish branch | Requires `FJORD_PUBLISH_SALES=true`. |
28
- | Admin mutations | `fjord-admin-mutations` | Requires `FJORD_ADMIN_MUTATE=true`. |
29
-
30
- ## Read-Only Run
31
-
32
- ```powershell
33
- $env:FJORD_PRIVATE_KEY = '<runtime-only-key>'
34
- $env:DAPP_URL = 'https://v4.fjordfoundry.com'
35
- npm test -- --reporter=list tests/fjord-public.spec.ts tests/fjord-live-sepolia.spec.ts tests/fjord-auth-edge.spec.ts tests/fjord-partials-live.spec.ts
36
- ```
37
-
38
- ## Live Mutation Run
39
-
40
- ```powershell
41
- $env:FJORD_PRIVATE_KEY = '<runtime-only-key>'
42
- $env:DAPP_URL = 'https://v4.fjordfoundry.com'
43
- $env:FJORD_MUTATE_STATE = 'true'
44
- $env:FJORD_QA_RUN_ID = 'YYYYMMDDXX'
45
- npm test -- --reporter=list tests/fjord-live-mutations.spec.ts
46
- ```
47
-
48
- ## Sale Publish Attempt
49
-
50
- ```powershell
51
- $env:FJORD_PRIVATE_KEY = '<runtime-only-key>'
52
- $env:FJORD_MUTATE_STATE = 'true'
53
- $env:FJORD_PUBLISH_SALES = 'true'
54
- $env:FJORD_QA_RUN_ID = 'YYYYMMDDPX'
55
- npm test -- --reporter=list tests/fjord-live-mutations.spec.ts
56
- ```
57
-
58
- ## Admin Mutation Attempt
59
-
60
- ```powershell
61
- $env:FJORD_PRIVATE_KEY = '<runtime-only-key>'
62
- $env:FJORD_ADMIN_MUTATE = 'true'
63
- npm test -- --reporter=list tests/fjord-admin-mutations.spec.ts
64
- ```
65
-
66
- ## Reporting Rules
67
-
68
- - Record `PASS`, `FAIL`, `PARTIAL`, `BLOCKED`, `NOT RUN`, or `N/A` for every doc line.
69
- - When a line fails, note the observable behavior and continue to the next line.
70
- - Do not collapse a doc mismatch into a product failure if the live UI has moved the control.
71
- - Never paste private keys into reports.
72
- - Include transaction hashes and deployed QA addresses when they help debugging.
73
-
74
- ## Current Report Artifacts
75
-
76
- - `reports/fjord-full-line-by-line-qa-2026-05-14.md`
77
- - `reports/fjord-qa-results-2026-05-14.md`
78
-
79
- ## Known Findings From The 2026-05-14 Run
80
-
81
- - ERC-20 deployment from the Fjord UI succeeded.
82
- - Token supply input minted raw units rather than the expected human-token amount.
83
- - Fixed-price sale draft creation reached review.
84
- - The review step did not show the documented full sale summary.
85
- - Publishing submitted an ERC-20 approval transaction but did not continue to pool creation.
86
- - Saved QA drafts were not listed in the resume dialog.
87
- - `/admin/cache` failed loading admin data with backend `401`.
@@ -1,55 +0,0 @@
1
- # Release Checklist
2
-
3
- Use this before publishing a new version or pinning it inside Fjord v4.
4
-
5
- ## Required
6
-
7
- - `npm run typecheck`
8
- - `npm run build`
9
- - `npm test`
10
- - `rg -n "FJORD_PRIVATE_KEY\\s*=\\s*0x[0-9a-fA-F]{64}|PRIVATE_KEY=.*[0-9a-fA-F]{64}" . -g "!node_modules/**" -g "!dist/**" -g "!.npm-cache/**"`
11
- - Confirm `.env` is ignored.
12
- - Confirm `dist/` is generated locally but not required in source review unless the team wants committed build output.
13
-
14
- ## Dependency Consumer Check
15
-
16
- From a clean consumer repo:
17
-
18
- ```bash
19
- npm install --save-dev @marigoldlabs/web3-tester@<version>
20
- ```
21
-
22
- Then import:
23
-
24
- ```ts
25
- import { expect, test } from '@marigoldlabs/web3-tester/fixtures';
26
- ```
27
-
28
- Run one provider smoke test.
29
-
30
- ## Live QA Check
31
-
32
- Run live tests only with runtime secrets:
33
-
34
- ```powershell
35
- $env:FJORD_PRIVATE_KEY = '<runtime-only-key>'
36
- $env:DAPP_URL = 'https://v4.fjordfoundry.com'
37
- npm test -- --reporter=list tests/fjord-live-sepolia.spec.ts
38
- ```
39
-
40
- Mutation runs require explicit flags and should not be part of default CI.
41
-
42
- ## Push
43
-
44
- ```bash
45
- git status --short
46
- git add .
47
- git commit -m "Document and package Web3 tester"
48
- git push -u origin main
49
- ```
50
-
51
- ## Publish
52
-
53
- ```bash
54
- npm publish --access public
55
- ```