mirror of
https://github.com/luxfi/sdk.git
synced 2026-10-30 15:19:23 +00:00
20 lines
452 B
Go
20 lines
452 B
Go
// Copyright (C) 2019-2025, Lux Industries, Inc. All rights reserved.
|
|
// See the file LICENSE for licensing terms.
|
|
|
|
package contract
|
|
|
|
import (
|
|
"context"
|
|
"time"
|
|
|
|
"github.com/luxfi/constants"
|
|
)
|
|
|
|
func apiContext(timeout time.Duration) (context.Context, context.CancelFunc) {
|
|
return context.WithTimeout(context.Background(), timeout)
|
|
}
|
|
|
|
func apiRequestContext() (context.Context, context.CancelFunc) {
|
|
return apiContext(constants.APIRequestTimeout)
|
|
}
|