-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from Bucket-Protocol/dev
[WIP] New query methods : getAllBuckets, getUserBottle
- Loading branch information
Showing
10 changed files
with
866 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
// Copyright (c) Mysten Labs, Inc. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
import { type CallArg } from "@mysten/sui.js/bcs"; | ||
import type { Infer } from "superstruct"; | ||
import { | ||
boolean, | ||
define, | ||
literal, | ||
nullable, | ||
object, | ||
record, | ||
string, | ||
union, | ||
} from "superstruct"; | ||
|
||
export const ObjectOwner = union([ | ||
object({ | ||
AddressOwner: string(), | ||
}), | ||
object({ | ||
ObjectOwner: string(), | ||
}), | ||
object({ | ||
Shared: object({ | ||
initial_shared_version: nullable(string()), | ||
}), | ||
}), | ||
literal("Immutable"), | ||
]); | ||
export type ObjectOwner = Infer<typeof ObjectOwner>; | ||
|
||
export type SuiJsonValue = | ||
| boolean | ||
| number | ||
| string | ||
| CallArg | ||
| Array<SuiJsonValue>; | ||
export const SuiJsonValue = define<SuiJsonValue>("SuiJsonValue", () => true); | ||
|
||
const ProtocolConfigValue = union([ | ||
object({ u32: string() }), | ||
object({ u64: string() }), | ||
object({ f64: string() }), | ||
]); | ||
type ProtocolConfigValue = Infer<typeof ProtocolConfigValue>; | ||
|
||
export const ProtocolConfig = object({ | ||
attributes: record(string(), nullable(ProtocolConfigValue)), | ||
featureFlags: record(string(), boolean()), | ||
maxSupportedProtocolVersion: string(), | ||
minSupportedProtocolVersion: string(), | ||
protocolVersion: string(), | ||
}); | ||
export type ProtocolConfig = Infer<typeof ProtocolConfig>; |
Oops, something went wrong.