> ## Documentation Index
> Fetch the complete documentation index at: https://docs.didit.me/llms.txt
> Use this file to discover all available pages before exploring further.

# 钱包地址导入 API：Travel Rule 地址簿

> 通过 Didit 可从 JSON 或 CSV 批量导入最多 10,000 个钱包到 Travel Rule 地址簿，支持按地址或地址哈希导入，具备幂等性，并附带逐行报告。



导入钱包地址 API 提示词
        将提示词复制到剪贴板



      
      

\<pre>

\`Import many wallets into the application's Travel Rule address book in one call, as JSON or as a CSV file.

Endpoint:
POST https://verification.didit.me/v3/travel-rule/wallet-addresses/import/

Authentication:
Use the x-api-key header with my Didit API key.

Request body, one of:
\- application/json: {"entries": [row, ...]} or a bare JSON array of rows.
\- multipart/form-data: a "file" field holding a UTF-8 CSV of at most 5 MB with a header row naming the columns.
At most 10,000 rows either way.

Row fields (every one optional, but each row needs address, address_hash or both):
\{
"address": "0xBeneficiaryWallet01",      // the wallet address (alias: walletAddress)
"address_hash": "4f7d...3f2e",           // SHA-256 of the lowercased address, 64 hex or 44 base64 characters (alias: walletAddressHash)
"chain": "ETH",
"memo": "104729",                        // destination tag or memo on XRP, XLM, EOS, ATOM, HBAR (alias: destinationTag)
"holder_name": "Ana Diaz",
"holder_vendor_data": "user-042",        // your id for the holder (alias: externalUserId)
"entity_type": "individual",             // individual or company
"label": "Main deposit wallet",
"owner_type": "customer",                // customer, internal or vasp
"travel_address": "ta...",
"self_declared": false                   // only when your settings allow self-declaration
}

Behavior:
\- Send address_hash alone to register a wallet without disclosing its address. Sent with address, it must be that address's hash.
\- Idempotent: a wallet already in the book (same address or hash, chain and memo) is reported as "existing" and left untouched, so the same file can be sent again.
\- A row that repeats an earlier row of the same import is "duplicate" and names that row.
\- Each row is validated on its own, so one bad row never fails the others.
\- An entry imported by its hash only matches transfers to that address, and can be proven with the wallet-ownership widget like any other entry.
\- In a CSV, an empty cell counts as not sent and columns the import does not read are ignored.

What to read from the response:
\- 200 when no row failed, 207 when at least one did.
\- total, created, existing, duplicate, failed - the counts.
\- rows[] - one result per row in the order sent: row (from 1), status, entry_id, errors, duplicate_of_row.

Failure modes:
\- 400 - both entries and a file, or neither; more than 10,000 rows; a file over 5 MB, not UTF-8 CSV, or without a header row or rows.
\- 401 - missing or malformed x-api-key.

Full guide: /transaction-monitoring/travel-rule#importing-wallets-in-bulk.`

\</pre>



      
      

粘贴到



## OpenAPI

````yaml zh/openapi-25.json POST /v3/travel-rule/wallet-addresses/import/
openapi: 3.0.0
info:
  version: 3.0.0
  title: Didit Verification API
  description: 身份证件验证 API。使用 x-api-key 请求头进行身份验证。
servers:
  - url: https://verification.didit.me
