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

Function claimLayer1BridgedTokens

packages/cardpay-cli/bridge.ts:49–65  ·  view source on GitHub ↗
(
  network: string,
  messageId: string,
  encodedData: string,
  signatures: string[],
  mnemonic?: string
)

Source from the content-addressed store, hash-verified

47}
48
49export async function claimLayer1BridgedTokens(
50 network: string,
51 messageId: string,
52 encodedData: string,
53 signatures: string[],
54 mnemonic?: string
55): Promise<void> {
56 let web3 = await getWeb3(network, mnemonic);
57 let tokenBridge = await getSDK('TokenBridgeForeignSide', web3);
58 let blockExplorer = await getConstant('blockExplorer', web3);
59
60 console.log(`Claiming layer 1 bridge tokens for message ID ${messageId}...`);
61 await tokenBridge.claimBridgedTokens(messageId, encodedData, signatures, (txnHash) =>
62 console.log(`transaction hash: ${blockExplorer}/tx/${txnHash}`)
63 );
64 console.log('Completed');
65}
66
67export async function bridgeToLayer2(
68 network: string,

Callers 1

index.tsFile · 0.85

Calls 5

getWeb3Function · 0.90
getSDKFunction · 0.90
getConstantFunction · 0.90
claimBridgedTokensMethod · 0.65
logMethod · 0.45

Tested by

no test coverage detected