Pay payee updateAccount fee

Payer can pay some tokens to the payee for the first updateAccount fee when transferring, including ERC20 transfer and NFT transfer.

Set payPayeeUpdateAccount as true in ERC20 transfer and NFT transfer can pay the payee updateAccount fee.

1. Checking whether the payer can pay the payee updateAccount fee

Get the payee account info via api/v3/account.

  • If the response is account not found, or nonce is 0 and tags do not contain "FirstUpdateAccountPaid", the payer can pay the updateAccountFee

Below are some examples that the payer can pay the updateAccount fee for the payee

1.1 Account not found

https://uat2.loopring.io//api/v3/account?owner=0x60d2D76ed6E07a9F46EEe7d444257148E08B7bbb

respone:
{"resultInfo":{"code":101002,"message":"account not found"}}

1.2 Account nonce is 0 and tag does not contain FirstUpdateAccountPaid

https://uat2.loopring.io//api/v3/account?owner=0x1111111111111111111111111111111111111111

respone:
{
	"accountId": 10500,
	"owner": "0x1111111111111111111111111111111111111111",
	"frozen": false,
	"publicKey": {
		"x": "",
		"y": ""
	},
	"tags": "",
	"nonce": 0,
	"keyNonce": 0,
	"keySeed": ""
}

2. ERC20 transfer

2.1 Get fee

GET api: api/v3/user/offchainFee

transfer: requestType is 15 (TRANSFER_AND_UPDATE_ACCOUNT)

2.2 get storageID

GET api: api/v3/storageId

2.3 submit transfer

POST api: api/v3/transfer

storageId: the response in get storageID

maxFee: the response in get fee

payeeId: set to 0 is ok

3. NFT transfer

3.1 Get fee

GET api: api/v3/user/nft/offchainFee

transfer: requestType is 19

3.2 get storageID

GET api: api/v3/storageId

3.3 submit nft transfer

POST api: api/v3/nft/transfer

Last updated

Was this helpful?