Unity FlowSDK 2.0.0
FLOW Unity SDK
Loading...
Searching...
No Matches
DapperLabs.Flow.Sdk.CommonTransactions Class Reference

Contains helpers for commonly used transactions to support FlowControl functions. More...

Classes

struct  KeyPair
 Holds a hex encoded Asymmetric Cipher Key Pair More...
 

Static Public Member Functions

static KeyPair GenerateKeypair ()
 Generates new Asymmetric Cipher Key Pair in hex More...
 
static async Task< SdkAccountCreateAccount (string newAccountName)
 Create a new Flow account More...
 
static async Task< FlowTransactionResponseDeployContract (string name, string code)
 Deploys the given contract to the given Flow account. More...
 
static async Task< FlowTransactionResponseRemoveContract (string name)
 Removes the contract with the given name from the given account. More...
 
static async Task< FlowTransactionResponseUpdateContract (string name, string code)
 Updates the contract with the given name on the given account with new contents. More...
 

Detailed Description

Contains helpers for commonly used transactions to support FlowControl functions.

Member Function Documentation

◆ CreateAccount()

static async Task< SdkAccount > DapperLabs.Flow.Sdk.CommonTransactions.CreateAccount ( string  newAccountName)
inlinestatic

Create a new Flow account

Parameters
newAccountNameThe name of the flow account. This is arbitrary and only used as a convenience to keep track of accounts.
Returns
A Task that will resolve to an SdkAccount object representing the newly created account

◆ DeployContract()

static async Task< FlowTransactionResponse > DapperLabs.Flow.Sdk.CommonTransactions.DeployContract ( string  name,
string  code 
)
inlinestatic

Deploys the given contract to the given Flow account.

Parameters
nameName of the contract to deploy
codeText contents of the contract to deploy
Returns
A Task the will resolve to a FlowTransactionResponse for the transaction deploying the contract.

◆ GenerateKeypair()

static KeyPair DapperLabs.Flow.Sdk.CommonTransactions.GenerateKeypair ( )
inlinestatic

Generates new Asymmetric Cipher Key Pair in hex

Returns
A Keypair struct

◆ RemoveContract()

static async Task< FlowTransactionResponse > DapperLabs.Flow.Sdk.CommonTransactions.RemoveContract ( string  name)
inlinestatic

Removes the contract with the given name from the given account.

Once a contract is deleted from an account, that name will not be available for use by new contracts on that account.

Parameters
nameName of the contract that will be removed.
Returns
A Task that will resolve to a FlowTransactionResponse for the transaction removing the contract.

◆ UpdateContract()

static async Task< FlowTransactionResponse > DapperLabs.Flow.Sdk.CommonTransactions.UpdateContract ( string  name,
string  code 
)
inlinestatic

Updates the contract with the given name on the given account with new contents.

For contract update limitations see: https://developers.flow.com/cadence/language/contract-updatability#updating-a-contract

Parameters
nameThe name of the contract to update
codeThe text of the contract that will replace the old contract text
Returns
A Task that will resolve to a FlowTransactionResponse of the transaction updating the contract