Task #12075
closedEarn Alliance Register kampan
100%
Description
Documentation
https://docs.google.com/document/d/1DRugdiiHMwcQSt4Z9AvDXZ1nep9rjWY3_2dP1Cn2SAA/edit
Credentials
export const EARN_ALLIANCE_SETTINGS = {
clientId: '46a72344-dc3d-42b9-8372-498666caadb9',
clientSecret: 'e9hnAaN520e2VbHCN9gUvckXZJntNvq6',
gameId: 'b2a0d439-414a-4f2d-aa2d-c2eb8fac56ea',
};
JS Example
private callCustomEvent(event: string) {
const requestBody: EACustomEventRequestBody = {
gameId: EARN_ALLIANCE_SETTINGS.gameId,
event: event,
address: this.walletAddres.value(),
time: new Date().toISOString(),
};
const headers = new HttpHeaders({
'x-client-id': EARN_ALLIANCE_SETTINGS.clientId,
'x-timestapm': String(new Date().getMilliseconds()),
'x-signature': this.generateSignature(requestBody),
});
return this.request.post(
`${this.endpoint}${CUSTOM_EVENT_API}`,
requestBody,
{ headers }
);
}
private generateSignature(body) {
const ts = Date.now();
const message = `${EARN_ALLIANCE_SETTINGS.clientId}${ts}${JSON.stringify(
body
)}`;
return HmacSHA256(message, EARN_ALLIANCE_SETTINGS.clientSecret).toString();
}
Updated by Michal Hornak almost 2 years ago
Michal Hornak wrote:
https://docs.google.com/document/d/1DRugdiiHMwcQSt4Z9AvDXZ1nep9rjWY3_2dP1Cn2SAA/edit
`
export const EARN_ALLIANCE_SETTINGS = {
clientId: '46a72344-dc3d-42b9-8372-498666caadb9',
clientSecret: 'e9hnAaN520e2VbHCN9gUvckXZJntNvq6',
gameId: 'b2a0d439-414a-4f2d-aa2d-c2eb8fac56ea',
};private callCustomEvent(event: string) {
const requestBody: EACustomEventRequestBody = {
gameId: EARN_ALLIANCE_SETTINGS.gameId,
event: event,
address: this.walletAddres.value(),
time: new Date().toISOString(),
};const headers = new HttpHeaders({ 'x-client-id': EARN_ALLIANCE_SETTINGS.clientId, 'x-timestapm': String(new Date().getMilliseconds()), 'x-signature': this.generateSignature(requestBody), }); return this.request.post( `${this.endpoint}${CUSTOM_EVENT_API}`, requestBody, { headers } );
}
private generateSignature(body) {
const ts = Date.now();
const message =${EARN_ALLIANCE_SETTINGS.clientId}${ts}${JSON.stringify(
;
body
)}
return HmacSHA256(message, EARN_ALLIANCE_SETTINGS.clientSecret).toString();
}`
Updated by Michal Hornak almost 2 years ago
Michal Hornak wrote:
https://docs.google.com/document/d/1DRugdiiHMwcQSt4Z9AvDXZ1nep9rjWY3_2dP1Cn2SAA/edit
export const EARN_ALLIANCE_SETTINGS = {
clientId: '46a72344-dc3d-42b9-8372-498666caadb9',
clientSecret: 'e9hnAaN520e2VbHCN9gUvckXZJntNvq6',
gameId: 'b2a0d439-414a-4f2d-aa2d-c2eb8fac56ea',
};private callCustomEvent(event: string) {
const requestBody: EACustomEventRequestBody = {
gameId: EARN_ALLIANCE_SETTINGS.gameId,
event: event,
address: this.walletAddres.value(),
time: new Date().toISOString(),
};const headers = new HttpHeaders({ 'x-client-id': EARN_ALLIANCE_SETTINGS.clientId, 'x-timestapm': String(new Date().getMilliseconds()), 'x-signature': this.generateSignature(requestBody), }); return this.request.post( `${this.endpoint}${CUSTOM_EVENT_API}`, requestBody, { headers } );
}
private generateSignature(body) {
${EARN_ALLIANCE_SETTINGS.clientId}${ts}${JSON.stringify(
const ts = Date.now();
const message =
body
)};
return HmacSHA256(message, EARN_ALLIANCE_SETTINGS.clientSecret).toString();
}
Updated by Michal Hornak almost 2 years ago
Michal Hornak wrote:
https://docs.google.com/document/d/1DRugdiiHMwcQSt4Z9AvDXZ1nep9rjWY3_2dP1Cn2SAA/edit
export const EARN_ALLIANCE_SETTINGS = {
clientId: '46a72344-dc3d-42b9-8372-498666caadb9',
clientSecret: 'e9hnAaN520e2VbHCN9gUvckXZJntNvq6',
gameId: 'b2a0d439-414a-4f2d-aa2d-c2eb8fac56ea',
};private callCustomEvent(event: string) {
const requestBody: EACustomEventRequestBody = {
gameId: EARN_ALLIANCE_SETTINGS.gameId,
event: event,
address: this.walletAddres.value(),
time: new Date().toISOString(),
};const headers = new HttpHeaders({ 'x-client-id': EARN_ALLIANCE_SETTINGS.clientId, 'x-timestapm': String(new Date().getMilliseconds()), 'x-signature': this.generateSignature(requestBody), }); return this.request.post( `${this.endpoint}${CUSTOM_EVENT_API}`, requestBody, { headers } );
}
private generateSignature(body) {
const ts = Date.now();
const message =${EARN_ALLIANCE_SETTINGS.clientId}${ts}${JSON.stringify(
;
body
)}
return HmacSHA256(message, EARN_ALLIANCE_SETTINGS.clientSecret).toString();
}
Updated by Ondrej Grman almost 2 years ago
- Sprint set to #5 summer is here (Jul 03 - Jul 17)
- Description updated (diff)
- Category set to Backend
- Status changed from New to In Progress
- Target version set to V3 - integrated custody L10
Updated by Ondrej Grman almost 2 years ago
- Status changed from In Progress to Testing
- % Done changed from 90 to 100
Updated by Andrej Ondrejovic over 1 year ago
- Status changed from Testing to Done