MCPcopy Create free account
hub / github.com/cardstack/cardstack / viewSafe

Function viewSafe

packages/cardpay-cli/safe.ts:8–22  ·  view source on GitHub ↗
(network: string, address: string, mnemonic?: string)

Source from the content-addressed store, hash-verified

6const { toWei } = Web3.utils;
7
8export async function viewSafe(network: string, address: string, mnemonic?: string): Promise<void> {
9 let web3 = await getWeb3(network, mnemonic);
10
11 let safesApi = await getSDK('Safes', web3);
12 console.log(`Getting safe ${address}`);
13 let safe = await safesApi.viewSafe(address);
14 console.log();
15 if (!safe) {
16 console.log(`The address ${address} is not a safe`);
17 } else {
18 displaySafe(address, safe);
19 }
20
21 console.log();
22}
23
24export async function viewSafes(network: string, address: string | undefined, mnemonic?: string): Promise<void> {
25 let web3 = await getWeb3(network, mnemonic);

Callers 1

index.tsFile · 0.85

Calls 5

getWeb3Function · 0.90
getSDKFunction · 0.90
displaySafeFunction · 0.85
viewSafeMethod · 0.80
logMethod · 0.45

Tested by

no test coverage detected