Skip to content

Commit

Permalink
add ref
Browse files Browse the repository at this point in the history
  • Loading branch information
leohhhn committed Aug 6, 2024
1 parent 1f58ee4 commit d3c83ca
Showing 1 changed file with 26 additions and 12 deletions.
38 changes: 26 additions & 12 deletions docs/reference/stdlibs/std/banker.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,18 @@ View concept page [here](../../../concepts/stdlibs/banker.md).
type BankerType uint8

const (
BankerTypeReadonly BankerType = iota
BankerTypeOrigSend
BankerTypeRealmSend
BankerTypeRealmIssue
BankerTypeReadonly BankerType = iota
BankerTypeOrigSend
BankerTypeRealmSend
BankerTypeRealmIssue
)

type Banker interface {
GetCoins(addr Address) (dst Coins)
SendCoins(from, to Address, coins Coins)
IssueCoin(addr Address, denom string, amount int64)
RemoveCoin(addr Address, denom string, amount int64)
GetCoins(addr Address) (dst Coins)
SendCoins(from, to Address, coins Coins)
IssueCoin(addr Address, denom string, amount int64)
RemoveCoin(addr Address, denom string, amount int64)
TotalCoin(denom string) int64
}
```

Expand All @@ -28,10 +29,10 @@ Returns `Banker` of the specified type.

#### Parameters
- `BankerType` - type of Banker to get:
- `BankerTypeReadonly` - read-only access to coin balances
- `BankerTypeOrigSend` - full access to coins sent with the transaction that calls the banker
- `BankerTypeRealmSend` - full access to coins that the realm itself owns, including the ones sent with the transaction
- `BankerTypeRealmIssue` - able to issue new coins
- `BankerTypeReadonly` - read-only access to coin balances
- `BankerTypeOrigSend` - full access to coins sent with the transaction that calls the banker
- `BankerTypeRealmSend` - full access to coins that the realm itself owns, including the ones sent with the transaction
- `BankerTypeRealmIssue` - able to issue new coins

#### Usage

Expand Down Expand Up @@ -94,3 +95,16 @@ Removes (burns) `amount` of coin with a denomination `denom` from address `addr`
```go
banker.RemoveCoin(addr, denom, amount)
```

---

## TotalCoin
Returns the total supply of coin with denomination `denom`.

#### Parameters
- `denom` **string** denomination of coin to get the total supply of

#### Usage
```go
banker.TotalCoin(denom)
```

0 comments on commit d3c83ca

Please sign in to comment.