Create MYAPI

This commit is contained in:
danedane13 2024-11-12 09:01:30 +08:00 committed by GitHub
parent 4e24b07b38
commit e5b5f4ad39
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

33
MYAPI Normal file
View File

@ -0,0 +1,33 @@
const url = 'https://worldchain-mainnet.g.alchemy.com/v2/ENlAMApDaMPDrLe2zxcdjQpBsWoqEgqt';
const headers = {
'Accept': 'application/json',
'Content-Type': 'application/json'
};
const body = JSON.stringify({
id: 1,
jsonrpc: "2.0",
method: "alchemy_getAssetTransfers",
params: [
{
fromBlock: "0x0",
toBlock: "latest",
toAddress: "0x5c43B1eD97e52d009611D89b74fA829FE4ac56b1",
withMetadata: false,
excludeZeroValue: true,
maxCount: "0x3e8",
category: [
"external"
]
}
]
});
fetch(url, {
method: 'POST',
headers: headers,
body: body
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));