Gateway: MarkRefRelation
Mark the transfer with your ref code after you submit on-chain transaction successfully.
post
https://cbridge-prod2.celer.app
/v2/partner/markRefRelation
Make a reference between transfer transaction with your ref code
// import getTransferConfig request message
import {
MarkRefRelationRequest
} from "../ts-proto/sgn/gateway/v1/gateway_pb";
// import grpc-web WebClient
import {
WebClient
} from "../ts-proto/sgn/gateway/v1/GatewayServiceClientPb";
const request = new MarkRefRelationRequest();
request.setTransferId(YOUR_TRANSFER_ID);
request.setRefId(YOUR_REF_CODE);
const client = new WebClient(`https://cbridge-prod2.celer.app`, null, null);
const response = await client.markRefRelation(request, null);
Name | Type | Description |
---|---|---|
transfer_id | String | Auto-generated transferId |
ref_id | String | Your reference code |
Since there are different types of transfer provided by cBridge, you should use corresponding transfer id generation logic, please refer following links.
The best practice for markRefRelation is notifying cBridge gateway after on-chain transaction has been submitted.
Since this request is notifying cBridge gateway one transfer is related to a ref code, normal response returns an empty body.