Categorygithub.com/goodwood511/chain_pay_sdk
repository
0.0.0-20250106032526-3b6b1b43d59e
Repository: https://github.com/goodwood511/chain_pay_sdk.git
Documentation: pkg.go.dev

# Packages

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# README

Chain Pay SDK

dogpay

English | 简体中文

License: MIT

1. Welcome to use chain pay sdk

1.1. Prepare

The unique identifier verifies the partner's identity. Different partners configure different parameters. New partners can contact the platform.

Production environment management platform:

https://admin.dogpay.ai/#/login

Sandbox environment management platform:

https://sandbox-admin.privatex.io/

Get API key:

system-apikey

(Figure 1-1-1)

  1. Create a private key and commit.
openssl genrsa -out rsa_private_key.pem 2048
  1. Create a public key from a private key
openssl rsa -in rsa_private_key.pem -out rsa_public_key.pem -pubout

Remove the comments at the head and tail of the generated public key, turn it into a line of string, and submit it to the platform.

Interface sandbox environment docking, joint debugging, and drills. The interface uses RSA2048 bit two-way signature verification to ensure communication credibility. Merchants need to give the public key to the platform in advance for the platform to verify the merchant's request parameters. Merchants need to obtain the platform public key in advance for the platform's response result verification.

Platform RSA Public Key:

system-apikey-plat-pub

(Figure 1-1-2)

Platform withdrawal risk control RSA public key:

system-apikey-risk-pub

(Figure 1-1-3)

Callback website need to enable IP whitelist:

system-whitelist

(Figure 1-1-4)

View transaction list:

(Figure 1-1-5)

transaction-list-en

Set callback website:

system-callback-en

(Figure 1-1-6)

2. User Management

2.1. Create user

  • Function: Create a new platform user, which requires passing the user's unique ID

HTTP Request

Production Environment API address: https://vapi.dogpay.ai/sdk/

Sandbox environment API address: https://sandbox-api.privatex.io/sdk/

POST : /user/create

Request Parameters

ParamterRequiredTypeDescription
OpenIdYstringIt is recommended to use a platform-wide prefix (such as HASH for partners) + user-unique number to form the user's unique OpenId

Example

curl --location 'https://sandbox-api.privatex.io/sdk/user/create' \
--header 'key: vratson2i5hjxgkd' \
--header 'sign: 0592dc64d480fb119d1e07ce06011db8' \
--header 'clientSign: xxxxxxxxxxxxxxxxx' \
--header 'Content-Type: application/json' \
--header 'timestamp: 1725076567682' \
--data '{
  "OpenId":"PT00001"
}'

Description of the fields in the request header:

key: For the partner's Key, please refer to (Figure 1-1-1)

sign: The generation rules aremd5( Secret + "Send data key=value, use & to connect in the middle" + Convert the current timestamp milliseconds into a string )

Example: md5("mysecret"+"OpenId=PT00001"+"1725076567682")

clientSign: The generation rule is rsaWithMd5("send data key=value, use & to connect in the middle")

timestamp: Convert the current timestamp milliseconds into a string

Return parameter description

ParamterTypeDescription
codeintGlobal status code
msgstringStatus description
data.OpenIdstringReturns the user's unique OpenId
signstringPlatform signature

Return data instance:

{
    "sign": "HCL5RTmVsBJBQd8caxUjlATQJbnL/P4rtCdqta2g3ISFR/G4J/MRT3755UmmEbn08s4rlcx/j+MBjo6EesQL9akLG0rAeVfJNpg3InFb1UJOYgEZ+cTYpfnCIIOhOohaCQO9NTABRp89kt+Qnsfq4WuoobOsvLzwSOHq7vQvODrihiRItF+EhIM+TFRbONOyv9nk4Ft85BFF9wwANa0g8m2rAdL8msIpS/ywnvyEx3VSJpASlQo23hhQhxYvnTaHeHzL7cHAz8Zasmm7MTR6Ww+boRwO8X2hLPukaejM46Fx6+uXLWWeN8tQrwiwnLY5XHyjiG0QWFAzhNoasRkjlg==",
    "timestamp": "1725431229743",
    "data": {
        "OpenId": "PT00001"
    },
    "msg": "ok",
    "code": 1
}

