@@ -32,6 +32,13 @@ type Config struct {
3232 // WithdrawPlatformPublicKeyPEM 平台 RSA 公钥 PEM(用于回调验签,可选).
3333 WithdrawPlatformPublicKeyPEM string
3434
35+ // APIKey 商户 API Key(MPK 商户密钥的 key 部分);account 与 vcard 命名空间共用.
36+ // 双密钥读场景作为 X-API-Key,HMAC 签名写场景作为 X-Key-ID.
37+ APIKey string
38+ // APISecret 商户 API Secret(MPK 商户密钥的 secret 部分);account 与 vcard 命名空间共用.
39+ // 双密钥读场景作为 X-Secret-Key,HMAC 签名写场景作为 HMAC-SHA256 的密钥.
40+ APISecret string
41+
3542 // Timeout HTTP 超时,默认 30s.
3643 Timeout time.Duration
3744
@@ -47,6 +54,8 @@ type Config struct {
4754// c.Exchange - 汇率
4855// c.Energy - TRON 能量租赁
4956// c.SMTP - SMTP 聚合
57+ // c.Account - 账户(余额 / 充值地址)
58+ // c.VCard - 虚拟信用卡
5059//
5160// 所有方法返回 json.RawMessage,业务方自行 json.Unmarshal 到具体 struct.
5261type Client struct {
@@ -63,6 +72,10 @@ type Client struct {
6372 SMTP * SMTPNamespace
6473 // Withdraw 提币命名空间(多链收款业务的资金出库端,RSA-2048 签名)
6574 Withdraw * WithdrawNamespace
75+ // Account 账户命名空间(余额 / 充值地址,双密钥读)
76+ Account * AccountNamespace
77+ // VCard 虚拟信用卡命名空间(读用双密钥,开卡/充值/注销/敏感信息用 HMAC 签名)
78+ VCard * VCardNamespace
6679}
6780
6881// NewClient creates a new NexCore client.
@@ -94,5 +107,7 @@ func NewClient(cfg Config) *Client {
94107 c .Energy = & EnergyNamespace {c : c }
95108 c .SMTP = & SMTPNamespace {c : c }
96109 c .Withdraw = & WithdrawNamespace {c : c }
110+ c .Account = & AccountNamespace {c : c }
111+ c .VCard = & VCardNamespace {c : c }
97112 return c
98113}
0 commit comments