security: []
tags: []
paths:
  /v3/travel-rule/wallet-addresses/import/:
    post:
      tags:
        - Travel Rule
      summary: 批量导入钱包地址
      description: >-
        单次调用即可向您的 Travel Rule 地址簿添加最多 10,000 个钱包（支持 JSON 或 CSV
        文件格式）。钱包可通过其地址发送，也可通过其小写地址的 SHA-256
        哈希值（`address_hash`）发送以保护地址隐私，或两者同时发送。导入具有幂等性：地址簿中已存在的钱包将报告为 `existing`
        且保持不变，因此可重复发送相同文件。每一行均独立验证，因此单行错误绝不会导致其他行失败。仅通过哈希导入的钱包仅与发往该地址的转账相匹配，并且可以像其他任何条目一样使用钱包所有权小部件进行证明。
      operationId: importTravelRuleWalletAddresses
      requestBody:
        required: true
        content:
          application/json:
            schema:
              oneOf:
                - type: object
                  required:
                    - entries
                  properties:
                    entries:
                      type: array
                      minItems: 1
                      maxItems: 10000
                      items:
                        $ref: '#/components/schemas/WalletAddressImportRow'
                - type: array
                  minItems: 1
                  maxItems: 10000
                  items:
                    $ref: '#/components/schemas/WalletAddressImportRow'
            example:
              entries:
                - address: 0xBeneficiaryWallet01
                  chain: ETH
                  holder_name: Ana Diaz
                  holder_vendor_data: user-042
                - address_hash: >-
                    4f7d2e1c9b8a7f6e5d4c3b2a1f0e9d8c7b6a5f4e3d2c1b0a9f8e7d6c5b4a3f2e
                  chain: bitcoin
                  holder_vendor_data: user-043
                - address: rExchangeSharedAddress01
                  chain: XRP
                  memo: '104729'
                  holder_name: Ana Diaz
          multipart/form-data:
            schema:
              type: object
              required:
                - file
              properties:
                file:
                  type: string
                  format: binary
                  description: >-
                    最大 5 MB 的 UTF-8 CSV
                    文件，带有列名的表头行（列名为字段名或其别名）。空单元格视为未发送；导入不读取的列将被忽略。
      responses:
        '200':
          description: 每一行都已创建、已在账簿中，或者是先前某行的重复项。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WalletAddressImportReport'
              example:
                total: 3
                created: 2
                existing: 1
                duplicate: 0
                failed: 0
                rows:
                  - row: 1
                    status: existing
                    entry_id: 11111111-2222-3333-4444-555555555555
                    errors: {}
                    duplicate_of_row: null
                  - row: 2
                    status: created
                    entry_id: 22222222-3333-4444-5555-666666666666
                    errors: {}
                    duplicate_of_row: null
                  - row: 3
                    status: created
                    entry_id: 33333333-4444-5555-6666-777777777777
                    errors: {}
                    duplicate_of_row: null
        '207':
          description: 至少有一行失败；其余行已导入。每个失败的行均指明了其错误。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WalletAddressImportReport'
              example:
                total: 2
                created: 1
                existing: 0
                duplicate: 0
                failed: 1
                rows:
                  - row: 1
                    status: created
                    entry_id: 44444444-5555-6666-7777-888888888888
                    errors: {}
                    duplicate_of_row: null
                  - row: 2
                    status: failed
                    entry_id: null
                    errors:
                      address:
                        - Send address, address_hash or both.
                    duplicate_of_row: null
        '400':
          description: >-
            请求本身无法读取：同时提供了 `entries` 和 `file`，或两者均未提供；超过 10,000 行；文件超过 5 MB、不是
            UTF-8 编码的 CSV、没有表头行或没有数据行。
          content:
            application/json:
              schema:
                type: object
              example:
                file:
                  - At most 10000 rows per import.
      security:
        - ApiKeyAuth: []
      x-codeSamples:
        - lang: curl
          label: curl (JSON)
          source: >-
            curl -X POST
            https://verification.didit.me/v3/travel-rule/wallet-addresses/import/
            \
              -H 'x-api-key: YOUR_API_KEY' -H 'Content-Type: application/json' \
              -d '{"entries": [{"address": "0xBeneficiaryWallet01", "chain": "ETH", "holder_name": "Ana Diaz"}, {"address": "rExchangeSharedAddress01", "chain": "XRP", "memo": "104729"}]}'
        - lang: curl
          label: curl (CSV)
          source: >-
            curl -X POST
            https://verification.didit.me/v3/travel-rule/wallet-addresses/import/
            \
              -H 'x-api-key: YOUR_API_KEY' \
              -F 'file=@wallets.csv;type=text/csv'
        - lang: python
          label: Python
          source: |-
            from didit import Didit

            # Reads DIDIT_API_KEY.
            client = Didit()

            result = client.travel_rule.wallet_addresses.bulk_import(
                body={
                    "entries": [{
                        "address": "0xBeneficiaryWallet01",
                        "chain": "ETH",
                        "holder_name": "Ana Diaz",
                        "holder_vendor_data": "user-042",
                    }, {
                        "address_hash": "4f7d2e1c9b8a7f6e5d4c3b2a1f0e9d8c7b6a5f4e3d2c1b0a9f8e7d6c5b4a3f2e",
                        "chain": "bitcoin",
                        "holder_vendor_data": "user-043",
                    }, {
                        "address": "rExchangeSharedAddress01",
                        "chain": "XRP",
                        "memo": "104729",
                        "holder_name": "Ana Diaz",
                    }],
                },
            )
            print(result)
        - lang: javascript
          label: Node.js
          source: |-
            import Didit, { fileFromPath } from "@didit-protocol/sdk-node";

            // Reads DIDIT_API_KEY.
            const didit = new Didit();

            const result = await didit.travelRule.walletAddresses.bulkImport({
              file: await fileFromPath("wallet-addresses.csv"),
            });
            console.log(result);
        - lang: go
          label: Go
          source: "ctx := context.Background()\n// Reads DIDIT_API_KEY.\nclient := didit.NewClient()\n\nresult, err := client.TravelRule.WalletAddresses.BulkImport(ctx, didit.TravelRuleWalletAddressesBulkImportParams{\n\tFile: didit.Some(didit.FileFromPath(\"wallet-addresses.csv\")),\n})\nif err != nil {\n\tlog.Fatal(err)\n}\nfmt.Printf(\"%+v\\n\", result)"
        - lang: java
          label: Java
          source: >-
            import java.nio.file.Path;

            import me.didit.Didit;

            import me.didit.types.TravelRuleWalletAddressesBulkImportParams;


            // Reads DIDIT_API_KEY.

            Didit client = new Didit();


            var result =
            client.travelRule().walletAddresses().bulkImport(TravelRuleWalletAddressesBulkImportParams.builder()
                    .file(Path.of("wallet-addresses.csv"))
                    .build());
            System.out.println(result);
        - lang: php
          label: PHP
          source: |-
            <?php

            require 'vendor/autoload.php';

            use Didit\DiditClient;
            use Didit\File;

            // Reads DIDIT_API_KEY.
            $didit = new DiditClient();

            $result = $didit->travelRule->walletAddresses->bulkImport([
                'file' => File::fromPath('wallet-addresses.csv'),
            ]);
            print_r($result->toArray());
        - lang: ruby
          label: Ruby
          source: |-
            require "didit"

            # Reads DIDIT_API_KEY.
            didit = Didit::Client.new

            result = didit.travel_rule.wallet_addresses.bulk_import(
              body: {
                entries: [{
                  address: "0xBeneficiaryWallet01",
                  chain: "ETH",
                  holder_name: "Ana Diaz",
                  holder_vendor_data: "user-042",
                }, {
                  address_hash: "4f7d2e1c9b8a7f6e5d4c3b2a1f0e9d8c7b6a5f4e3d2c1b0a9f8e7d6c5b4a3f2e",
                  chain: "bitcoin",
                  holder_vendor_data: "user-043",
                }, {
                  address: "rExchangeSharedAddress01",
                  chain: "XRP",
                  memo: "104729",
                  holder_name: "Ana Diaz",
                }],
              }
            )
            puts result.to_h
        - lang: csharp
          label: .NET
          source: >-
            using System;

            using System.Text.Json;

            using Didit;


            // Reads DIDIT_API_KEY.

            using var client = new DiditClient();


            var result = await
            client.TravelRule.WalletAddresses.BulkImportAsync(new
            TravelRuleWalletAddressesBulkImportParams

            {
                File = FileUpload.FromPath("wallet-addresses.csv"),
            });

            Console.WriteLine(JsonSerializer.Serialize(result));
