Manage Digital Passport Transferability
Before you begin
As a brand, you wish to disable the transferability of an digital passport.
To manage digital passport access, Arianee defines different tokenType
:
0
-viewKey
: Allows to display digital passport.1
-requestKey
: Allows to claim digital passport.2
-proofKey
: Allows to generate a proof of ownership on-chain. [Ne pas le mettre si on veut plus gรฉnรฉrer de proof on chain?]
![](https://files.readme.io/35dcc62-NEW_Manage_Transferability.png)
Let's start ๐
To disable the transferability of a specific digital passport, let's focus on the requestKey
. Use /api/contracts/smartAssetContract/addTokenAccess/send
.
Input | Mandatory | Type | Description |
---|---|---|---|
tokenId | โ | Number | Digital passport identification number |
tokenAccess | โ | String | Wallet address generated through the passphrase.* |
tokenType | โ | String | Type of key. - 0 - viewKey - 1 - requestKey - 2 - proofKey |
- | โ | Boolean | true : The token will be transferable.false : The transfer will be disabled. |
[
"90587067",
"0x0000000000000000000000000000000000000000",
false,
1
]
Result: The digital passport cannot be claimed anymore.
{
"message": "Not yet in blockchain => transaction saved in transaction manager",
"type": "transactionManager",
"nonce": 61852,
"chainId": 77,
"from": "0x305051e9a023fe881EE21cA43fd90c460B427Caa",
"data": "0xb71c34d50000000000000000000000000000000000000000000000000000000005663fbb000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001",
"to": "0x512C1FCF401133680f373a386F3f752b98070BC5",
"gasLimit": 500000,
"gasPrice": "72000000000",
"value": "0x00",
"readableTransaction": {
"contractName": "smartAsset",
"from": "0x305051e9a023fe881EE21cA43fd90c460B427Caa",
"to": "0x512C1FCF401133680f373a386F3f752b98070BC5",
"constant": false,
"inputs": [
{
"name": "_tokenId",
"type": "uint256"
},
{
"name": "_key",
"type": "address"
},
{
"name": "_enable",
"type": "bool"
},
{
"name": "_tokenType",
"type": "uint256"
}
],
"name": "addTokenAccess",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function",
"signature": "0xb71c34d5",
"arguments": [
{
"value": "90587067",
"name": "_tokenId"
},
{
"value": "0x0000000000000000000000000000000000000000",
"name": "_key"
},
{
"value": false,
"name": "_enable"
},
{
"value": 1,
"name": "_tokenType"
}
]
}
}
tokenAccess
tokenAccess
The Arianee SDK provides a convenient way to generate a tokenAccess
.
Before generating a tokenAccess
, you need to have a passphrase. This passphrase is required to instantiate a wallet, which in turn serves as the source for creating the private key associated with the tokenAccess
.
const tmpWallet = Core.fromPassPhrase('mypassphrase');
const tokenAccess = tmpWallet.getAddress(); //0x008B4B0fa3ee2DB07848941998DAABC1D11480fe
Updated 10 months ago