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

Function setSupplierInfoDID

packages/cardpay-cli/safe.ts:96–111  ·  view source on GitHub ↗
(
  network: string,
  safe: string,
  infoDID: string,
  gasToken: string,
  mnemonic?: string
)

Source from the content-addressed store, hash-verified

94}
95
96export async function setSupplierInfoDID(
97 network: string,
98 safe: string,
99 infoDID: string,
100 gasToken: string,
101 mnemonic?: string
102): Promise<void> {
103 let web3 = await getWeb3(network, mnemonic);
104 let safes = await getSDK('Safes', web3);
105 let assets = await getSDK('Assets', web3);
106 let { symbol } = await assets.getTokenInfo(gasToken);
107 console.log(`setting the info DID for the supplier safe ${safe} to ${infoDID} using ${symbol} token to pay for gas`);
108 let result = await safes.setSupplierInfoDID(safe, infoDID, gasToken);
109 let blockExplorer = await getConstant('blockExplorer', web3);
110 console.log(`Transaction hash: ${blockExplorer}/tx/${result.ethereumTx.txHash}/token-transfers`);
111}

Callers 1

index.tsFile · 0.85

Calls 6

getWeb3Function · 0.90
getSDKFunction · 0.90
getConstantFunction · 0.90
setSupplierInfoDIDMethod · 0.80
getTokenInfoMethod · 0.65
logMethod · 0.45

Tested by

no test coverage detected