Module: transaction
Classes
- AccessKey
- AccessKeyPermission
- Action
- AddKey
- CreateAccount
- DeleteAccount
- DeleteKey
- DeployContract
- FullAccessPermission
- FunctionCall
- FunctionCallPermission
- IAction
- Signature
- SignedTransaction
- Stake
- Transaction
- Transfer
Variables
SCHEMA
Const SCHEMA: Map<Class<any>, any>
Defined in
Functions
addKey
addKey(publicKey, accessKey): Action
Parameters
| Name | Type |
|---|---|
publicKey | PublicKey |
accessKey | AccessKey |
Returns
Defined in
createAccount
createAccount(): Action
Returns
Defined in
createTransaction
createTransaction(signerId, publicKey, receiverId, nonce, actions, blockHash): Transaction
Parameters
| Name | Type |
|---|---|
signerId | string |
publicKey | PublicKey |
receiverId | string |
nonce | string | number | BN |
actions | Action[] |
blockHash | Uint8Array |
Returns
Defined in
deleteAccount
deleteAccount(beneficiaryId): Action
Parameters
| Name | Type |
|---|---|
beneficiaryId | string |
Returns
Defined in
deleteKey
deleteKey(publicKey): Action
Parameters
| Name | Type |
|---|---|
publicKey | PublicKey |
Returns
Defined in
deployContract
deployContract(code): Action
Parameters
| Name | Type |
|---|---|
code | Uint8Array |
Returns
Defined in
fullAccessKey
fullAccessKey(): AccessKey
Returns
Defined in
functionCall
functionCall(methodName, args, gas, deposit, stringify?, jsContract?): Action
Constructs Action instance representing contract method call.
Parameters
| Name | Type | Default value | Description |
|---|---|---|---|
methodName | string | undefined | the name of the method to call |
args | object | Uint8Array | undefined | arguments to pass to method. Can be either plain JS object which gets serialized as JSON automatically or Uint8Array instance which represents bytes passed as is. |
gas | BN | undefined | max amount of gas that method call can use |
deposit | BN | undefined | amount of NEAR (in yoctoNEAR) to send together with the call |
stringify | (args: any) => Buffer | stringifyJsonOrBytes | Convert input arguments into bytes array. |
jsContract | boolean | false | Is contract from JS SDK, skips stringification of arguments. |
Returns
Defined in
functionCallAccessKey
functionCallAccessKey(receiverId, methodNames, allowance?): AccessKey
Parameters
| Name | Type |
|---|---|
receiverId | string |
methodNames | string[] |
allowance? | BN |
Returns
Defined in
signTransaction
signTransaction(transaction, signer, accountId?, networkId?): Promise<[Uint8Array, SignedTransaction]>
Parameters
| Name | Type |
|---|---|
transaction | Transaction |
signer | Signer |
accountId? | string |
networkId? | string |
Returns
Promise<[Uint8Array, SignedTransaction]>
Defined in
signTransaction(receiverId, nonce, actions, blockHash, signer, accountId?, networkId?): Promise<[Uint8Array, SignedTransaction]>
Parameters
| Name | Type |
|---|---|
receiverId | string |
nonce | BN |
actions | Action[] |
blockHash | Uint8Array |
signer | Signer |
accountId? | string |
networkId? | string |
Returns
Promise<[Uint8Array, SignedTransaction]>
Defined in
stake
stake(stake, publicKey): Action
Parameters
| Name | Type |
|---|---|
stake | BN |
publicKey | PublicKey |
Returns
Defined in
stringifyJsonOrBytes
stringifyJsonOrBytes(args): Buffer
Parameters
| Name | Type |
|---|---|
args | any |
Returns
Buffer
Defined in
transfer
transfer(deposit): Action
Parameters
| Name | Type |
|---|---|
deposit | BN |