## Index

### Variables

- argumentCoinID
- argumentCoins
- argumentDarcID
- argumentDestination
- argumentType
- commandFetch
- commandMint
- commandStore
- commandTransfer
- contractID
- ruleFetch
- ruleMint
- ruleSpawn
- ruleStore
- ruleTransfer

### Functions

- coinIID
- fetch
- mint
- rule
- store
- transfer

## Variables

### Const argumentCoinID

argumentCoinID: "coinID" = "coinID"

- Defined in src/v2/byzcoin/contracts/coinContract.ts:12

### Const argumentCoins

argumentCoins: "coins" = "coins"

- Defined in src/v2/byzcoin/contracts/coinContract.ts:15

### Const argumentDarcID

argumentDarcID: "darcID" = "darcID"

- Defined in src/v2/byzcoin/contracts/coinContract.ts:13

### Const argumentDestination

argumentDestination: "destination" = "destination"

- Defined in src/v2/byzcoin/contracts/coinContract.ts:16

### Const argumentType

argumentType: "type" = "type"

- Defined in src/v2/byzcoin/contracts/coinContract.ts:14

### Const commandFetch

commandFetch: "fetch" = "fetch"

- Defined in src/v2/byzcoin/contracts/coinContract.ts:9

### Const commandMint

commandMint: "mint" = "mint"

- Defined in src/v2/byzcoin/contracts/coinContract.ts:8

### Const commandStore

commandStore: "store" = "store"

- Defined in src/v2/byzcoin/contracts/coinContract.ts:11

### Const commandTransfer

commandTransfer: "transfer" = "transfer"

- Defined in src/v2/byzcoin/contracts/coinContract.ts:10

### Const contractID

contractID: "coin" = "coin"

- Defined in src/v2/byzcoin/contracts/coinContract.ts:7

### Const ruleFetch

ruleFetch: string = rule(commandFetch)

- Defined in src/v2/byzcoin/contracts/coinContract.ts:19

### Const ruleMint

ruleMint: string = rule(commandMint)

- Defined in src/v2/byzcoin/contracts/coinContract.ts:18

### Const ruleSpawn

ruleSpawn: string = "spawn:" + contractID

- Defined in src/v2/byzcoin/contracts/coinContract.ts:17

### Const ruleStore

ruleStore: string = rule(commandStore)

- Defined in src/v2/byzcoin/contracts/coinContract.ts:21

### Const ruleTransfer

ruleTransfer: string = rule(commandTransfer)

- Defined in src/v2/byzcoin/contracts/coinContract.ts:20

## Functions

### coinIID

- coinIID(buf: Buffer): InstanceID

- - Defined in src/v2/byzcoin/contracts/coinContract.ts:29

  Generate the coin instance ID for a given darc ID

  #### Parameters

  - ##### buf: Buffer

    Any buffer that is known to the caller

  #### Returns InstanceID

  the id as a buffer

### fetch

- fetch(tx: TransactionBuilder, src: InstanceID, amount: Long): void

- - Defined in src/v2/byzcoin/contracts/coinContract.ts:78

  Fetches coins from a coinInstance and puts it on the ByzCoin 'stack' for use by the next instruction. Unused coins are discarded by all nodes and thus lost.

  #### Parameters

  - ##### tx: TransactionBuilder

    used to collect one or more instructions that will be bundled together and sent as one transaction to byzcoin.

  - ##### src: InstanceID

    the source account to fetch coins from.

  - ##### amount: Long

    how many coins to put on the stack

  #### Returns void

### mint

- mint(tx: TransactionBuilder, coinID: InstanceID, amount: Long): void

- - Defined in src/v2/byzcoin/contracts/coinContract.ts:44

  Mints coins on ByzCoin. For this to work, the DARC governing this coin instance needs to have a 'invoke.Coin.mint' rule and the instruction will need to be signed by the appropriate identity.

  #### Parameters

  - ##### tx: TransactionBuilder

    used to collect one or more instructions

  - ##### coinID: InstanceID

    to mint

  - ##### amount: Long

    positive, non-zero value to mint on this coin

  #### Returns void

### rule

- rule(command: string): string

- - Defined in src/v2/byzcoin/contracts/coinContract.ts:95

  #### Parameters

  - ##### command: string

  #### Returns string

### store

- store(tx: TransactionBuilder, dst: InstanceID): void

- - Defined in src/v2/byzcoin/contracts/coinContract.ts:91

  Stores coins from the ByzCoin 'stack' in the given coin-account. Only the coins of the stack with the same name are added to the destination account.

  #### Parameters

  - ##### tx: TransactionBuilder

    used to collect one or more instructions that will be bundled together and sent as one transaction to byzcoin.

  - ##### dst: InstanceID

    where the coins to store

  #### Returns void

### transfer

- transfer(tx: TransactionBuilder, src: InstanceID, dest: InstanceID, amount: Long): void

- - Defined in src/v2/byzcoin/contracts/coinContract.ts:63

  Creates an instruction to transfer coins to another account.

  #### Parameters

  - ##### tx: TransactionBuilder

    used to collect one or more instructions that will be bundled together and sent as one transaction to byzcoin.

  - ##### src: InstanceID

    the source account to fetch coins from.

  - ##### dest: InstanceID

    the destination account to store the coins in. The destination must exist!

  - ##### amount: Long

    how many coins to transfer.

  #### Returns void

Generated using TypeDoc