@namespace("stellar.1") protocol common { import idl "../keybase1" as keybase1; @typedef("string") record AccountID {} @typedef("string") record SecretKey {} @typedef("string") record TransactionID {} @typedef("string") record PaymentID {} @typedef("string") record KeybaseTransactionID {} @typedef("long") record TimeMs {} // ms since epoch @typedef("bytes") record Hash {} @typedef("string") record KeybaseRequestID {} @typedef("string") record AssetCode {} record Asset { string type; // 'native' | 'credit_alphanum4' | 'credit_alphanum12' string code; string issuer; string verifiedDomain; // 'stronghold.co' or empty if XLM or unverified string issuerName; // 'Stronghold' or empty if it didn't exist, XLM, or unverified string desc; // 'Worthwhile token' or empty string infoUrl; // 'https://...' or empty string infoUrlText; // 'Exchange' for an exchange, 'View details' for anything else boolean showDepositButton; // if true, show a deposit button string depositButtonText; // the text to show in the deposit button, most likely "Deposit" boolean showWithdrawButton; // if true, show a withdraw button string withdrawButtonText; // the text to show in the withdraw button, most likely "Withdraw" string withdrawType; // bank_account, crypto, cash, etc. that the anchor supports string transferServer; // sep6 transfer server string authEndpoint; // sep6 auth endpoint boolean depositReqAuth; // deposit requires sep10 authentication boolean withdrawReqAuth; // withdraw requires sep10 authentication } record AssetListResult { array assets; int totalCount; } record Balance { Asset asset; string amount; string limit; boolean isAuthorized; } record AccountReserve { string amount; // "-1" string description; // e.g. "HUGZ/Unknown trustline" or "account" } enum TransactionStatus { NONE_0, PENDING_1, SUCCESS_2, ERROR_TRANSIENT_3, ERROR_PERMANENT_4 } enum RequestStatus { OK_0, CANCELED_1, DONE_2 } enum PaymentStrategy { NONE_0, DIRECT_1, RELAY_2 } enum RelayDirection { CLAIM_0, YANK_1 } record PaymentResult { AccountID senderAccountID; KeybaseTransactionID keybaseID; // Direct: tx ID of the payment tx // Relay : tx ID of the funding payment tx TransactionID stellarID; // If (arg.quickReturn && result.pending) then the payment // was recorded but may still be pending on the stellar network // and could still fail. // If arg.quickReturn == false then result.pending should be ignored. boolean pending; } record RelayClaimResult { // tx ID of the submitted claim tx (not the fund tx) TransactionID claimStellarID; } // A note encrypted for one or two keybase users. // Decrypts to a NoteContents. record EncryptedNote { int v; // version bytes e; // encrypted data keybase1.BoxNonce n; // nonce NoteRecipient sender; union { null, NoteRecipient } recipient; } record NoteRecipient { keybase1.UserVersion user; keybase1.PerUserKeyGeneration pukGen; } record NoteContents { string note; TransactionID stellarID; } // A stellar secret key encrypted for an iteam. // Decrypts to a stellar1.SecretKey. record EncryptedRelaySecret { int v; // version bytes e; // encrypted data keybase1.BoxNonce n; // nonce keybase1.PerTeamKeyGeneration gen; // key generation that was used } record RelayContents { TransactionID stellarID; SecretKey sk; string note; } // OutsideCurrencyCode examples: "USD", "EUR" @typedef("string") record OutsideCurrencyCode {} record OutsideExchangeRate { OutsideCurrencyCode currency; // Example: PLN string rate; // Example: "0.9389014463" = PLN / XLM } record CurrencySymbol { @jsonkey("str") string symbol; // Example: "$" boolean ambigious; // whether the symbol is used by multiple currencies boolean postfix; // whether symbol goes after the number } record OutsideCurrencyDefinition { string name; // Example: "US Dollar" CurrencySymbol symbol; } record StellarServerDefinitions { int revision; map currencies; } record PageCursor { string horizonCursor; string directCursor; string relayCursor; } enum AccountMode { NONE_0, USER_1, // Each of the user's devices has access to the keys MOBILE_2 // Only the user's mobile devices have access to the keys } // Record describing trustline input argument for trustline operations - when // changing trustlines, caller only needs to supply issuer account ID and asset // code. record Trustline { AssetCode assetCode; AccountID issuer; } record PaymentPath { string sourceAmount; string sourceAmountMax; Asset sourceAsset; array path; string destinationAmount; Asset destinationAsset; // Populated only if source account balance isn't sufficient to make this // balance. If populated it will be the source account balance. string sourceInsufficientBalance; } }