diff --git a/utils/apiutils/principal.go b/utils/apiutils/principal.go index 819cbcaa..c5e9a367 100644 --- a/utils/apiutils/principal.go +++ b/utils/apiutils/principal.go @@ -7,6 +7,7 @@ type contextKey int const ( contextKeyPrincipalAddressValue contextKey = 1 contextKeyBatchValue contextKey = 2 + contextKeyBotID contextKey = 3 ) func GetAddress(ctx context.Context) string { @@ -24,3 +25,11 @@ func GetBatch(ctx context.Context) string { func SetBatch(ctx context.Context, batch string) context.Context { return context.WithValue(ctx, contextKeyBatchValue, batch) } + +func GetBotID(ctx context.Context) string { + return ctx.Value(contextKeyBotID).(string) +} + +func SetBotID(ctx context.Context, addr string) context.Context { + return context.WithValue(ctx, contextKeyBotID, addr) +}