SecretNET.Token Namespace

Snip20Querier..::..GetAllowance Method

Gets the allowance (This query MUST be authenticated). This returns the available allowance that spender can access from the owner's account, along with the expiration info. Every account's viewing key MUST be given permissions to query the allowance of any pair of owner and spender, as long as that account is either the owner or the spender in the query. In other words, every account's viewing key can be used to find out how much allowance the account has given other accounts, and how much it has been given by other accounts. The expiration field of the response may be either null or unset if no expiration has been set.

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

Syntax


public Task<SecretQueryContractResult<GetAllowanceResponse>> GetAllowance(
	string contractAddress,
	string ownerAddress,
	string spenderAddress,
	Nullable<string> viewingKey,
	Nullable<Permit> permit,
	Nullable<string> codeHash
)
Public Function GetAllowance ( _
	contractAddress As String, _
	ownerAddress As String, _
	spenderAddress As String, _
	viewingKey As Nullable(Of String), _
	permit As Nullable(Of Permit), _
	codeHash As Nullable(Of String) _
) As Task(Of SecretQueryContractResult(Of GetAllowanceResponse))
public:
Task<SecretQueryContractResult<GetAllowanceResponse^>^>^ GetAllowance(
	String^ contractAddress, 
	String^ ownerAddress, 
	String^ spenderAddress, 
	Nullable<String^> viewingKey, 
	Nullable<Permit^> permit, 
	Nullable<String^> codeHash
)

Parameters

contractAddress
Type: String
The contract address.
ownerAddress
Type: String
Account from which tokens are allowed to be taken.
spenderAddress
Type: String
Account which is allowed to spend tokens on behalf of the owner.
viewingKey
Type: Nullable<(Of <(<'String>)>)>
Authenticate with viewing key.
permit
Type: Nullable<(Of <(<'Permit>)>)>
Authenticate with permit.
codeHash
Type: Nullable<(Of <(<'String>)>)>
CodeHash is (not really) optional and makes a call way faster.

Return Value

SecretQueryContractResult<GetAllowanceResponse>.