Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 20 additions & 11 deletions modules/express/src/typedRoutes/api/v2/shareWallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,38 @@ import { ShareState, ShareWalletKeychain } from '../../schemas/wallet';
* Path parameters for sharing a wallet
*/
export const ShareWalletParams = {
/** Coin ticker / chain identifier */
/** A cryptocurrency or token ticker symbol. */
coin: t.string,
/** Wallet ID */
/** The wallet ID. */
id: t.string,
} as const;

/**
* Request body for sharing a wallet
*/
export const ShareWalletBody = {
/** Recipient email address */
/** Email address of the user being invited. */
email: t.string,
/** Permissions string, e.g., "view,spend" */
/**
* Comma-separated list of privileges for a wallet. Includes:
* - `admin` - Can manage wallet policies and users and approve or reject pending approvals.
* - `freeze` - Can freeze a wallet, disabling all withdrawals.
* - `spend` - Can initiate withdrawals and generate new receive addresses.
* - `trade` - Can initiate trades from a Go Account (`trading` wallet type).
* - `view` - Can view balances and transactions.
*
* Permissions don't overlap. Required parameter if 'reshare' is false.
*/
permissions: t.string,
/** Wallet passphrase used to derive shared key when needed */
/** Wallet passphrase of the user sharing the wallet. */
walletPassphrase: optional(t.string),
/** Optional message to include with the share */
/** User readable message to display to the share recipient. */
message: optional(t.string),
/** If true, allows sharing without a keychain */
/** Flag for reinviting a user to the wallet. This is required if the invitee has already been invited to the wallet, but has changed their password and needs a new invite. */
reshare: optional(t.boolean),
/** If true, skips sharing the wallet keychain with the recipient */
/** If true, skips using a shared key (for when the wallet is shared without spend permission). */
skipKeychain: optional(t.boolean),
/** If true, suppresses email notification to the recipient */
/** Flag for disabling invite notification email. */
disableEmail: optional(t.boolean),
} as const;

Expand Down Expand Up @@ -73,10 +82,10 @@ export const ShareWalletResponse = {
} as const;

/**
* Share this wallet with another BitGo user.
* Share wallet with an existing BitGo user
*
* @operationId express.v2.wallet.share
* @tag express
* @tag Express
*/
export const PostShareWallet = httpRoute({
path: '/api/v2/{coin}/wallet/{id}/share',
Expand Down
Loading