2.2. Create wallet

  • Function: Create a wallet account for the user corresponding to this blockchain network
  • Precondition: The user with the specified OpenId has been created successfully

HTTP Request

Production Environment API address: https://vapi.dogpay.ai/sdk/

Sandbox environment API address: https://sandbox-api.privatex.io/sdk/

POST : /wallet/create

Request Parameters

ParamterRequiredTypeDescription
ChainIDYstringPublic chain ID
OpenIdYstringUser's unique OpenId

key: parnter Key

sign: The generation rules aremd5( Secret + "Send data key=value, use & to connect in the middle" + The current timestamp in milliseconds is converted into a string )

example: md5("mysecret"+"ChainId=1&OpenId=PT00001"+"1725076567682")

timestamp: The current timestamp in milliseconds is converted into a string chain ID

TokenFull nameBlockchain browser addressChain ID unique identifier
ethethhttps://etherscan.io1
trxTronhttps://tronscan.io2
btcbtchttps://blockchair.com/bitcoin3
solsolanahttps://explorer.solana.com4
xrpxrphttps://xrpscan.com5
eth_optimismoptimismhttps://optimistic.etherscan.io10
bnbbnbhttps://bscscan.com56
matic_polygonMATIC polygon chainhttps://polygonscan.com137
TONToncoinhttps://tonscan.org/15186

Example

curl --location 'https://sandbox-api.privatex.io/sdk/user/create' \
--header 'key: vratson2i5hjxgkd' \
--header 'sign: 0592dc64d480fb119d1e07ce06011db8' \
--header 'clientSign: xxxxxxxxxxxxxxxxx' \
--header 'Content-Type: application/json' \
--header 'timestamp: 1725076567682' \
--data '{
  "OpenId":"PT00001",
  "ChainID":"1"
}'

Return parameter description

ParamterTypeDescription
codeintGlobal status code
msgstringStatus description
data.addressstringWallet address
data.UserIdstringUser ID
data.ChainIDstringPublic chain ID
data.OpenIdstringUser's unique OpenId
signstringPlatform signature

Example

{
    "sign": "i24t857ix3027CPiuQ+getyC7u3pJHcL/m5NiPUQwmv5XkOEdrDnckoblGXIbdO2hgjpJDg47Lbq/YoKu+NiJHGJTwu10CAYDRzyiimBfLsP9yNdnFxJLTUEfOKPSXupJdceMZL8WXF4XkMpwHCrUqhekyM+aVLDHsfROKf3uP+zdjJ++9Z//3Xukg57OBvspYGPqpgIY5fOmALiXs3DgZTdXRYYN6MBRUR3NEd1lb4dSO1AjAGkahhIjGqwaeqSO6YAcfwoj9Be48QS9CurfVxZ9xM8FvbPzPsa2W8kHG7q+Cji4NTk243LJyrQ9QFRpTDUTo5JNrJ1vne/2js8kg==",
    "timestamp": "1725432397796",
    "data": {
        "address": "TUUYqqUsXA2iwfxhiYNfRTKTW3zXFwK3Xx",
        "UserId": 26178,
        "PartnerId": 87,
        "ChainID": 2,
        "OpenId": "PT00001"
    },
    "msg": "ok",
    "code": 1
}

3. Withdrawl

3.1. Partner User Withdrawal

  • Function: Provide an operation interface for partner users to withdraw funds. It is necessary to withdraw funds from the partner's corresponding Token withdrawal fund pool account to the withdrawal wallet address set by the user. For partners, a safe callback address can be set to verify the legality of the withdrawal. If the verification is legal, directly operate the merchant fund pool wallet to complete the withdrawal.
  • The withdrawal transaction interface will check whether the default withdrawal hot wallet has sufficient wallet fees and withdrawal assets;
  • The withdrawal interface will use the security verification code as the unique parameter requirement for withdrawal transactions by default. It is recommended to use the unique withdrawal order number of the business platform as the security code. Repeated security verification code submission will return an error code;
  • All withdrawal transaction requests will match the risk control review rules configured on the channel platform. If the parameter request is legal, the transaction request will be received. Transactions that meet the automatic review rules will be submitted to the network immediately, and the Hash information of the submitted transaction will be returned (return field data); for withdrawal transaction requests that need to be reviewed twice in the channel, (code=2) will be returned. There is no need to submit the withdrawal request again. The administrator needs to complete the second review on the channel platform. After the second review is completed, the transaction order will call back to notify the status change of the withdrawal transaction request.
  • Precondition: The fund pool of the corresponding currency has an amount exceeding the withdrawal limit (pay special attention to ETH network Token withdrawal, which requires the fund pool wallet to have a certain ETH handling fee balance)
  • ⚠️ Note: **For the withdrawal operation of initiating a blockchain, it is necessary to ensure that the pre-review process is completed before calling the interface. Once a blockchain transaction is initiated, it cannot be revoked or returned. **

