Mark the transfer with your ref code after you submit on-chain transaction successfully.
Make a reference between transfer transaction with your ref code
// import getTransferConfig request message
} from "../ts-proto/sgn/gateway/v1/gateway_pb";
// import grpc-web WebClient
} from "../ts-proto/sgn/gateway/v1/GatewayServiceClientPb";
const request = new MarkRefRelationRequest();
const client = new WebClient(`https://cbridge-prod2.celer.app`, null, null);
const response = await client.markRefRelation(request, null);
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.