const snapId = `npm:@hashgraph/hedera-wallet-snap`
const initiateSwapAPI = async () => {
const externalAccountParams = {
externalAccount: {
accountIdOrEvmAddress: '0.0.12345',
curve: 'ED25519'
}
}
await window.ethereum.request({
method: 'wallet_invokeSnap',
params: {
snapId,
request: {
method: 'hts/completeSwap',
params: {
network: 'testnet',
scheduleId: '0.0.4285081',
/*
Uncomment the below line if you want to connect
to a non-metamask account
*/
// ...externalAccountParams
}
}
}
})
}responder{
"currentAccount": {
"metamaskEvmAddress": "0x0b3628d1b838993b5fceec8b2a26502e7a8e5241",
"externalEvmAddress": "",
"hederaAccountId": "0.0.3589358",
"hederaEvmAddress": "0x0ca39034793f026127bcfb651b85515394fd21b1",
"publicKey": "0x03d5f871cfe7134c67799dc6df75cdfc4b3f4fd797442350297efa9483661916d2",
"balance": {
"hbars": 346.70233551,
"timestamp": "Fri, 26 Apr 2024 19:24:31 GMT"
},
"network": "testnet",
"mirrorNodeUrl": "https://testnet.mirrornode.hedera.com"
},
"receipt": {
"status": "SUCCESS",
"accountId": "",
"fileId": "",
"contractId": "",
"topicId": "",
"tokenId": "",
"scheduleId": "",
"exchangeRate": {
"hbars": 30000,
"cents": 333977,
"expirationTime": "Fri, 26 Apr 2024 20:00:00 GMT",
"exchangeRateInCents": 11.132566666666667
},
"topicSequenceNumber": "0",
"topicRunningHash": "",
"totalSupply": "0",
"scheduledTransactionId": "[email protected]?scheduled",
"serials": [],
"duplicates": [],
"children": []
}
}