HTTP Request

Production Environment API address: https://vapi.dogpay.ai/sdk/

Sandbox environment API address: https://sandbox-api.privatex.io/sdk/

POST : /partner/UserWithdrawByOpenID

Request Parameters

ParamterRequiredTypeDescription
OpenIdYstringUser's unique OpenId
TokenIdYstringTokenId
AmountYfloatThe amount of currency the user withdraws, accurate to 2 decimal places
AddressToYstringDestination wallet for withdrawal
CallBackUrlNstringCallback to notify the user of the withdrawal progress, optional, using the partner's default callback url
SafeCheckCodeNstringThe security verification code for user withdrawal transactions is generally the unique withdrawal order number of the business platform. The order number is required to be globally unique. Users request withdrawals multiple times and require different order number parameters. The withdrawal transaction callback information will return the information in this field through the field 'safecode'. The business platform can uniquely associate the withdrawal request based on the order number.

key: Partner Key

sign: The generation rules aremd5( Secret + "Send data key=value, use & to connect in the middle" + "Convert the current timestamp milliseconds into a string" )

example: md5("mysecret"+"AddressTo=TQdL5yttJPTx7hJmBhGfo2LcE7AXLPtHSg&Amount=0.02&CallBackUrl=..."+"1725076567682")

timestamp: Convert the current timestamp milliseconds into a string Token

TokenIDValueDescription
1ETH-ETHETH Network ETH
2ETH-USDTETH Network USDT
3TRON-TRXTRON Network TRX
4TRON-USDTTRON Network token:USDT
5BNB-BNBBNB Smart Chain Network BNB
6BNB-USDTBNB Smart Chain Network token:USDT
11Polygon-MATICPolygon Network Matic
12Polygon-USDTPolygon Network token:USDT
13Polygon-USDCPolygon Network token:USDC
22BNB-USDCBNB Smart Chain Network token:USDC
23BNB-DAIBNB Smart Chain Network token:DAI
24ETH-USDCETH Network USDC
25ETH-DAIETH Network DAI
130Optimism-ETHOptimism Network ETH
131Optimism-WLDOptimism Network token:WLD
132Optimism-USDTOptimism Network token:USDT
100BTC-BTCBTC Network BTC Main chain currency
200TON-TONTON Network TON Main chain currency

Example

curl --location 'https://sandbox-api.privatex.io/sdk/partner/UserWithdrawByOpenID' \
--header 'key: vratson2i5hjxgkd' \
--header 'sign: 0592dc64d480fb119d1e07ce06011db8' \
--header 'clientSign: xxxxxxxxxxxxxxxxx' \
--header 'Content-Type: application/json' \
--header 'timestamp: 1725076567682' \
--data '{
  "OpenId": "PT00001",
  "TokenId": "4",
  "Amount": "0.02",
  "AddressTo": "TQdL5yttJPTx7hJmBhGfo2LcE7AXLPtHSg",
  "CallBackUrl": "http://xxxxxx/withdraw_callback",
  "SafeCheckCode": "1000000000000000"
}'

Return parameter description

