Documentation
¶
Index ¶
- Constants
- Variables
- func AesDecrypt(secret, b []byte) ([]byte, error)
- func AesEncrypt(secret, b []byte) ([]byte, error)
- func CallMixinRPC(ctx context.Context, uid, sid, sessionKey, method string, ...) ([]byte, error)
- func CancelMultisig(ctx context.Context, id string, uid, sid, sessionKey string) error
- func Chunked(source []interface{}, size int) [][]interface{}
- func CreateRaw(ctx context.Context)
- func DecryptMessageData(data string, sessionId, private string) (string, error)
- func DeleteAddress(ctx context.Context, addressId, uid, sid, sessionKey, pin, pinToken string) error
- func EncodeMixinExtra(traceId, memo string) []byte
- func EncryptEd25519PIN(pin, pinTokenBase64, privateKey string, iterator uint64) (string, error)
- func EncryptMessageData(data string, sessions []*Session, privateKey string) (string, error)
- func EncryptPIN(pin, pinToken, sessionId, privateKey string, iterator uint64) (string, error)
- func EstimateObjectFee(memo string) number.Decimal
- func GenerateUserChecksum(sessions []*Session) string
- func HashMembers(ids []string) string
- func MsgpackMarshalPanic(val interface{}) []byte
- func MsgpackUnmarshal(data []byte, val interface{}) error
- func NewTransport(roundTripper http.RoundTripper, uid, sid, privateKey string) (*transport, error)
- func OAuthGetAccessToken(ctx context.Context, clientID, clientSecret string, authorizationCode string, ...) (string, string, string, error)
- func PostAcknowledgements(ctx context.Context, requests []*ReceiptAcknowledgementRequest, ...) error
- func PostMessage(ctx context.Context, ...) error
- func PostMessages(ctx context.Context, messages []*MessageRequest, ...) error
- func PrivateKeyToCurve25519(curve25519Private *[32]byte, privateKey ed25519.PrivateKey)
- func PublicKeyToCurve25519(publicKey ed25519.PublicKey) ([]byte, error)
- func ReadCode[C Code](ctx context.Context, codeId string) (C, error)
- func Request(ctx context.Context, method, path string, body []byte, accessToken string) ([]byte, error)
- func RequestWithId(ctx context.Context, method, path string, body []byte, ...) ([]byte, error)
- func SetBaseUri(base string)
- func SetBlazeUri(blaze string)
- func SharedKey(public ed25519.PublicKey, private ed25519.PrivateKey) ([32]byte, error)
- func SignAuthenticationToken(uid, sid, privateKey, method, uri, body string) (string, error)
- func SignAuthenticationTokenWithoutBody(uid, sid, privateKey, method, uri string) (string, error)
- func SignOauthAccessToken(appID, authorizationID, privateKey, method, uri, body, scp string, ...) (string, error)
- func SimpleRequest(ctx context.Context, method, path string, body []byte) ([]byte, error)
- func TIPBodyForVerify(timestamp int64) []byte
- func TIPMigrateBody(pub ed25519.PublicKey) string
- func TipBody(s string) []byte
- func TipBodyForAddressAdd(assetId string, publicKey, keyTag, name string) []byte
- func TipBodyForEmergencyContactCreate(verificationId, code string) []byte
- func TipBodyForOwnershipTransfer(userId string) []byte
- func TipBodyForPhoneNumberUpdate(verificationId, code string) []byte
- func TipBodyForProvisioningUpdate(deviceId string, secret string) []byte
- func TipBodyForRawTransactionCreate(assetId string, opponentKey string, opponentReceivers []string, ...) []byte
- func TipBodyForTransfer(assetId string, counterUserId string, amount number.Decimal, ...) []byte
- func TipBodyForWithdrawalCreate(addressId string, amount, fee number.Decimal, traceId, memo string) []byte
- func UniqueConversationId(userId, recipientId string) string
- func UniqueObjectId(args ...string) string
- func UnlockMultisig(ctx context.Context, id, pin string, uid, sid, sessionKey string) error
- func UpdatePin(ctx context.Context, ...) error
- func UpdateTipPin(ctx context.Context, pin, pubTip, pinToken, uid, sid, sessionKey string) error
- func UuidFromBytes(input []byte) (uuid.UUID, error)
- func UuidFromString(id string) (uuid.UUID, error)
- func UuidNewV4() uuid.UUID
- func WithAPIKey(userId, sessionId, p string)
- type Address
- func CreateAddress(ctx context.Context, in *AddressInput, ...) (*Address, error)
- func ExternalAdddressCheck(ctx context.Context, asset, destination, tag string) (*Address, error)
- func GetAddressesByAssetId(ctx context.Context, assetId, uid, sid, sessionKey string) ([]*Address, error)
- func ReadAddress(ctx context.Context, addressId, uid, sid, sessionKey string) (*Address, error)
- type AddressInput
- type App
- type AppButtonView
- type Asset
- func AssetList(ctx context.Context, accessToken string) ([]*Asset, error)
- func AssetListWithRequestID(ctx context.Context, accessToken, requestID string) ([]*Asset, error)
- func AssetSearch(ctx context.Context, name string) ([]*Asset, error)
- func AssetShow(ctx context.Context, assetId string, accessToken string) (*Asset, error)
- func AssetShowWithRequestID(ctx context.Context, assetId string, accessToken, requestID string) (*Asset, error)
- type Attachment
- type Authenticator
- type BlazeClient
- func (b *BlazeClient) Loop(ctx context.Context, listener BlazeListener) error
- func (b *BlazeClient) SendAppButton(ctx context.Context, conversationId, recipientId, label, action, color string) error
- func (b *BlazeClient) SendAppCard(ctx context.Context, ...) error
- func (b *BlazeClient) SendContact(ctx context.Context, conversationId, recipientId, contactId string) error
- func (b *BlazeClient) SendGroupAppButton(ctx context.Context, conversationId, recipientId string, ...) error
- func (b *BlazeClient) SendMessage(ctx context.Context, ...) error
- func (b *BlazeClient) SendPlainText(ctx context.Context, msg MessageView, content string) error
- func (b *BlazeClient) SendPost(ctx context.Context, msg MessageView, content string) error
- func (b *BlazeClient) SendRecallMessage(ctx context.Context, conversationId, recipientId, recallMessageId string) error
- func (b *BlazeClient) SetupDailer(dailer *websocket.Dialer)
- type BlazeListener
- type BlazeMessage
- type Code
- type Conversation
- func ConversationShow(ctx context.Context, conversationId string, accessToken string) (*Conversation, error)
- func CreateContactConversation(ctx context.Context, participantID, uid, sid, key string) (*Conversation, error)
- func CreateConversation(ctx context.Context, category, conversationId string, ...) (*Conversation, error)
- func JoinConversation(ctx context.Context, conversationId, uid, sid, key string) (*Conversation, error)
- type DepositEntry
- type Error
- type Fiat
- type GhostKeyRequest
- type GhostKeys
- type ImageMessagePayload
- type LiveMessagePayload
- type MessageRequest
- type MessageView
- type MixinExtraPack
- type MultisigRequest
- func CreateMultisig(ctx context.Context, action, raw string, uid, sid, sessionKey string) (*MultisigRequest, error)
- func ReadMultisigByCode(ctx context.Context, codeId string) (*MultisigRequest, error)
- func SignMultisig(ctx context.Context, id, pin string, uid, sid, sessionKey string) (*MultisigRequest, error)
- type MultisigUTXO
- type NetworkAsset
- type NetworkChain
- type NetworkTicker
- type ObjectInput
- type Participant
- type ParticipantSessionView
- type Payment
- type PaymentRequest
- type RawTransaction
- type RecallMessagePayload
- type ReceiptAcknowledgementRequest
- type Session
- type Snapshot
- func CreateObject(ctx context.Context, in *ObjectInput, ...) (*Snapshot, error)
- func CreateTransfer(ctx context.Context, in *TransferInput, ...) (*Snapshot, error)
- func CreateWithdrawal(ctx context.Context, in *WithdrawalInput, ...) (*Snapshot, error)
- func NetworkSnapshot(ctx context.Context, snapshotId string) (*Snapshot, error)
- func NetworkSnapshotByToken(ctx context.Context, snapshotId, accessToken string) (*Snapshot, error)
- func ReadTransferByTrace(ctx context.Context, traceId, uid, sid, sessionKey string) (*Snapshot, error)
- func SnapshotById(ctx context.Context, snapshotId string, uid, sid, sessionKey string) (*Snapshot, error)
- func SnapshotByToken(ctx context.Context, snapshotId string, accessToken string) (*Snapshot, error)
- func SnapshotByTraceId(ctx context.Context, traceId string, uid, sid, sessionKey string) (*Snapshot, error)
- func Snapshots(ctx context.Context, limit int, ...) ([]*Snapshot, error)
- func SnapshotsByToken(ctx context.Context, limit int, offset, assetId, order, accessToken string) ([]*Snapshot, error)
- type SnapshotShort
- type TipNodeData
- type Transaction
- type TransferInput
- type TransferView
- type Turn
- type User
- func CreateUser(ctx context.Context, sessionSecret, fullName, uid, sid, privateKey string) (*User, error)
- func CreateUserSimple(ctx context.Context, sessionSecret, fullName string) (*User, error)
- func GetUser(ctx context.Context, userId, uid, sid, sessionKey string) (*User, error)
- func Relationship(ctx context.Context, uid, sid, privateKey string, userId, action string) (*User, error)
- func SearchUser(ctx context.Context, mixinId, uid, sid, sessionKey string) (*User, error)
- func UpdatePreference(ctx context.Context, uid, sid, privateKey string, ...) (*User, error)
- func UpdateUserMe(ctx context.Context, uid, sid, privateKey, fullName, avatarBase64 string) (*User, error)
- func UserMe(ctx context.Context, accessToken string) (*User, error)
- func UserMeWithRequestID(ctx context.Context, accessToken, requestID string) (*User, error)
- func VerifyPIN(ctx context.Context, uid, pin, pinToken, sessionId, privateKey string) (*User, error)
- func VerifyPINTip(ctx context.Context, uid, pinToken, sessionId, privateKey, privateTip string) (*User, error)
- type UserSession
- type WithdrawalInput
Constants ¶
View Source
const ( BTC = "c6d0c728-2624-429b-8e0d-d9d19b6592fa" ETH = "43d61dcd-e413-450d-80b8-101d5e903357" USDT_ERC20 = "4d8c508b-91c5-375b-92b0-ee702ed2dac5" USDC_ERC20 = "9b180ab6-6abe-3dc0-a13f-04169eb34bfa" USDT_TRC20 = "b91e18ff-a9ae-3dc7-8679-e935d9a4b34b" )
View Source
const ( MessageCategoryPlainText = "PLAIN_TEXT" MessageCategoryPlainImage = "PLAIN_IMAGE" MessageCategoryPlainData = "PLAIN_DATA" MessageCategoryPlainSticker = "PLAIN_STICKER" MessageCategoryPlainLive = "PLAIN_LIVE" MessageCategoryPlainContact = "PLAIN_CONTACT" MessageCategoryPlainPost = "PLAIN_POST" MessageCategoryPlainLocation = "PLAIN_LOCATION" MessageCategoryPlainTranscript = "PLAIN_TRANSCRIPT" MessageCategorySystemConversation = "SYSTEM_CONVERSATION" MessageCategorySystemAccountSnapshot = "SYSTEM_ACCOUNT_SNAPSHOT" MessageCategoryMessageRecall = "MESSAGE_RECALL" MessageCategoryMessagePin = "MESSAGE_PIN" MessageCategoryAppButtonGroup = "APP_BUTTON_GROUP" MessageCategoryAppCard = "APP_CARD" )
View Source
const ( BitcoinChainId = "c6d0c728-2624-429b-8e0d-d9d19b6592fa" BitcoinCashChainId = "fd11b6e3-0b87-41f1-a41f-f0e9b49e5bf0" BitcoinSVChainId = "574388fd-b93f-4034-a682-01c2bc095d17" LitecoinChainId = "76c802a2-7c88-447f-a93e-c29c9e5dd9c8" EthereumChainId = "43d61dcd-e413-450d-80b8-101d5e903357" EthereumClassicChainId = "2204c1ee-0ea2-4add-bb9a-b3719cfff93a" BSCChainId = "1949e683-6a08-49e2-b087-d6b72398588f" PolygonChainId = "b7938396-3f94-4e0a-9179-d3440718156f" MVMChainId = "a0ffd769-5850-4b48-9651-d2ae44a3e64d" DecredChainId = "8f5caf2a-283d-4c85-832a-91e83bbf290b" RippleChainId = "23dfb5a5-5d7b-48b6-905f-3970e3176e27" SiacoinChainId = "990c4c29-57e9-48f6-9819-7d986ea44985" EOSChainId = "6cfe566e-4aad-470b-8c9a-2fd35b49c68d" DogecoinChainId = "6770a1e5-6086-44d5-b60f-545f9d9e8ffd" DashChainId = "6472e7e3-75fd-48b6-b1dc-28d294ee1476" ZcashChainId = "c996abc9-d94e-4494-b1cf-2a3fd3ac5714" NEMChainId = "27921032-f73e-434e-955f-43d55672ee31" ArweaveChainId = "882eb041-64ea-465f-a4da-817bd3020f52" HorizenChainId = "a2c5d22b-62a2-4c13-b3f0-013290dbac60" TRONChainId = "25dabac5-056a-48ff-b9f9-f67395dc407c" StellarChainId = "56e63c06-b506-4ec5-885a-4a5ac17b83c1" MassGridChainId = "b207bce9-c248-4b8e-b6e3-e357146f3f4c" BytomChainId = "443e1ef5-bc9b-47d3-be77-07f328876c50" BytomPoSChainId = "71a0e8b5-a289-4845-b661-2b70ff9968aa" CosmosChainId = "7397e9f1-4e42-4dc8-8a3b-171daaadd436" AkashChainId = "9c612618-ca59-4583-af34-be9482f5002d" BinanceChainId = "17f78d7c-ed96-40ff-980c-5dc62fecbc85" MoneroChainId = "05c5ac01-31f9-4a69-aa8a-ab796de1d041" StarcoinChainId = "c99a3779-93df-404d-945d-eddc440aa0b2" RavencoinChainId = "6877d485-6b64-4225-8d7e-7333393cb243" GrinChainId = "1351e6bd-66cf-40c1-8105-8a8fe518a222" VCashChainId = "c3b9153a-7fab-4138-a3a4-99849cadc073" HandshakeChainId = "13036886-6b83-4ced-8d44-9f69151587bf" NervosChainId = "d243386e-6d84-42e6-be03-175be17bf275" TezosChainId = "5649ca42-eb5f-4c0e-ae28-d9a4e77eded3" NamecoinChainId = "f8b77dc0-46fd-4ea1-9821-587342475869" SolanaChainId = "64692c23-8971-4cf4-84a7-4dd1271dd887" NearChainId = "d6ac94f7-c932-4e11-97dd-617867f0669e" FilecoinChainId = "08285081-e1d8-4be6-9edc-e203afa932da" MobileCoinChainId = "eea900a8-b327-488c-8d8d-1428702fe240" PolkadotChainId = "54c61a72-b982-4034-a556-0d99e3c21e39" KusamaChainId = "9d29e4f6-d67c-4c4b-9525-604b04afbe9f" AlgorandChainId = "706b6f84-3333-4e55-8e89-275e71ce9803" AvalancheChainId = "cbc77539-0a20-4666-8c8a-4ded62b36f0a" XDCChainId = "b12bb04a-1cea-401c-a086-0be61f544889" AptosChainId = "d2c1c7e1-a1a9-4f88-b282-d93b0a08b42b" TONChainId = "ef660437-d915-4e27-ad3f-632bfb6ba0ee" )
View Source
const ( TIPVerify = "TIP:VERIFY:" TIPAddressAdd = "TIP:ADDRESS:ADD:" TIPAddressRemove = "TIP:ADDRESS:REMOVE:" TIPUserDeactivate = "TIP:USER:DEACTIVATE:" TIPEmergencyContactCreate = "TIP:EMERGENCY:CONTACT:CREATE:" TIPEmergencyContactRead = "TIP:EMERGENCY:CONTACT:READ:" TIPEmergencyContactRemove = "TIP:EMERGENCY:CONTACT:REMOVE:" TIPPhoneNumberUpdate = "TIP:PHONE:NUMBER:UPDATE:" TIPMultisigRequestSign = "TIP:MULTISIG:REQUEST:SIGN:" TIPMultisigRequestUnlock = "TIP:MULTISIG:REQUEST:UNLOCK:" TIPCollectibleRequestSign = "TIP:COLLECTIBLE:REQUEST:SIGN:" TIPCollectibleRequestUnlock = "TIP:COLLECTIBLE:REQUEST:UNLOCK:" TIPTransferCreate = "TIP:TRANSFER:CREATE:" TIPWithdrawalCreate = "TIP:WITHDRAWAL:CREATE:" TIPRawTransactionCreate = "TIP:TRANSACTION:CREATE:" TIPOAuthApprove = "TIP:OAUTH:APPROVE:" TIPProvisioningUpdate = "TIP:PROVISIONING:UPDATE:" TIPOwnershipTransfer = "TIP:APP:OWNERSHIP:TRANSFER:" )
View Source
const ( RelationshipActionAdd = "ADD" RelationshipActionUpdate = "UPDATE" RelationshipActionRemove = "REMOVE" RelationshipActionBlock = "BLOCK" RelationshipActionUnblock = "UNBLOCK" )
Variables ¶
View Source
var ( DefaultApiHost = "https://api.mixin.one" DefaultBlazeHost = "blaze.mixin.one" ZeromeshApiHost = "https://mixin-api.zeromesh.net" ZeromeshBlazeHost = "mixin-blaze.zeromesh.net" )
View Source
var Nil = uuid.Nil
Functions ¶
func AesDecrypt ¶ added in v1.8.3
func AesEncrypt ¶ added in v1.8.3
func CallMixinRPC ¶ added in v1.4.0
func CancelMultisig ¶ added in v1.2.0
func DecryptMessageData ¶ added in v1.4.4
func DeleteAddress ¶ added in v1.1.5
func EncodeMixinExtra ¶ added in v1.7.0
func EncryptEd25519PIN ¶ added in v1.2.0
func EncryptMessageData ¶ added in v1.4.4
func EncryptPIN ¶
func EstimateObjectFee ¶ added in v1.7.0
func EstimateObjectFee(memo string) number.Decimal
func GenerateUserChecksum ¶ added in v1.4.4
func HashMembers ¶ added in v1.4.0
func MsgpackMarshalPanic ¶ added in v1.7.0
func MsgpackMarshalPanic(val interface{}) []byte
func MsgpackUnmarshal ¶ added in v1.7.0
func NewTransport ¶ added in v1.7.3
func NewTransport( roundTripper http.RoundTripper, uid, sid, privateKey string) (*transport, error)
NewTransport returns a new transport based on the given inputs.
func OAuthGetAccessToken ¶
func OAuthGetAccessToken(ctx context.Context, clientID, clientSecret string, authorizationCode string, codeVerifier string, ed25519 string) (string, string, string, error)
OAuthGetAccessToken get the access token of a user ed25519 is optional, only use it when you want to sign OAuth access token locally
func PostAcknowledgements ¶ added in v1.1.5
func PostAcknowledgements(ctx context.Context, requests []*ReceiptAcknowledgementRequest, clientId, sessionId, secret string) error
func PostMessage ¶
func PostMessages ¶
func PostMessages(ctx context.Context, messages []*MessageRequest, clientId, sessionId, secret string) error
func PrivateKeyToCurve25519 ¶ added in v1.2.0
func PrivateKeyToCurve25519(curve25519Private *[32]byte, privateKey ed25519.PrivateKey)
func PublicKeyToCurve25519 ¶ added in v1.2.0
func RequestWithId ¶ added in v1.2.0
func SetBaseUri ¶ added in v1.2.0
func SetBaseUri(base string)
func SetBlazeUri ¶ added in v1.2.0
func SetBlazeUri(blaze string)
func SignAuthenticationToken ¶
func SignAuthenticationTokenWithoutBody ¶ added in v1.2.0
func SignOauthAccessToken ¶ added in v1.2.0
func SimpleRequest ¶ added in v1.7.3
func TIPBodyForVerify ¶ added in v1.6.0
func TIPMigrateBody ¶ added in v1.6.0
func TipBodyForAddressAdd ¶ added in v1.7.0
func TipBodyForEmergencyContactCreate ¶ added in v1.7.0
func TipBodyForOwnershipTransfer ¶ added in v1.7.3
func TipBodyForPhoneNumberUpdate ¶ added in v1.7.0
func TipBodyForProvisioningUpdate ¶ added in v1.7.0
func TipBodyForRawTransactionCreate ¶ added in v1.7.0
func TipBodyForTransfer ¶ added in v1.7.0
func TipBodyForWithdrawalCreate ¶ added in v1.7.0
func UniqueConversationId ¶
func UniqueObjectId ¶ added in v1.7.3
func UnlockMultisig ¶ added in v1.2.0
func UpdateTipPin ¶ added in v1.7.3
func UuidFromBytes ¶
func UuidFromString ¶
func WithAPIKey ¶ added in v1.7.3
func WithAPIKey(userId, sessionId, p string)
Types ¶
type Address ¶
type Address struct {
AddressId string `json:"address_id"`
AssetId string `json:"asset_id"`
FeeAssetId string `json:"fee_asset_id"`
Label string `json:"label"`
Destination string `json:"destination"`
Tag string `json:"tag"`
Fee string `json:"fee"`
Reserve string `json:"reserve"`
Dust string `json:"dust"`
UpdatedAt string `json:"updated_at"`
}
func CreateAddress ¶
func ExternalAdddressCheck ¶ added in v1.4.0
func GetAddressesByAssetId ¶ added in v1.1.5
type AddressInput ¶
type App ¶ added in v1.7.3
type App struct {
Type string `json:"type"`
AppId string `json:"app_id"`
AppNumber string `json:"app_number"`
RedirectURI string `json:"redirect_uri"`
HomeURI string `json:"home_uri"`
Name string `json:"name"`
IconURL string `json:"icon_url"`
Description string `json:"description"`
Capabilities []string `json:"capabilities"`
ResourcePatterns []string `json:"resource_patterns"`
Category string `json:"category"`
CreatorId string `json:"creator_id"`
UpdatedAt time.Time `json:"updated_at"`
IsVerified bool `json:"is_verified"`
}
type AppButtonView ¶ added in v1.4.4
type Asset ¶
type Asset struct {
AssetId string `json:"asset_id"`
ChainId string `json:"chain_id"`
MixinID string `json:"mixin_id"`
FeeAssetId string `json:"fee_asset_id"`
Symbol string `json:"symbol"`
Name string `json:"name"`
IconURL string `json:"icon_url"`
PriceBTC string `json:"price_btc"`
PriceUSD string `json:"price_usd"`
ChangeBTC string `json:"change_btc"`
ChangeUSD string `json:"change_usd"`
Balance string `json:"balance"`
Destination string `json:"destination"`
Tag string `json:"tag"`
Confirmations int `json:"confirmations"`
Capitalization float64 `json:"capitalization"`
DepositEntries []DepositEntry `json:"deposit_entries"`
}
func AssetListWithRequestID ¶ added in v1.4.3
func AssetSearch ¶ added in v1.1.5
type Attachment ¶
type Attachment struct {
Type string `json:"type"`
AttachmentId string `json:"attachment_id"`
ViewURL string `json:"view_url"`
UploadUrl string `json:"upload_url"`
}
func AttachmentShow ¶ added in v1.1.5
func AttachmentShow(ctx context.Context, uid, sid, key, id string) (*Attachment, error)
func CreateAttachment ¶ added in v1.1.5
func CreateAttachment(ctx context.Context, uid, sid, key string) (*Attachment, error)
type Authenticator ¶ added in v1.7.3
func NewAuthenticator ¶ added in v1.7.3
func NewAuthenticator(uid, sid, privateKey string) *Authenticator
type BlazeClient ¶
type BlazeClient struct {
// contains filtered or unexported fields
}
func NewBlazeClient ¶
func NewBlazeClient(uid, sid, key string) *BlazeClient
func (*BlazeClient) Loop ¶
func (b *BlazeClient) Loop(ctx context.Context, listener BlazeListener) error
func (*BlazeClient) SendAppButton ¶
func (b *BlazeClient) SendAppButton(ctx context.Context, conversationId, recipientId, label, action, color string) error
func (*BlazeClient) SendAppCard ¶ added in v1.2.0
func (b *BlazeClient) SendAppCard(ctx context.Context, conversationId, recipientId, title, description, action, iconUrl string) error
func (*BlazeClient) SendContact ¶
func (b *BlazeClient) SendContact(ctx context.Context, conversationId, recipientId, contactId string) error
func (*BlazeClient) SendGroupAppButton ¶ added in v1.4.4
func (b *BlazeClient) SendGroupAppButton(ctx context.Context, conversationId, recipientId string, buttons []*AppButtonView) error
func (*BlazeClient) SendMessage ¶
func (b *BlazeClient) SendMessage(ctx context.Context, conversationId, recipientId, messageId, category, content, representativeId string) error
func (*BlazeClient) SendPlainText ¶
func (b *BlazeClient) SendPlainText(ctx context.Context, msg MessageView, content string) error
func (*BlazeClient) SendPost ¶ added in v1.1.5
func (b *BlazeClient) SendPost(ctx context.Context, msg MessageView, content string) error
func (*BlazeClient) SendRecallMessage ¶ added in v1.4.0
func (b *BlazeClient) SendRecallMessage(ctx context.Context, conversationId, recipientId, recallMessageId string) error
func (*BlazeClient) SetupDailer ¶ added in v1.4.4
func (b *BlazeClient) SetupDailer(dailer *websocket.Dialer)
type BlazeListener ¶
type BlazeMessage ¶
type Code ¶ added in v1.7.0
type Code interface {
*MultisigRequest | *User | *Conversation
}
type Conversation ¶
type Conversation struct {
ConversationId string `json:"conversation_id"`
CreatorId string `json:"creator_id"`
Category string `json:"category"`
Name string `json:"name"`
IconURL string `json:"icon_url"`
Announcement string `json:"announcement"`
CreatedAt time.Time `json:"created_at"`
Participants []Participant `json:"participants"`
ParticipantSessions []ParticipantSessionView `json:"participant_sessions"`
}
func ConversationShow ¶
func CreateContactConversation ¶ added in v1.7.2
func CreateContactConversation(ctx context.Context, participantID, uid, sid, key string) (*Conversation, error)
func CreateConversation ¶
func CreateConversation(ctx context.Context, category, conversationId string, name, announcement string, participants []Participant, uid, sid, key string) (*Conversation, error)
func JoinConversation ¶ added in v1.8.0
func JoinConversation(ctx context.Context, conversationId, uid, sid, key string) (*Conversation, error)
type DepositEntry ¶ added in v1.3.0
type Error ¶
type Error struct {
Status int `json:"status"`
Code int `json:"code"`
Description string `json:"description"`
Extra interface{} `json:"extra,omitempty"`
// contains filtered or unexported fields
}
func AuthorizationError ¶
func BadDataError ¶
func ForbiddenError ¶
type GhostKeyRequest ¶ added in v1.2.1
type GhostKeys ¶ added in v1.2.0
type GhostKeys struct {
Type string `json:"type"`
Mask string `json:"mask"`
Keys []string `json:"keys"`
}
func ReadGhostKey ¶ added in v1.2.1
func ReadGhostKeys ¶ added in v1.2.0
type ImageMessagePayload ¶ added in v1.6.0
type LiveMessagePayload ¶ added in v1.1.5
type MessageRequest ¶
type MessageRequest struct {
ConversationId string `json:"conversation_id"`
RecipientId string `json:"recipient_id"`
MessageId string `json:"message_id"`
Category string `json:"category"`
Data string `json:"data"`
DataBase64 string `json:"data_base64"`
RepresentativeId string `json:"representative_id"`
QuoteMessageId string `json:"quote_message_id"`
}
type MessageView ¶
type MessageView struct {
ConversationId string `json:"conversation_id"`
UserId string `json:"user_id"`
MessageId string `json:"message_id"`
Category string `json:"category"`
Data string `json:"data"`
DataBase64 string `json:"data_base64"`
RepresentativeId string `json:"representative_id"`
QuoteMessageId string `json:"quote_message_id"`
Status string `json:"status"`
Source string `json:"source"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
type MixinExtraPack ¶ added in v1.7.0
type MixinExtraPack struct {
T uuid.UUID
M string `msgpack:",omitempty"`
}
func DecodeMixinExtra ¶ added in v1.7.3
func DecodeMixinExtra(b []byte) *MixinExtraPack
type MultisigRequest ¶ added in v1.2.0
type MultisigRequest struct {
Type string `json:"type"`
RequestId string `json:"request_id"`
UserId string `json:"user_id"`
AssetId string `json:"asset_id"`
Amount string `json:"amount"`
Threshold int64 `json:"threshold"`
Senders []string `json:"senders"`
Receivers []string `json:"receivers"`
Signers []string `json:"signers"`
Memo string `json:"memo"`
Action string `json:"action"`
State string `json:"state"`
TransactionHash string `json:"transaction_hash"`
RawTransaction string `json:"raw_transaction"`
CreatedAt time.Time `json:"created_at"`
CodeId string `json:"code_id"`
}
func CreateMultisig ¶ added in v1.2.0
func CreateMultisig(ctx context.Context, action, raw string, uid, sid, sessionKey string) (*MultisigRequest, error)
CreateMultisig create a multisigs request which action is `unlock` or `sign`
func ReadMultisigByCode ¶ added in v1.7.0
func ReadMultisigByCode(ctx context.Context, codeId string) (*MultisigRequest, error)
func SignMultisig ¶ added in v1.2.0
type MultisigUTXO ¶ added in v1.2.0
type MultisigUTXO struct {
Type string `json:"type"`
UserId string `json:"user_id"`
UTXOId string `json:"utxo_id"`
AssetId string `json:"asset_id"`
TransactionHash string `json:"transaction_hash"`
OutputIndex int64 `json:"output_index"`
Amount string `json:"amount"`
Threshold int64 `json:"threshold"`
Members []string `json:"members"`
Memo string `json:"memo"`
State string `json:"state"`
Sender string `json:"sender"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
SignedBy string `json:"signed_by"`
SignedTx string `json:"signed_tx"`
}
func ReadMultisigs ¶ added in v1.2.0
func ReadMultisigs(ctx context.Context, limit int, offset, membersHash, threshold, state, uid, sid, sessionKey string) ([]*MultisigUTXO, error)
state: spent, unspent, signed
func ReadMultisigsLegacy ¶ added in v1.2.0
type NetworkAsset ¶ added in v1.4.8
type NetworkAsset struct {
Type string `json:"type"`
AssetID string `json:"asset_id"`
FeeAssetId string `json:"fee_asset_id"`
ChainID string `json:"chain_id"`
AssetKey string `json:"asset_key"`
MixinID string `json:"mixin_id"`
Symbol string `json:"symbol"`
Name string `json:"name"`
IconURL string `json:"icon_url"`
Amount string `json:"amount"`
PriceBTC string `json:"price_btc"`
PriceUSD string `json:"price_usd"`
ChangeBTC string `json:"change_btc"`
ChangeUSD string `json:"change_usd"`
Confirmations int64 `json:"confirmations"`
Fee string `json:"fee"`
Reserve string `json:"reserve"`
SnapshotsCount int64 `json:"snapshots_count"`
Capitalization float64 `json:"capitalization"`
Liquidity string `json:"liquidity"`
}
func ReadNetworkAsset ¶ added in v1.4.4
func ReadNetworkAsset(ctx context.Context, name string) (*NetworkAsset, error)
type NetworkChain ¶ added in v1.6.0
type NetworkChain struct {
Type string `json:"type"`
ChainId string `json:"chain_id"`
Name string `json:"name"`
Symbol string `json:"symbol"`
IconURL string `json:"icon_url"`
ManagedBlockHeight int64 `json:"managed_block_height"`
DepositBlockHeight int64 `json:"deposit_block_height"`
ExternalBlockHeight int64 `json:"external_block_height"`
Threshold int `json:"threshold"`
WithdrawalTimestamp time.Time `json:"withdrawal_timestamp"`
WithdrawalPendingCount int64 `json:"withdrawal_pending_count"`
WithdrawalFee string `json:"withdrawal_fee"`
IsSynchronized bool `json:"is_synchronized"`
}
func ReadNetworkChainById ¶ added in v1.6.0
func ReadNetworkChainById(ctx context.Context, chainId string) (*NetworkChain, error)
func ReadNetworkChains ¶ added in v1.6.0
func ReadNetworkChains(ctx context.Context, chainId string) ([]*NetworkChain, error)
type NetworkTicker ¶ added in v1.8.1
type NetworkTicker struct {
Type string `json:"type"`
PriceBTC string `json:"price_btc"`
PriceUSD string `json:"price_usd"`
}
func ReadNetworkTicker ¶ added in v1.8.1
func ReadNetworkTicker(ctx context.Context, assetId string) (*NetworkTicker, error)
type ObjectInput ¶ added in v1.7.0
type Participant ¶
type ParticipantSessionView ¶ added in v1.2.0
type Payment ¶ added in v1.2.0
type Payment struct {
Type string `json:"type"`
TraceId string `json:"trace_id"`
AssetId string `json:"asset_id"`
Amount string `json:"amount"`
Threshold int64 `json:"threshold"`
Receivers []string `json:"receivers"`
Memo string `json:"memo"`
Status string `json:"status"`
CodeId string `json:"code_id"`
CreatedAt time.Time `json:"created_at"`
}
func CreatePaymentRequest ¶ added in v1.2.0
type PaymentRequest ¶ added in v1.2.0
type RawTransaction ¶
type RawTransaction struct {
Type string `json:"type"`
SnapshotId string `json:"snapshot_id"`
OpponentKey string `json:"opponent_key"`
AssetId string `json:"asset_id"`
Amount string `json:"amount"`
TraceId string `json:"trace_id"`
Memo string `json:"memo"`
State string `json:"state"`
CreatedAt time.Time `json:"created_at"`
TransactionHash string `json:"transaction_hash"`
SnapshotHash string `json:"snapshot_hash"`
SnapshotAt time.Time `json:"snapshot_at"`
}
func CreateMultisigTransaction ¶ added in v1.2.0
func CreateMultisigTransaction(ctx context.Context, in *TransferInput, uid, sid, sessionKey, pin, pinToken string) (*RawTransaction, error)
func CreateTransaction ¶
func CreateTransaction(ctx context.Context, in *TransferInput, uid, sid, sessionKey, pin, pinToken string) (*RawTransaction, error)
type RecallMessagePayload ¶ added in v1.1.5
type RecallMessagePayload struct {
MessageId string `json:"message_id"`
}
type ReceiptAcknowledgementRequest ¶ added in v1.1.5
type Snapshot ¶ added in v1.1.5
type Snapshot struct {
Type string `json:"type"`
SnapshotId string `json:"snapshot_id"`
AssetId string `json:"asset_id"`
Amount string `json:"amount"`
OpeningBalance string `json:"opening_balance"`
ClosingBalance string `json:"closing_balance"`
TransactionHash string `json:"transaction_hash,omitempty"`
SnapshotHash string `json:"snapshot_hash,omitempty"`
SnapshotAt time.Time `json:"snapshot_at,omitempty"`
CreatedAt time.Time `json:"created_at"`
// deposit & withdrawal
OutputIndex int64 `json:"output_index,omitempty"` // deposit
Sender string `json:"sender,omitempty"` // deposit
OpponentId string `json:"opponent_id,omitempty"` // transfer
TraceId string `json:"trace_id,omitempty"` // transfer & raw & withdrawal
Memo string `json:"memo,omitempty"` // transfer & raw & withdrawal
OpponentKey string `json:"opponent_key"` // raw
OpponentMultisigReceivers []string `json:"opponent_receivers"` // raw
OpponentMultisigThreshold int64 `json:"opponent_threshold"` // raw
State string `json:"state"` // raw & withdrawal
// withdrawal
Receiver string `json:"receiver,omitempty"`
Confirmations int64 `json:"confirmations,omitempty"`
Fee struct {
Amount string `json:"amount"`
AssetId string `json:"asset_id"`
} `json:"fee,omitempty"`
}
func CreateObject ¶ added in v1.7.0
func CreateTransfer ¶
func CreateWithdrawal ¶
func NetworkSnapshot ¶ added in v1.1.5
func NetworkSnapshotByToken ¶ added in v1.1.5
func ReadTransferByTrace ¶ added in v1.1.5
func SnapshotById ¶ added in v1.1.5
func SnapshotByToken ¶ added in v1.1.5
func SnapshotByTraceId ¶ added in v1.7.0
type SnapshotShort ¶ added in v1.2.0
type SnapshotShort struct {
Type string `json:"type"`
SnapshotId string `json:"snapshot_id"`
Source string `json:"source"`
Amount string `json:"amount"`
Asset struct {
Type string `json:"type"`
AssetId string `json:"asset_id"`
ChainId string `json:"chain_id"`
MixinId string `json:"mixin_id"`
Symbol string `json:"symbol"`
Name string `json:"name"`
AssetKey string `json:"asset_key"`
IconUrl string `json:"icon_url"`
} `json:"asset"`
State string `json:"state"`
SnapshotHash string `json:"snapshot_hash"`
CreatedAt time.Time `json:"created_at"`
TraceId string `json:"trace_id"`
OpponentId string `json:"opponent_id"`
Memo string `json:"data"`
}
func NetworkSnapshots ¶ added in v1.1.5
func NetworkSnapshotsByToken ¶ added in v1.1.5
type TipNodeData ¶ added in v1.4.7
type TipNodeData struct {
Commitments []string `json:"commitments"`
Identity string `json:"identity"`
}
func GetTipNodeByPath ¶ added in v1.4.7
func GetTipNodeByPath(ctx context.Context, path string) (*TipNodeData, error)
func GetTipNodeByPathWithRequestId ¶ added in v1.4.8
func GetTipNodeByPathWithRequestId(ctx context.Context, path, requestId string) (*TipNodeData, error)
type Transaction ¶ added in v1.1.5
type Transaction struct {
Type string `json:"type"`
TransactionId string `json:"transaction_id"`
TransactionHash string `json:"transaction_hash"`
Sender string `json:"sender"`
ChainId string `json:"chain_id"`
AssetId string `json:"asset_id"`
Amount string `json:"amount"`
Destination string `json:"destination"`
Tag string `json:"tag"`
Confirmations int `json:"confirmations"`
Threshold int `json:"threshold"`
CreatedAt string `json:"created_at"`
}
func ExternalTranactions ¶ added in v1.1.5
func ExternalTranactions(ctx context.Context, asset, destination, tag string) ([]*Transaction, error)
type TransferInput ¶
type TransferView ¶
type TransferView struct {
Type string `json:"type"`
SnapshotId string `json:"snapshot_id"`
CounterUserId string `json:"counter_user_id"`
AssetId string `json:"asset_id"`
Amount string `json:"amount"`
TraceId string `json:"trace_id"`
Memo string `json:"memo"`
CreatedAt time.Time `json:"created_at"`
}
type Turn ¶ added in v1.2.0
type User ¶
type User struct {
UserId string `json:"user_id"`
SessionId string `json:"session_id"`
PinToken string `json:"pin_token"`
PINTokenBase64 string `json:"pin_token_base64"`
IdentityNumber string `json:"identity_number"`
Phone string `json:"phone"`
FullName string `json:"full_name"`
AvatarURL string `json:"avatar_url"`
DeviceStatus string `json:"device_status"`
CreatedAt string `json:"created_at"`
}
func CreateUser ¶
func CreateUserSimple ¶ added in v1.7.3
func Relationship ¶ added in v1.2.0
func SearchUser ¶ added in v1.1.5
func UpdatePreference ¶ added in v1.1.4
func UpdateUserMe ¶ added in v1.1.5
func UserMeWithRequestID ¶ added in v1.4.3
type UserSession ¶ added in v1.8.2
type UserSession struct {
UserId string `json:"user_id"`
SessionId string `json:"session_id"`
PublicKey string `json:"public_key"`
Platform string `json:"platform"`
}
func FetchUserSession ¶ added in v1.8.2
Source Files
¶
- address.go
- aes.go
- app.go
- asset.go
- attachment.go
- auth.go
- authenticator.go
- blaze.go
- chain.go
- code.go
- conversation.go
- crypto.go
- error.go
- fiats.go
- message.go
- multisigs.go
- network.go
- network_asset.go
- object.go
- payment.go
- pin.go
- request.go
- session.go
- snapshot.go
- tip.go
- transaction.go
- transfer.go
- transport.go
- turn.go
- user.go
- uuid.go
- withdrawal.go
Click to show internal directories.
Click to hide internal directories.