Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update the documentation to let users understand how to pass parameters of type Option<Move Type> via JSON #20210

Merged
merged 4 commits into from
Nov 11, 2024
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 docs/content/references/sui-api.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,5 @@ Additionally, Move supports u128 and u256 but JSON doesn't. As a result Sui allo
| Address | 32 byte hex string prefixed with 0x | "0xbc33e6e4818f9f2ef77d020b35c24be738213e64d9e58839ee7b4222029610de" | 0xbc33: string too short bc33e6e4818f9f2ef77d020b35c24be738213e64d9e58839ee7b4222029610de: missing 0x prefix 0xG2B1A39A1514E1D8A7CE45919CFEB4FEE70B4E01: invalid hex char G |
| ObjectID | 32 byte hex string prefixed with 0x | "0x1b879f00b03357c95a908b7fb568712f5be862c5cb0a5894f62d06e9098de6dc" | Similar to above |
| Identifier | Typically used for module and function names. Encoded as one of the following: A String whose first character is a letter and the remaining characters are letters, digits or underscore. A String whose first character is an underscore, and there is at least one further letter, digit or underscore | "function", "\_function", "some_name", "\_\_\_\_some_name", "Another" | "\_": missing trailing underscore, digit or letter, "8name": cannot start with digit, ".function": cannot start with period, " ": cannot be empty space, "func name": cannot have spaces |
| Vector`<Move Type>` | Homogeneous vector of aforementioned types including nested vectors of primitive types (only "flat" vectors of ObjectIDs are allowed) | [1,2,3,4]: simple U8 vector [[3,600],[],[0,7,4]]: nested U32 vector ["0x2B1A39A1514E1D8A7CE45919CFEB4FEE", "0x2B1A39A1514E1D8A7CE45919CFEB4FEF"]: ObjectID vector | [1,2,3,false]: not homogeneous JSON [1,2,null,4]: invalid elements [1,2,"7"]: although Sui allows encoding numbers as strings meaning this array can evaluate to [1,2,7], the array is still ambiguous so it fails the homogeneity check. |
| Vector`<Move Type>` / Option`<Move Type>` | Homogeneous vector of aforementioned types including nested vectors of primitive types (only "flat" vectors of ObjectIDs are allowed) | [1,2,3,4]: simple U8 vector [[3,600],[],[0,7,4]]: nested U32 vector ["0x2B1A39A1514E1D8A7CE45919CFEB4FEE", "0x2B1A39A1514E1D8A7CE45919CFEB4FEF"]: ObjectID vector | [1,2,3,false]: not homogeneous JSON [1,2,null,4]: invalid elements [1,2,"7"]: although Sui allows encoding numbers as strings meaning this array can evaluate to [1,2,7], the array is still ambiguous so it fails the homogeneity check. |
| Vector`<u8>` | For convenience, Sui allows: U8 vectors represented as UTF-8 (and ASCII) strings. | "√®ˆbo72 √∂†∆˚–œ∑π2ie": UTF-8 "abcdE738-2 \_=?": ASCII | |
2 changes: 1 addition & 1 deletion docs/content/references/sui-api/json-rpc-format.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,5 @@ Additionally, Move supports u128 and u256 but JSON doesn't. As a result Sui allo
| Address | 32 byte hex string prefixed with 0x | "0xbc33e6e4818f9f2ef77d020b35c24be738213e64d9e58839ee7b4222029610de" | 0xbc33: string too short bc33e6e4818f9f2ef77d020b35c24be738213e64d9e58839ee7b4222029610de: missing 0x prefix 0xG2B1A39A1514E1D8A7CE45919CFEB4FEE70B4E01: invalid hex char G |
| ObjectID | 32 byte hex string prefixed with 0x | "0x1b879f00b03357c95a908b7fb568712f5be862c5cb0a5894f62d06e9098de6dc" | Similar to above |
| Identifier | Typically used for module and function names. Encoded as one of the following: A String whose first character is a letter and the remaining characters are letters, digits or underscore. A String whose first character is an underscore, and there is at least one further letter, digit or underscore | "function", "\_function", "some_name", "\_\_\_\_some_name", "Another" | "\_": missing trailing underscore, digit or letter, "8name": cannot start with digit, ".function": cannot start with period, " ": cannot be empty space, "func name": cannot have spaces |
| Vector`<Move Type>` | Homogeneous vector of aforementioned types including nested vectors of primitive types (only "flat" vectors of ObjectIDs are allowed) | [1,2,3,4]: simple U8 vector [[3,600],[],[0,7,4]]: nested U32 vector ["0x2B1A39A1514E1D8A7CE45919CFEB4FEE", "0x2B1A39A1514E1D8A7CE45919CFEB4FEF"]: ObjectID vector | [1,2,3,false]: not homogeneous JSON [1,2,null,4]: invalid elements [1,2,"7"]: although Sui allows encoding numbers as strings meaning this array can evaluate to [1,2,7], the array is still ambiguous so it fails the homogeneity check. |
| Vector`<Move Type>` / Option`<Move Type>` | Homogeneous vector of aforementioned types including nested vectors of primitive types (only "flat" vectors of ObjectIDs are allowed) | [1,2,3,4]: simple U8 vector [[3,600],[],[0,7,4]]: nested U32 vector ["0x2B1A39A1514E1D8A7CE45919CFEB4FEE", "0x2B1A39A1514E1D8A7CE45919CFEB4FEF"]: ObjectID vector | [1,2,3,false]: not homogeneous JSON [1,2,null,4]: invalid elements [1,2,"7"]: although Sui allows encoding numbers as strings meaning this array can evaluate to [1,2,7], the array is still ambiguous so it fails the homogeneity check. |
| Vector`<u8>` | For convenience, Sui allows: U8 vectors represented as UTF-8 (and ASCII) strings. | "√®ˆbo72 √∂†∆˚–œ∑π2ie": UTF-8 "abcdE738-2 \_=?": ASCII | |
Loading