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
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Creating Go Accounts without BitGo Express
# Go Account Workflows

This guide demonstrates how to create Go Accounts (trading wallets) using only the BitGo SDK, without requiring BitGo Express.
This guide covers the full Go Account (trading wallet) lifecycle using the BitGo SDK directly, without requiring BitGo Express.

## Overview

Expand All @@ -12,6 +12,68 @@ This guide demonstrates how to create Go Accounts (trading wallets) using only t

## Available Scripts

### 1. SDK Approach (Recommended)
**File:** `examples/ts/go-account/create-go-account.ts`

Uses the high-level `generateWallet()` method which handles keychain creation, encryption, and wallet setup automatically.

**Best for:**
- Most production use cases
- Quick integration
- Users who don't need manual key management

**Example:**
```typescript
const bitgo = new BitGoAPI({
accessToken: process.env.TESTNET_ACCESS_TOKEN,
env: 'test',
});

const coin = 'ofc';
bitgo.register(coin, coins.Ofc.createInstance);

const response = await bitgo.coin(coin).wallets().generateWallet({
label: 'My Go Account',
passphrase: 'wallet_passphrase',
passcodeEncryptionCode: 'encryption_code',
enterprise: 'your_enterprise_id',
type: 'trading', // Required for Go Accounts
});

const { wallet, userKeychain, encryptedWalletPassphrase } = response;
```

### 2. Advanced SDK Approach
**File:** `examples/ts/go-account/create-go-account-advanced.ts`

Provides manual control over keychain creation and wallet setup using SDK methods.

**Best for:**
- Advanced users needing custom key management
- Integration with custom key storage systems
- Understanding the internals of Go Account creation
- Testing and debugging

### 3. Creating Addresses for Existing Wallets
**File:** `examples/ts/go-account/create-go-account-address.ts`

Demonstrates how to create additional addresses for an existing Go Account wallet.

**Best for:**
- Adding new addresses to existing wallets
- Creating addresses for different tokens
- Managing multiple receiving addresses

**Example:**
```typescript
const wallet = await bitgo.coin('ofc').wallets().get({ id: walletId });

const address = await wallet.createAddress({
label: 'My New Address',
onToken: 'ofctsol:usdc' // Required for OFC wallets
});
```

### 4. Go Account Withdrawal — complete flow
**File:** `examples/ts/go-account/go-account-withdrawal.ts`

Expand Down Expand Up @@ -78,68 +140,6 @@ const signature = await tradingAccount.signPayload({

---

### 1. SDK Approach (Recommended)
**File:** `examples/ts/go-account/create-go-account.ts`

Uses the high-level `generateWallet()` method which handles keychain creation, encryption, and wallet setup automatically.

**Best for:**
- Most production use cases
- Quick integration
- Users who don't need manual key management

**Example:**
```typescript
const bitgo = new BitGoAPI({
accessToken: process.env.TESTNET_ACCESS_TOKEN,
env: 'test',
});

const coin = 'ofc';
bitgo.register(coin, coins.Ofc.createInstance);

const response = await bitgo.coin(coin).wallets().generateWallet({
label: 'My Go Account',
passphrase: 'wallet_passphrase',
passcodeEncryptionCode: 'encryption_code',
enterprise: 'your_enterprise_id',
type: 'trading', // Required for Go Accounts
});

const { wallet, userKeychain, encryptedWalletPassphrase } = response;
```

### 2. Advanced SDK Approach
**File:** `examples/ts/go-account/create-go-account-advanced.ts`

Provides manual control over keychain creation and wallet setup using SDK methods.

**Best for:**
- Advanced users needing custom key management
- Integration with custom key storage systems
- Understanding the internals of Go Account creation
- Testing and debugging

### 3. Creating Addresses for Existing Wallets
**File:** `examples/ts/go-account/create-go-account-address.ts`

Demonstrates how to create additional addresses for an existing Go Account wallet.

**Best for:**
- Adding new addresses to existing wallets
- Creating addresses for different tokens
- Managing multiple receiving addresses

**Example:**
```typescript
const wallet = await bitgo.coin('ofc').wallets().get({ id: walletId });

const address = await wallet.createAddress({
label: 'My New Address',
onToken: 'ofctsol:usdc' // Required for OFC wallets
});
```

## Detailed Examples

### SDK Approach Example
Expand Down
Loading