-
Notifications
You must be signed in to change notification settings - Fork 146
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: mock nfts and txs hiro requests
- Loading branch information
1 parent
ea76352
commit 318378d
Showing
4 changed files
with
70 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import type { Page } from '@playwright/test'; | ||
|
||
import { TEST_ACCOUNT_1_STX_ADDRESS } from './constants'; | ||
|
||
export async function mockMainnetTestAccountStacksBnsNameRequest(page: Page) { | ||
await page.route(`**/api.hiro.so/v1/addresses/stacks/${TEST_ACCOUNT_1_STX_ADDRESS}`, route => | ||
route.fulfill({ | ||
json: { | ||
names: [], | ||
}, | ||
}) | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import type { Page } from '@playwright/test'; | ||
|
||
import { TEST_ACCOUNT_1_STX_ADDRESS } from './constants'; | ||
|
||
export async function mockMainnetTestAccountStacksNFTsRequest(page: Page) { | ||
await page.route( | ||
`**/api.hiro.so/extended/v1/tokens/nft/holdings?principal=${TEST_ACCOUNT_1_STX_ADDRESS}&limit=50`, | ||
route => | ||
route.fulfill({ | ||
json: { | ||
limit: 50, | ||
offset: 0, | ||
total: 0, | ||
results: [], | ||
}, | ||
}) | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import type { Page } from '@playwright/test'; | ||
|
||
import { TEST_ACCOUNT_1_STX_ADDRESS } from './constants'; | ||
|
||
export async function mockMainnetTestAccountStacksTxsRequests(page: Page) { | ||
await Promise.all([ | ||
page.route( | ||
`**/api.hiro.so/extended/v1/address/${TEST_ACCOUNT_1_STX_ADDRESS}/transactions_with_transfers?limit=50`, | ||
route => | ||
route.fulfill({ | ||
json: { | ||
limit: 50, | ||
offset: 0, | ||
total: 0, | ||
results: [], | ||
}, | ||
}) | ||
), | ||
|
||
page.route( | ||
`**/api.hiro.so/extended/v1/tx/mempool?address=${TEST_ACCOUNT_1_STX_ADDRESS}&limit=50`, | ||
route => | ||
route.fulfill({ | ||
json: { | ||
limit: 50, | ||
offset: 0, | ||
total: 0, | ||
results: [], | ||
}, | ||
}) | ||
), | ||
]); | ||
} |