ParamterTypeDescription
codeintStatus code
0 Parameter error, or duplicate order number, or incorrect withdrawal address format, or insufficient handling fee in the withdrawal wallet. msg can be used to view detailed information;
1 The withdrawal transaction is successfully submitted and has been submitted to the blockchain network. The data contains the unique hash of the submitted transaction;
2 The withdrawal transaction is successfully submitted. The transaction can only be completed after the channel has reviewed it twice. After the review is completed, the transaction information will be updated through callback;
-1 The withdrawal transaction failed. You can resubmit the withdrawal request;
⛑️**Special reminder: For the withdrawal transaction callback information received by the business platform, if status=-1, ignore it directly; after the administrator logs in to the management backend and resubmits the transaction, a new status notification will be pushed synchronously. **
msgstringStatus description
datastringTransaction hash
signstringPlatform signature

Example:

curl --location 'https://sandbox-api.privatex.io/sdk/partner/UserWithdrawByOpenID' \
--header 'key: vratson2i5hjxgkd' \
--header 'sign: 0592dc64d480fb119d1e07ce06011db8' \
--header 'clientSign: xxxxxxxxxxxxxxxxx' \
--header 'Content-Type: application/json' \
--header 'timestamp: 1725076567682' \
--data '{
  "OpenId":"PT00001",
  "AddressTo":"TPoNrj1a9LCPYHUN88LnGQxG11XoFUNcw3",
  "SafeCheckCode":"1000000000000000",
  "TokenId":"4",
  "Amount":"0.0105"
}'

3.2. Query user deposit and withdrawal records

  • Function: Provide partners with a data interface to query user recharge/withdrawal records, supporting paging query data
  • Prerequisites: None

HTTP Request

Production Environment API address: https://vapi.dogpay.ai/sdk/

Sandbox environment API address: https://sandbox-api.privatex.io/sdk/

POST : /wallet/GetPayChargeRecords

Request Parameters

ParamterRequiredTypeDescription
OpenIdYstringOpenId
TopStartYintThe starting serial number of the current record, the number of client-defined pages and the calculation of the starting and ending serial numbers
TopEndYintThe ending serial number of the current record
PayTypeYintFilter type, 0 means no filtering, 1 means only querying withdrawal records; 2 means only querying recharge records
hashCodeNstringCan be empty, specify Hash to query transaction records
safeCodeNstringCan be empty, specify safeCode, generally withdrawals can query the withdrawal record status through the unique withdrawal security verification code

Return parameter description

ParamterTypeDescription
codeintstatus
msgstringstatus description
data.userPayChargeRecords[]object[]Deposit and withdrawal transaction data collection
data.userPayChargeRecords.OpenIDstringOpenId
data.userPayChargeRecords.PayOrChargeint1 recharge, 2 withdrawal
data.userPayChargeRecords.FromAddressstringfrom address
data.userPayChargeRecords.ToAddressstringto address
data.userPayChargeRecords.HashCodestringBlockchain transactions Hash
data.userPayChargeRecords.SafeCodestringsafeCode
data.userPayChargeRecords.AmountfloatAmount: accurate to 2 decimal places
data.userPayChargeRecords.StatusintTransaction status,
1 successfully completed,
2 waiting for review,
3 waiting for block transaction confirmation
-1 means transaction failed (business platform needs to roll back user assets)
-2 means review rejected or transaction canceled (business platform needs to roll back user assets)
data.userPayChargeRecords.NoticeTimesintBlock confirmation times
data.userPayChargeRecords.NoticeUrlstringCallback address
data.userPayChargeRecords.NoticeResponestringCallback feedback
data.userPayChargeRecords.CreateTimestringCreation time
data.TotalCountintTotal number of transactions, providing paging query data
signstringPlatform Signature

3.3. Second review of withdrawal order

  • Function: Merchant withdrawal order risk control secondary review interface.
  • ⚠️ Note: The platform assigns a separate risk control public key to merchants (different from the deposit/withdrawal public key)

HTTP Request

Production Environment API address: https://vapi.dogpay.ai/sdk/

Sandbox environment API address: https://sandbox-api.privatex.io/sdk/

POST : /withdrawal/order/check

Request Parameters

ParamterRequiredTypeDescription
dataNobjectAs follows
data.order_idYstringMerchant-side transaction unique ID (trade_id when withdrawing)
data.user_idYstringUser to whom the order belongs
data.coin_symbolYstringCurrency name in lowercase, subject to the currency provided by the platform
data.addressYstringWithdrawal address
data.amountYdecimal(20,8)Withdrawal amount
data.timestampYintCurrent timestamp

