Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion internal/apiserver/route_post_token_mint.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ var postTokenMint = &oapispec.Route{
FilterFactory: nil,
Description: i18n.MsgTBD,
JSONInputValue: func() interface{} { return &fftypes.TokenTransferInput{} },
JSONInputMask: []string{"Type", "LocalID", "TokenIndex", "URI", "From", "ProtocolID", "MessageHash", "TX", "Created"},
JSONInputMask: []string{"Type", "LocalID", "URI", "From", "ProtocolID", "MessageHash", "TX", "Created"},
JSONOutputValue: func() interface{} { return &fftypes.TokenTransfer{} },
JSONOutputCodes: []int{http.StatusAccepted, http.StatusOK},
JSONHandler: func(r *oapispec.APIRequest) (output interface{}, err error) {
Expand Down
26 changes: 14 additions & 12 deletions internal/tokens/fftokens/fftokens.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,13 @@ type activatePool struct {
}

type mintTokens struct {
PoolID string `json:"poolId"`
To string `json:"to"`
Amount string `json:"amount"`
RequestID string `json:"requestId,omitempty"`
Operator string `json:"operator"`
Data string `json:"data,omitempty"`
PoolID string `json:"poolId"`
TokenIndex string `json:"tokenIndex,omitempty"`
To string `json:"to"`
Amount string `json:"amount"`
RequestID string `json:"requestId,omitempty"`
Operator string `json:"operator"`
Data string `json:"data,omitempty"`
}

type burnTokens struct {
Expand Down Expand Up @@ -428,12 +429,13 @@ func (ft *FFTokens) MintTokens(ctx context.Context, opID *fftypes.UUID, poolProt
})
res, err := ft.client.R().SetContext(ctx).
SetBody(&mintTokens{
PoolID: poolProtocolID,
To: mint.To,
Amount: mint.Amount.Int().String(),
RequestID: opID.String(),
Operator: mint.Key,
Data: string(data),
PoolID: poolProtocolID,
TokenIndex: mint.TokenIndex,
To: mint.To,
Amount: mint.Amount.Int().String(),
RequestID: opID.String(),
Operator: mint.Key,
Data: string(data),
}).
Post("/api/v1/mint")
if err != nil || !res.IsSuccess() {
Expand Down