anchor.diff:      <<"creatorType">> => atom_to_binary(Type, utf8),
       <<"creatorId">> => utils:undefined_to_null(Id)
   }.
  +
  +
  +%% @private
  +-spec serialize_token(tokens:token()) -> tokens:serialized().
  +serialize_token(Token) ->
  +    {ok, Serialized} = tokens:serialize(Token),
  +    Serialized.
positive.code: translate_provider(#gri{type = od_provider, aspect = instance, scope = private}, {_Provider, RootToken}) ->
      % This covers provider creation via Graph Sync, in contrast to the get
      % request that does not return the root token
      {ok, Serialized} = tokens:serialize(RootToken),
      #{
          <<"providerRootToken">> => Serialized
      };
  translate_provider(GRI = #gri{id = Id, aspect = instance, scope = private}, Provider) ->
      #od_provider{
  
negative.code:         <<"caveats">> => [caveats:to_json(C) || C <- Caveats],
          <<"metadata">> => Metadata,
          <<"revoked">> => Revoked,
          <<"token">> => serialize_token(Token)
      }.
  
  
  