支付存储费用
Pay for storage on MCS
def test_approve_usdc(wallet_info):
wallet_address = wallet_info['wallet_address']
private_key = wallet_info['private_key']
web3_api = wallet_info['web3_api']
w3_api = ContractAPI(web3_api)
w3_api.approve_usdc(wallet_address, private_key, "1")Parameters
def test_upload_file_pay(wallet_info):
wallet_address = wallet_info['wallet_address']
private_key = wallet_info['private_key']
web3_api = wallet_info['web3_api']
w3_api = ContractAPI(web3_api)
api = McsAPI()
# upload file to mcs
file_path = "/*"
upload_file = api.upload_file(wallet_address, file_path)
file_data = upload_file["data"]
payload_cid, source_file_upload_id, nft_uri, file_size, w_cid = file_data['payload_cid'], file_data[
'source_file_upload_id'], file_data['ipfs_url'], file_data['file_size'], file_data['w_cid']
# get the global variable
params = api.get_params()["data"]
# get filcoin price
rate = api.get_price_rate()["data"]
# upload_file_pay
w3_api.upload_file_pay(wallet_address, private_key, file_size, w_cid, rate, params)Parameters
Return
Last updated