diff --git a/api.yaml b/api.yaml index 3869cc9..a2be32c 100644 --- a/api.yaml +++ b/api.yaml @@ -16586,62 +16586,6 @@ paths: application/json: schema: $ref: '#/components/schemas/PlatformError3' - /api/v2/wallet/balances: - get: - tags: - - Wallet - summary: List total balances - description: | - Selects wallets based on the given filter parameters. Gets all balances for the selected wallets and sums up the - balances by coin. - operationId: v2.wallet.gettotalbalances - parameters: - - $ref: '#/components/parameters/coinArray' - - name: deleted - in: query - description: Filter by deleted state - schema: - type: array - items: - type: boolean - default: - - false - - $ref: '#/components/parameters/queryEnterpriseArray' - - $ref: '#/components/parameters/queryIdArray' - - name: labelContains - in: query - description: Filter by label substring - schema: - type: string - - name: type - in: query - description: Filter by wallet type - schema: - type: array - items: - $ref: '#/components/schemas/WalletTypePublic' - - name: expandCustodialWallet - description: Whether balances of linked custodial wallets should be included - in: query - schema: - type: boolean - - $ref: '#/components/parameters/skipPendingTxs' - - $ref: '#/components/parameters/skipTxCounts' - - $ref: '#/components/parameters/excludeEmptyBalances' - - $ref: '#/components/parameters/excludeSpendableBalances' - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/TotalBalances' - '400': - description: Bad Request - content: - application/json: - schema: - $ref: '#/components/schemas/PlatformError3' /api/v2/{coin}/wallet/{walletId}/requestreshare: post: tags: @@ -22302,6 +22246,42 @@ paths: application/json: schema: $ref: '#/components/schemas/PlatformError' + /api/v2/{coin}/wallet/{walletId}/allowance: + get: + summary: Get the token allowance for a specific token contract address + operationId: v2.wallet.token.allowance + tags: + - Wallet + parameters: + - name: coin + in: path + required: true + schema: + $ref: '#/components/schemas/CoinNonEmptyString' + - name: walletId + in: path + required: true + schema: + $ref: '#/components/schemas/WalletIdNonEmptyString' + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/TokenAllowanceResponse' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/PlatformError' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/InvalidAddress' /api/v2/{coin}/wallet/{walletId}/crossChainUnspents: get: summary: Get Wallet Cross Chain Unspents @@ -22629,6 +22609,84 @@ paths: application/json: schema: $ref: '#/components/schemas/PlatformError' + /api/v2/{coin}/wallet/balances: + get: + summary: Get wallet by ID and coin + description: Get one wallet by its 'coin' and 'walletId'. One 'walletId' can map to multiple receive addresses. + operationId: v2.wallet.gettotalbalancesbycoin + tags: + - Wallet + parameters: + - name: allTokens + description: Include balances for all subtokens (i.e. ERC20 Tokens, Stellar Tokens) + in: query + schema: + type: string + enum: + - 'true' + - 'false' + - name: enterprise + description: Filter by enterprise ID + in: query + schema: + oneOf: + - $ref: '#/components/schemas/EnterpriseIdString' + - type: array + items: + type: string + example: 59cd72485007a239fb00282ed480da1f + pattern: ^[0-9a-f]{32}$ + - name: showAllWallets + description: Include wallets that have 'deleted' or 'creationFailed' set to **true** + in: query + schema: + type: string + enum: + - 'true' + - 'false' + default: 'false' + - name: coin + in: path + required: true + schema: + $ref: '#/components/schemas/CoinString' + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/GetWalletBalancesByCoinResponse' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/PlatformError' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/PlatformError' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/PlatformError' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/PlatformError' + '500': + description: Internal Server Error + content: + application/json: + schema: + $ref: '#/components/schemas/PlatformError' /api/v2/auditlog: get: summary: List audit logs @@ -22879,6 +22937,7 @@ paths: - freezePendingApproval - unfreezePendingApproval - trustToSingaporeUpgrade + - updateWalletApprovalsRequired - name: userId description: The user ID to filter by in: query @@ -26431,6 +26490,169 @@ paths: application/json: schema: $ref: '#/components/schemas/PlatformError' + /api/v2/wallet/balances: + get: + summary: Get wallet by ID and coin + description: Get one wallet by its 'coin' and 'walletId'. One 'walletId' can map to multiple receive addresses. + operationId: v2.wallet.gettotalbalances + tags: + - Wallet + parameters: + - name: allTokens + description: Include balances for all subtokens (i.e. ERC20 Tokens, Stellar Tokens) + in: query + schema: + type: string + enum: + - 'true' + - 'false' + - name: coin + description: Filter by coin + in: query + schema: + oneOf: + - $ref: '#/components/schemas/CoinNonEmptyString' + - type: array + items: + type: string + description: A cryptocurrency symbol or token ticker symbol + example: btc + minLength: 1 + example: btc | ['btc', 'eth'] + - name: deleted + description: Filter by deleted state + in: query + schema: + type: string + enum: + - 'true' + - 'false' + default: 'false' + - name: enterprise + description: Filter by enterprise ID + in: query + schema: + oneOf: + - $ref: '#/components/schemas/EnterpriseIdString' + - type: array + items: + type: string + example: 59cd72485007a239fb00282ed480da1f + pattern: ^[0-9a-f]{32}$ + - name: excludeEmptyBalances + description: Exclude tokens with zero balance. When allTokens is passed, then every token supported by BitGo will be included, regardless of balance. + in: query + schema: + type: string + enum: + - 'true' + - 'false' + default: 'false' + - name: excludeSpendableBalances + description: Skip spendable balance calculations and only include confirmed balances. If absent, defaults to false. + in: query + schema: + type: string + enum: + - 'true' + - 'false' + default: 'false' + - name: expandCustodialWallet + description: Whether balances of linked custodial wallets should be included + in: query + schema: + type: string + enum: + - 'true' + - 'false' + default: 'false' + - name: id + description: Filter by wallet ID + in: query + schema: + oneOf: + - $ref: '#/components/schemas/WalletIdString' + - type: array + items: + type: string + example: 59cd72485007a239fb00282ed480da1f + pattern: ^[0-9a-f]{32}$ + - name: labelContains + description: Filter by label substring + in: query + schema: + type: string + - name: skipPendingTxs + description: Do not include pending withdrawals when determining total balances. By default, pending withdrawals will be considered. + in: query + schema: + type: string + enum: + - 'true' + - 'false' + default: 'false' + - name: skipTxCounts + description: True, if excluding transfer counts when calculating total balances. If absent, defaults to false. + in: query + schema: + type: string + enum: + - 'true' + - 'false' + default: 'false' + - name: type + description: Filter by wallet type + in: query + schema: + oneOf: + - $ref: '#/components/schemas/WalletType' + - type: array + items: + type: string + enum: + - backing + - cold + - custodial + - custodialPaired + - hot + - trading + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/GetWalletBalanceResponse' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/PlatformError' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/PlatformError' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/PlatformError' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/PlatformError' + '500': + description: Internal Server Error + content: + application/json: + schema: + $ref: '#/components/schemas/PlatformError' /api/v2/wallets: get: summary: List wallets @@ -27100,6 +27322,18 @@ components: example: 59cd72485007a239fb00282ed480da1f minLength: 1 pattern: ^[0-9a-f]{32}$ + InvalidAddress: + title: Invalid Address + allOf: + - type: object + properties: + name: + type: string + enum: + - InvalidAddress + required: + - name + - $ref: '#/components/schemas/InvalidId' InvalidId: title: InvalidId allOf: @@ -28073,6 +28307,7 @@ components: - triggerWebhookNotification - performLivenessVerification - recommendBackingWalletRouting + - getManualTrustReview TransactionRequestId: title: TransactionRequestId type: string @@ -41597,22 +41832,6 @@ components: type: number description: Number of decimal places the token uses (for fungible tokens unsupported in WP). example: 18 - TotalBalances: - type: object - properties: - balances: - type: array - items: - type: object - properties: - balanceString: - allOf: - - $ref: '#/components/schemas/IntegerString' - description: | - String representation of the balance in base units. Guaranteed to not lose - precision. - coin: - $ref: '#/components/schemas/Coin' Transaction1: type: object properties: @@ -48200,6 +48419,33 @@ components: associatedNativeCoinAddress: type: string description: The native coin receive address associated with the solana ATA address. This is currently present only for BitGo addresses. This change was done so that there is a mapping between the two addresses in the transfer entries. + isFee: + type: boolean + description: Indicates if this entry is a fee + isInternal: + type: boolean + description: Indicates if this entry is internal + memo: + type: string + description: Memo associated with this entry + rewardAddress: + type: string + description: Reward address associated with this entry + subtype: + type: string + description: Subtype of this entry + backingFeeString: + type: string + description: Backing fee represented as a string + nftId: + type: string + description: NFT ID associated with this entry + tokenContractHash: + type: string + description: Token contract hash associated with this entry + isReward: + type: boolean + description: Indicates if this entry is a reward required: - address description: An array of objects describing the change in address balances made as a result of this Transfer @@ -48368,6 +48614,100 @@ components: description: The number of pending approvals required: - pendingApprovalsCount + GetWalletBalancesByCoinResponse: + title: GetWalletBalancesByCoinResponse + allOf: + - type: object + properties: + balance: + type: number + description: The total balance of all wallets containing the given coin type. May lose precision for large values. + confirmedBalance: + type: number + description: The total balance of confirmed transactions for all wallets containing the given coin type. May lose precision for large values. + spendableBalance: + type: number + description: The total balance of all wallets containing the given coin which may be used as inputs for creating new transactions. May lose precision for large values. + stakedBalance: + type: number + description: The total balance of all wallets containing the given coin which has been staked. May lose precision for large values. + stakedBalanceString: + type: string + description: String representation of 'stakedBalance'. Guaranteed to not lose precision. + tokens: + allOf: + - $ref: '#/components/schemas/tokenBalances' + description: Object of key value pairs where the keys are the token symbols (e.g. omg) and the values are the balance data for that token symbol. + unsupportedTokens: + allOf: + - $ref: '#/components/schemas/tokenBalances' + description: Object of key value pairs where the keys are the unsupported token contracts (e.g. 0x9928e4046d7c6513326ccea028cd3e7a91c7590a) and the values are the balance data for that token contract. UnsupportedTokens will only be returned for wallets that supports Metamask Institutional and has enableMMI flag turned on + required: + - balance + - confirmedBalance + - spendableBalance + - $ref: '#/components/schemas/baseBalanceStrings' + baseBalanceStrings: + title: baseBalanceStrings + type: object + properties: + balanceString: + type: string + description: String representation of the total balance of all wallets containing the given coin type. Guaranteed to not lose precision. + confirmedBalanceString: + type: string + description: String representation of the total balance of confirmed transactions for all wallets containing the given coin type. Guaranteed to not lose precision. + spendableBalanceString: + type: string + description: String representation of the total balance of all wallets containing the given coin which may be used as inputs for creating new transactions. Guaranteed to not lose precision. + required: + - balanceString + - confirmedBalanceString + - spendableBalanceString + tokenBalances: + title: tokenBalances + type: object + additionalProperties: + allOf: + - type: object + properties: + transferCount: + type: number + description: Number of transfers for the token. + heldBalanceString: + type: string + description: The difference between the balanceString and the spendableBalanceString. + required: + - transferCount + - $ref: '#/components/schemas/baseBalanceStrings' + GetWalletBalanceResponse: + title: GetWalletBalanceResponse + type: object + properties: + balances: + type: array + items: + type: object + properties: + coin: + allOf: + - $ref: '#/components/schemas/CoinNonEmptyString' + description: A cryptocurrency or token ticker symbol. + balanceString: + type: string + description: String representation of the balance in base units. Guaranteed to not lose precision. + confirmedBalanceString: + type: string + description: String representation of the confirmed balance in base units. Guaranteed to not lose precision. + spendableBalanceString: + type: string + description: String representation of the spendable in base units. Guaranteed to not lose precision. Will not be included if 'excludeSpendableBalances=false' + required: + - coin + - balanceString + - confirmedBalanceString + required: + - balances DeployAddressAndForwardTokenResponse: title: DeployAddressAndForwardTokenResponse type: object @@ -48583,6 +48923,14 @@ components: - balance required: - forwarders + TokenAllowanceResponse: + title: TokenAllowanceResponse + type: object + properties: + allowance: + type: string + required: + - allowance ListWalletShareRequestResponse: title: ListWalletShareRequestResponse type: object @@ -48784,6 +49132,33 @@ components: associatedNativeCoinAddress: type: string description: The native coin receive address associated with the solana ATA address. This is currently present only for BitGo addresses. This change was done so that there is a mapping between the two addresses in the transfer entries. + isFee: + type: boolean + description: Indicates if this entry is a fee + isInternal: + type: boolean + description: Indicates if this entry is internal + memo: + type: string + description: Memo associated with this entry + rewardAddress: + type: string + description: Reward address associated with this entry + subtype: + type: string + description: Subtype of this entry + backingFeeString: + type: string + description: Backing fee represented as a string + nftId: + type: string + description: NFT ID associated with this entry + tokenContractHash: + type: string + description: Token contract hash associated with this entry + isReward: + type: boolean + description: Indicates if this entry is a reward required: - address description: An array of objects describing the change in address balances made as a result of this Transfer @@ -49276,21 +49651,48 @@ components: associatedNativeCoinAddress: type: string description: The native coin receive address associated with the solana ATA address. This is currently present only for BitGo addresses. This change was done so that there is a mapping between the two addresses in the transfer entries. + backingFeeString: + type: string + description: Backing fee represented as a string failed: type: boolean description: True if this entry is failed isChange: type: boolean description: True if this address is a change address (only exists for UTXO coins) and if this is a "send" transfer + isFee: + type: boolean + description: Indicates if this entry is a fee + isInternal: + type: boolean + description: Indicates if this entry is internal isPayGo: type: boolean description: True if this address is the BitGo PayGo wallet + isReward: + type: boolean + description: Indicates if this entry is a reward + memo: + type: string + description: Memo associated with this entry + nftId: + type: string + description: NFT ID associated with this entry nftSymbol: type: string + rewardAddress: + type: string + description: Reward address associated with this entry + subtype: + type: string + description: Subtype of this entry token: type: string description: If this is a token entry, the token's symbol example: omg + tokenContractHash: + type: string + description: Token contract hash associated with this entry type: type: string enum: @@ -51506,6 +51908,7 @@ components: - freezePendingApproval - unfreezePendingApproval - trustToSingaporeUpgrade + - updateWalletApprovalsRequired responses: BadRequest: description: Bad Request @@ -51706,22 +52109,6 @@ components: required: true schema: $ref: '#/components/schemas/BankAccountId' - queryIdArray: - name: id - in: query - description: Filter by ID. - schema: - type: array - items: - $ref: '#/components/schemas/Id' - queryEnterpriseArray: - name: enterprise - in: query - description: Filter by enterprise. - schema: - type: array - items: - $ref: '#/components/schemas/Id' pathUserId: name: userId in: path @@ -51990,36 +52377,6 @@ components: example: true description: | Skip spendable balance calculations and only include confirmed balances. If absent, defaults to false. - skipPendingTxs: - name: skipPendingTxs - schema: - type: boolean - in: query - example: true - description: Do not include pending withdrawals when determining total balances. By default, pending withdrawals will be considered. - skipTxCounts: - name: skipTxCounts - schema: - type: boolean - in: query - example: true - description: True, if excluding transfer counts when calculating total balances. If absent, defaults to false. - excludeSpendableBalances: - name: excludeSpendableBalances - schema: - type: boolean - in: query - example: true - description: | - Skip spendable balance calculations and only include confirmed balances. If absent, defaults to false. - excludeEmptyBalances: - name: excludeEmptyBalances - schema: - type: boolean - in: query - example: true - description: | - Exclude tokens with zero balance. When allTokens is passed, then every token supported by BitGo will be included, regardless of balance. state: name: state description: |