Return parameter description

ParamterTypeDescription
statusint200 means success
msgstringStatus description
dataobjectData object
data.status_codeint200 means success
data.timestampintTimestamp
data.order_idintTransaction number
signstringPlatform signature

Token transfer callback notification

  1. Deposit and withdrawal transactions will be notified repeatedly, and the transaction information and status of the last callback notification will prevail;
  2. The business end is required to return valid callback information. The format refers to the return parameter description. The business end needs to return code=0 to indicate that the callback message has been processed and no further notification is required. Otherwise, the callback will continue to notify (initial 50 times every 2 seconds, and then every 10 minutes) until the message confirmation with code=0 is returned;

Set the callback URL through the management backend, refer to the figure (Figure 1-1-6).

POST

  • Function: Define the format of the callback message that the platform sends to the application for receiving Token transfer notifications, which is suitable for the application to handle event notification messages for Token transaction status (withdrawal or recharge). The application can design optional callback notification interface functions based on the application functions.

Request Parameters

ParamterRequiredTypeDescription
openidYstringChannel user unique id
totalvalueYstringThe amount of USDT value corresponding to the deposit or withdrawal transaction (calculated based on the market price at the time of the transaction)
statusYintTransaction status:
1 The transaction is completed and has been successfully submitted to the blockchain network. The transaction details on the chain can be queried through Hash;
-1 The transaction has been submitted to the blockchain network. The transaction on the chain failed. You can go to Merchant Management-->Transaction Management-->Re-examine [Submit Order Security Code]. The business platform does not need to process the status change and just wait for the channel to callback the new status notification;
-2 The withdrawal transaction application was rejected by the merchant backend and the withdrawal application has expired. It is recommended that the business platform return the user's withdrawal application after receiving the notification;
2 The withdrawal transaction has been submitted to the merchant management. Since the configured currency security risk control requirements have been triggered, the administrator needs to further log in to the merchant management-->Transaction Management-->Withdrawal Review to complete the withdrawal application processing;
3 The withdrawal transaction blockchain transaction is being processed. The business platform does not need to update the status change and just wait for the channel to callback the new status notification;
typeYint1 indicates a deposit transaction; 2 indicates a withdrawal transaction
hashYstringHash
confirmYintThe number of confirmations of the transaction completed on the chain
createdtimeYstringcreate time
fromYstringTransaction from address
toYstringTransaction to address
amountYstringNumber of transactions
chainidYstringchain Id id
tokenidYstringtokenid
tokenaddressYstringtoken contract address
safecodeYstringValid for withdrawal orders, usually the unique number of the withdrawal order orderid
timestampYstringTransaction timestamp
tagNstringoptional just for XRP,EOS
signYstringPlatform signature data The recipient can use the platform public key to verify the reliability of the data returned by the platform. It is strongly recommended that the recipient verify the validity of the signature

Example

{
    "amount": "23.000000000000000000",
    "chainid": "2",
    "confirm": "1",
    "createdtime": "1732105978000",
    "from": "TPQmWeYVUmW4ZP",
    "hash": "b180f4184be91e12124b01089",
    "openid": "xxxxxx",
    "safecode": "",
    "sign":"",
    "status": "1",
    "timestamp": "1732105988040",
    "to": "TWLd7av6Lumoz9XAUkS8mPG7R51UstVLux",
    "tokenaddress": "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t",
    "tokenid": "4",
    "totalvalue": "23.00000000",
    "type": "1"
}

4.1. Second review of withdrawal order

  • Function: Merchant withdrawal order risk control secondary review interface
  • ⚠️ Note: The platform assigns a separate risk control RSA public key to the merchant (different from the recharge/withdrawal callback notification public key)
  • Triggering time: After the administrator configures the risk control callback URL parameter on the merchant side (system settings), the channel will add an additional risk control callback secondary review to each withdrawal transaction interface request initiated. Only when the merchant-side risk control URL returns the correct verification pass code can the transaction be effectively submitted.

HTTP Request

POST : /withdrawal/order/check

Request Parameters

