Documentation ¶
Index ¶
- Constants
- Variables
- type BlockchainData
- type BlockchainProvider
- func (dp *BlockchainProvider) GetBlockchainAccountDataAfterBlock(ctx context.Context, account string, slot uint64) ([]byte, uint64, error)
- func (dp *BlockchainProvider) GetBlockchainAccountInfo(ctx context.Context, account string, commitment solana.Commitment) (*solana.AccountInfo, error)
- func (dp *BlockchainProvider) GetBlockchainBalance(ctx context.Context, account string) (uint64, uint64, error)
- func (dp *BlockchainProvider) GetBlockchainBlock(ctx context.Context, slot uint64) (*solana.Block, error)
- func (dp *BlockchainProvider) GetBlockchainBlockSignatures(ctx context.Context, slot uint64) ([]string, error)
- func (dp *BlockchainProvider) GetBlockchainBlocksWithLimit(ctx context.Context, start uint64, limit uint64) ([]uint64, error)
- func (dp *BlockchainProvider) GetBlockchainFilteredProgramAccounts(ctx context.Context, program string, offset uint, filterValue []byte) ([]string, uint64, error)
- func (dp *BlockchainProvider) GetBlockchainHistory(ctx context.Context, account string, commitment solana.Commitment, ...) ([]*solana.TransactionSignature, error)
- func (dp *BlockchainProvider) GetBlockchainLatestBlockhash(ctx context.Context) (solana.Blockhash, error)
- func (dp *BlockchainProvider) GetBlockchainMinimumBalanceForRentExemption(ctx context.Context, size uint64) (uint64, error)
- func (dp *BlockchainProvider) GetBlockchainSignatureStatuses(ctx context.Context, signatures []solana.Signature) ([]*solana.SignatureStatus, error)
- func (dp *BlockchainProvider) GetBlockchainSlot(ctx context.Context, commitment solana.Commitment) (uint64, error)
- func (dp *BlockchainProvider) GetBlockchainTokenAccountInfo(ctx context.Context, account string, commitment solana.Commitment) (*token.Account, error)
- func (dp *BlockchainProvider) GetBlockchainTokenAccountsByOwner(ctx context.Context, account string) ([]ed25519.PublicKey, error)
- func (dp *BlockchainProvider) GetBlockchainTransaction(ctx context.Context, sig string, commitment solana.Commitment) (*solana.ConfirmedTransaction, error)
- func (dp *BlockchainProvider) GetBlockchainTransactionTokenBalances(ctx context.Context, sig string) (*solana.TransactionTokenBalances, error)
- func (dp *BlockchainProvider) RequestBlockchainAirdrop(ctx context.Context, account string, amount uint64) (solana.Signature, error)
- func (dp *BlockchainProvider) SubmitBlockchainTransaction(ctx context.Context, tx *solana.Transaction) (solana.Signature, error)
- type ConfigProvider
- type DataProvider
- type DatabaseData
- type DatabaseProvider
- func (dp *DatabaseProvider) ActivelyScheduleTreasuryAdvanceFulfillments(ctx context.Context, treasury string, intentOrderingIndex uint64, limit int) (uint64, error)
- func (dp *DatabaseProvider) AddContact(ctx context.Context, owner *user.DataContainerID, contact string) error
- func (dp *DatabaseProvider) AddToBadgeCount(ctx context.Context, owner string, amount uint32) error
- func (dp *DatabaseProvider) AdvanceChatPointer(ctx context.Context, chatId chat.ChatId, pointer string) error
- func (dp *DatabaseProvider) BatchAddContacts(ctx context.Context, owner *user.DataContainerID, contacts []string) error
- func (dp *DatabaseProvider) BatchRemoveContacts(ctx context.Context, owner *user.DataContainerID, contacts []string) error
- func (dp *DatabaseProvider) CountCommitmentRepaymentsDivertedToVault(ctx context.Context, vault string) (uint64, error)
- func (dp *DatabaseProvider) CountCommitmentsByState(ctx context.Context, state commitment.State) (uint64, error)
- func (dp *DatabaseProvider) CountWebhookByState(ctx context.Context, state webhook.State) (uint64, error)
- func (dp *DatabaseProvider) CreateAccountInfo(ctx context.Context, record *account.Record) error
- func (dp *DatabaseProvider) CreateMessage(ctx context.Context, record *messaging.Record) error
- func (dp *DatabaseProvider) CreatePayment(ctx context.Context, record *payment.Record) error
- func (dp *DatabaseProvider) CreatePaywall(ctx context.Context, record *paywall.Record) error
- func (dp *DatabaseProvider) CreateRequest(ctx context.Context, record *paymentrequest.Record) error
- func (dp *DatabaseProvider) CreateWebhook(ctx context.Context, record *webhook.Record) error
- func (dp *DatabaseProvider) DeleteChatMessage(ctx context.Context, chatId chat.ChatId, messageId string) error
- func (dp *DatabaseProvider) DeleteMessage(ctx context.Context, account string, messageID uuid.UUID) error
- func (dp *DatabaseProvider) DeletePushToken(ctx context.Context, pushToken string) error
- func (dp *DatabaseProvider) DeleteRendezvous(ctx context.Context, key string) error
- func (dp *DatabaseProvider) ExecuteInTx(ctx context.Context, isolation sql.IsolationLevel, ...) error
- func (dp *DatabaseProvider) FilterVerifiedPhoneNumbers(ctx context.Context, phoneNumbers []string) ([]string, error)
- func (dp *DatabaseProvider) GetAccountInfoByAuthorityAddress(ctx context.Context, address string) (*account.Record, error)
- func (dp *DatabaseProvider) GetAccountInfoByTokenAddress(ctx context.Context, address string) (*account.Record, error)
- func (dp *DatabaseProvider) GetAccountInfoCountRequiringAutoReturnCheck(ctx context.Context) (uint64, error)
- func (dp *DatabaseProvider) GetAccountInfoCountRequiringDepositSync(ctx context.Context) (uint64, error)
- func (dp *DatabaseProvider) GetAccountInfoCountRequiringSwapRetry(ctx context.Context) (uint64, error)
- func (dp *DatabaseProvider) GetActionById(ctx context.Context, intent string, actionId uint32) (*action.Record, error)
- func (dp *DatabaseProvider) GetAllActionsByAddress(ctx context.Context, address string) ([]*action.Record, error)
- func (dp *DatabaseProvider) GetAllActionsByIntent(ctx context.Context, intent string) ([]*action.Record, error)
- func (dp *DatabaseProvider) GetAllChatMessages(ctx context.Context, chatId chat.ChatId, opts ...query.Option) ([]*chat.Message, error)
- func (dp *DatabaseProvider) GetAllChatsForUser(ctx context.Context, user string, opts ...query.Option) ([]*chat.Chat, error)
- func (dp *DatabaseProvider) GetAllCommitmentsByState(ctx context.Context, state commitment.State, opts ...query.Option) ([]*commitment.Record, error)
- func (dp *DatabaseProvider) GetAllExchangeRates(ctx context.Context, t time.Time) (*currency.MultiRateRecord, error)
- func (dp *DatabaseProvider) GetAllFulfillmentsByAction(ctx context.Context, intentId string, actionId uint32) ([]*fulfillment.Record, error)
- func (dp *DatabaseProvider) GetAllFulfillmentsByIntent(ctx context.Context, intent string, opts ...query.Option) ([]*fulfillment.Record, error)
- func (dp *DatabaseProvider) GetAllFulfillmentsByState(ctx context.Context, state fulfillment.State, ...) ([]*fulfillment.Record, error)
- func (dp *DatabaseProvider) GetAllFulfillmentsByTypeAndAction(ctx context.Context, fulfillmentType fulfillment.Type, intentId string, ...) ([]*fulfillment.Record, error)
- func (dp *DatabaseProvider) GetAllIntentsByOwner(ctx context.Context, owner string, opts ...query.Option) ([]*intent.Record, error)
- func (dp *DatabaseProvider) GetAllKeysByState(ctx context.Context, state vault.State, opts ...query.Option) ([]*vault.Record, error)
- func (dp *DatabaseProvider) GetAllNonceByState(ctx context.Context, state nonce.State, opts ...query.Option) ([]*nonce.Record, error)
- func (dp *DatabaseProvider) GetAllPendingWebhooksReadyToSend(ctx context.Context, limit uint64) ([]*webhook.Record, error)
- func (dp *DatabaseProvider) GetAllPhoneVerificationsForNumber(ctx context.Context, phoneNumber string) ([]*phone.Verification, error)
- func (dp *DatabaseProvider) GetAllTimelocksByState(ctx context.Context, state timelock_token.TimelockState, opts ...query.Option) ([]*timelock.Record, error)
- func (dp *DatabaseProvider) GetAllTreasuryPoolsByState(ctx context.Context, state treasury.TreasuryPoolState, opts ...query.Option) ([]*treasury.Record, error)
- func (dp *DatabaseProvider) GetAllValidPushTokensdByDataContainer(ctx context.Context, id *user.DataContainerID) ([]*push.Record, error)
- func (dp *DatabaseProvider) GetBadgeCount(ctx context.Context, owner string) (*badgecount.Record, error)
- func (dp *DatabaseProvider) GetBalanceCheckpoint(ctx context.Context, account string) (*balance.Record, error)
- func (dp *DatabaseProvider) GetChatById(ctx context.Context, chatId chat.ChatId) (*chat.Chat, error)
- func (dp *DatabaseProvider) GetChatMessage(ctx context.Context, chatId chat.ChatId, messageId string) (*chat.Message, error)
- func (dp *DatabaseProvider) GetChatUnreadCount(ctx context.Context, chatId chat.ChatId) (uint32, error)
- func (dp *DatabaseProvider) GetCommitmentByAction(ctx context.Context, intentId string, actionId uint32) (*commitment.Record, error)
- func (dp *DatabaseProvider) GetCommitmentByAddress(ctx context.Context, address string) (*commitment.Record, error)
- func (dp *DatabaseProvider) GetCommitmentByVault(ctx context.Context, vault string) (*commitment.Record, error)
- func (dp *DatabaseProvider) GetContacts(ctx context.Context, owner *user.DataContainerID, limit uint32, ...) (contacts []string, nextPageToken []byte, err error)
- func (dp *DatabaseProvider) GetDepositedAmountForAntiMoneyLaundering(ctx context.Context, phoneNumber string, since time.Time) (uint64, float64, error)
- func (dp *DatabaseProvider) GetEvent(ctx context.Context, id string) (*event.Record, error)
- func (dp *DatabaseProvider) GetExchangeRate(ctx context.Context, code currency_lib.Code, t time.Time) (*currency.ExchangeRateRecord, error)
- func (dp *DatabaseProvider) GetExchangeRateHistory(ctx context.Context, code currency_lib.Code, opts ...query.Option) ([]*currency.ExchangeRateRecord, error)
- func (dp *DatabaseProvider) GetExternalDeposit(ctx context.Context, signature, account string) (*deposit.Record, error)
- func (dp *DatabaseProvider) GetFiatOnrampPurchase(ctx context.Context, nonce uuid.UUID) (*onramp.Record, error)
- func (dp *DatabaseProvider) GetFirstSchedulableFulfillmentByAddressAsDestination(ctx context.Context, address string) (*fulfillment.Record, error)
- func (dp *DatabaseProvider) GetFirstSchedulableFulfillmentByAddressAsSource(ctx context.Context, address string) (*fulfillment.Record, error)
- func (dp *DatabaseProvider) GetFirstSchedulableFulfillmentByType(ctx context.Context, fulfillmentType fulfillment.Type) (*fulfillment.Record, error)
- func (dp *DatabaseProvider) GetFulfillmentById(ctx context.Context, id uint64) (*fulfillment.Record, error)
- func (dp *DatabaseProvider) GetFulfillmentBySignature(ctx context.Context, signature string) (*fulfillment.Record, error)
- func (dp *DatabaseProvider) GetFulfillmentCount(ctx context.Context) (uint64, error)
- func (dp *DatabaseProvider) GetFulfillmentCountByIntent(ctx context.Context, intent string) (uint64, error)
- func (dp *DatabaseProvider) GetFulfillmentCountByIntentAndState(ctx context.Context, intent string, state fulfillment.State) (uint64, error)
- func (dp *DatabaseProvider) GetFulfillmentCountByState(ctx context.Context, state fulfillment.State) (uint64, error)
- func (dp *DatabaseProvider) GetFulfillmentCountByStateAndAddress(ctx context.Context, state fulfillment.State, address string) (uint64, error)
- func (dp *DatabaseProvider) GetFulfillmentCountByStateGroupedByType(ctx context.Context, state fulfillment.State) (map[fulfillment.Type]uint64, error)
- func (dp *DatabaseProvider) GetFulfillmentCountByTypeActionAndState(ctx context.Context, intentId string, actionId uint32, ...) (uint64, error)
- func (dp *DatabaseProvider) GetFulfillmentCountByTypeStateAndAddress(ctx context.Context, fulfillmentType fulfillment.Type, state fulfillment.State, ...) (uint64, error)
- func (dp *DatabaseProvider) GetFulfillmentCountByTypeStateAndAddressAsSource(ctx context.Context, fulfillmentType fulfillment.Type, state fulfillment.State, ...) (uint64, error)
- func (dp *DatabaseProvider) GetFulfillmentCountForMetrics(ctx context.Context, state fulfillment.State) (map[fulfillment.Type]uint64, error)
- func (dp *DatabaseProvider) GetGiftCardAutoReturnAction(ctx context.Context, giftCardVault string) (*action.Record, error)
- func (dp *DatabaseProvider) GetGiftCardClaimedAction(ctx context.Context, giftCardVault string) (*action.Record, error)
- func (dp *DatabaseProvider) GetGiftCardClaimedIntent(ctx context.Context, giftCardVault string) (*intent.Record, error)
- func (dp *DatabaseProvider) GetIntent(ctx context.Context, intentID string) (*intent.Record, error)
- func (dp *DatabaseProvider) GetIntentBySignature(ctx context.Context, signature string) (*intent.Record, error)
- func (dp *DatabaseProvider) GetIntentCountForAntispam(ctx context.Context, intentType intent.Type, phoneNumber string, ...) (uint64, error)
- func (dp *DatabaseProvider) GetIntentCountWithOwnerInteractionsForAntispam(ctx context.Context, sourceOwner, destinationOwner string, ...) (uint64, error)
- func (dp *DatabaseProvider) GetKey(ctx context.Context, public_key string) (*vault.Record, error)
- func (dp *DatabaseProvider) GetKeyCount(ctx context.Context) (uint64, error)
- func (dp *DatabaseProvider) GetKeyCountByState(ctx context.Context, state vault.State) (uint64, error)
- func (dp *DatabaseProvider) GetLatestAccountInfoByOwnerAddressAndType(ctx context.Context, address string, accountType commonpb.AccountType) (*account.Record, error)
- func (dp *DatabaseProvider) GetLatestAccountInfosByOwnerAddress(ctx context.Context, address string) (map[commonpb.AccountType][]*account.Record, error)
- func (dp *DatabaseProvider) GetLatestIntentByInitiatorAndType(ctx context.Context, intentType intent.Type, owner string) (*intent.Record, error)
- func (dp *DatabaseProvider) GetLatestLoginByOwner(ctx context.Context, owner string) (*login.Record, error)
- func (dp *DatabaseProvider) GetLatestPhoneEventForNumberByType(ctx context.Context, phoneNumber string, eventType phone.EventType) (*phone.Event, error)
- func (dp *DatabaseProvider) GetLatestPhoneVerificationForAccount(ctx context.Context, account string) (*phone.Verification, error)
- func (dp *DatabaseProvider) GetLatestPhoneVerificationForNumber(ctx context.Context, phoneNumber string) (*phone.Verification, error)
- func (dp *DatabaseProvider) GetLatestSaveRecentRootIntentForTreasury(ctx context.Context, treasury string) (*intent.Record, error)
- func (dp *DatabaseProvider) GetLegacyTotalExternalDepositAmountFromPrePrivacy2022Accounts(ctx context.Context, account string) (uint64, error)
- func (dp *DatabaseProvider) GetLoginsByAppInstall(ctx context.Context, appInstallId string) (*login.MultiRecord, error)
- func (dp *DatabaseProvider) GetMessages(ctx context.Context, account string) ([]*messaging.Record, error)
- func (dp *DatabaseProvider) GetNetBalanceFromActions(ctx context.Context, address string) (int64, error)
- func (dp *DatabaseProvider) GetNetBalanceFromActionsBatch(ctx context.Context, accounts ...string) (map[string]int64, error)
- func (dp *DatabaseProvider) GetNetBalanceFromPrePrivacy2022Intents(ctx context.Context, account string) (int64, error)
- func (dp *DatabaseProvider) GetNextSchedulableFulfillmentByAddress(ctx context.Context, address string, intentOrderingIndex uint64, ...) (*fulfillment.Record, error)
- func (dp *DatabaseProvider) GetNonce(ctx context.Context, address string) (*nonce.Record, error)
- func (dp *DatabaseProvider) GetNonceCount(ctx context.Context) (uint64, error)
- func (dp *DatabaseProvider) GetNonceCountByState(ctx context.Context, state nonce.State) (uint64, error)
- func (dp *DatabaseProvider) GetNonceCountByStateAndPurpose(ctx context.Context, state nonce.State, purpose nonce.Purpose) (uint64, error)
- func (dp *DatabaseProvider) GetOriginalGiftCardIssuedIntent(ctx context.Context, giftCardVault string) (*intent.Record, error)
- func (dp *DatabaseProvider) GetPayment(ctx context.Context, sig string, index int) (*payment.Record, error)
- func (dp *DatabaseProvider) GetPaymentHistory(ctx context.Context, account string, opts ...query.Option) ([]*payment.Record, error)
- func (dp *DatabaseProvider) GetPaymentHistoryWithinBlockRange(ctx context.Context, account string, lowerBound, upperBound uint64, ...) ([]*payment.Record, error)
- func (dp *DatabaseProvider) GetPaywallByShortPath(ctx context.Context, path string) (*paywall.Record, error)
- func (dp *DatabaseProvider) GetPendingFulfillmentCountByType(ctx context.Context) (map[fulfillment.Type]uint64, error)
- func (dp *DatabaseProvider) GetPhoneEventCountForNumberByTypeSinceTimestamp(ctx context.Context, phoneNumber string, eventType phone.EventType, ...) (uint64, error)
- func (dp *DatabaseProvider) GetPhoneEventCountForVerificationByType(ctx context.Context, verification string, eventType phone.EventType) (uint64, error)
- func (dp *DatabaseProvider) GetPhoneVerification(ctx context.Context, account, phoneNumber string) (*phone.Verification, error)
- func (dp *DatabaseProvider) GetPrioritizedAccountInfosRequiringAutoReturnCheck(ctx context.Context, maxAge time.Duration, limit uint64) ([]*account.Record, error)
- func (dp *DatabaseProvider) GetPrioritizedAccountInfosRequiringDepositSync(ctx context.Context, limit uint64) ([]*account.Record, error)
- func (dp *DatabaseProvider) GetPrioritizedAccountInfosRequiringSwapRetry(ctx context.Context, maxAge time.Duration, limit uint64) ([]*account.Record, error)
- func (dp *DatabaseProvider) GetRandomAvailableNonceByPurpose(ctx context.Context, purpose nonce.Purpose) (*nonce.Record, error)
- func (dp *DatabaseProvider) GetRelationshipAccountInfoByOwnerAddress(ctx context.Context, address, relationshipTo string) (*account.Record, error)
- func (dp *DatabaseProvider) GetRendezvous(ctx context.Context, key string) (*rendezvous.Record, error)
- func (dp *DatabaseProvider) GetRequest(ctx context.Context, intentId string) (*paymentrequest.Record, error)
- func (dp *DatabaseProvider) GetStaleTwitterUsers(ctx context.Context, minAge time.Duration, limit int) ([]*twitter.Record, error)
- func (dp *DatabaseProvider) GetTimelockByAddress(ctx context.Context, address string) (*timelock.Record, error)
- func (dp *DatabaseProvider) GetTimelockByVault(ctx context.Context, vault string) (*timelock.Record, error)
- func (dp *DatabaseProvider) GetTimelockByVaultBatch(ctx context.Context, vaults ...string) (map[string]*timelock.Record, error)
- func (dp *DatabaseProvider) GetTimelockCountByState(ctx context.Context, state timelock_token.TimelockState) (uint64, error)
- func (dp *DatabaseProvider) GetTotalAvailableTreasuryPoolFunds(ctx context.Context, vault string) (uint64, error)
- func (dp *DatabaseProvider) GetTotalExternalDepositedAmountInQuarks(ctx context.Context, account string) (uint64, error)
- func (dp *DatabaseProvider) GetTotalExternalDepositedAmountInQuarksBatch(ctx context.Context, accounts ...string) (map[string]uint64, error)
- func (dp *DatabaseProvider) GetTotalExternalDepositedAmountInUsd(ctx context.Context, account string) (float64, error)
- func (dp *DatabaseProvider) GetTotalTreasuryPoolDeficitFromCommitments(ctx context.Context, treasuryPool string) (uint64, error)
- func (dp *DatabaseProvider) GetTransactedAmountForAntiMoneyLaundering(ctx context.Context, phoneNumber string, since time.Time) (uint64, float64, error)
- func (dp *DatabaseProvider) GetTransaction(ctx context.Context, sig string) (*transaction.Record, error)
- func (dp *DatabaseProvider) GetTreasuryPoolByAddress(ctx context.Context, address string) (*treasury.Record, error)
- func (dp *DatabaseProvider) GetTreasuryPoolByName(ctx context.Context, name string) (*treasury.Record, error)
- func (dp *DatabaseProvider) GetTreasuryPoolByVault(ctx context.Context, vault string) (*treasury.Record, error)
- func (dp *DatabaseProvider) GetTwitterUserByTipAddress(ctx context.Context, tipAddress string) (*twitter.Record, error)
- func (dp *DatabaseProvider) GetTwitterUserByUsername(ctx context.Context, username string) (*twitter.Record, error)
- func (dp *DatabaseProvider) GetUniquePhoneVerificationIdCountForNumberSinceTimestamp(ctx context.Context, phoneNumber string, since time.Time) (uint64, error)
- func (dp *DatabaseProvider) GetUpgradeableCommitmentsByOwner(ctx context.Context, owner string, limit uint64) ([]*commitment.Record, error)
- func (dp *DatabaseProvider) GetUsedTreasuryPoolDeficitFromCommitments(ctx context.Context, treasuryPool string) (uint64, error)
- func (dp *DatabaseProvider) GetUserByID(ctx context.Context, id *user.UserID) (*identity.Record, error)
- func (dp *DatabaseProvider) GetUserByPhoneView(ctx context.Context, phoneNumber string) (*identity.Record, error)
- func (dp *DatabaseProvider) GetUserDataContainerByID(ctx context.Context, id *user.DataContainerID) (*storage.Record, error)
- func (dp *DatabaseProvider) GetUserDataContainerByPhone(ctx context.Context, tokenAccount, phoneNumber string) (*storage.Record, error)
- func (dp *DatabaseProvider) GetUserLocale(ctx context.Context, owner string) (language.Tag, error)
- func (dp *DatabaseProvider) GetUserPreferences(ctx context.Context, id *user.DataContainerID) (*preferences.Record, error)
- func (dp *DatabaseProvider) GetWebhook(ctx context.Context, webhookId string) (*webhook.Record, error)
- func (dp *DatabaseProvider) ImportExchangeRates(ctx context.Context, data *currency.MultiRateRecord) error
- func (dp *DatabaseProvider) InitializeNewMerkleTree(ctx context.Context, name string, levels uint8, seeds []merkletree.Seed, ...) (*merkletree.MerkleTree, error)
- func (dp *DatabaseProvider) IsEligibleForAirdrop(ctx context.Context, owner string) (bool, error)
- func (dp *DatabaseProvider) IsPhoneNumberEnabledForRemoteSendToAccount(ctx context.Context, phoneNumber string, ownerAccount string) (bool, error)
- func (dp *DatabaseProvider) IsPhoneNumberLinkedToAccount(ctx context.Context, phoneNumber string, ownerAccount string) (bool, error)
- func (dp *DatabaseProvider) IsTweetProcessed(ctx context.Context, tweetId string) (bool, error)
- func (dp *DatabaseProvider) LoadExistingMerkleTree(ctx context.Context, name string, readOnly bool) (*merkletree.MerkleTree, error)
- func (dp *DatabaseProvider) MarkFulfillmentAsActivelyScheduled(ctx context.Context, id uint64) error
- func (dp *DatabaseProvider) MarkIneligibleForAirdrop(ctx context.Context, owner string) error
- func (dp *DatabaseProvider) MarkPushTokenAsInvalid(ctx context.Context, pushToken string) error
- func (dp *DatabaseProvider) MarkTweetAsProcessed(ctx context.Context, tweetId string) error
- func (dp *DatabaseProvider) MarkTwitterNonceAsUsed(ctx context.Context, tweetId string, nonce uuid.UUID) error
- func (dp *DatabaseProvider) PutAllActions(ctx context.Context, records ...*action.Record) error
- func (dp *DatabaseProvider) PutAllFulfillments(ctx context.Context, records ...*fulfillment.Record) error
- func (dp *DatabaseProvider) PutChat(ctx context.Context, record *chat.Chat) error
- func (dp *DatabaseProvider) PutChatMessage(ctx context.Context, record *chat.Message) error
- func (dp *DatabaseProvider) PutFiatOnrampPurchase(ctx context.Context, record *onramp.Record) error
- func (dp *DatabaseProvider) PutPhoneEvent(ctx context.Context, event *phone.Event) error
- func (dp *DatabaseProvider) PutPushToken(ctx context.Context, record *push.Record) error
- func (dp *DatabaseProvider) PutUser(ctx context.Context, record *identity.Record) error
- func (dp *DatabaseProvider) PutUserDataContainer(ctx context.Context, record *storage.Record) error
- func (dp *DatabaseProvider) RemoveContact(ctx context.Context, owner *user.DataContainerID, contact string) error
- func (dp *DatabaseProvider) ResetBadgeCount(ctx context.Context, owner string) error
- func (dp *DatabaseProvider) SaveBalanceCheckpoint(ctx context.Context, record *balance.Record) error
- func (dp *DatabaseProvider) SaveCommitment(ctx context.Context, record *commitment.Record) error
- func (dp *DatabaseProvider) SaveEvent(ctx context.Context, record *event.Record) error
- func (dp *DatabaseProvider) SaveExternalDeposit(ctx context.Context, record *deposit.Record) error
- func (dp *DatabaseProvider) SaveIntent(ctx context.Context, record *intent.Record) error
- func (dp *DatabaseProvider) SaveKey(ctx context.Context, record *vault.Record) error
- func (dp *DatabaseProvider) SaveLogins(ctx context.Context, record *login.MultiRecord) error
- func (dp *DatabaseProvider) SaveNonce(ctx context.Context, record *nonce.Record) error
- func (dp *DatabaseProvider) SaveOwnerAccountPhoneSetting(ctx context.Context, phoneNumber string, ...) error
- func (dp *DatabaseProvider) SavePhoneLinkingToken(ctx context.Context, token *phone.LinkingToken) error
- func (dp *DatabaseProvider) SavePhoneVerification(ctx context.Context, v *phone.Verification) error
- func (dp *DatabaseProvider) SaveRendezvous(ctx context.Context, record *rendezvous.Record) error
- func (dp *DatabaseProvider) SaveTimelock(ctx context.Context, record *timelock.Record) error
- func (dp *DatabaseProvider) SaveTransaction(ctx context.Context, record *transaction.Record) error
- func (dp *DatabaseProvider) SaveTreasuryPool(ctx context.Context, record *treasury.Record) error
- func (dp *DatabaseProvider) SaveTreasuryPoolFunding(ctx context.Context, record *treasury.FundingHistoryRecord) error
- func (dp *DatabaseProvider) SaveTwitterUser(ctx context.Context, record *twitter.Record) error
- func (dp *DatabaseProvider) SaveUserPreferences(ctx context.Context, record *preferences.Record) error
- func (dp *DatabaseProvider) SetChatMuteState(ctx context.Context, chatId chat.ChatId, isMuted bool) error
- func (dp *DatabaseProvider) SetChatSubscriptionState(ctx context.Context, chatId chat.ChatId, isSubscribed bool) error
- func (dp *DatabaseProvider) UpdateAccountInfo(ctx context.Context, record *account.Record) error
- func (dp *DatabaseProvider) UpdateAction(ctx context.Context, record *action.Record) error
- func (dp *DatabaseProvider) UpdateFulfillment(ctx context.Context, record *fulfillment.Record) error
- func (dp *DatabaseProvider) UpdateOrCreatePayment(ctx context.Context, record *payment.Record) error
- func (dp *DatabaseProvider) UpdatePayment(ctx context.Context, record *payment.Record) error
- func (dp *DatabaseProvider) UpdateWebhook(ctx context.Context, record *webhook.Record) error
- func (dp *DatabaseProvider) UsePhoneLinkingToken(ctx context.Context, phoneNumber, code string) error
- type EstimatedData
- type EstimatedProvider
- type Provider
- type WebData
- type WebProvider
Constants ¶
const (
FixerApiKeyConfigEnvName = "FIXER_API_KEY"
)
Variables ¶
var (
ErrInvalidAccount = errors.New("invalid account")
)
Functions ¶
This section is empty.
Types ¶
type BlockchainData ¶
type BlockchainData interface { SubmitBlockchainTransaction(ctx context.Context, tx *solana.Transaction) (solana.Signature, error) RequestBlockchainAirdrop(ctx context.Context, account string, amount uint64) (solana.Signature, error) GetBlockchainAccountInfo(ctx context.Context, account string, commitment solana.Commitment) (*solana.AccountInfo, error) GetBlockchainAccountDataAfterBlock(ctx context.Context, account string, slot uint64) ([]byte, uint64, error) GetBlockchainBalance(ctx context.Context, account string) (uint64, uint64, error) GetBlockchainBlock(ctx context.Context, slot uint64) (*solana.Block, error) GetBlockchainBlockSignatures(ctx context.Context, slot uint64) ([]string, error) GetBlockchainBlocksWithLimit(ctx context.Context, start uint64, limit uint64) ([]uint64, error) GetBlockchainHistory(ctx context.Context, account string, commitment solana.Commitment, opts ...query.Option) ([]*solana.TransactionSignature, error) GetBlockchainMinimumBalanceForRentExemption(ctx context.Context, size uint64) (uint64, error) GetBlockchainLatestBlockhash(ctx context.Context) (solana.Blockhash, error) GetBlockchainSignatureStatuses(ctx context.Context, signatures []solana.Signature) ([]*solana.SignatureStatus, error) GetBlockchainSlot(ctx context.Context, commitment solana.Commitment) (uint64, error) GetBlockchainTokenAccountInfo(ctx context.Context, account string, commitment solana.Commitment) (*token.Account, error) GetBlockchainTokenAccountsByOwner(ctx context.Context, account string) ([]ed25519.PublicKey, error) GetBlockchainTransaction(ctx context.Context, sig string, commitment solana.Commitment) (*solana.ConfirmedTransaction, error) GetBlockchainTransactionTokenBalances(ctx context.Context, sig string) (*solana.TransactionTokenBalances, error) GetBlockchainFilteredProgramAccounts(ctx context.Context, program string, offset uint, filterValue []byte) ([]string, uint64, error) }
func NewBlockchainProvider ¶
func NewBlockchainProvider(solanaEndpoint string) (BlockchainData, error)
type BlockchainProvider ¶
type BlockchainProvider struct {
// contains filtered or unexported fields
}
func (*BlockchainProvider) GetBlockchainAccountDataAfterBlock ¶
func (*BlockchainProvider) GetBlockchainAccountInfo ¶
func (dp *BlockchainProvider) GetBlockchainAccountInfo(ctx context.Context, account string, commitment solana.Commitment) (*solana.AccountInfo, error)
func (*BlockchainProvider) GetBlockchainBalance ¶
func (*BlockchainProvider) GetBlockchainBlock ¶
func (*BlockchainProvider) GetBlockchainBlockSignatures ¶
func (*BlockchainProvider) GetBlockchainBlocksWithLimit ¶
func (*BlockchainProvider) GetBlockchainFilteredProgramAccounts ¶
func (*BlockchainProvider) GetBlockchainHistory ¶
func (dp *BlockchainProvider) GetBlockchainHistory(ctx context.Context, account string, commitment solana.Commitment, opts ...query.Option) ([]*solana.TransactionSignature, error)
func (*BlockchainProvider) GetBlockchainLatestBlockhash ¶
func (*BlockchainProvider) GetBlockchainMinimumBalanceForRentExemption ¶
func (*BlockchainProvider) GetBlockchainSignatureStatuses ¶
func (dp *BlockchainProvider) GetBlockchainSignatureStatuses(ctx context.Context, signatures []solana.Signature) ([]*solana.SignatureStatus, error)
func (*BlockchainProvider) GetBlockchainSlot ¶
func (dp *BlockchainProvider) GetBlockchainSlot(ctx context.Context, commitment solana.Commitment) (uint64, error)
func (*BlockchainProvider) GetBlockchainTokenAccountInfo ¶
func (dp *BlockchainProvider) GetBlockchainTokenAccountInfo(ctx context.Context, account string, commitment solana.Commitment) (*token.Account, error)
func (*BlockchainProvider) GetBlockchainTokenAccountsByOwner ¶
func (*BlockchainProvider) GetBlockchainTransaction ¶
func (dp *BlockchainProvider) GetBlockchainTransaction(ctx context.Context, sig string, commitment solana.Commitment) (*solana.ConfirmedTransaction, error)
func (*BlockchainProvider) GetBlockchainTransactionTokenBalances ¶
func (dp *BlockchainProvider) GetBlockchainTransactionTokenBalances(ctx context.Context, sig string) (*solana.TransactionTokenBalances, error)
func (*BlockchainProvider) RequestBlockchainAirdrop ¶
func (*BlockchainProvider) SubmitBlockchainTransaction ¶
func (dp *BlockchainProvider) SubmitBlockchainTransaction(ctx context.Context, tx *solana.Transaction) (solana.Signature, error)
type ConfigProvider ¶
type ConfigProvider func() *conf
ConfigProvider defines how config values are pulled
todo: Possibly introduce an override config provider, for things like scripts.
func WithEnvConfigs ¶
func WithEnvConfigs() ConfigProvider
WithEnvConfigs returns configuration pulled from environment variables
type DataProvider ¶
type DataProvider struct { *BlockchainProvider *DatabaseProvider *WebProvider *EstimatedProvider }
func (*DataProvider) GetBlockchainDataProvider ¶
func (p *DataProvider) GetBlockchainDataProvider() BlockchainData
func (*DataProvider) GetDatabaseDataProvider ¶
func (p *DataProvider) GetDatabaseDataProvider() DatabaseData
func (*DataProvider) GetEstimatedDataProvider ¶
func (p *DataProvider) GetEstimatedDataProvider() EstimatedData
func (*DataProvider) GetWebDataProvider ¶
func (p *DataProvider) GetWebDataProvider() WebData
type DatabaseData ¶
type DatabaseData interface { // Account Info // -------------------------------------------------------------------------------- CreateAccountInfo(ctx context.Context, record *account.Record) error UpdateAccountInfo(ctx context.Context, record *account.Record) error GetAccountInfoByTokenAddress(ctx context.Context, address string) (*account.Record, error) GetAccountInfoByAuthorityAddress(ctx context.Context, address string) (*account.Record, error) GetLatestAccountInfosByOwnerAddress(ctx context.Context, address string) (map[commonpb.AccountType][]*account.Record, error) GetLatestAccountInfoByOwnerAddressAndType(ctx context.Context, address string, accountType commonpb.AccountType) (*account.Record, error) GetRelationshipAccountInfoByOwnerAddress(ctx context.Context, address, relationshipTo string) (*account.Record, error) GetPrioritizedAccountInfosRequiringDepositSync(ctx context.Context, limit uint64) ([]*account.Record, error) GetPrioritizedAccountInfosRequiringAutoReturnCheck(ctx context.Context, maxAge time.Duration, limit uint64) ([]*account.Record, error) GetPrioritizedAccountInfosRequiringSwapRetry(ctx context.Context, maxAge time.Duration, limit uint64) ([]*account.Record, error) GetAccountInfoCountRequiringDepositSync(ctx context.Context) (uint64, error) GetAccountInfoCountRequiringAutoReturnCheck(ctx context.Context) (uint64, error) GetAccountInfoCountRequiringSwapRetry(ctx context.Context) (uint64, error) // Currency // -------------------------------------------------------------------------------- GetExchangeRate(ctx context.Context, code currency_lib.Code, t time.Time) (*currency.ExchangeRateRecord, error) GetAllExchangeRates(ctx context.Context, t time.Time) (*currency.MultiRateRecord, error) GetExchangeRateHistory(ctx context.Context, code currency_lib.Code, opts ...query.Option) ([]*currency.ExchangeRateRecord, error) ImportExchangeRates(ctx context.Context, data *currency.MultiRateRecord) error // Vault // -------------------------------------------------------------------------------- GetKey(ctx context.Context, public_key string) (*vault.Record, error) GetKeyCount(ctx context.Context) (uint64, error) GetKeyCountByState(ctx context.Context, state vault.State) (uint64, error) GetAllKeysByState(ctx context.Context, state vault.State, opts ...query.Option) ([]*vault.Record, error) SaveKey(ctx context.Context, record *vault.Record) error // Nonce // -------------------------------------------------------------------------------- GetNonce(ctx context.Context, address string) (*nonce.Record, error) GetNonceCount(ctx context.Context) (uint64, error) GetNonceCountByState(ctx context.Context, state nonce.State) (uint64, error) GetNonceCountByStateAndPurpose(ctx context.Context, state nonce.State, purpose nonce.Purpose) (uint64, error) GetAllNonceByState(ctx context.Context, state nonce.State, opts ...query.Option) ([]*nonce.Record, error) GetRandomAvailableNonceByPurpose(ctx context.Context, purpose nonce.Purpose) (*nonce.Record, error) SaveNonce(ctx context.Context, record *nonce.Record) error // Fulfillment // -------------------------------------------------------------------------------- GetFulfillmentById(ctx context.Context, id uint64) (*fulfillment.Record, error) GetFulfillmentBySignature(ctx context.Context, signature string) (*fulfillment.Record, error) GetFulfillmentCount(ctx context.Context) (uint64, error) GetFulfillmentCountByState(ctx context.Context, state fulfillment.State) (uint64, error) GetFulfillmentCountByStateGroupedByType(ctx context.Context, state fulfillment.State) (map[fulfillment.Type]uint64, error) GetFulfillmentCountForMetrics(ctx context.Context, state fulfillment.State) (map[fulfillment.Type]uint64, error) GetFulfillmentCountByStateAndAddress(ctx context.Context, state fulfillment.State, address string) (uint64, error) GetFulfillmentCountByTypeStateAndAddress(ctx context.Context, fulfillmentType fulfillment.Type, state fulfillment.State, address string) (uint64, error) GetFulfillmentCountByTypeStateAndAddressAsSource(ctx context.Context, fulfillmentType fulfillment.Type, state fulfillment.State, address string) (uint64, error) GetFulfillmentCountByIntentAndState(ctx context.Context, intent string, state fulfillment.State) (uint64, error) GetFulfillmentCountByIntent(ctx context.Context, intent string) (uint64, error) GetFulfillmentCountByTypeActionAndState(ctx context.Context, intentId string, actionId uint32, fulfillmentType fulfillment.Type, state fulfillment.State) (uint64, error) GetPendingFulfillmentCountByType(ctx context.Context) (map[fulfillment.Type]uint64, error) GetAllFulfillmentsByState(ctx context.Context, state fulfillment.State, includeDisabledActiveScheduling bool, opts ...query.Option) ([]*fulfillment.Record, error) GetAllFulfillmentsByIntent(ctx context.Context, intent string, opts ...query.Option) ([]*fulfillment.Record, error) GetAllFulfillmentsByAction(ctx context.Context, intentId string, actionId uint32) ([]*fulfillment.Record, error) GetAllFulfillmentsByTypeAndAction(ctx context.Context, fulfillmentType fulfillment.Type, intentId string, actionId uint32) ([]*fulfillment.Record, error) GetFirstSchedulableFulfillmentByAddressAsSource(ctx context.Context, address string) (*fulfillment.Record, error) GetFirstSchedulableFulfillmentByAddressAsDestination(ctx context.Context, address string) (*fulfillment.Record, error) GetFirstSchedulableFulfillmentByType(ctx context.Context, fulfillmentType fulfillment.Type) (*fulfillment.Record, error) GetNextSchedulableFulfillmentByAddress(ctx context.Context, address string, intentOrderingIndex uint64, actionOrderingIndex, fulfillmentOrderingIndex uint32) (*fulfillment.Record, error) PutAllFulfillments(ctx context.Context, records ...*fulfillment.Record) error UpdateFulfillment(ctx context.Context, record *fulfillment.Record) error MarkFulfillmentAsActivelyScheduled(ctx context.Context, id uint64) error ActivelyScheduleTreasuryAdvanceFulfillments(ctx context.Context, treasury string, intentOrderingIndex uint64, limit int) (uint64, error) // Intent // -------------------------------------------------------------------------------- SaveIntent(ctx context.Context, record *intent.Record) error GetIntent(ctx context.Context, intentID string) (*intent.Record, error) GetIntentBySignature(ctx context.Context, signature string) (*intent.Record, error) GetLatestIntentByInitiatorAndType(ctx context.Context, intentType intent.Type, owner string) (*intent.Record, error) GetAllIntentsByOwner(ctx context.Context, owner string, opts ...query.Option) ([]*intent.Record, error) GetIntentCountForAntispam(ctx context.Context, intentType intent.Type, phoneNumber string, states []intent.State, since time.Time) (uint64, error) GetIntentCountWithOwnerInteractionsForAntispam(ctx context.Context, sourceOwner, destinationOwner string, states []intent.State, since time.Time) (uint64, error) GetTransactedAmountForAntiMoneyLaundering(ctx context.Context, phoneNumber string, since time.Time) (uint64, float64, error) GetDepositedAmountForAntiMoneyLaundering(ctx context.Context, phoneNumber string, since time.Time) (uint64, float64, error) GetNetBalanceFromPrePrivacy2022Intents(ctx context.Context, account string) (int64, error) GetLatestSaveRecentRootIntentForTreasury(ctx context.Context, treasury string) (*intent.Record, error) GetOriginalGiftCardIssuedIntent(ctx context.Context, giftCardVault string) (*intent.Record, error) GetGiftCardClaimedIntent(ctx context.Context, giftCardVault string) (*intent.Record, error) // Action // -------------------------------------------------------------------------------- PutAllActions(ctx context.Context, records ...*action.Record) error UpdateAction(ctx context.Context, record *action.Record) error GetActionById(ctx context.Context, intent string, actionId uint32) (*action.Record, error) GetAllActionsByIntent(ctx context.Context, intent string) ([]*action.Record, error) GetAllActionsByAddress(ctx context.Context, address string) ([]*action.Record, error) GetNetBalanceFromActions(ctx context.Context, address string) (int64, error) GetNetBalanceFromActionsBatch(ctx context.Context, accounts ...string) (map[string]int64, error) GetGiftCardClaimedAction(ctx context.Context, giftCardVault string) (*action.Record, error) GetGiftCardAutoReturnAction(ctx context.Context, giftCardVault string) (*action.Record, error) // Payment (mostly deprecated for legacy accounts and unmigrated processes) // -------------------------------------------------------------------------------- GetPayment(ctx context.Context, sig string, index int) (*payment.Record, error) CreatePayment(ctx context.Context, record *payment.Record) error UpdateOrCreatePayment(ctx context.Context, record *payment.Record) error GetPaymentHistory(ctx context.Context, account string, opts ...query.Option) ([]*payment.Record, error) GetPaymentHistoryWithinBlockRange(ctx context.Context, account string, lowerBound, upperBound uint64, opts ...query.Option) ([]*payment.Record, error) GetLegacyTotalExternalDepositAmountFromPrePrivacy2022Accounts(ctx context.Context, account string) (uint64, error) // Transaction // -------------------------------------------------------------------------------- GetTransaction(ctx context.Context, sig string) (*transaction.Record, error) SaveTransaction(ctx context.Context, record *transaction.Record) error // Messaging // -------------------------------------------------------------------------------- CreateMessage(ctx context.Context, record *messaging.Record) error GetMessages(ctx context.Context, account string) ([]*messaging.Record, error) DeleteMessage(ctx context.Context, account string, messageID uuid.UUID) error // Phone // -------------------------------------------------------------------------------- SavePhoneVerification(ctx context.Context, v *phone.Verification) error GetPhoneVerification(ctx context.Context, account, phoneNumber string) (*phone.Verification, error) GetLatestPhoneVerificationForAccount(ctx context.Context, account string) (*phone.Verification, error) GetLatestPhoneVerificationForNumber(ctx context.Context, phoneNumber string) (*phone.Verification, error) GetAllPhoneVerificationsForNumber(ctx context.Context, phoneNumber string) ([]*phone.Verification, error) SavePhoneLinkingToken(ctx context.Context, token *phone.LinkingToken) error UsePhoneLinkingToken(ctx context.Context, phoneNumber, code string) error FilterVerifiedPhoneNumbers(ctx context.Context, phoneNumbers []string) ([]string, error) SaveOwnerAccountPhoneSetting(ctx context.Context, phoneNumber string, newSettings *phone.OwnerAccountSetting) error IsPhoneNumberLinkedToAccount(ctx context.Context, phoneNumber string, tokenAccount string) (bool, error) IsPhoneNumberEnabledForRemoteSendToAccount(ctx context.Context, phoneNumber string, tokenAccount string) (bool, error) PutPhoneEvent(ctx context.Context, event *phone.Event) error GetLatestPhoneEventForNumberByType(ctx context.Context, phoneNumber string, eventType phone.EventType) (*phone.Event, error) GetPhoneEventCountForVerificationByType(ctx context.Context, verification string, eventType phone.EventType) (uint64, error) GetPhoneEventCountForNumberByTypeSinceTimestamp(ctx context.Context, phoneNumber string, eventType phone.EventType, since time.Time) (uint64, error) GetUniquePhoneVerificationIdCountForNumberSinceTimestamp(ctx context.Context, phoneNumber string, since time.Time) (uint64, error) // Contact // -------------------------------------------------------------------------------- AddContact(ctx context.Context, owner *user.DataContainerID, contact string) error BatchAddContacts(ctx context.Context, owner *user.DataContainerID, contacts []string) error RemoveContact(ctx context.Context, owner *user.DataContainerID, contact string) error BatchRemoveContacts(ctx context.Context, owner *user.DataContainerID, contacts []string) error GetContacts(ctx context.Context, owner *user.DataContainerID, limit uint32, pageToken []byte) (contacts []string, nextPageToken []byte, err error) // User Identity // -------------------------------------------------------------------------------- PutUser(ctx context.Context, record *identity.Record) error GetUserByID(ctx context.Context, id *user.UserID) (*identity.Record, error) GetUserByPhoneView(ctx context.Context, phoneNumber string) (*identity.Record, error) // User Storage Management // -------------------------------------------------------------------------------- PutUserDataContainer(ctx context.Context, container *storage.Record) error GetUserDataContainerByID(ctx context.Context, id *user.DataContainerID) (*storage.Record, error) GetUserDataContainerByPhone(ctx context.Context, tokenAccount, phoneNumber string) (*storage.Record, error) // Timelock // -------------------------------------------------------------------------------- SaveTimelock(ctx context.Context, record *timelock.Record) error GetTimelockByAddress(ctx context.Context, address string) (*timelock.Record, error) GetTimelockByVault(ctx context.Context, vault string) (*timelock.Record, error) GetTimelockByVaultBatch(ctx context.Context, vaults ...string) (map[string]*timelock.Record, error) GetAllTimelocksByState(ctx context.Context, state timelock_token.TimelockState, opts ...query.Option) ([]*timelock.Record, error) GetTimelockCountByState(ctx context.Context, state timelock_token.TimelockState) (uint64, error) // Push // -------------------------------------------------------------------------------- PutPushToken(ctx context.Context, record *push.Record) error MarkPushTokenAsInvalid(ctx context.Context, pushToken string) error DeletePushToken(ctx context.Context, pushToken string) error GetAllValidPushTokensdByDataContainer(ctx context.Context, id *user.DataContainerID) ([]*push.Record, error) // Commitment // -------------------------------------------------------------------------------- SaveCommitment(ctx context.Context, record *commitment.Record) error GetCommitmentByAddress(ctx context.Context, address string) (*commitment.Record, error) GetCommitmentByVault(ctx context.Context, vault string) (*commitment.Record, error) GetCommitmentByAction(ctx context.Context, intentId string, actionId uint32) (*commitment.Record, error) GetAllCommitmentsByState(ctx context.Context, state commitment.State, opts ...query.Option) ([]*commitment.Record, error) GetUpgradeableCommitmentsByOwner(ctx context.Context, owner string, limit uint64) ([]*commitment.Record, error) GetUsedTreasuryPoolDeficitFromCommitments(ctx context.Context, treasuryPool string) (uint64, error) GetTotalTreasuryPoolDeficitFromCommitments(ctx context.Context, treasuryPool string) (uint64, error) CountCommitmentsByState(ctx context.Context, state commitment.State) (uint64, error) CountCommitmentRepaymentsDivertedToVault(ctx context.Context, vault string) (uint64, error) // Treasury Pool // -------------------------------------------------------------------------------- SaveTreasuryPool(ctx context.Context, record *treasury.Record) error GetTreasuryPoolByName(ctx context.Context, name string) (*treasury.Record, error) GetTreasuryPoolByAddress(ctx context.Context, address string) (*treasury.Record, error) GetTreasuryPoolByVault(ctx context.Context, vault string) (*treasury.Record, error) GetAllTreasuryPoolsByState(ctx context.Context, state treasury.TreasuryPoolState, opts ...query.Option) ([]*treasury.Record, error) SaveTreasuryPoolFunding(ctx context.Context, record *treasury.FundingHistoryRecord) error GetTotalAvailableTreasuryPoolFunds(ctx context.Context, vault string) (uint64, error) // Merkle Tree // -------------------------------------------------------------------------------- InitializeNewMerkleTree(ctx context.Context, name string, levels uint8, seeds []merkletree.Seed, readOnly bool) (*merkletree.MerkleTree, error) LoadExistingMerkleTree(ctx context.Context, name string, readOnly bool) (*merkletree.MerkleTree, error) // External Deposits // -------------------------------------------------------------------------------- SaveExternalDeposit(ctx context.Context, record *deposit.Record) error GetExternalDeposit(ctx context.Context, signature, destination string) (*deposit.Record, error) GetTotalExternalDepositedAmountInQuarks(ctx context.Context, account string) (uint64, error) GetTotalExternalDepositedAmountInQuarksBatch(ctx context.Context, accounts ...string) (map[string]uint64, error) GetTotalExternalDepositedAmountInUsd(ctx context.Context, account string) (float64, error) // Rendezvous // -------------------------------------------------------------------------------- SaveRendezvous(ctx context.Context, record *rendezvous.Record) error GetRendezvous(ctx context.Context, key string) (*rendezvous.Record, error) DeleteRendezvous(ctx context.Context, key string) error // Requests // -------------------------------------------------------------------------------- CreateRequest(ctx context.Context, record *paymentrequest.Record) error GetRequest(ctx context.Context, intentId string) (*paymentrequest.Record, error) // Paywall // -------------------------------------------------------------------------------- CreatePaywall(ctx context.Context, record *paywall.Record) error GetPaywallByShortPath(ctx context.Context, path string) (*paywall.Record, error) // Event // -------------------------------------------------------------------------------- SaveEvent(ctx context.Context, record *event.Record) error GetEvent(ctx context.Context, id string) (*event.Record, error) // Webhook // -------------------------------------------------------------------------------- CreateWebhook(ctx context.Context, record *webhook.Record) error UpdateWebhook(ctx context.Context, record *webhook.Record) error GetWebhook(ctx context.Context, webhookId string) (*webhook.Record, error) CountWebhookByState(ctx context.Context, state webhook.State) (uint64, error) GetAllPendingWebhooksReadyToSend(ctx context.Context, limit uint64) ([]*webhook.Record, error) // Chat // -------------------------------------------------------------------------------- PutChat(ctx context.Context, record *chat.Chat) error GetChatById(ctx context.Context, chatId chat.ChatId) (*chat.Chat, error) GetAllChatsForUser(ctx context.Context, user string, opts ...query.Option) ([]*chat.Chat, error) PutChatMessage(ctx context.Context, record *chat.Message) error DeleteChatMessage(ctx context.Context, chatId chat.ChatId, messageId string) error GetChatMessage(ctx context.Context, chatId chat.ChatId, messageId string) (*chat.Message, error) GetAllChatMessages(ctx context.Context, chatId chat.ChatId, opts ...query.Option) ([]*chat.Message, error) AdvanceChatPointer(ctx context.Context, chatId chat.ChatId, pointer string) error GetChatUnreadCount(ctx context.Context, chatId chat.ChatId) (uint32, error) SetChatMuteState(ctx context.Context, chatId chat.ChatId, isMuted bool) error SetChatSubscriptionState(ctx context.Context, chatId chat.ChatId, isSubscribed bool) error // Badge Count // -------------------------------------------------------------------------------- AddToBadgeCount(ctx context.Context, owner string, amount uint32) error ResetBadgeCount(ctx context.Context, owner string) error GetBadgeCount(ctx context.Context, owner string) (*badgecount.Record, error) // Login // -------------------------------------------------------------------------------- SaveLogins(ctx context.Context, record *login.MultiRecord) error GetLoginsByAppInstall(ctx context.Context, appInstallId string) (*login.MultiRecord, error) GetLatestLoginByOwner(ctx context.Context, owner string) (*login.Record, error) // Balance // -------------------------------------------------------------------------------- SaveBalanceCheckpoint(ctx context.Context, record *balance.Record) error GetBalanceCheckpoint(ctx context.Context, account string) (*balance.Record, error) // Onramp // -------------------------------------------------------------------------------- PutFiatOnrampPurchase(ctx context.Context, record *onramp.Record) error GetFiatOnrampPurchase(ctx context.Context, nonce uuid.UUID) (*onramp.Record, error) // User Preferences // -------------------------------------------------------------------------------- SaveUserPreferences(ctx context.Context, record *preferences.Record) error GetUserPreferences(ctx context.Context, id *user.DataContainerID) (*preferences.Record, error) GetUserLocale(ctx context.Context, owner string) (language.Tag, error) // Airdrop // -------------------------------------------------------------------------------- MarkIneligibleForAirdrop(ctx context.Context, owner string) error IsEligibleForAirdrop(ctx context.Context, owner string) (bool, error) // Twitter // -------------------------------------------------------------------------------- SaveTwitterUser(ctx context.Context, record *twitter.Record) error GetTwitterUserByUsername(ctx context.Context, username string) (*twitter.Record, error) GetTwitterUserByTipAddress(ctx context.Context, tipAddress string) (*twitter.Record, error) GetStaleTwitterUsers(ctx context.Context, minAge time.Duration, limit int) ([]*twitter.Record, error) MarkTweetAsProcessed(ctx context.Context, tweetId string) error IsTweetProcessed(ctx context.Context, tweetId string) (bool, error) MarkTwitterNonceAsUsed(ctx context.Context, tweetId string, nonce uuid.UUID) error // ExecuteInTx executes fn with a single DB transaction that is scoped to the call. // This enables more complex transactions that can span many calls across the provider. // // Note: This highly relies on the store implementations adding explicit support for // this, which was added way later than when most were written. When using this // function, ensure there is proper support for whatever is being called inside fn. ExecuteInTx(ctx context.Context, isolation sql.IsolationLevel, fn func(ctx context.Context) error) error }
func NewDatabaseProvider ¶
func NewDatabaseProvider(dbConfig *pg.Config) (DatabaseData, error)
func NewTestDatabaseProvider ¶
func NewTestDatabaseProvider() DatabaseData
type DatabaseProvider ¶
type DatabaseProvider struct {
// contains filtered or unexported fields
}
func (*DatabaseProvider) ActivelyScheduleTreasuryAdvanceFulfillments ¶
func (*DatabaseProvider) AddContact ¶
func (dp *DatabaseProvider) AddContact(ctx context.Context, owner *user.DataContainerID, contact string) error
func (*DatabaseProvider) AddToBadgeCount ¶
Badge Count --------------------------------------------------------------------------------
func (*DatabaseProvider) AdvanceChatPointer ¶
func (*DatabaseProvider) BatchAddContacts ¶
func (dp *DatabaseProvider) BatchAddContacts(ctx context.Context, owner *user.DataContainerID, contacts []string) error
func (*DatabaseProvider) BatchRemoveContacts ¶
func (dp *DatabaseProvider) BatchRemoveContacts(ctx context.Context, owner *user.DataContainerID, contacts []string) error
func (*DatabaseProvider) CountCommitmentRepaymentsDivertedToVault ¶
func (*DatabaseProvider) CountCommitmentsByState ¶
func (dp *DatabaseProvider) CountCommitmentsByState(ctx context.Context, state commitment.State) (uint64, error)
func (*DatabaseProvider) CountWebhookByState ¶
func (*DatabaseProvider) CreateAccountInfo ¶
Account Info --------------------------------------------------------------------------------
func (*DatabaseProvider) CreateMessage ¶
Messaging --------------------------------------------------------------------------------
func (*DatabaseProvider) CreatePayment ¶
func (*DatabaseProvider) CreatePaywall ¶
Paywall --------------------------------------------------------------------------------
func (*DatabaseProvider) CreateRequest ¶ added in v1.2.0
func (dp *DatabaseProvider) CreateRequest(ctx context.Context, record *paymentrequest.Record) error
Payment Request --------------------------------------------------------------------------------
func (*DatabaseProvider) CreateWebhook ¶
Webhook --------------------------------------------------------------------------------
func (*DatabaseProvider) DeleteChatMessage ¶
func (*DatabaseProvider) DeleteMessage ¶
func (*DatabaseProvider) DeletePushToken ¶
func (dp *DatabaseProvider) DeletePushToken(ctx context.Context, pushToken string) error
func (*DatabaseProvider) DeleteRendezvous ¶
func (dp *DatabaseProvider) DeleteRendezvous(ctx context.Context, key string) error
func (*DatabaseProvider) ExecuteInTx ¶
func (dp *DatabaseProvider) ExecuteInTx(ctx context.Context, isolation sql.IsolationLevel, fn func(ctx context.Context) error) error
func (*DatabaseProvider) FilterVerifiedPhoneNumbers ¶
func (*DatabaseProvider) GetAccountInfoByAuthorityAddress ¶
func (*DatabaseProvider) GetAccountInfoByTokenAddress ¶
func (*DatabaseProvider) GetAccountInfoCountRequiringAutoReturnCheck ¶
func (dp *DatabaseProvider) GetAccountInfoCountRequiringAutoReturnCheck(ctx context.Context) (uint64, error)
func (*DatabaseProvider) GetAccountInfoCountRequiringDepositSync ¶
func (dp *DatabaseProvider) GetAccountInfoCountRequiringDepositSync(ctx context.Context) (uint64, error)
func (*DatabaseProvider) GetAccountInfoCountRequiringSwapRetry ¶ added in v1.10.6
func (dp *DatabaseProvider) GetAccountInfoCountRequiringSwapRetry(ctx context.Context) (uint64, error)
func (*DatabaseProvider) GetActionById ¶
func (*DatabaseProvider) GetAllActionsByAddress ¶
func (*DatabaseProvider) GetAllActionsByIntent ¶
func (*DatabaseProvider) GetAllChatMessages ¶
func (*DatabaseProvider) GetAllChatsForUser ¶
func (*DatabaseProvider) GetAllCommitmentsByState ¶
func (dp *DatabaseProvider) GetAllCommitmentsByState(ctx context.Context, state commitment.State, opts ...query.Option) ([]*commitment.Record, error)
func (*DatabaseProvider) GetAllExchangeRates ¶
func (dp *DatabaseProvider) GetAllExchangeRates(ctx context.Context, t time.Time) (*currency.MultiRateRecord, error)
func (*DatabaseProvider) GetAllFulfillmentsByAction ¶
func (dp *DatabaseProvider) GetAllFulfillmentsByAction(ctx context.Context, intentId string, actionId uint32) ([]*fulfillment.Record, error)
func (*DatabaseProvider) GetAllFulfillmentsByIntent ¶
func (dp *DatabaseProvider) GetAllFulfillmentsByIntent(ctx context.Context, intent string, opts ...query.Option) ([]*fulfillment.Record, error)
func (*DatabaseProvider) GetAllFulfillmentsByState ¶
func (dp *DatabaseProvider) GetAllFulfillmentsByState(ctx context.Context, state fulfillment.State, includeDisabledActiveScheduling bool, opts ...query.Option) ([]*fulfillment.Record, error)
func (*DatabaseProvider) GetAllFulfillmentsByTypeAndAction ¶
func (dp *DatabaseProvider) GetAllFulfillmentsByTypeAndAction(ctx context.Context, fulfillmentType fulfillment.Type, intentId string, actionId uint32) ([]*fulfillment.Record, error)
func (*DatabaseProvider) GetAllIntentsByOwner ¶
func (*DatabaseProvider) GetAllKeysByState ¶
func (*DatabaseProvider) GetAllNonceByState ¶
func (*DatabaseProvider) GetAllPendingWebhooksReadyToSend ¶
func (*DatabaseProvider) GetAllPhoneVerificationsForNumber ¶
func (dp *DatabaseProvider) GetAllPhoneVerificationsForNumber(ctx context.Context, phoneNumber string) ([]*phone.Verification, error)
func (*DatabaseProvider) GetAllTimelocksByState ¶
func (dp *DatabaseProvider) GetAllTimelocksByState(ctx context.Context, state timelock_token.TimelockState, opts ...query.Option) ([]*timelock.Record, error)
func (*DatabaseProvider) GetAllTreasuryPoolsByState ¶
func (dp *DatabaseProvider) GetAllTreasuryPoolsByState(ctx context.Context, state treasury.TreasuryPoolState, opts ...query.Option) ([]*treasury.Record, error)
func (*DatabaseProvider) GetAllValidPushTokensdByDataContainer ¶
func (dp *DatabaseProvider) GetAllValidPushTokensdByDataContainer(ctx context.Context, id *user.DataContainerID) ([]*push.Record, error)
func (*DatabaseProvider) GetBadgeCount ¶
func (dp *DatabaseProvider) GetBadgeCount(ctx context.Context, owner string) (*badgecount.Record, error)
func (*DatabaseProvider) GetBalanceCheckpoint ¶ added in v1.3.2
func (*DatabaseProvider) GetChatById ¶
func (*DatabaseProvider) GetChatMessage ¶
func (*DatabaseProvider) GetChatUnreadCount ¶
func (*DatabaseProvider) GetCommitmentByAction ¶
func (dp *DatabaseProvider) GetCommitmentByAction(ctx context.Context, intentId string, actionId uint32) (*commitment.Record, error)
func (*DatabaseProvider) GetCommitmentByAddress ¶
func (dp *DatabaseProvider) GetCommitmentByAddress(ctx context.Context, address string) (*commitment.Record, error)
func (*DatabaseProvider) GetCommitmentByVault ¶
func (dp *DatabaseProvider) GetCommitmentByVault(ctx context.Context, vault string) (*commitment.Record, error)
func (*DatabaseProvider) GetContacts ¶
func (dp *DatabaseProvider) GetContacts(ctx context.Context, owner *user.DataContainerID, limit uint32, pageToken []byte) (contacts []string, nextPageToken []byte, err error)
func (*DatabaseProvider) GetDepositedAmountForAntiMoneyLaundering ¶
func (*DatabaseProvider) GetExchangeRate ¶
func (dp *DatabaseProvider) GetExchangeRate(ctx context.Context, code currency_lib.Code, t time.Time) (*currency.ExchangeRateRecord, error)
Currency --------------------------------------------------------------------------------
func (*DatabaseProvider) GetExchangeRateHistory ¶
func (dp *DatabaseProvider) GetExchangeRateHistory(ctx context.Context, code currency_lib.Code, opts ...query.Option) ([]*currency.ExchangeRateRecord, error)
func (*DatabaseProvider) GetExternalDeposit ¶
func (*DatabaseProvider) GetFiatOnrampPurchase ¶ added in v1.5.0
func (*DatabaseProvider) GetFirstSchedulableFulfillmentByAddressAsDestination ¶
func (dp *DatabaseProvider) GetFirstSchedulableFulfillmentByAddressAsDestination(ctx context.Context, address string) (*fulfillment.Record, error)
func (*DatabaseProvider) GetFirstSchedulableFulfillmentByAddressAsSource ¶
func (dp *DatabaseProvider) GetFirstSchedulableFulfillmentByAddressAsSource(ctx context.Context, address string) (*fulfillment.Record, error)
func (*DatabaseProvider) GetFirstSchedulableFulfillmentByType ¶
func (dp *DatabaseProvider) GetFirstSchedulableFulfillmentByType(ctx context.Context, fulfillmentType fulfillment.Type) (*fulfillment.Record, error)
func (*DatabaseProvider) GetFulfillmentById ¶
func (dp *DatabaseProvider) GetFulfillmentById(ctx context.Context, id uint64) (*fulfillment.Record, error)
Fulfillment --------------------------------------------------------------------------------
func (*DatabaseProvider) GetFulfillmentBySignature ¶
func (dp *DatabaseProvider) GetFulfillmentBySignature(ctx context.Context, signature string) (*fulfillment.Record, error)
func (*DatabaseProvider) GetFulfillmentCount ¶
func (dp *DatabaseProvider) GetFulfillmentCount(ctx context.Context) (uint64, error)
func (*DatabaseProvider) GetFulfillmentCountByIntent ¶
func (*DatabaseProvider) GetFulfillmentCountByIntentAndState ¶
func (dp *DatabaseProvider) GetFulfillmentCountByIntentAndState(ctx context.Context, intent string, state fulfillment.State) (uint64, error)
func (*DatabaseProvider) GetFulfillmentCountByState ¶
func (dp *DatabaseProvider) GetFulfillmentCountByState(ctx context.Context, state fulfillment.State) (uint64, error)
func (*DatabaseProvider) GetFulfillmentCountByStateAndAddress ¶
func (dp *DatabaseProvider) GetFulfillmentCountByStateAndAddress(ctx context.Context, state fulfillment.State, address string) (uint64, error)
func (*DatabaseProvider) GetFulfillmentCountByStateGroupedByType ¶
func (dp *DatabaseProvider) GetFulfillmentCountByStateGroupedByType(ctx context.Context, state fulfillment.State) (map[fulfillment.Type]uint64, error)
func (*DatabaseProvider) GetFulfillmentCountByTypeActionAndState ¶
func (dp *DatabaseProvider) GetFulfillmentCountByTypeActionAndState(ctx context.Context, intentId string, actionId uint32, fulfillmentType fulfillment.Type, state fulfillment.State) (uint64, error)
func (*DatabaseProvider) GetFulfillmentCountByTypeStateAndAddress ¶
func (dp *DatabaseProvider) GetFulfillmentCountByTypeStateAndAddress(ctx context.Context, fulfillmentType fulfillment.Type, state fulfillment.State, address string) (uint64, error)
func (*DatabaseProvider) GetFulfillmentCountByTypeStateAndAddressAsSource ¶
func (dp *DatabaseProvider) GetFulfillmentCountByTypeStateAndAddressAsSource(ctx context.Context, fulfillmentType fulfillment.Type, state fulfillment.State, address string) (uint64, error)
func (*DatabaseProvider) GetFulfillmentCountForMetrics ¶
func (dp *DatabaseProvider) GetFulfillmentCountForMetrics(ctx context.Context, state fulfillment.State) (map[fulfillment.Type]uint64, error)
func (*DatabaseProvider) GetGiftCardAutoReturnAction ¶
func (*DatabaseProvider) GetGiftCardClaimedAction ¶
func (*DatabaseProvider) GetGiftCardClaimedIntent ¶
func (*DatabaseProvider) GetIntent ¶
Intent --------------------------------------------------------------------------------
func (*DatabaseProvider) GetIntentBySignature ¶
func (*DatabaseProvider) GetIntentCountForAntispam ¶
func (*DatabaseProvider) GetIntentCountWithOwnerInteractionsForAntispam ¶
func (*DatabaseProvider) GetKey ¶
Vault --------------------------------------------------------------------------------
func (*DatabaseProvider) GetKeyCount ¶
func (dp *DatabaseProvider) GetKeyCount(ctx context.Context) (uint64, error)
func (*DatabaseProvider) GetKeyCountByState ¶
func (*DatabaseProvider) GetLatestAccountInfoByOwnerAddressAndType ¶
func (dp *DatabaseProvider) GetLatestAccountInfoByOwnerAddressAndType(ctx context.Context, address string, accountType commonpb.AccountType) (*account.Record, error)
func (*DatabaseProvider) GetLatestAccountInfosByOwnerAddress ¶
func (dp *DatabaseProvider) GetLatestAccountInfosByOwnerAddress(ctx context.Context, address string) (map[commonpb.AccountType][]*account.Record, error)
func (*DatabaseProvider) GetLatestIntentByInitiatorAndType ¶
func (*DatabaseProvider) GetLatestLoginByOwner ¶
func (*DatabaseProvider) GetLatestPhoneEventForNumberByType ¶
func (*DatabaseProvider) GetLatestPhoneVerificationForAccount ¶
func (dp *DatabaseProvider) GetLatestPhoneVerificationForAccount(ctx context.Context, account string) (*phone.Verification, error)
func (*DatabaseProvider) GetLatestPhoneVerificationForNumber ¶
func (dp *DatabaseProvider) GetLatestPhoneVerificationForNumber(ctx context.Context, phoneNumber string) (*phone.Verification, error)
func (*DatabaseProvider) GetLatestSaveRecentRootIntentForTreasury ¶
func (*DatabaseProvider) GetLegacyTotalExternalDepositAmountFromPrePrivacy2022Accounts ¶
func (*DatabaseProvider) GetLoginsByAppInstall ¶
func (dp *DatabaseProvider) GetLoginsByAppInstall(ctx context.Context, appInstallId string) (*login.MultiRecord, error)
func (*DatabaseProvider) GetMessages ¶
func (*DatabaseProvider) GetNetBalanceFromActions ¶
func (*DatabaseProvider) GetNetBalanceFromActionsBatch ¶
func (*DatabaseProvider) GetNetBalanceFromPrePrivacy2022Intents ¶
func (*DatabaseProvider) GetNextSchedulableFulfillmentByAddress ¶
func (dp *DatabaseProvider) GetNextSchedulableFulfillmentByAddress(ctx context.Context, address string, intentOrderingIndex uint64, actionOrderingIndex, fulfillmentOrderingIndex uint32) (*fulfillment.Record, error)
func (*DatabaseProvider) GetNonce ¶
Nonce --------------------------------------------------------------------------------
func (*DatabaseProvider) GetNonceCount ¶
func (dp *DatabaseProvider) GetNonceCount(ctx context.Context) (uint64, error)
func (*DatabaseProvider) GetNonceCountByState ¶
func (*DatabaseProvider) GetNonceCountByStateAndPurpose ¶
func (*DatabaseProvider) GetOriginalGiftCardIssuedIntent ¶
func (*DatabaseProvider) GetPayment ¶
func (dp *DatabaseProvider) GetPayment(ctx context.Context, sig string, index int) (*payment.Record, error)
Payment --------------------------------------------------------------------------------
func (*DatabaseProvider) GetPaymentHistory ¶
func (*DatabaseProvider) GetPaymentHistoryWithinBlockRange ¶
func (*DatabaseProvider) GetPaywallByShortPath ¶
func (*DatabaseProvider) GetPendingFulfillmentCountByType ¶
func (dp *DatabaseProvider) GetPendingFulfillmentCountByType(ctx context.Context) (map[fulfillment.Type]uint64, error)
func (*DatabaseProvider) GetPhoneEventCountForNumberByTypeSinceTimestamp ¶
func (*DatabaseProvider) GetPhoneEventCountForVerificationByType ¶
func (*DatabaseProvider) GetPhoneVerification ¶
func (dp *DatabaseProvider) GetPhoneVerification(ctx context.Context, account, phoneNumber string) (*phone.Verification, error)
func (*DatabaseProvider) GetPrioritizedAccountInfosRequiringAutoReturnCheck ¶
func (*DatabaseProvider) GetPrioritizedAccountInfosRequiringDepositSync ¶
func (*DatabaseProvider) GetPrioritizedAccountInfosRequiringSwapRetry ¶ added in v1.10.6
func (*DatabaseProvider) GetRandomAvailableNonceByPurpose ¶
func (*DatabaseProvider) GetRelationshipAccountInfoByOwnerAddress ¶
func (*DatabaseProvider) GetRendezvous ¶
func (dp *DatabaseProvider) GetRendezvous(ctx context.Context, key string) (*rendezvous.Record, error)
func (*DatabaseProvider) GetRequest ¶ added in v1.2.0
func (dp *DatabaseProvider) GetRequest(ctx context.Context, intentId string) (*paymentrequest.Record, error)
func (*DatabaseProvider) GetStaleTwitterUsers ¶ added in v1.8.0
func (*DatabaseProvider) GetTimelockByAddress ¶
func (*DatabaseProvider) GetTimelockByVault ¶
func (*DatabaseProvider) GetTimelockByVaultBatch ¶
func (*DatabaseProvider) GetTimelockCountByState ¶
func (dp *DatabaseProvider) GetTimelockCountByState(ctx context.Context, state timelock_token.TimelockState) (uint64, error)
func (*DatabaseProvider) GetTotalAvailableTreasuryPoolFunds ¶
func (*DatabaseProvider) GetTotalExternalDepositedAmountInQuarks ¶ added in v1.3.0
func (*DatabaseProvider) GetTotalExternalDepositedAmountInQuarksBatch ¶ added in v1.3.0
func (*DatabaseProvider) GetTotalExternalDepositedAmountInUsd ¶
func (*DatabaseProvider) GetTotalTreasuryPoolDeficitFromCommitments ¶
func (*DatabaseProvider) GetTransactedAmountForAntiMoneyLaundering ¶
func (*DatabaseProvider) GetTransaction ¶
func (dp *DatabaseProvider) GetTransaction(ctx context.Context, sig string) (*transaction.Record, error)
Transaction --------------------------------------------------------------------------------
func (*DatabaseProvider) GetTreasuryPoolByAddress ¶
func (*DatabaseProvider) GetTreasuryPoolByName ¶
func (*DatabaseProvider) GetTreasuryPoolByVault ¶
func (*DatabaseProvider) GetTwitterUserByTipAddress ¶ added in v1.9.0
func (*DatabaseProvider) GetTwitterUserByUsername ¶ added in v1.9.0
func (*DatabaseProvider) GetUniquePhoneVerificationIdCountForNumberSinceTimestamp ¶
func (*DatabaseProvider) GetUpgradeableCommitmentsByOwner ¶
func (dp *DatabaseProvider) GetUpgradeableCommitmentsByOwner(ctx context.Context, owner string, limit uint64) ([]*commitment.Record, error)
func (*DatabaseProvider) GetUsedTreasuryPoolDeficitFromCommitments ¶
func (*DatabaseProvider) GetUserByID ¶
func (*DatabaseProvider) GetUserByPhoneView ¶
func (*DatabaseProvider) GetUserDataContainerByID ¶
func (dp *DatabaseProvider) GetUserDataContainerByID(ctx context.Context, id *user.DataContainerID) (*storage.Record, error)
func (*DatabaseProvider) GetUserDataContainerByPhone ¶
func (*DatabaseProvider) GetUserLocale ¶ added in v1.6.0
func (*DatabaseProvider) GetUserPreferences ¶ added in v1.6.0
func (dp *DatabaseProvider) GetUserPreferences(ctx context.Context, id *user.DataContainerID) (*preferences.Record, error)
func (*DatabaseProvider) GetWebhook ¶
func (*DatabaseProvider) ImportExchangeRates ¶
func (dp *DatabaseProvider) ImportExchangeRates(ctx context.Context, data *currency.MultiRateRecord) error
func (*DatabaseProvider) InitializeNewMerkleTree ¶
func (dp *DatabaseProvider) InitializeNewMerkleTree(ctx context.Context, name string, levels uint8, seeds []merkletree.Seed, readOnly bool) (*merkletree.MerkleTree, error)
Merkle Tree
func (*DatabaseProvider) IsEligibleForAirdrop ¶ added in v1.7.0
func (*DatabaseProvider) IsPhoneNumberEnabledForRemoteSendToAccount ¶
func (*DatabaseProvider) IsPhoneNumberLinkedToAccount ¶
func (*DatabaseProvider) IsTweetProcessed ¶ added in v1.8.0
func (*DatabaseProvider) LoadExistingMerkleTree ¶
func (dp *DatabaseProvider) LoadExistingMerkleTree(ctx context.Context, name string, readOnly bool) (*merkletree.MerkleTree, error)
func (*DatabaseProvider) MarkFulfillmentAsActivelyScheduled ¶
func (dp *DatabaseProvider) MarkFulfillmentAsActivelyScheduled(ctx context.Context, id uint64) error
func (*DatabaseProvider) MarkIneligibleForAirdrop ¶ added in v1.7.0
func (dp *DatabaseProvider) MarkIneligibleForAirdrop(ctx context.Context, owner string) error
Airdrop --------------------------------------------------------------------------------
func (*DatabaseProvider) MarkPushTokenAsInvalid ¶
func (dp *DatabaseProvider) MarkPushTokenAsInvalid(ctx context.Context, pushToken string) error
func (*DatabaseProvider) MarkTweetAsProcessed ¶ added in v1.8.0
func (dp *DatabaseProvider) MarkTweetAsProcessed(ctx context.Context, tweetId string) error
func (*DatabaseProvider) MarkTwitterNonceAsUsed ¶ added in v1.9.0
func (*DatabaseProvider) PutAllActions ¶
Action --------------------------------------------------------------------------------
func (*DatabaseProvider) PutAllFulfillments ¶
func (dp *DatabaseProvider) PutAllFulfillments(ctx context.Context, records ...*fulfillment.Record) error
func (*DatabaseProvider) PutChat ¶
Chat --------------------------------------------------------------------------------
func (*DatabaseProvider) PutChatMessage ¶
func (*DatabaseProvider) PutFiatOnrampPurchase ¶ added in v1.5.0
Onramp --------------------------------------------------------------------------------
func (*DatabaseProvider) PutPhoneEvent ¶
func (*DatabaseProvider) PutPushToken ¶
Push --------------------------------------------------------------------------------
func (*DatabaseProvider) PutUser ¶
User Identity --------------------------------------------------------------------------------
func (*DatabaseProvider) PutUserDataContainer ¶
User Storage Management --------------------------------------------------------------------------------
func (*DatabaseProvider) RemoveContact ¶
func (dp *DatabaseProvider) RemoveContact(ctx context.Context, owner *user.DataContainerID, contact string) error
func (*DatabaseProvider) ResetBadgeCount ¶
func (dp *DatabaseProvider) ResetBadgeCount(ctx context.Context, owner string) error
func (*DatabaseProvider) SaveBalanceCheckpoint ¶ added in v1.3.2
func (dp *DatabaseProvider) SaveBalanceCheckpoint(ctx context.Context, record *balance.Record) error
Balance --------------------------------------------------------------------------------
func (*DatabaseProvider) SaveCommitment ¶
func (dp *DatabaseProvider) SaveCommitment(ctx context.Context, record *commitment.Record) error
Commitment --------------------------------------------------------------------------------
func (*DatabaseProvider) SaveEvent ¶
Event --------------------------------------------------------------------------------
func (*DatabaseProvider) SaveExternalDeposit ¶
External Deposits --------------------------------------------------------------------------------
func (*DatabaseProvider) SaveIntent ¶
func (*DatabaseProvider) SaveLogins ¶
func (dp *DatabaseProvider) SaveLogins(ctx context.Context, record *login.MultiRecord) error
Login --------------------------------------------------------------------------------
func (*DatabaseProvider) SaveOwnerAccountPhoneSetting ¶
func (dp *DatabaseProvider) SaveOwnerAccountPhoneSetting(ctx context.Context, phoneNumber string, newSettings *phone.OwnerAccountSetting) error
func (*DatabaseProvider) SavePhoneLinkingToken ¶
func (dp *DatabaseProvider) SavePhoneLinkingToken(ctx context.Context, token *phone.LinkingToken) error
func (*DatabaseProvider) SavePhoneVerification ¶
func (dp *DatabaseProvider) SavePhoneVerification(ctx context.Context, v *phone.Verification) error
Phone --------------------------------------------------------------------------------
func (*DatabaseProvider) SaveRendezvous ¶
func (dp *DatabaseProvider) SaveRendezvous(ctx context.Context, record *rendezvous.Record) error
Rendezvous --------------------------------------------------------------------------------
func (*DatabaseProvider) SaveTimelock ¶
Timelock --------------------------------------------------------------------------------
func (*DatabaseProvider) SaveTransaction ¶
func (dp *DatabaseProvider) SaveTransaction(ctx context.Context, record *transaction.Record) error
func (*DatabaseProvider) SaveTreasuryPool ¶
Treasury Pool --------------------------------------------------------------------------------
func (*DatabaseProvider) SaveTreasuryPoolFunding ¶
func (dp *DatabaseProvider) SaveTreasuryPoolFunding(ctx context.Context, record *treasury.FundingHistoryRecord) error
func (*DatabaseProvider) SaveTwitterUser ¶ added in v1.8.0
Twitter --------------------------------------------------------------------------------
func (*DatabaseProvider) SaveUserPreferences ¶ added in v1.6.0
func (dp *DatabaseProvider) SaveUserPreferences(ctx context.Context, record *preferences.Record) error
User Preferences --------------------------------------------------------------------------------
func (*DatabaseProvider) SetChatMuteState ¶
func (*DatabaseProvider) SetChatSubscriptionState ¶
func (*DatabaseProvider) UpdateAccountInfo ¶
func (*DatabaseProvider) UpdateAction ¶
func (*DatabaseProvider) UpdateFulfillment ¶
func (dp *DatabaseProvider) UpdateFulfillment(ctx context.Context, record *fulfillment.Record) error
func (*DatabaseProvider) UpdateOrCreatePayment ¶
func (*DatabaseProvider) UpdatePayment ¶
func (*DatabaseProvider) UpdateWebhook ¶
func (*DatabaseProvider) UsePhoneLinkingToken ¶
func (dp *DatabaseProvider) UsePhoneLinkingToken(ctx context.Context, phoneNumber, code string) error
type EstimatedData ¶
type EstimatedData interface { TestForKnownAccount(ctx context.Context, account []byte) (bool, error) AddKnownAccount(ctx context.Context, account []byte) error }
func NewEstimatedProvider ¶
func NewEstimatedProvider() (EstimatedData, error)
type EstimatedProvider ¶
type EstimatedProvider struct {
// contains filtered or unexported fields
}
func (*EstimatedProvider) AddKnownAccount ¶
func (p *EstimatedProvider) AddKnownAccount(ctx context.Context, account []byte) error
func (*EstimatedProvider) TestForKnownAccount ¶
type Provider ¶
type Provider interface { BlockchainData DatabaseData WebData EstimatedData GetBlockchainDataProvider() BlockchainData GetDatabaseDataProvider() DatabaseData GetWebDataProvider() WebData GetEstimatedDataProvider() EstimatedData }
func NewDataProvider ¶
func NewDataProviderWithoutBlockchain ¶
func NewDataProviderWithoutBlockchain(dbConfig *pg.Config, configProvider ConfigProvider) (Provider, error)
func NewTestDataProvider ¶
func NewTestDataProvider() Provider
type WebData ¶
type WebData interface { GetCurrentExchangeRatesFromExternalProviders(ctx context.Context) (*currency.MultiRateRecord, error) GetPastExchangeRatesFromExternalProviders(ctx context.Context, t time.Time) (*currency.MultiRateRecord, error) }
func NewWebProvider ¶
func NewWebProvider(configProvider ConfigProvider) (WebData, error)
type WebProvider ¶
type WebProvider struct {
// contains filtered or unexported fields
}
func (*WebProvider) GetCurrentExchangeRatesFromExternalProviders ¶
func (dp *WebProvider) GetCurrentExchangeRatesFromExternalProviders(ctx context.Context) (*currency.MultiRateRecord, error)
Currency --------------------------------------------------------------------------------
func (*WebProvider) GetPastExchangeRatesFromExternalProviders ¶
func (dp *WebProvider) GetPastExchangeRatesFromExternalProviders(ctx context.Context, t time.Time) (*currency.MultiRateRecord, error)