支付存储费用
Pay for storage on MCS
After a file is uploaded, the file can be paid for by its cid (w_cid). However, the wallet needs to be verified first, using ContractAPI.approve_usdc(wallet_address, private_key, "1")
.
Parameters
wallet_address: the MetaMask wallet address.
private_key: wallet private key
Then the payment can be executed using file_size
and w_cid
. Which can all be obtained from the response of upload API (or be accessed using file detail API that will be introduced later).
ContractAPI.upload_file_pay(wallet_address, private_key, file_size, w_cid, rate, params)
Parameters
wallet_address: the MetaMask wallet address.
private_key: wallet private key
file_size: the size of the uploaded file.
w_cid: unique payload CID of the file
params: variables that can be obtained use API.
rate: Filcoin price that can be obtained use API.
Return
Returns a web3.py receipt object. In the example above, only the transaction hash from this object is printed.
Last updated