ParamterRequiredTypeDescription
safeCodeNstringThe merchant submits a unique transaction ID, which generally corresponds to the merchant withdrawal order ID (SafeCheckCode of the withdrawal transaction)
openIdYstringUser ID of the merchant submitting the withdrawal transaction
tokenIdYstringCurrency ID, subject to the currency ID provided by the platform
toAddressYstringWithdrawal address
amountYstringWithdrawal amount
timestampYintCurrent timestamp
signYstringSignature, only the parameters in data are signed; the platform's risk control RSA public key is required to verify the correctness of the signature

Return parameter description

ParamterTypeDescription
codeintVerify the inspection result, 0 means the inspection passed; other codes are invalid
timestampintCurrent timestamp, in seconds
messagestringReturn message
signstringSignature - Sign the data field in the response parameter using the merchant's RSA private key

5.2. Public Information

The following information is common to all interfaces and will not be repeated for each interface.

5.2.1. Production Environment

API address: https://vapi.dogpay.ai/sdk/

5.2.2. Sandbox environment

API address: https://sandbox-api.privatex.io/sdk/

5.2.3. Request public parameters

Request header definition

Parameter NameConstraintExampleDescription
keylength:64ithujj3onrzbgw5tPartner key
timestamplength:321722586649000Timestamp of the request (in milliseconds)
signlength:329e0ccfe3915e94bcc5bf7dd51ad4e8d9Partner secret signature
clientSignlength:5124bcc5bf7dd51ad4e8d9 ...Partner RSA signature
  • sign field rules
  1. Register partners, get Key and Secret

  2. Parse the JSON Body of the request, sort the keys in JSON from small to large according to ASCII, and concatenate the string dataStr=key1=value1&key2=value2&key3=value3&...

  3. Generate timestamp (unit: milliseconds)

  4. Encrypt to generate sign:

Plain text before encryption: strToHash = Secret+dataStr+timestamp

Perform MD5 encryption on the above plain text strToHash to generate sign

  1. Put key, timestamp, sign in http head

clientSign

Detailed explanation of signature algorithm

  1. Get request parameters and format them to obtain a new parameter formatted string:

  2. Sign the first step data with RSA private key and save the signature result to a variable:

Generate signature string, for the following parameter array: user_id = 1 coin = eth address = 0x038B8E7406dED2Be112B6c7E4681Df5316957cad amount = 10.001 trade_id = 20220131012030274786

Sort each key in the array from a to z. If you encounter the same first letter, look at the second letter, and so on. After the sorting is completed, connect all array values ​​with the "&" character, such as $dataString:

address=0x038B8E7406dED2Be112B6c7E4681Df5316957cad&amount=10.001&coin=eth&trade_id=20220131012030274786&user_id=1

This string is the concatenated string.

Use the private key to sign the data with RSA-md5.

1.3.4. Public Information Notice

NameTypeExampleDescription
Global status codeinteger11 means success, see Global Status Code for details
InformationstringokReturns information in text format
Datajson{"OpenID":"HEX..."}Returns specific data content
TimetimeStamp1722587274000UTC time is unified time without time zone, in milliseconds
Signaturesign9e0ccfe3915e94bcc5bfbBsC5EUxV6 ...The platform uses RSA to sign all data

6. Install

go get github.com/goodwood511/chain_pay_sdk

Note: You need to run Go 1.18+ to compile;

7. Business flow

7.1. Recharge flow

pay-service-flow

7.2. withdraw flow

pay-service-withdraw-flow

8. SDK

8.1. Configuration required

  1. Register a business name to obtain ApiKey and ApiSecret;
  2. Generate your own RSA password pair;
  3. Prepare the platform's RSA public key;

8.2. Creating a Signature Object

  1. Add a configuration file config.yaml.
ApiKey: ""
ApiSecret: ""
PlatformPubKey: ""
RsaPrivateKey: ""
  1. Load the configuration file and create the API object.

	viper.SetConfigFile("config.yaml")
	viper.AddConfigPath(".")
	if err := viper.ReadInConfig(); err != nil {
		panic(fmt.Sprintf("Failed to load config: %s", err))
	}
	apiObj := api.NewSDK(api.SDKConfig{
		ApiKey:             viper.GetString("ApiKey"),
		ApiSecret:          viper.GetString("ApiSecret"),
		PlatformPubKey:     viper.GetString("PlatformPubKey"),
		PlatformRiskPubKey: viper.GetString("PlatformRiskPubKey"),
		RsaPrivateKey:      viper.GetString("RsaPrivateKey"),
	})