components:
  schemas:
    WalletAddressImportRow:
      type: object
      description: >-
        要导入的一个钱包：通过其 `address`、`address_hash` 或两者。这些字段的 camelCase 形式也被接受，例如
        `walletAddress`、`walletAddressHash`、`destinationTag` 和 `externalUserId`。
      properties:
        address:
          type: string
          maxLength: 128
          description: 钱包地址。别名：`walletAddress`。
        address_hash:
          type: string
          description: >-
            将地址转换为小写后计算的 SHA-256，表示为 64 个十六进制字符或 44 个 Base64
            字符。单独发送可在不透露其地址的情况下注册钱包；与 `address`
            一起发送时，必须为该地址的哈希值。别名：`walletAddressHash`。
        chain:
          type: string
          maxLength: 32
        memo:
          type: string
          maxLength: 256
          description: >-
            目标标签或备注。XRP：目标标签，0 到 4294967295 之间的整数（支持 JSON 数字格式）。XLM：最多 28
            字节的文本备注、64 位 ID 或 32 字节的十六进制哈希。EOS：最多 256 字节。ATOM：最多 256 个字符。HBAR：最多
            100 字节。Bitcoin、EVM、Solana、Tron、Litecoin、Bitcoin Cash、Dogecoin 和
            Lightning 钱包不支持备注：若传入将返回 `400`。
        holder_name:
          type: string
          maxLength: 255
        holder_vendor_data:
          type: string
          maxLength: 255
          description: 您为持有者指定的内部标识符。别名：`externalUserId`。
        entity_type:
          type: string
          enum:
            - individual
            - company
          default: individual
        label:
          type: string
          maxLength: 255
        owner_type:
          type: string
          enum:
            - customer
            - internal
            - vasp
          default: customer
        travel_address:
          type: string
          maxLength: 512
        self_declared:
          type: boolean
          default: false
          description: 当您的设置允许时，创建已通过自主申报核验的条目。
    WalletAddressImportReport:
      type: object
      description: 导入中每一行的处理情况，按发送顺序排列。
      properties:
        total:
          type: integer
        created:
          type: integer
        existing:
          type: integer
        duplicate:
          type: integer
        failed:
          type: integer
        rows:
          type: array
          items:
            type: object
            properties:
              row:
                type: integer
                description: 行号，从 1 开始。
              status:
                type: string
                enum:
                  - created
                  - existing
                  - duplicate
                  - failed
                description: >-
                  `created`：已添加到名录。`existing`：钱包已在名录中且未作任何改动。`duplicate`：重复了此导入中之前的某一行。`failed`：参见
                  `errors`。
              entry_id:
                type: string
                format: uuid
                nullable: true
                description: 该行创建或找到的地址簿条目。
              errors:
                type: object
                description: '`failed` 行的字段错误；否则为空。'
              duplicate_of_row:
                type: integer
                nullable: true
                description: 在 `duplicate` 行上，表示其重复的行。
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        您的应用 API 密钥，可在 Business Console 的“开发者 -> API
        密钥”中获取。主密钥拥有完整访问权限。指定名称的密钥可设置作用域：针对每个资源设为无权限、只读或读写，限定于特定工作流或已通过的会话、限定于
        IP 地址列表，以及设置到期日期。401 表示密钥错误、已撤销或已过期；403 表示未发送密钥、密钥无权访问该资源或操作，或请求来自其 IP
        列表之外的地址；在会话路由上返回 404 表示该会话不在该密钥允许的工作流或状态范围内。没有媒体访问权限的密钥获取到的图片、视频和 PDF
        URL 将为 null；没有会话写入权限的密钥获取到的会话链接和 token 将为 null。请参阅
        https://docs.didit.me/console/api-keys。

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.