-
Notifications
You must be signed in to change notification settings - Fork 2
/
shared-types.d.ts
64 lines (63 loc) · 2.13 KB
/
shared-types.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/**
* Expiration represents a point in time when some event happens. It can compare with a BlockInfo and will return is_expired() == true once the condition is hit (and for every block in the future)
*/
export type Expiration = ({
at_height: number
} | {
at_time: Timestamp
} | {
never: {
}
});
/**
* A point in time in nanosecond precision.
*
* This type can represent times from 1970-01-01T00:00:00Z to 2554-07-21T23:34:33Z.
*
* ## Examples
*
* ``` # use cosmwasm_std::Timestamp; let ts = Timestamp::from_nanos(1_000_000_202); assert_eq!(ts.nanos(), 1_000_000_202); assert_eq!(ts.seconds(), 1); assert_eq!(ts.subsec_nanos(), 202);
*
* let ts = ts.plus_seconds(2); assert_eq!(ts.nanos(), 3_000_000_202); assert_eq!(ts.seconds(), 3); assert_eq!(ts.subsec_nanos(), 202); ```
*/
export type Timestamp = Uint64;
/**
* A thin wrapper around u64 that is using strings for JSON encoding/decoding, such that the full u64 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.
*
* # Examples
*
* Use `from` to create instances of this and `u64` to get the value out:
*
* ``` # use cosmwasm_std::Uint64; let a = Uint64::from(42u64); assert_eq!(a.u64(), 42);
*
* let b = Uint64::from(70u32); assert_eq!(b.u64(), 70); ```
*/
export type Uint64 = string;
export interface OwnerOfResponse {
/**
* If set this address is approved to transfer/send the token as well
*/
approvals: Approval[];
/**
* Owner of the token
*/
owner: string;
}
export interface Approval {
/**
* When the Approval expires (maybe Expiration::never)
*/
expires: Expiration;
/**
* Account that can transfer/send the token
*/
spender: string;
}
/**
* An empty struct that serves as a placeholder in different places, such as contracts that don't set a custom message.
*
* It is designed to be expressable in correct JSON and JSON Schema but contains no meaningful data. Previously we used enums without cases, but those cannot represented as valid JSON Schema (https://github.com/CosmWasm/cosmwasm/issues/451)
*/
export interface Empty {
[k: string]: unknown;
}