8.3. Create request data and sign it

Let's take creating a user as an example.


  // ....
	openId := "PT00001"

	reqBody, timestamp, sign, clientSign, err := apiObj.CreateUser(openId)
	if err != nil {
		logrus.Warnln("Error: ", err)
		return
	}

8.4. Fill Request Initiate Request

  // ....
	
	finalURL, err := url.JoinPath(api.DevNetEndpoint, api.PathCreateWallet)
	if err != nil {
		logrus.Warnln("Error: ", err)
		return
	}

	resp, err := client.R().
		SetHeader("Content-Type", "application/json").
		SetBody(reqBody).
		SetHeader("key", apiObj.GetApiKey()).
		SetHeader("timestamp", timestamp).
		SetHeader("sign", sign).
		SetHeader("clientSign", clientSign).
		Post(finalURL)

8.5. Verify parsing return data


	rspCommon := response_define.ResponseCommon{}
	err = json.Unmarshal(body, &rspCommon)
	if err != nil {
		logrus.Warnln("Error: ", err)
		return
	}
	logrus.Infoln("Response: ", rspCommon)

	if rspCommon.Code != response_define.SUCCESS {
		logrus.Warnln("Response fail Code", rspCommon.Code, "Msg", rspCommon.Msg)
		return
	}

	rspCreateUser := response_define.ResponseCreateUser{}
	err = json.Unmarshal(body, &rspCreateUser)
	if err != nil {
		logrus.Warnln("Error: ", err)
		return
	}
	logrus.Infoln("ResponseCreateUser: ", rspCreateUser)

	mapObj := rsa_utils.ToStringMap(body)
	err = apiObj.VerifyRSAsignature(mapObj, rspCreateUser.Sign)
	if err != nil {
		logrus.Warnln("Error: ", err)
		return
	}

9. Global status code

🔔Interface return value status code meaning list

Status codeMeaningRemark
1success
10701Failed to create user: This user already exists

10. Token

TokenIDValueDescription
1ETH-ETHETH Network ETH
2ETH-USDTETH Network USDT
3TRON-TRXTRON Network TRX
4TRON-USDTTRON Network token:USDT
5BNB-BNBBNB Smart Chain Network BNB
6BNB-USDTBNB Smart Chain Network token:USDT
11Polygon-MATICPolygon Network Matic
12Polygon-USDTPolygon Network token:USDT
13Polygon-USDCPolygon Network token:USDC
22BNB-USDCBNB Smart Chain Network token:USDC
23BNB-DAIBNB Smart Chain Network token:DAI
24ETH-USDCETH Network USDC
25ETH-DAIETH Network DAI
130Optimism-ETHOptimism Network ETH
131Optimism-WLDOptimism Network token:WLD
132Optimism-USDTOptimism Network token:USDT
100BTC-BTCBTC Network BTC Main chain currency
200TON-TONTON Network TON Main chain currency

11. chain ID

TokenFull nameBlockchain browser addressChain ID unique identifier
ethethhttps://etherscan.io1
trxTronhttps://tronscan.io2
btcbtchttps://blockchair.com/bitcoin3
solsolanahttps://explorer.solana.com4
xrpxrphttps://xrpscan.com5
eth_optimismoptimismhttps://optimistic.etherscan.io10
bnbbnbhttps://bscscan.com56
matic_polygonMATIC polygon chainhttps://polygonscan.com137
TONToncoinhttps://tonscan.org/15186

12. token list

