icrc

package
v0.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 25, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	Owner      principal.Principal
	SubAccount *[32]byte
}
Example
package main

import (
	"encoding/hex"
	"fmt"
	"github.com/mohaijiang/agent-go/principal"
	"github.com/mohaijiang/agent-go/principal/icrc"
)

func main() {
	p, _ := principal.Decode("k2t6j-2nvnp-4zjm3-25dtz-6xhaa-c7boj-5gayf-oj3xs-i43lp-teztq-6ae")
	s, _ := hex.DecodeString("0102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f20")
	var s32 [32]byte
	copy(s32[:], s)
	fmt.Println(icrc.Account{
		Owner:      p,
		SubAccount: &s32,
	}.String())
}
Output:

k2t6j-2nvnp-4zjm3-25dtz-6xhaa-c7boj-5gayf-oj3xs-i43lp-teztq-6ae-dfxgiyy.102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f20

func Decode

func Decode(s string) (Account, error)

func (Account) Encode

func (a Account) Encode() string

func (Account) String

func (a Account) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL