SecretNET.Token Namespace

Snip20Tx..::..SetViewingKey Method (String, String, Nullable<(Of <(<'String>)>)>, Nullable<(Of <(<'String>)>)>, Nullable<(Of <(<'TxOptions>)>)>)

Set a viewing key with a predefined value for Cosmos message sender, without creating it. This is useful to manage multiple SNIP-20 tokens using the same viewing key. If a viewing key is already set, the contract MUST replace the current key.If a viewing key is not set, the contract MUST set the provided key as the viewing key. It is NOT RECOMMENDED to use this function to create easy to remember passwords for users, but this is left up to implementors to enforce.

Namespace:  SecretNET.Token
Assembly:  SecretNET.Token (in SecretNET.Token.dll)

Syntax


public Task<SingleSecretTx<SetViewingKeyResponse>> SetViewingKey(
	string contractAddress,
	string viewingKey,
	Nullable<string> padding,
	Nullable<string> codeHash,
	Nullable<TxOptions> txOptions
)
Public Function SetViewingKey ( _
	contractAddress As String, _
	viewingKey As String, _
	padding As Nullable(Of String), _
	codeHash As Nullable(Of String), _
	txOptions As Nullable(Of TxOptions) _
) As Task(Of SingleSecretTx(Of SetViewingKeyResponse))
public:
Task<SingleSecretTx<SetViewingKeyResponse^>^>^ SetViewingKey(
	String^ contractAddress, 
	String^ viewingKey, 
	Nullable<String^> padding, 
	Nullable<String^> codeHash, 
	Nullable<TxOptions^> txOptions
)

Parameters

contractAddress
Type: String
The contract address.
viewingKey
Type: String
The viewing key.
padding
Type: Nullable<(Of <(<'String>)>)>
An ignored string that can be used to maintain constant message length.
codeHash
Type: Nullable<(Of <(<'String>)>)>
CodeHash is (not really) optional and makes a call way faster.
txOptions
Type: Nullable<(Of <(<'TxOptions>)>)>
The tx options.

Return Value

SecretTx<SetViewingKeyResponse>.