main networkchain_idtoken_idtoken_addresssymboldecimals
Ethereum120xdac17f958d2ee523a2206206994597c13d831ec7USDT6
11400x6982508145454Ce325dDbE47a25d4ec3d2311933PEPE18
11410xb131f4A55907B10d1F0A50d8ab8FA09EC342cd74MEME18
1640xEd04915c23f00A313a544955524EB7DBD823143dACH8
1250x6B175474E89094C44Da98b954EedeAC495271d0FDAI18
1240xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48USDC6
11420x163f8C2467924be0ae7B5347228CABF260318753WLD18
11ETH18
Tron240THb4CqiFdwNHsWsQCs4JhzwjMWys4aqCbFETH18
290TPYmHEhy5n8TCEfYGqW2rPxsghSfzghPDnUSDD18
226TEkxiTehnzSmSe2XqrBj4w32RUN966rdz8USDC6
233TSkW873XMKiDCxGZrA4YH8KGeipLdC6GyuCVNT18
23TRXTRX6
24TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6tUSDT6
Bitcoin3100BTCBTC8
3102SATSSATS18
3103RATSRATS18
3101ORDIORDI18
Solana4400Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYBUSDT6
4401EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1vUSDC6
419SOLSOL9
4410nQ1qgSpXWi71twnWPFjyfCtcbUXbVyQb64RfHKwRpKEDAOT9
XRP5200XRPXRP6
DogeCoin9300DOGEDOGE8
Optimistic101310xdC6fF44d5d932Cbd77B52E5612Ba0529DC6226F1WLD18
10130ETHETH18
101330x0b2C639c533813f4Aa9D7837CAf62653d097Ff85USDC6
101320x94b008aA00579c1307B0EF2c499aD98a8ce58e58USDT6
Bnb Smart Chain56620xc0be866ecc026957fc7160c1a45f2bee9870fd46ARK18
565610xbA2aE424d960c26247Dd6c32edC70B295c744C43DOGE8
56680x6FDcdfef7c496407cCb0cEC90f9C5Aaa1Cc8D888VET18
56630x8540f3D726Aed340Bc57Fd07a61b0ae2a9d5ECa9PUC18
56650xbc7d6b50616989655afd682fb42743507003056dACH8
56660xFE8bF5B8F5e4eb5f9BC2be16303f7dAB8CF56aA8BIBI18
56290xe9e7CEA3DedcA5984780Bafc599bD69ADd087D56BUSD18
56310x7130d2A12B9BCbFAe4f2634d864A1Ee1Ce3Ead9cBTCB18
56300x2170Ed0880ac9A755fd29B2688956BD959F933F8ETH18
5660x55d398326f99059ff775485246999027b3197955USDT18
56230x1AF3F329e8BE154074D8769D1FFa4eE058B1DBc3DAI18
56220x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580dUSDC18
565BNBBNB18
Polygon137120xc2132D05D31c914a87C6611C10748AEb04B58e8FUSDT6
137130x2791Bca1f2de4661ED88A30C99A7a9449Aa84174USDC6
13711POLMATIC18
1371100x3c499c542cEF5E3811e1192ce70d8cC03d5c3359USDC6
CVN Chain20327CVNCVN18
2032350x109B57A29eE6E9A93f33687F6CE553fB18D8EE78USDT6
2032510x6b94b0a2878c68811c1bd6cecc2b7cc44a9ed7abHPT8
Merlin4200500BTCBTC18
42005010x5c46bFF4B38dc1EAE09C5BAc65872a1D8bc87378MERL18
Base84538010x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913USDC6
8453802ETHETH18
TON2010:105e5589bc66db15f13c177a12f2cf3b94881da2f4b8e7922c58569176625eb5JETTON9
151862020:b113a994b5024a16719f69139328eb759596c38a25f59028b146fecdc3621dfeUSDT6
15186200TONTON9
Arbitrum One421611220xaf88d065e77c8cC2239327C5EDb3A432268e5831USDC6
421611210xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9USDT6
42161120ETHETH18
421611230x9fE175843Df9deCd99C78E72b2424C47D61Ad2bFATM18
421611240x58BDf739aE17d1C60C6FD3433E288E38B81C2853SAM18
Avax Chain C43114180xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6EUSDC6
43114170xc7198437980c041c805A1EDcbA50c1Ce5db95118USDT6
4311416AVAXAVAX18
NA Chain65143600NACNAC9
65143601GATGAT9
ODIN66666680ODINODIN18
THOR86886881THORTHOR18