calculating checksum is slow
We're using reed-solomon.
diff --git a/FAQs/migrate/index.html b/FAQs/migrate/index.html index a83da43e..f9ee5b0d 100644 --- a/FAQs/migrate/index.html +++ b/FAQs/migrate/index.html @@ -4,8 +4,8 @@migrate to 2
-
diff --git a/api/account/index.html b/api/account/index.html
index 9a185df9..7a34cf64 100644
--- a/api/account/index.html
+++ b/api/account/index.html
@@ -4,8 +4,8 @@
Create
,Associate payment accounts
Grant
,Revoke
the above permissions
-
Account
getAccount Query
diff --git a/api/api-overview/index.html b/api/api-overview/index.html index ae0b0c1f..df57174a 100644 --- a/api/api-overview/index.html +++ b/api/api-overview/index.html @@ -4,8 +4,8 @@Bucket
createBucket Storage Provider Tx
diff --git a/api/crosschain/index.html b/api/crosschain/index.html index 11d233a8..c4d94b02 100644 --- a/api/crosschain/index.html +++ b/api/crosschain/index.html @@ -4,8 +4,8 @@Crosschain
getChannelSendSequence Query
diff --git a/api/feegrant/index.html b/api/feegrant/index.html index 4945412d..1fa5e19b 100644 --- a/api/feegrant/index.html +++ b/api/feegrant/index.html @@ -4,8 +4,8 @@Feegrant
grantAllowance Tx
diff --git a/api/gashub/index.html b/api/gashub/index.html index 44890848..1d9b4103 100644 --- a/api/gashub/index.html +++ b/api/gashub/index.html @@ -4,8 +4,8 @@Gashub
getMsgGasParams Query
diff --git a/api/group/index.html b/api/group/index.html index ae62f7c4..0209546a 100644 --- a/api/group/index.html +++ b/api/group/index.html @@ -4,8 +4,8 @@Group
createGroup Tx
@@ -21,8 +21,7 @@For more details regarding Group
, please refer to
-https://docs.bnbchain.org/greenfield-docs/docs/guide/greenfield-blockchain/modules/permission.
For more details regarding Group
, please refer to permisson.
params | description |
---|---|
creator | the account address of group owner who create the group |
groupName | the name of the group. it's not globally unique |
extra | extra info for the group |
const tx = await client.group.createGroup({
creator: '0x00..',
groupName: 'group_name',
extra: 'extra_info',
});
This is only construct tx, next need simulate and diff --git a/api/object/index.html b/api/object/index.html index 162e477e..2242b826 100644 --- a/api/object/index.html +++ b/api/object/index.html @@ -4,8 +4,8 @@
Object
cancelCreateObject Tx
diff --git a/api/payment/index.html b/api/payment/index.html index 5dea49df..6036bc01 100644 --- a/api/payment/index.html +++ b/api/payment/index.html @@ -4,8 +4,8 @@Payment
getStreamRecord Query
diff --git a/api/sp/index.html b/api/sp/index.html index 4ba2f5b4..5d6d4fe1 100644 --- a/api/sp/index.html +++ b/api/sp/index.html @@ -4,8 +4,8 @@Sp
getStorageProviders Query
@@ -23,8 +23,7 @@getQ
listGroups Storage Provider
Get the group list by name and prefix. It provides fuzzy searches by inputting a specific name and prefix.
-More details: -https://docs.bnbchain.org/greenfield-docs/docs/api/storage-provider-rest/get_group_list.
+More details: get group list.
await client.sp.listGroups({
name: groupName,
prefix: '',
sourceType: 'SOURCE_TYPE_ORIGIN',
limit: 1000,
offset: 0,
});
listGroupsMembers Storage Provider
Query a list of group members by a given group id.
diff --git a/api/virtual-group/index.html b/api/virtual-group/index.html index 046840ad..338a7c7f 100644 --- a/api/virtual-group/index.html +++ b/api/virtual-group/index.html @@ -4,8 +4,8 @@VirtualGroup
getGlobalVirtualGroup Query
diff --git a/assets/js/053d6f47.c565f168.js b/assets/js/053d6f47.863a03c1.js similarity index 99% rename from assets/js/053d6f47.c565f168.js rename to assets/js/053d6f47.863a03c1.js index ac0972c5..d8a2d22b 100644 --- a/assets/js/053d6f47.c565f168.js +++ b/assets/js/053d6f47.863a03c1.js @@ -1 +1 @@ -(self.webpackChunkgreenfield_js_sdk_docs=self.webpackChunkgreenfield_js_sdk_docs||[]).push([[768],{7741:(e,t,a)=>{e.exports={src:{srcSet:a.p+"assets/ideal-img/create-bucket.2a6d733.686.png 686w",images:[{path:a.p+"assets/ideal-img/create-bucket.2a6d733.686.png",width:686,height:396}],src:a.p+"assets/ideal-img/create-bucket.2a6d733.686.png",toString:function(){return a.p+"assets/ideal-img/create-bucket.2a6d733.686.png"},placeholder:void 0,width:686,height:396},preSrc:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAGCAIAAAB1kpiRAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAsElEQVR4nGNgZWVlY2NjRQAWCGJjY2FiYmI4fPjw3Tt37ty+c+PG3Vs3wejW3avXbr549S42No7h7p27796+/fr1+7cf/378/Pv959+///7//PX7////OTk5DIvuXnF9fcnzyVnnx2fcnpy1fXS67NXN/7//gKRzcxmWHtjTcOFI49lDjecPNZ0/XHvu4Nwrp+/dvfPx44e4uDgGLlZWUXZOEXZOOCnAxsHMAgJMTEwAjD9fmT3cOTwAAAAASUVORK5CYII="}},7122:(e,t,a)=>{e.exports={src:{srcSet:a.p+"assets/ideal-img/create-object.1006193.712.png 712w",images:[{path:a.p+"assets/ideal-img/create-object.1006193.712.png",width:712,height:646}],src:a.p+"assets/ideal-img/create-object.1006193.712.png",toString:function(){return a.p+"assets/ideal-img/create-object.1006193.712.png"},placeholder:void 0,width:712,height:646},preSrc:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAJCAIAAACExCpEAAAACXBIWXMAABYlAAAWJQFJUiTwAAAA9UlEQVR4nE2OvUrDUABG8zauWQIuwSE+iuYGF5OAEG62BEREROySKm55AqE4ipuDWKiDUhGFpongT5L2kp97m3wSLdizHj7OJ8my7Pu+67qUUvcXSqnjOJ7nKYoiGYYBgDGGFYQQACzLkgghAPLPL5ZmLM2KOeNCVFUFwDTNTs+AYTy5j95G8STJM7Tt39q2bWmbkJ30WRnfbL7ero2vjz5eANSCL7VOyKDJD5KnyywZFXnECwD8f63rVzw9jB4H33G7aJpFw4Uoy3LZ3iJkt56uT+823ocPdfe/wUpbVdX9i/7e6bHTO+n1g/OzjiAIwjDUNO0HOk7HIZ8J0xEAAAAASUVORK5CYII="}},8072:(e,t,a)=>{e.exports={src:{srcSet:a.p+"assets/ideal-img/details.a20f594.864.png 864w",images:[{path:a.p+"assets/ideal-img/details.a20f594.864.png",width:864,height:832}],src:a.p+"assets/ideal-img/details.a20f594.864.png",toString:function(){return a.p+"assets/ideal-img/details.a20f594.864.png"},placeholder:void 0,width:864,height:832},preSrc:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAIAAAACUFjqAAAACXBIWXMAABYlAAAWJQFJUiTwAAABAklEQVR4nGNgwACMyBxdE/0Z6+dvWr9p/oIFTU3Nm7ZuXbpq1YIlSzZv3erq6srAI8BnZWEcb2Ftb2SspKbmaG4RZWkdaGZuY2EhIioKMoCZiYmDhYWNhYWVnZ2DhUWMlVWIlZWFiQlqPhMTEzMzMzMLCxNcCBmIiIoqqarIKyrKKyrIKSrIKSgoKytLSEhApefMmvX/7/+f37////3n/+8/v3/++v///86dO6HSbbNnzP7xqu/VnYlv73e+ubvz06v////v3rMHKp3f3px7/Xjska2JJ3aGH9vWd+7o+5evFi1eDJUW4ONTkZRSkpBUkpBUkZCUFZcQFRPj5+dnYGAAAI6mVPsAWoXtAAAAAElFTkSuQmCC"}},7880:(e,t,a)=>{e.exports={src:{srcSet:a.p+"assets/ideal-img/select-wallet.9a34841.942.png 942w",images:[{path:a.p+"assets/ideal-img/select-wallet.9a34841.942.png",width:942,height:1142}],src:a.p+"assets/ideal-img/select-wallet.9a34841.942.png",toString:function(){return a.p+"assets/ideal-img/select-wallet.9a34841.942.png"},placeholder:void 0,width:942,height:1142},preSrc:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAMCAIAAADUCbv3AAAACXBIWXMAABYlAAAWJQFJUiTwAAABGElEQVR4nI3OQUuDYBwG8Hcy0IN7dabVbJ26dCtYsKD7Omuu9QXqi/lVxkyNSD3UICi2aYHLdNZB9H3feB0Fdeo5/n88fx4AAACNBgCA3T2BR1ewd9nc2K+PDPhOzWpPOhy1D0ZNae+n849wHMfzvCCIoiiJbQlCodXiWZalBiH0PD+OY8/3XdedTKwgCJIkMU2TsqJsZmmKMSqrCmNMCEEIEUIcx6G81VEXD7ezeRi9LjGmUFUVIcS2bcrdrjq27qaPizRLi6LAGP9q73QU+z6fPr+H4SyKXjD6w9vKzdNqvvxM3uI8/0AIlWVZP7+mLMvyKsvWi9bTipLWx1bNDMMMBqeGMdQ0Tdd1wzB0/Wx4ftHvHwMAvgCM5Kf0BR6bDwAAAABJRU5ErkJggg=="}},3198:(e,t,a)=>{"use strict";a.r(t),a.d(t,{assets:()=>r,contentTitle:()=>c,default:()=>h,frontMatter:()=>l,metadata:()=>d,toc:()=>p});var n=a(9214),i=a(3159),s=a(6923);const l={id:"quick-start",sidebar_position:3},c="Quick Start",d={id:"getting-started/quick-start",title:"Quick Start",description:"We provide templates that can run React (Next.js, Vite and CRA etc) directly.",source:"@site/docs/getting-started/quick-start.mdx",sourceDirName:"getting-started",slug:"/getting-started/quick-start",permalink:"/greenfield-js-sdk/getting-started/quick-start",draft:!1,unlisted:!1,editUrl:"https://github.com/bnb-chain/greenfield-js-sdk/tree/main/doc-site/docs/getting-started/quick-start.mdx",tags:[],version:"current",sidebarPosition:3,frontMatter:{id:"quick-start",sidebar_position:3},sidebar:"GettingStartSidebar",previous:{title:"Install",permalink:"/greenfield-js-sdk/getting-started/install"},next:{title:"Client",permalink:"/greenfield-js-sdk/category/client"}},r={},p=[{value:"Using Template",id:"using-template",level:2},{value:"1. Fill Application name",id:"1-fill-application-name",level:3},{value:"2. Select a template",id:"2-select-a-template",level:3},{value:"3. Select a package manager",id:"3-select-a-package-manager",level:3},{value:"4. Download template",id:"4-download-template",level:3},{value:"Run Application",id:"run-application",level:2},{value:"1. You can seeConnect Wallet
button",id:"1-you-can-see-connect-wallet-button",level:3},{value:"2. Click the button and select a wallet",id:"2-click-the-button-and-select-a-wallet",level:3},{value:"3. wallet",id:"3-wallet",level:3},{value:"4. Create a Bucket",id:"4-create-a-bucket",level:3},{value:"5. Create an Object",id:"5-create-an-object",level:3}];function g(e){const t={a:"a",code:"code",h1:"h1",h2:"h2",h3:"h3",img:"img",p:"p",pre:"pre",...(0,i.R)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(t.h1,{id:"quick-start",children:"Quick Start"}),"\n",(0,n.jsxs)(t.p,{children:["We provide templates that can run ",(0,n.jsx)(t.code,{children:"React"})," (",(0,n.jsx)(t.a,{href:"https://nextjs.org/",children:"Next.js"}),", ",(0,n.jsx)(t.a,{href:"https://vitejs.dev/",children:"Vite"})," and ",(0,n.jsx)(t.a,{href:"https://create-react-app.dev/",children:"CRA"})," etc) directly."]}),"\n",(0,n.jsxs)(t.p,{children:["You can use ",(0,n.jsx)(t.a,{href:"https://github.com/bnb-chain/greenfield-js-sdk/tree/main/packages/create-gnfd-app",children:(0,n.jsx)(t.code,{children:"create-gnfd-app"})})," to create a app quickly:"]}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-bash",children:"> npx @bnb-chain/create-gnfd-app\n"})}),"\n",(0,n.jsx)(t.p,{children:(0,n.jsx)(t.img,{alt:"create-gnfd-app",src:a(5417).A+"",width:"1505",height:"943"})}),"\n",(0,n.jsx)(t.h2,{id:"using-template",children:"Using Template"}),"\n",(0,n.jsx)(t.h3,{id:"1-fill-application-name",children:"1. Fill Application name"}),"\n",(0,n.jsxs)(t.p,{children:["Here I take ",(0,n.jsx)(t.code,{children:"my-gnfd-app"})," as an example:"]}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-bash",children:"> npx @bnb-chain/create-gnfd-app\n# highlight-start\n? What is your project named? my-gnfd-app\n# highlight-end\n"})}),"\n",(0,n.jsx)(t.h3,{id:"2-select-a-template",children:"2. Select a template"}),"\n",(0,n.jsxs)(t.p,{children:["Here I take ",(0,n.jsx)(t.code,{children:"nextjs"})," as an example:"]}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-bash",children:"> npx @bnb-chain/create-gnfd-app\n? What is your project named? my-gnfd-app\n? select a template? (Use arrow keys)\n# highlight-start\n\u276f nextjs\n create-react-app\n vite\n# highlight-end\n"})}),"\n",(0,n.jsx)(t.h3,{id:"3-select-a-package-manager",children:"3. Select a package manager"}),"\n",(0,n.jsxs)(t.p,{children:["Here I take ",(0,n.jsx)(t.code,{children:"pnpm"})," as an example:"]}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-bash",children:"> npx @bnb-chain/create-gnfd-app\n? What is your project named? my-gnfd-app\n? select a template? nextjs\n# highlight-start\n? select a package manager?\n npm\n yarn\n\u276f pnpm\n# highlight-end\n"})}),"\n",(0,n.jsx)(t.h3,{id:"4-download-template",children:"4. Download template"}),"\n",(0,n.jsx)(t.p,{children:"Now downloading template:"}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-bash",children:"? What is your project named? my-gnfd-app\n? select a template? nextjs\n? select a package manager? pnpm\n# highlight-start\nCreating a new Greenfield app in my-gnfd-app.\n\ud83c\udf89 download template - nextjs success\n\n\u2827 Installing dependencies with pnpm......\n# highlight-end\n"})}),"\n",(0,n.jsx)(t.p,{children:"After a while you will see this line:"}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-bash",children:"? What is your project named? my-gnfd-app\n? select a template? nextjs\n? select a package manager? pnpm\nCreating a new Greenfield app in my-gnfd-app.\n# highlight-start\n\ud83c\udf89 download template - nextjs success\n\n\ud83c\udf89 Install dependencies successfully.\n# highlight-end\n"})}),"\n",(0,n.jsx)(t.h2,{id:"run-application",children:"Run Application"}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-bash",children:"> cd my-gnfd-app\n> npm run dev\n"})}),"\n",(0,n.jsxs)(t.h3,{id:"1-you-can-see-connect-wallet-button",children:["1. You can see ",(0,n.jsx)(t.code,{children:"Connect Wallet"})," button"]}),"\n",(0,n.jsx)(t.p,{children:(0,n.jsx)(t.img,{alt:"init",src:a(450).A+"",width:"1928",height:"588"})}),"\n",(0,n.jsx)(t.h3,{id:"2-click-the-button-and-select-a-wallet",children:"2. Click the button and select a wallet"}),"\n",(0,n.jsx)(s.A,{img:a(7880),width:"500"}),"\n",(0,n.jsx)(t.h3,{id:"3-wallet",children:"3. wallet"}),"\n",(0,n.jsx)(s.A,{img:a(8072),width:"500"}),"\n",(0,n.jsx)(t.h3,{id:"4-create-a-bucket",children:"4. Create a Bucket"}),"\n",(0,n.jsx)(t.p,{children:"Create Bucket Tx:"}),"\n",(0,n.jsx)(s.A,{img:a(7741)}),"\n",(0,n.jsx)(t.h3,{id:"5-create-an-object",children:"5. Create an Object"}),"\n",(0,n.jsx)(t.p,{children:"Create Object Tx / Upload File / Download File:"}),"\n",(0,n.jsx)(s.A,{img:a(7122)})]})}function h(e={}){const{wrapper:t}={...(0,i.R)(),...e.components};return t?(0,n.jsx)(t,{...e,children:(0,n.jsx)(g,{...e})}):g(e)}},5417:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n=a.p+"assets/images/gnfd-template-b2faa2ad941917182372954ae449d559.gif"},450:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n=a.p+"assets/images/init-3621d6791218d0a3d565cef6caaffb85.png"}}]);
\ No newline at end of file
+(self.webpackChunkgreenfield_js_sdk_docs=self.webpackChunkgreenfield_js_sdk_docs||[]).push([[768],{7741:(e,t,a)=>{e.exports={src:{srcSet:a.p+"assets/ideal-img/create-bucket.2a6d733.686.png 686w",images:[{path:a.p+"assets/ideal-img/create-bucket.2a6d733.686.png",width:686,height:396}],src:a.p+"assets/ideal-img/create-bucket.2a6d733.686.png",toString:function(){return a.p+"assets/ideal-img/create-bucket.2a6d733.686.png"},placeholder:void 0,width:686,height:396},preSrc:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAGCAIAAAB1kpiRAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAsElEQVR4nGNgZWVlY2NjRQAWCGJjY2FiYmI4fPjw3Tt37ty+c+PG3Vs3wejW3avXbr549S42No7h7p27796+/fr1+7cf/378/Pv959+///7//PX7////OTk5DIvuXnF9fcnzyVnnx2fcnpy1fXS67NXN/7//gKRzcxmWHtjTcOFI49lDjecPNZ0/XHvu4Nwrp+/dvfPx44e4uDgGLlZWUXZOEXZOOCnAxsHMAgJMTEwAjD9fmT3cOTwAAAAASUVORK5CYII="}},7122:(e,t,a)=>{e.exports={src:{srcSet:a.p+"assets/ideal-img/create-object.1006193.712.png 712w",images:[{path:a.p+"assets/ideal-img/create-object.1006193.712.png",width:712,height:646}],src:a.p+"assets/ideal-img/create-object.1006193.712.png",toString:function(){return a.p+"assets/ideal-img/create-object.1006193.712.png"},placeholder:void 0,width:712,height:646},preSrc:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAJCAIAAACExCpEAAAACXBIWXMAABYlAAAWJQFJUiTwAAAA9UlEQVR4nE2OvUrDUABG8zauWQIuwSE+iuYGF5OAEG62BEREROySKm55AqE4ipuDWKiDUhGFpongT5L2kp97m3wSLdizHj7OJ8my7Pu+67qUUvcXSqnjOJ7nKYoiGYYBgDGGFYQQACzLkgghAPLPL5ZmLM2KOeNCVFUFwDTNTs+AYTy5j95G8STJM7Tt39q2bWmbkJ30WRnfbL7ero2vjz5eANSCL7VOyKDJD5KnyywZFXnECwD8f63rVzw9jB4H33G7aJpFw4Uoy3LZ3iJkt56uT+823ocPdfe/wUpbVdX9i/7e6bHTO+n1g/OzjiAIwjDUNO0HOk7HIZ8J0xEAAAAASUVORK5CYII="}},8072:(e,t,a)=>{e.exports={src:{srcSet:a.p+"assets/ideal-img/details.a20f594.864.png 864w",images:[{path:a.p+"assets/ideal-img/details.a20f594.864.png",width:864,height:832}],src:a.p+"assets/ideal-img/details.a20f594.864.png",toString:function(){return a.p+"assets/ideal-img/details.a20f594.864.png"},placeholder:void 0,width:864,height:832},preSrc:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAIAAAACUFjqAAAACXBIWXMAABYlAAAWJQFJUiTwAAABAklEQVR4nGNgwACMyBxdE/0Z6+dvWr9p/oIFTU3Nm7ZuXbpq1YIlSzZv3erq6srAI8BnZWEcb2Ftb2SspKbmaG4RZWkdaGZuY2EhIioKMoCZiYmDhYWNhYWVnZ2DhUWMlVWIlZWFiQlqPhMTEzMzMzMLCxNcCBmIiIoqqarIKyrKKyrIKSrIKSgoKytLSEhApefMmvX/7/+f37////3n/+8/v3/++v///86dO6HSbbNnzP7xqu/VnYlv73e+ubvz06v////v3rMHKp3f3px7/Xjska2JJ3aGH9vWd+7o+5evFi1eDJUW4ONTkZRSkpBUkpBUkZCUFZcQFRPj5+dnYGAAAI6mVPsAWoXtAAAAAElFTkSuQmCC"}},7880:(e,t,a)=>{e.exports={src:{srcSet:a.p+"assets/ideal-img/select-wallet.9a34841.942.png 942w",images:[{path:a.p+"assets/ideal-img/select-wallet.9a34841.942.png",width:942,height:1142}],src:a.p+"assets/ideal-img/select-wallet.9a34841.942.png",toString:function(){return a.p+"assets/ideal-img/select-wallet.9a34841.942.png"},placeholder:void 0,width:942,height:1142},preSrc:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAMCAIAAADUCbv3AAAACXBIWXMAABYlAAAWJQFJUiTwAAABGElEQVR4nI3OQUuDYBwG8Hcy0IN7dabVbJ26dCtYsKD7Omuu9QXqi/lVxkyNSD3UICi2aYHLdNZB9H3feB0Fdeo5/n88fx4AAACNBgCA3T2BR1ewd9nc2K+PDPhOzWpPOhy1D0ZNae+n849wHMfzvCCIoiiJbQlCodXiWZalBiH0PD+OY8/3XdedTKwgCJIkMU2TsqJsZmmKMSqrCmNMCEEIEUIcx6G81VEXD7ezeRi9LjGmUFUVIcS2bcrdrjq27qaPizRLi6LAGP9q73QU+z6fPr+H4SyKXjD6w9vKzdNqvvxM3uI8/0AIlWVZP7+mLMvyKsvWi9bTipLWx1bNDMMMBqeGMdQ0Tdd1wzB0/Wx4ftHvHwMAvgCM5Kf0BR6bDwAAAABJRU5ErkJggg=="}},3198:(e,t,a)=>{"use strict";a.r(t),a.d(t,{assets:()=>r,contentTitle:()=>c,default:()=>h,frontMatter:()=>l,metadata:()=>d,toc:()=>p});var n=a(9214),i=a(3159),s=a(9816);const l={id:"quick-start",sidebar_position:3},c="Quick Start",d={id:"getting-started/quick-start",title:"Quick Start",description:"We provide templates that can run React (Next.js, Vite and CRA etc) directly.",source:"@site/docs/getting-started/quick-start.mdx",sourceDirName:"getting-started",slug:"/getting-started/quick-start",permalink:"/greenfield-js-sdk/getting-started/quick-start",draft:!1,unlisted:!1,editUrl:"https://github.com/bnb-chain/greenfield-js-sdk/tree/main/doc-site/docs/getting-started/quick-start.mdx",tags:[],version:"current",sidebarPosition:3,frontMatter:{id:"quick-start",sidebar_position:3},sidebar:"GettingStartSidebar",previous:{title:"Install",permalink:"/greenfield-js-sdk/getting-started/install"},next:{title:"Client",permalink:"/greenfield-js-sdk/category/client"}},r={},p=[{value:"Using Template",id:"using-template",level:2},{value:"1. Fill Application name",id:"1-fill-application-name",level:3},{value:"2. Select a template",id:"2-select-a-template",level:3},{value:"3. Select a package manager",id:"3-select-a-package-manager",level:3},{value:"4. Download template",id:"4-download-template",level:3},{value:"Run Application",id:"run-application",level:2},{value:"1. You can see Connect Wallet
button",id:"1-you-can-see-connect-wallet-button",level:3},{value:"2. Click the button and select a wallet",id:"2-click-the-button-and-select-a-wallet",level:3},{value:"3. wallet",id:"3-wallet",level:3},{value:"4. Create a Bucket",id:"4-create-a-bucket",level:3},{value:"5. Create an Object",id:"5-create-an-object",level:3}];function g(e){const t={a:"a",code:"code",h1:"h1",h2:"h2",h3:"h3",img:"img",p:"p",pre:"pre",...(0,i.R)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(t.h1,{id:"quick-start",children:"Quick Start"}),"\n",(0,n.jsxs)(t.p,{children:["We provide templates that can run ",(0,n.jsx)(t.code,{children:"React"})," (",(0,n.jsx)(t.a,{href:"https://nextjs.org/",children:"Next.js"}),", ",(0,n.jsx)(t.a,{href:"https://vitejs.dev/",children:"Vite"})," and ",(0,n.jsx)(t.a,{href:"https://create-react-app.dev/",children:"CRA"})," etc) directly."]}),"\n",(0,n.jsxs)(t.p,{children:["You can use ",(0,n.jsx)(t.a,{href:"https://github.com/bnb-chain/greenfield-js-sdk/tree/main/packages/create-gnfd-app",children:(0,n.jsx)(t.code,{children:"create-gnfd-app"})})," to create a app quickly:"]}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-bash",children:"> npx @bnb-chain/create-gnfd-app\n"})}),"\n",(0,n.jsx)(t.p,{children:(0,n.jsx)(t.img,{alt:"create-gnfd-app",src:a(5417).A+"",width:"1505",height:"943"})}),"\n",(0,n.jsx)(t.h2,{id:"using-template",children:"Using Template"}),"\n",(0,n.jsx)(t.h3,{id:"1-fill-application-name",children:"1. Fill Application name"}),"\n",(0,n.jsxs)(t.p,{children:["Here I take ",(0,n.jsx)(t.code,{children:"my-gnfd-app"})," as an example:"]}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-bash",children:"> npx @bnb-chain/create-gnfd-app\n# highlight-start\n? What is your project named? my-gnfd-app\n# highlight-end\n"})}),"\n",(0,n.jsx)(t.h3,{id:"2-select-a-template",children:"2. Select a template"}),"\n",(0,n.jsxs)(t.p,{children:["Here I take ",(0,n.jsx)(t.code,{children:"nextjs"})," as an example:"]}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-bash",children:"> npx @bnb-chain/create-gnfd-app\n? What is your project named? my-gnfd-app\n? select a template? (Use arrow keys)\n# highlight-start\n\u276f nextjs\n create-react-app\n vite\n# highlight-end\n"})}),"\n",(0,n.jsx)(t.h3,{id:"3-select-a-package-manager",children:"3. Select a package manager"}),"\n",(0,n.jsxs)(t.p,{children:["Here I take ",(0,n.jsx)(t.code,{children:"pnpm"})," as an example:"]}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-bash",children:"> npx @bnb-chain/create-gnfd-app\n? What is your project named? my-gnfd-app\n? select a template? nextjs\n# highlight-start\n? select a package manager?\n npm\n yarn\n\u276f pnpm\n# highlight-end\n"})}),"\n",(0,n.jsx)(t.h3,{id:"4-download-template",children:"4. Download template"}),"\n",(0,n.jsx)(t.p,{children:"Now downloading template:"}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-bash",children:"? What is your project named? my-gnfd-app\n? select a template? nextjs\n? select a package manager? pnpm\n# highlight-start\nCreating a new Greenfield app in my-gnfd-app.\n\ud83c\udf89 download template - nextjs success\n\n\u2827 Installing dependencies with pnpm......\n# highlight-end\n"})}),"\n",(0,n.jsx)(t.p,{children:"After a while you will see this line:"}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-bash",children:"? What is your project named? my-gnfd-app\n? select a template? nextjs\n? select a package manager? pnpm\nCreating a new Greenfield app in my-gnfd-app.\n# highlight-start\n\ud83c\udf89 download template - nextjs success\n\n\ud83c\udf89 Install dependencies successfully.\n# highlight-end\n"})}),"\n",(0,n.jsx)(t.h2,{id:"run-application",children:"Run Application"}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-bash",children:"> cd my-gnfd-app\n> npm run dev\n"})}),"\n",(0,n.jsxs)(t.h3,{id:"1-you-can-see-connect-wallet-button",children:["1. You can see ",(0,n.jsx)(t.code,{children:"Connect Wallet"})," button"]}),"\n",(0,n.jsx)(t.p,{children:(0,n.jsx)(t.img,{alt:"init",src:a(450).A+"",width:"1928",height:"588"})}),"\n",(0,n.jsx)(t.h3,{id:"2-click-the-button-and-select-a-wallet",children:"2. Click the button and select a wallet"}),"\n",(0,n.jsx)(s.A,{img:a(7880),width:"500"}),"\n",(0,n.jsx)(t.h3,{id:"3-wallet",children:"3. wallet"}),"\n",(0,n.jsx)(s.A,{img:a(8072),width:"500"}),"\n",(0,n.jsx)(t.h3,{id:"4-create-a-bucket",children:"4. Create a Bucket"}),"\n",(0,n.jsx)(t.p,{children:"Create Bucket Tx:"}),"\n",(0,n.jsx)(s.A,{img:a(7741)}),"\n",(0,n.jsx)(t.h3,{id:"5-create-an-object",children:"5. Create an Object"}),"\n",(0,n.jsx)(t.p,{children:"Create Object Tx / Upload File / Download File:"}),"\n",(0,n.jsx)(s.A,{img:a(7122)})]})}function h(e={}){const{wrapper:t}={...(0,i.R)(),...e.components};return t?(0,n.jsx)(t,{...e,children:(0,n.jsx)(g,{...e})}):g(e)}},5417:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n=a.p+"assets/images/gnfd-template-b2faa2ad941917182372954ae449d559.gif"},450:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n=a.p+"assets/images/init-3621d6791218d0a3d565cef6caaffb85.png"}}]);
\ No newline at end of file
diff --git a/assets/js/14eb3368.0fde5b9e.js b/assets/js/14eb3368.0fde5b9e.js
new file mode 100644
index 00000000..311f6718
--- /dev/null
+++ b/assets/js/14eb3368.0fde5b9e.js
@@ -0,0 +1 @@
+"use strict";(self.webpackChunkgreenfield_js_sdk_docs=self.webpackChunkgreenfield_js_sdk_docs||[]).push([[969],{2124:(e,t,n)=>{n.d(t,{A:()=>g});n(8318);var s=n(3372),r=n(9166),i=n(8263),a=n(8412),l=n(8965),o=n(6093),c=n(5378),d=n(9214);function u(e){return(0,d.jsx)("svg",{viewBox:"0 0 24 24",...e,children:(0,d.jsx)("path",{d:"M10 19v-5h4v5c0 .55.45 1 1 1h3c.55 0 1-.45 1-1v-7h1.7c.46 0 .68-.57.33-.87L12.67 3.6c-.38-.34-.96-.34-1.34 0l-8.36 7.53c-.34.3-.13.87.33.87H5v7c0 .55.45 1 1 1h3c.55 0 1-.45 1-1z",fill:"currentColor"})})}const m={breadcrumbHomeIcon:"breadcrumbHomeIcon_RqSR"};function h(){const e=(0,c.A)("/");return(0,d.jsx)("li",{className:"breadcrumbs__item",children:(0,d.jsx)(l.A,{"aria-label":(0,o.T)({id:"theme.docs.breadcrumbs.home",message:"Home page",description:"The ARIA label for the home page in the breadcrumbs"}),className:"breadcrumbs__link",href:e,children:(0,d.jsx)(u,{className:m.breadcrumbHomeIcon})})})}const b={breadcrumbsContainer:"breadcrumbsContainer_lZus"};function p(e){let{children:t,href:n,isLast:s}=e;const r="breadcrumbs__link";return s?(0,d.jsx)("span",{className:r,itemProp:"name",children:t}):n?(0,d.jsx)(l.A,{className:r,href:n,itemProp:"item",children:(0,d.jsx)("span",{itemProp:"name",children:t})}):(0,d.jsx)("span",{className:r,children:t})}function x(e){let{children:t,active:n,index:r,addMicrodata:i}=e;return(0,d.jsxs)("li",{...i&&{itemScope:!0,itemProp:"itemListElement",itemType:"https://schema.org/ListItem"},className:(0,s.A)("breadcrumbs__item",{"breadcrumbs__item--active":n}),children:[t,(0,d.jsx)("meta",{itemProp:"position",content:String(r+1)})]})}function g(){const e=(0,i.OF)(),t=(0,a.Dt)();return e?(0,d.jsx)("nav",{className:(0,s.A)(r.G.docs.docBreadcrumbs,b.breadcrumbsContainer),"aria-label":(0,o.T)({id:"theme.docs.breadcrumbs.navAriaLabel",message:"Breadcrumbs",description:"The ARIA label for the breadcrumbs"}),children:(0,d.jsxs)("ul",{className:"breadcrumbs",itemScope:!0,itemType:"https://schema.org/BreadcrumbList",children:[t&&(0,d.jsx)(h,{}),e.map(((t,n)=>{const s=n===e.length-1,r="category"===t.type&&t.linkUnlisted?void 0:t.href;return(0,d.jsx)(x,{active:s,index:n,addMicrodata:!!r,children:(0,d.jsx)(p,{href:r,isLast:s,children:t.label})},n)}))]})}):null}},3762:(e,t,n)=>{n.r(t),n.d(t,{default:()=>V});var s=n(8318),r=n(7173),i=n(8263),a=n(5378),l=n(3372),o=n(8965),c=n(7713);const d=["zero","one","two","few","many","other"];function u(e){return d.filter((t=>e.includes(t)))}const m={locale:"en",pluralForms:u(["one","other"]),select:e=>1===e?"one":"other"};function h(){const{i18n:{currentLocale:e}}=(0,c.A)();return(0,s.useMemo)((()=>{try{return function(e){const t=new Intl.PluralRules(e);return{locale:e,pluralForms:u(t.resolvedOptions().pluralCategories),select:e=>t.select(e)}}(e)}catch(t){return console.error(`Failed to use Intl.PluralRules for locale "${e}".\nDocusaurus will fallback to the default (English) implementation.\nError: ${t.message}\n`),m}}),[e])}function b(){const e=h();return{selectMessage:(t,n)=>function(e,t,n){const s=e.split("|");if(1===s.length)return s[0];s.length>n.pluralForms.length&&console.error(`For locale=${n.locale}, a maximum of ${n.pluralForms.length} plural forms are expected (${n.pluralForms.join(",")}), but the message contains ${s.length}: ${e}`);const r=n.select(t),i=n.pluralForms.indexOf(r);return s[Math.min(i,s.length-1)]}(n,t,e)}}var p=n(3547),x=n(6093),g=n(146);const v={cardContainer:"cardContainer_J70z",cardTitle:"cardTitle_NQzT",cardDescription:"cardDescription_G_Bt"};var f=n(9214);function j(e){let{href:t,children:n}=e;return(0,f.jsx)(o.A,{href:t,className:(0,l.A)("card padding--lg",v.cardContainer),children:n})}function A(e){let{href:t,icon:n,title:s,description:r}=e;return(0,f.jsxs)(j,{href:t,children:[(0,f.jsxs)(g.A,{as:"h2",className:(0,l.A)("text--truncate",v.cardTitle),title:s,children:[n," ",s]}),r&&(0,f.jsx)("p",{className:(0,l.A)("text--truncate",v.cardDescription),title:r,children:r})]})}function N(e){let{item:t}=e;const n=(0,i.Nr)(t),s=function(){const{selectMessage:e}=b();return t=>e(t,(0,x.T)({message:"{count} items",id:"theme.docs.DocCard.categoryDescription.plurals",description:"The default description for a category card in the generated index about how many items this category includes"},{count:t}))}();return n?(0,f.jsx)(A,{href:n,icon:"\ud83d\uddc3\ufe0f",title:t.label,description:t.description??s(t.items.length)}):null}function _(e){let{item:t}=e;const n=(0,p.A)(t.href)?"\ud83d\udcc4\ufe0f":"\ud83d\udd17",s=(0,i.cC)(t.docId??void 0);return(0,f.jsx)(A,{href:t.href,icon:n,title:t.label,description:t.description??s?.description})}function L(e){let{item:t}=e;switch(t.type){case"link":return(0,f.jsx)(_,{item:t});case"category":return(0,f.jsx)(N,{item:t});default:throw new Error(`unknown item type ${JSON.stringify(t)}`)}}function T(e){let{className:t}=e;const n=(0,i.$S)();return(0,f.jsx)(k,{items:n.items,className:t})}function k(e){const{items:t,className:n}=e;if(!t)return(0,f.jsx)(T,{...e});const s=(0,i.d1)(t);return(0,f.jsx)("section",{className:(0,l.A)("row",n),children:s.map(((e,t)=>(0,f.jsx)("article",{className:"col col--6 margin-bottom--lg",children:(0,f.jsx)(L,{item:e})},t)))})}var y=n(2388),w=n(1917),I=n(7086),C=n(2124);const M={generatedIndexPage:"generatedIndexPage_chrm",list:"list_zLq6",title:"title_jmNj"};function P(e){let{categoryGeneratedIndex:t}=e;return(0,f.jsx)(r.be,{title:t.title,description:t.description,keywords:t.keywords,image:(0,a.A)(t.image)})}function F(e){let{categoryGeneratedIndex:t}=e;const n=(0,i.$S)();return(0,f.jsxs)("div",{className:M.generatedIndexPage,children:[(0,f.jsx)(w.A,{}),(0,f.jsx)(C.A,{}),(0,f.jsx)(I.A,{}),(0,f.jsxs)("header",{children:[(0,f.jsx)(g.A,{as:"h1",className:M.title,children:t.title}),t.description&&(0,f.jsx)("p",{children:t.description})]}),(0,f.jsx)("article",{className:"margin-top--lg",children:(0,f.jsx)(k,{items:n.items,className:M.list})}),(0,f.jsx)("footer",{className:"margin-top--lg",children:(0,f.jsx)(y.A,{previous:t.navigation.previous,next:t.navigation.next})})]})}function V(e){return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(P,{...e}),(0,f.jsx)(F,{...e})]})}},2388:(e,t,n)=>{n.d(t,{A:()=>o});n(8318);var s=n(6093),r=n(3372),i=n(8965),a=n(9214);function l(e){const{permalink:t,title:n,subLabel:s,isNext:l}=e;return(0,a.jsxs)(i.A,{className:(0,r.A)("pagination-nav__link",l?"pagination-nav__link--next":"pagination-nav__link--prev"),to:t,children:[s&&(0,a.jsx)("div",{className:"pagination-nav__sublabel",children:s}),(0,a.jsx)("div",{className:"pagination-nav__label",children:n})]})}function o(e){const{previous:t,next:n}=e;return(0,a.jsxs)("nav",{className:"pagination-nav docusaurus-mt-lg","aria-label":(0,s.T)({id:"theme.docs.paginator.navAriaLabel",message:"Docs pages",description:"The ARIA label for the docs pagination"}),children:[t&&(0,a.jsx)(l,{...t,subLabel:(0,a.jsx)(s.A,{id:"theme.docs.paginator.previous",description:"The label used to navigate to the previous doc",children:"Previous"})}),n&&(0,a.jsx)(l,{...n,subLabel:(0,a.jsx)(s.A,{id:"theme.docs.paginator.next",description:"The label used to navigate to the next doc",children:"Next"}),isNext:!0})]})}},7086:(e,t,n)=>{n.d(t,{A:()=>o});n(8318);var s=n(3372),r=n(6093),i=n(9166),a=n(8563),l=n(9214);function o(e){let{className:t}=e;const n=(0,a.r)();return n.badge?(0,l.jsx)("span",{className:(0,s.A)(t,i.G.docs.docVersionBadge,"badge badge--secondary"),children:(0,l.jsx)(r.A,{id:"theme.docs.versionBadge.label",values:{versionLabel:n.label},children:"Version: {versionLabel}"})}):null}},1917:(e,t,n)=>{n.d(t,{A:()=>x});n(8318);var s=n(3372),r=n(7713),i=n(8965),a=n(6093),l=n(8420),o=n(9166),c=n(7076),d=n(8563),u=n(9214);const m={unreleased:function(e){let{siteTitle:t,versionMetadata:n}=e;return(0,u.jsx)(a.A,{id:"theme.docs.versions.unreleasedVersionLabel",description:"The label used to tell the user that he's browsing an unreleased doc version",values:{siteTitle:t,versionLabel:(0,u.jsx)("b",{children:n.label})},children:"This is unreleased documentation for {siteTitle} {versionLabel} version."})},unmaintained:function(e){let{siteTitle:t,versionMetadata:n}=e;return(0,u.jsx)(a.A,{id:"theme.docs.versions.unmaintainedVersionLabel",description:"The label used to tell the user that he's browsing an unmaintained doc version",values:{siteTitle:t,versionLabel:(0,u.jsx)("b",{children:n.label})},children:"This is documentation for {siteTitle} {versionLabel}, which is no longer actively maintained."})}};function h(e){const t=m[e.versionMetadata.banner];return(0,u.jsx)(t,{...e})}function b(e){let{versionLabel:t,to:n,onClick:s}=e;return(0,u.jsx)(a.A,{id:"theme.docs.versions.latestVersionSuggestionLabel",description:"The label used to tell the user to check the latest version",values:{versionLabel:t,latestVersionLink:(0,u.jsx)("b",{children:(0,u.jsx)(i.A,{to:n,onClick:s,children:(0,u.jsx)(a.A,{id:"theme.docs.versions.latestVersionLinkLabel",description:"The label used for the latest version suggestion link label",children:"latest version"})})})},children:"For up-to-date documentation, see the {latestVersionLink} ({versionLabel})."})}function p(e){let{className:t,versionMetadata:n}=e;const{siteConfig:{title:i}}=(0,r.A)(),{pluginId:a}=(0,l.vT)({failfast:!0}),{savePreferredVersionName:d}=(0,c.g1)(a),{latestDocSuggestion:m,latestVersionSuggestion:p}=(0,l.HW)(a),x=m??(g=p).docs.find((e=>e.id===g.mainDocId));var g;return(0,u.jsxs)("div",{className:(0,s.A)(t,o.G.docs.docVersionBanner,"alert alert--warning margin-bottom--md"),role:"alert",children:[(0,u.jsx)("div",{children:(0,u.jsx)(h,{siteTitle:i,versionMetadata:n})}),(0,u.jsx)("div",{className:"margin-top--md",children:(0,u.jsx)(b,{versionLabel:p.label,to:x.path,onClick:()=>d(p.name)})})]})}function x(e){let{className:t}=e;const n=(0,d.r)();return n.banner?(0,u.jsx)(p,{className:t,versionMetadata:n}):null}}}]);
\ No newline at end of file
diff --git a/assets/js/14eb3368.e57c6b8b.js b/assets/js/14eb3368.e57c6b8b.js
deleted file mode 100644
index 9abc541f..00000000
--- a/assets/js/14eb3368.e57c6b8b.js
+++ /dev/null
@@ -1 +0,0 @@
-"use strict";(self.webpackChunkgreenfield_js_sdk_docs=self.webpackChunkgreenfield_js_sdk_docs||[]).push([[969],{4803:(e,t,n)=>{n.d(t,{A:()=>g});n(8318);var s=n(3372),r=n(9023),i=n(1462),a=n(5977),l=n(908),o=n(7084),c=n(823),d=n(9214);function u(e){return(0,d.jsx)("svg",{viewBox:"0 0 24 24",...e,children:(0,d.jsx)("path",{d:"M10 19v-5h4v5c0 .55.45 1 1 1h3c.55 0 1-.45 1-1v-7h1.7c.46 0 .68-.57.33-.87L12.67 3.6c-.38-.34-.96-.34-1.34 0l-8.36 7.53c-.34.3-.13.87.33.87H5v7c0 .55.45 1 1 1h3c.55 0 1-.45 1-1z",fill:"currentColor"})})}const m={breadcrumbHomeIcon:"breadcrumbHomeIcon_RqSR"};function h(){const e=(0,c.A)("/");return(0,d.jsx)("li",{className:"breadcrumbs__item",children:(0,d.jsx)(l.A,{"aria-label":(0,o.T)({id:"theme.docs.breadcrumbs.home",message:"Home page",description:"The ARIA label for the home page in the breadcrumbs"}),className:"breadcrumbs__link",href:e,children:(0,d.jsx)(u,{className:m.breadcrumbHomeIcon})})})}const b={breadcrumbsContainer:"breadcrumbsContainer_lZus"};function p(e){let{children:t,href:n,isLast:s}=e;const r="breadcrumbs__link";return s?(0,d.jsx)("span",{className:r,itemProp:"name",children:t}):n?(0,d.jsx)(l.A,{className:r,href:n,itemProp:"item",children:(0,d.jsx)("span",{itemProp:"name",children:t})}):(0,d.jsx)("span",{className:r,children:t})}function x(e){let{children:t,active:n,index:r,addMicrodata:i}=e;return(0,d.jsxs)("li",{...i&&{itemScope:!0,itemProp:"itemListElement",itemType:"https://schema.org/ListItem"},className:(0,s.A)("breadcrumbs__item",{"breadcrumbs__item--active":n}),children:[t,(0,d.jsx)("meta",{itemProp:"position",content:String(r+1)})]})}function g(){const e=(0,i.OF)(),t=(0,a.Dt)();return e?(0,d.jsx)("nav",{className:(0,s.A)(r.G.docs.docBreadcrumbs,b.breadcrumbsContainer),"aria-label":(0,o.T)({id:"theme.docs.breadcrumbs.navAriaLabel",message:"Breadcrumbs",description:"The ARIA label for the breadcrumbs"}),children:(0,d.jsxs)("ul",{className:"breadcrumbs",itemScope:!0,itemType:"https://schema.org/BreadcrumbList",children:[t&&(0,d.jsx)(h,{}),e.map(((t,n)=>{const s=n===e.length-1,r="category"===t.type&&t.linkUnlisted?void 0:t.href;return(0,d.jsx)(x,{active:s,index:n,addMicrodata:!!r,children:(0,d.jsx)(p,{href:r,isLast:s,children:t.label})},n)}))]})}):null}},6044:(e,t,n)=>{n.r(t),n.d(t,{default:()=>V});var s=n(8318),r=n(5679),i=n(1462),a=n(823),l=n(3372),o=n(908),c=n(9780);const d=["zero","one","two","few","many","other"];function u(e){return d.filter((t=>e.includes(t)))}const m={locale:"en",pluralForms:u(["one","other"]),select:e=>1===e?"one":"other"};function h(){const{i18n:{currentLocale:e}}=(0,c.A)();return(0,s.useMemo)((()=>{try{return function(e){const t=new Intl.PluralRules(e);return{locale:e,pluralForms:u(t.resolvedOptions().pluralCategories),select:e=>t.select(e)}}(e)}catch(t){return console.error(`Failed to use Intl.PluralRules for locale "${e}".\nDocusaurus will fallback to the default (English) implementation.\nError: ${t.message}\n`),m}}),[e])}function b(){const e=h();return{selectMessage:(t,n)=>function(e,t,n){const s=e.split("|");if(1===s.length)return s[0];s.length>n.pluralForms.length&&console.error(`For locale=${n.locale}, a maximum of ${n.pluralForms.length} plural forms are expected (${n.pluralForms.join(",")}), but the message contains ${s.length}: ${e}`);const r=n.select(t),i=n.pluralForms.indexOf(r);return s[Math.min(i,s.length-1)]}(n,t,e)}}var p=n(3252),x=n(7084),g=n(5418);const v={cardContainer:"cardContainer_J70z",cardTitle:"cardTitle_NQzT",cardDescription:"cardDescription_G_Bt"};var f=n(9214);function j(e){let{href:t,children:n}=e;return(0,f.jsx)(o.A,{href:t,className:(0,l.A)("card padding--lg",v.cardContainer),children:n})}function A(e){let{href:t,icon:n,title:s,description:r}=e;return(0,f.jsxs)(j,{href:t,children:[(0,f.jsxs)(g.A,{as:"h2",className:(0,l.A)("text--truncate",v.cardTitle),title:s,children:[n," ",s]}),r&&(0,f.jsx)("p",{className:(0,l.A)("text--truncate",v.cardDescription),title:r,children:r})]})}function N(e){let{item:t}=e;const n=(0,i.Nr)(t),s=function(){const{selectMessage:e}=b();return t=>e(t,(0,x.T)({message:"{count} items",id:"theme.docs.DocCard.categoryDescription.plurals",description:"The default description for a category card in the generated index about how many items this category includes"},{count:t}))}();return n?(0,f.jsx)(A,{href:n,icon:"\ud83d\uddc3\ufe0f",title:t.label,description:t.description??s(t.items.length)}):null}function _(e){let{item:t}=e;const n=(0,p.A)(t.href)?"\ud83d\udcc4\ufe0f":"\ud83d\udd17",s=(0,i.cC)(t.docId??void 0);return(0,f.jsx)(A,{href:t.href,icon:n,title:t.label,description:t.description??s?.description})}function L(e){let{item:t}=e;switch(t.type){case"link":return(0,f.jsx)(_,{item:t});case"category":return(0,f.jsx)(N,{item:t});default:throw new Error(`unknown item type ${JSON.stringify(t)}`)}}function T(e){let{className:t}=e;const n=(0,i.$S)();return(0,f.jsx)(k,{items:n.items,className:t})}function k(e){const{items:t,className:n}=e;if(!t)return(0,f.jsx)(T,{...e});const s=(0,i.d1)(t);return(0,f.jsx)("section",{className:(0,l.A)("row",n),children:s.map(((e,t)=>(0,f.jsx)("article",{className:"col col--6 margin-bottom--lg",children:(0,f.jsx)(L,{item:e})},t)))})}var y=n(5898),w=n(3440),I=n(1145),C=n(4803);const M={generatedIndexPage:"generatedIndexPage_chrm",list:"list_zLq6",title:"title_jmNj"};function P(e){let{categoryGeneratedIndex:t}=e;return(0,f.jsx)(r.be,{title:t.title,description:t.description,keywords:t.keywords,image:(0,a.A)(t.image)})}function F(e){let{categoryGeneratedIndex:t}=e;const n=(0,i.$S)();return(0,f.jsxs)("div",{className:M.generatedIndexPage,children:[(0,f.jsx)(w.A,{}),(0,f.jsx)(C.A,{}),(0,f.jsx)(I.A,{}),(0,f.jsxs)("header",{children:[(0,f.jsx)(g.A,{as:"h1",className:M.title,children:t.title}),t.description&&(0,f.jsx)("p",{children:t.description})]}),(0,f.jsx)("article",{className:"margin-top--lg",children:(0,f.jsx)(k,{items:n.items,className:M.list})}),(0,f.jsx)("footer",{className:"margin-top--lg",children:(0,f.jsx)(y.A,{previous:t.navigation.previous,next:t.navigation.next})})]})}function V(e){return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(P,{...e}),(0,f.jsx)(F,{...e})]})}},5898:(e,t,n)=>{n.d(t,{A:()=>o});n(8318);var s=n(7084),r=n(3372),i=n(908),a=n(9214);function l(e){const{permalink:t,title:n,subLabel:s,isNext:l}=e;return(0,a.jsxs)(i.A,{className:(0,r.A)("pagination-nav__link",l?"pagination-nav__link--next":"pagination-nav__link--prev"),to:t,children:[s&&(0,a.jsx)("div",{className:"pagination-nav__sublabel",children:s}),(0,a.jsx)("div",{className:"pagination-nav__label",children:n})]})}function o(e){const{previous:t,next:n}=e;return(0,a.jsxs)("nav",{className:"pagination-nav docusaurus-mt-lg","aria-label":(0,s.T)({id:"theme.docs.paginator.navAriaLabel",message:"Docs pages",description:"The ARIA label for the docs pagination"}),children:[t&&(0,a.jsx)(l,{...t,subLabel:(0,a.jsx)(s.A,{id:"theme.docs.paginator.previous",description:"The label used to navigate to the previous doc",children:"Previous"})}),n&&(0,a.jsx)(l,{...n,subLabel:(0,a.jsx)(s.A,{id:"theme.docs.paginator.next",description:"The label used to navigate to the next doc",children:"Next"}),isNext:!0})]})}},1145:(e,t,n)=>{n.d(t,{A:()=>o});n(8318);var s=n(3372),r=n(7084),i=n(9023),a=n(4148),l=n(9214);function o(e){let{className:t}=e;const n=(0,a.r)();return n.badge?(0,l.jsx)("span",{className:(0,s.A)(t,i.G.docs.docVersionBadge,"badge badge--secondary"),children:(0,l.jsx)(r.A,{id:"theme.docs.versionBadge.label",values:{versionLabel:n.label},children:"Version: {versionLabel}"})}):null}},3440:(e,t,n)=>{n.d(t,{A:()=>x});n(8318);var s=n(3372),r=n(9780),i=n(908),a=n(7084),l=n(5404),o=n(9023),c=n(8933),d=n(4148),u=n(9214);const m={unreleased:function(e){let{siteTitle:t,versionMetadata:n}=e;return(0,u.jsx)(a.A,{id:"theme.docs.versions.unreleasedVersionLabel",description:"The label used to tell the user that he's browsing an unreleased doc version",values:{siteTitle:t,versionLabel:(0,u.jsx)("b",{children:n.label})},children:"This is unreleased documentation for {siteTitle} {versionLabel} version."})},unmaintained:function(e){let{siteTitle:t,versionMetadata:n}=e;return(0,u.jsx)(a.A,{id:"theme.docs.versions.unmaintainedVersionLabel",description:"The label used to tell the user that he's browsing an unmaintained doc version",values:{siteTitle:t,versionLabel:(0,u.jsx)("b",{children:n.label})},children:"This is documentation for {siteTitle} {versionLabel}, which is no longer actively maintained."})}};function h(e){const t=m[e.versionMetadata.banner];return(0,u.jsx)(t,{...e})}function b(e){let{versionLabel:t,to:n,onClick:s}=e;return(0,u.jsx)(a.A,{id:"theme.docs.versions.latestVersionSuggestionLabel",description:"The label used to tell the user to check the latest version",values:{versionLabel:t,latestVersionLink:(0,u.jsx)("b",{children:(0,u.jsx)(i.A,{to:n,onClick:s,children:(0,u.jsx)(a.A,{id:"theme.docs.versions.latestVersionLinkLabel",description:"The label used for the latest version suggestion link label",children:"latest version"})})})},children:"For up-to-date documentation, see the {latestVersionLink} ({versionLabel})."})}function p(e){let{className:t,versionMetadata:n}=e;const{siteConfig:{title:i}}=(0,r.A)(),{pluginId:a}=(0,l.vT)({failfast:!0}),{savePreferredVersionName:d}=(0,c.g1)(a),{latestDocSuggestion:m,latestVersionSuggestion:p}=(0,l.HW)(a),x=m??(g=p).docs.find((e=>e.id===g.mainDocId));var g;return(0,u.jsxs)("div",{className:(0,s.A)(t,o.G.docs.docVersionBanner,"alert alert--warning margin-bottom--md"),role:"alert",children:[(0,u.jsx)("div",{children:(0,u.jsx)(h,{siteTitle:i,versionMetadata:n})}),(0,u.jsx)("div",{className:"margin-top--md",children:(0,u.jsx)(b,{versionLabel:p.label,to:x.path,onClick:()=>d(p.name)})})]})}function x(e){let{className:t}=e;const n=(0,d.r)();return n.banner?(0,u.jsx)(p,{className:t,versionMetadata:n}):null}}}]);
\ No newline at end of file
diff --git a/assets/js/17896441.2b7135b0.js b/assets/js/17896441.2b7135b0.js
deleted file mode 100644
index 81b38a49..00000000
--- a/assets/js/17896441.2b7135b0.js
+++ /dev/null
@@ -1 +0,0 @@
-(self.webpackChunkgreenfield_js_sdk_docs=self.webpackChunkgreenfield_js_sdk_docs||[]).push([[401],{4803:(e,t,n)=>{"use strict";n.d(t,{A:()=>b});n(8318);var s=n(3372),a=n(9023),o=n(1462),i=n(5977),c=n(908),l=n(7084),r=n(823),d=n(9214);function u(e){return(0,d.jsx)("svg",{viewBox:"0 0 24 24",...e,children:(0,d.jsx)("path",{d:"M10 19v-5h4v5c0 .55.45 1 1 1h3c.55 0 1-.45 1-1v-7h1.7c.46 0 .68-.57.33-.87L12.67 3.6c-.38-.34-.96-.34-1.34 0l-8.36 7.53c-.34.3-.13.87.33.87H5v7c0 .55.45 1 1 1h3c.55 0 1-.45 1-1z",fill:"currentColor"})})}const m={breadcrumbHomeIcon:"breadcrumbHomeIcon_RqSR"};function h(){const e=(0,r.A)("/");return(0,d.jsx)("li",{className:"breadcrumbs__item",children:(0,d.jsx)(c.A,{"aria-label":(0,l.T)({id:"theme.docs.breadcrumbs.home",message:"Home page",description:"The ARIA label for the home page in the breadcrumbs"}),className:"breadcrumbs__link",href:e,children:(0,d.jsx)(u,{className:m.breadcrumbHomeIcon})})})}const p={breadcrumbsContainer:"breadcrumbsContainer_lZus"};function f(e){let{children:t,href:n,isLast:s}=e;const a="breadcrumbs__link";return s?(0,d.jsx)("span",{className:a,itemProp:"name",children:t}):n?(0,d.jsx)(c.A,{className:a,href:n,itemProp:"item",children:(0,d.jsx)("span",{itemProp:"name",children:t})}):(0,d.jsx)("span",{className:a,children:t})}function x(e){let{children:t,active:n,index:a,addMicrodata:o}=e;return(0,d.jsxs)("li",{...o&&{itemScope:!0,itemProp:"itemListElement",itemType:"https://schema.org/ListItem"},className:(0,s.A)("breadcrumbs__item",{"breadcrumbs__item--active":n}),children:[t,(0,d.jsx)("meta",{itemProp:"position",content:String(a+1)})]})}function b(){const e=(0,o.OF)(),t=(0,i.Dt)();return e?(0,d.jsx)("nav",{className:(0,s.A)(a.G.docs.docBreadcrumbs,p.breadcrumbsContainer),"aria-label":(0,l.T)({id:"theme.docs.breadcrumbs.navAriaLabel",message:"Breadcrumbs",description:"The ARIA label for the breadcrumbs"}),children:(0,d.jsxs)("ul",{className:"breadcrumbs",itemScope:!0,itemType:"https://schema.org/BreadcrumbList",children:[t&&(0,d.jsx)(h,{}),e.map(((t,n)=>{const s=n===e.length-1,a="category"===t.type&&t.linkUnlisted?void 0:t.href;return(0,d.jsx)(x,{active:s,index:n,addMicrodata:!!a,children:(0,d.jsx)(f,{href:a,isLast:s,children:t.label})},n)}))]})}):null}},9277:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>Tt});var s=n(8318),a=n(5679),o=n(7972),i=n(9214);const c=s.createContext(null);function l(e){let{children:t,content:n}=e;const a=function(e){return(0,s.useMemo)((()=>({metadata:e.metadata,frontMatter:e.frontMatter,assets:e.assets,contentTitle:e.contentTitle,toc:e.toc})),[e])}(n);return(0,i.jsx)(c.Provider,{value:a,children:t})}function r(){const e=(0,s.useContext)(c);if(null===e)throw new o.dV("DocProvider");return e}function d(){const{metadata:e,frontMatter:t,assets:n}=r();return(0,i.jsx)(a.be,{title:e.title,description:e.description,keywords:t.keywords,image:n.image??t.image})}var u=n(3372),m=n(4893),h=n(5898);function p(){const{metadata:e}=r();return(0,i.jsx)(h.A,{previous:e.previous,next:e.next})}var f=n(3440),x=n(1145),b=n(9023),g=n(7084),v=n(908);const j={tag:"tag_BKO8",tagRegular:"tagRegular_vReb",tagWithCount:"tagWithCount_QlZQ"};function N(e){let{permalink:t,label:n,count:s}=e;return(0,i.jsxs)(v.A,{href:t,className:(0,u.A)(j.tag,s?j.tagWithCount:j.tagRegular),children:[n,s&&(0,i.jsx)("span",{children:s})]})}const A={tags:"tags_yFON",tag:"tag_zToO"};function C(e){let{tags:t}=e;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("b",{children:(0,i.jsx)(g.A,{id:"theme.tags.tagsListLabel",description:"The label alongside a tag list",children:"Tags:"})}),(0,i.jsx)("ul",{className:(0,u.A)(A.tags,"padding--none","margin-left--sm"),children:t.map((e=>{let{label:t,permalink:n}=e;return(0,i.jsx)("li",{className:A.tag,children:(0,i.jsx)(N,{label:t,permalink:n})},n)}))})]})}const k={iconEdit:"iconEdit_pI7w"};function L(e){let{className:t,...n}=e;return(0,i.jsx)("svg",{fill:"currentColor",height:"20",width:"20",viewBox:"0 0 40 40",className:(0,u.A)(k.iconEdit,t),"aria-hidden":"true",...n,children:(0,i.jsx)("g",{children:(0,i.jsx)("path",{d:"m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"})})})}function y(e){let{editUrl:t}=e;return(0,i.jsxs)(v.A,{to:t,className:b.G.common.editThisPage,children:[(0,i.jsx)(L,{}),(0,i.jsx)(g.A,{id:"theme.common.editThisPage",description:"The link label to edit the current page",children:"Edit this page"})]})}var _=n(9780);function B(e){void 0===e&&(e={});const{i18n:{currentLocale:t}}=(0,_.A)(),n=function(){const{i18n:{currentLocale:e,localeConfigs:t}}=(0,_.A)();return t[e].calendar}();return new Intl.DateTimeFormat(t,{calendar:n,...e})}function w(e){let{lastUpdatedAt:t}=e;const n=new Date(t),s=B({day:"numeric",month:"short",year:"numeric",timeZone:"UTC"}).format(n);return(0,i.jsx)(g.A,{id:"theme.lastUpdated.atDate",description:"The words used to describe on which date a page has been last updated",values:{date:(0,i.jsx)("b",{children:(0,i.jsx)("time",{dateTime:n.toISOString(),itemProp:"dateModified",children:s})})},children:" on {date}"})}function T(e){let{lastUpdatedBy:t}=e;return(0,i.jsx)(g.A,{id:"theme.lastUpdated.byUser",description:"The words used to describe by who the page has been last updated",values:{user:(0,i.jsx)("b",{children:t})},children:" by {user}"})}function E(e){let{lastUpdatedAt:t,lastUpdatedBy:n}=e;return(0,i.jsxs)("span",{className:b.G.common.lastUpdated,children:[(0,i.jsx)(g.A,{id:"theme.lastUpdated.lastUpdatedAtBy",description:"The sentence used to display when a page has been last updated, and by who",values:{atDate:t?(0,i.jsx)(w,{lastUpdatedAt:t}):"",byUser:n?(0,i.jsx)(T,{lastUpdatedBy:n}):""},children:"Last updated{atDate}{byUser}"}),!1]})}const H={lastUpdated:"lastUpdated_MoxG"};function M(e){let{className:t,editUrl:n,lastUpdatedAt:s,lastUpdatedBy:a}=e;return(0,i.jsxs)("div",{className:(0,u.A)("row",t),children:[(0,i.jsx)("div",{className:"col",children:n&&(0,i.jsx)(y,{editUrl:n})}),(0,i.jsx)("div",{className:(0,u.A)("col",H.lastUpdated),children:(s||a)&&(0,i.jsx)(E,{lastUpdatedAt:s,lastUpdatedBy:a})})]})}function I(){const{metadata:e}=r(),{editUrl:t,lastUpdatedAt:n,lastUpdatedBy:s,tags:a}=e,o=a.length>0,c=!!(t||n||s);return o||c?(0,i.jsxs)("footer",{className:(0,u.A)(b.G.docs.docFooter,"docusaurus-mt-lg"),children:[o&&(0,i.jsx)("div",{className:(0,u.A)("row margin-top--sm",b.G.docs.docFooterTagsRow),children:(0,i.jsx)("div",{className:"col",children:(0,i.jsx)(C,{tags:a})})}),c&&(0,i.jsx)(M,{className:(0,u.A)("margin-top--sm",b.G.docs.docFooterEditMetaRow),editUrl:t,lastUpdatedAt:n,lastUpdatedBy:s})]}):null}var S=n(1270),U=n(8462);function R(e){const t=e.map((e=>({...e,parentIndex:-1,children:[]}))),n=Array(7).fill(-1);t.forEach(((e,t)=>{const s=n.slice(2,e.level);e.parentIndex=Math.max(...s),n[e.level]=t}));const s=[];return t.forEach((e=>{const{parentIndex:n,...a}=e;n>=0?t[n].children.push(a):s.push(a)})),s}function z(e){let{toc:t,minHeadingLevel:n,maxHeadingLevel:s}=e;return t.flatMap((e=>{const t=z({toc:e.children,minHeadingLevel:n,maxHeadingLevel:s});return function(e){return e.level>=n&&e.level<=s}(e)?[{...e,children:t}]:t}))}function O(e){const t=e.getBoundingClientRect();return t.top===t.bottom?O(e.parentNode):t}function V(e,t){let{anchorTopOffset:n}=t;const s=e.find((e=>O(e).top>=n));if(s){return function(e){return e.top>0&&e.bottom["'])(?.*?)\1/,me=/\{(? [\d,-]+)\}/,he={js:{start:"\\/\\/",end:""},jsBlock:{start:"\\/\\*",end:"\\*\\/"},jsx:{start:"\\{\\s*\\/\\*",end:"\\*\\/\\s*\\}"},bash:{start:"#",end:""},html:{start:"\x3c!--",end:"--\x3e"}},pe={...he,lua:{start:"--",end:""},wasm:{start:"\\;\\;",end:""},tex:{start:"%",end:""},vb:{start:"['\u2018\u2019]",end:""},vbnet:{start:"(?:_\\s*)?['\u2018\u2019]",end:""},rem:{start:"[Rr][Ee][Mm]\\b",end:""},f90:{start:"!",end:""},ml:{start:"\\(\\*",end:"\\*\\)"},cobol:{start:"\\*>",end:""}},fe=Object.keys(he);function xe(e,t){const n=e.map((e=>{const{start:n,end:s}=pe[e];return`(?:${n}\\s*(${t.flatMap((e=>[e.line,e.block?.start,e.block?.end].filter(Boolean))).join("|")})\\s*${s})`})).join("|");return new RegExp(`^\\s*(?:${n})\\s*$`)}function be(e,t){let n=e.replace(/\n$/,"");const{language:s,magicComments:a,metastring:o}=t;if(o&&me.test(o)){const e=o.match(me).groups.range;if(0===a.length)throw new Error(`A highlight range has been given in code block's metastring (\`\`\` ${o}), but no magic comment config is available. Docusaurus applies the first magic comment entry's className for metastring ranges.`);const t=a[0].className,s=de()(e).filter((e=>e>0)).map((e=>[e-1,[t]]));return{lineClassNames:Object.fromEntries(s),code:n}}if(void 0===s)return{lineClassNames:{},code:n};const i=function(e,t){switch(e){case"js":case"javascript":case"ts":case"typescript":return xe(["js","jsBlock"],t);case"jsx":case"tsx":return xe(["js","jsBlock","jsx"],t);case"html":return xe(["js","jsBlock","html"],t);case"python":case"py":case"bash":return xe(["bash"],t);case"markdown":case"md":return xe(["html","jsx","bash"],t);case"tex":case"latex":case"matlab":return xe(["tex"],t);case"lua":case"haskell":case"sql":return xe(["lua"],t);case"wasm":return xe(["wasm"],t);case"vb":case"vba":case"visual-basic":return xe(["vb","rem"],t);case"vbnet":return xe(["vbnet","rem"],t);case"batch":return xe(["rem"],t);case"basic":return xe(["rem","f90"],t);case"fsharp":return xe(["js","ml"],t);case"ocaml":case"sml":return xe(["ml"],t);case"fortran":return xe(["f90"],t);case"cobol":return xe(["cobol"],t);default:return xe(fe,t)}}(s,a),c=n.split("\n"),l=Object.fromEntries(a.map((e=>[e.className,{start:0,range:""}]))),r=Object.fromEntries(a.filter((e=>e.line)).map((e=>{let{className:t,line:n}=e;return[n,t]}))),d=Object.fromEntries(a.filter((e=>e.block)).map((e=>{let{className:t,block:n}=e;return[n.start,t]}))),u=Object.fromEntries(a.filter((e=>e.block)).map((e=>{let{className:t,block:n}=e;return[n.end,t]})));for(let h=0;h void 0!==e));r[t]?l[r[t]].range+=`${h},`:d[t]?l[d[t]].start=h:u[t]&&(l[u[t]].range+=`${l[u[t]].start}-${h-1},`),c.splice(h,1)}n=c.join("\n");const m={};return Object.entries(l).forEach((e=>{let[t,{range:n}]=e;de()(n).forEach((e=>{m[e]??=[],m[e].push(t)}))})),{lineClassNames:m,code:n}}const ge={codeBlockContainer:"codeBlockContainer_GZNp"};function ve(e){let{as:t,...n}=e;const s=function(e){const t={color:"--prism-color",backgroundColor:"--prism-background-color"},n={};return Object.entries(e.plain).forEach((e=>{let[s,a]=e;const o=t[s];o&&"string"==typeof a&&(n[o]=a)})),n}(le());return(0,i.jsx)(t,{...n,style:s,className:(0,u.A)(n.className,ge.codeBlockContainer,b.G.common.codeBlock)})}const je={codeBlockContent:"codeBlockContent_p3BZ",codeBlockTitle:"codeBlockTitle_a7Bi",codeBlock:"codeBlock_gOL6",codeBlockStandalone:"codeBlockStandalone_AcKV",codeBlockLines:"codeBlockLines_C1CL",codeBlockLinesWithNumbering:"codeBlockLinesWithNumbering_A_u_",buttonGroup:"buttonGroup_YXlW"};function Ne(e){let{children:t,className:n}=e;return(0,i.jsx)(ve,{as:"pre",tabIndex:0,className:(0,u.A)(je.codeBlockStandalone,"thin-scrollbar",n),children:(0,i.jsx)("code",{className:je.codeBlockLines,children:t})})}const Ae={attributes:!0,characterData:!0,childList:!0,subtree:!0};function Ce(e,t){const[n,a]=(0,s.useState)(),i=(0,s.useCallback)((()=>{a(e.current?.closest("[role=tabpanel][hidden]"))}),[e,a]);(0,s.useEffect)((()=>{i()}),[i]),function(e,t,n){void 0===n&&(n=Ae);const a=(0,o._q)(t),i=(0,o.Be)(n);(0,s.useEffect)((()=>{const t=new MutationObserver(a);return e&&t.observe(e,i),()=>t.disconnect()}),[e,a,i])}(n,(e=>{e.forEach((e=>{"attributes"===e.type&&"hidden"===e.attributeName&&(t(),i())}))}),{attributes:!0,characterData:!1,childList:!1,subtree:!1})}var ke=n(9095);const Le={codeLine:"codeLine_ptHe",codeLineNumber:"codeLineNumber_eWxL",codeLineContent:"codeLineContent_V0Ww"};function ye(e){let{line:t,classNames:n,showLineNumbers:s,getLineProps:a,getTokenProps:o}=e;1===t.length&&"\n"===t[0].content&&(t[0].content="");const c=a({line:t,className:(0,u.A)(n,s&&Le.codeLine)}),l=t.map(((e,t)=>(0,i.jsx)("span",{...o({token:e,key:t})},t)));return(0,i.jsxs)("span",{...c,children:[s?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("span",{className:Le.codeLineNumber}),(0,i.jsx)("span",{className:Le.codeLineContent,children:l})]}):l,(0,i.jsx)("br",{})]})}function _e(e){return(0,i.jsx)("svg",{viewBox:"0 0 24 24",...e,children:(0,i.jsx)("path",{fill:"currentColor",d:"M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"})})}function Be(e){return(0,i.jsx)("svg",{viewBox:"0 0 24 24",...e,children:(0,i.jsx)("path",{fill:"currentColor",d:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"})})}const we={copyButtonCopied:"copyButtonCopied_xwQT",copyButtonIcons:"copyButtonIcons_P3LL",copyButtonIcon:"copyButtonIcon_cekT",copyButtonSuccessIcon:"copyButtonSuccessIcon_i9ru"};function Te(e){let{code:t,className:n}=e;const[a,o]=(0,s.useState)(!1),c=(0,s.useRef)(void 0),l=(0,s.useCallback)((()=>{!function(e,t){let{target:n=document.body}=void 0===t?{}:t;if("string"!=typeof e)throw new TypeError(`Expected parameter \`text\` to be a \`string\`, got \`${typeof e}\`.`);const s=document.createElement("textarea"),a=document.activeElement;s.value=e,s.setAttribute("readonly",""),s.style.contain="strict",s.style.position="absolute",s.style.left="-9999px",s.style.fontSize="12pt";const o=document.getSelection(),i=o.rangeCount>0&&o.getRangeAt(0);n.append(s),s.select(),s.selectionStart=0,s.selectionEnd=e.length;let c=!1;try{c=document.execCommand("copy")}catch{}s.remove(),i&&(o.removeAllRanges(),o.addRange(i)),a&&a.focus()}(t),o(!0),c.current=window.setTimeout((()=>{o(!1)}),1e3)}),[t]);return(0,s.useEffect)((()=>()=>window.clearTimeout(c.current)),[]),(0,i.jsx)("button",{type:"button","aria-label":a?(0,g.T)({id:"theme.CodeBlock.copied",message:"Copied",description:"The copied button label on code blocks"}):(0,g.T)({id:"theme.CodeBlock.copyButtonAriaLabel",message:"Copy code to clipboard",description:"The ARIA label for copy code blocks button"}),title:(0,g.T)({id:"theme.CodeBlock.copy",message:"Copy",description:"The copy button label on code blocks"}),className:(0,u.A)("clean-btn",n,we.copyButton,a&&we.copyButtonCopied),onClick:l,children:(0,i.jsxs)("span",{className:we.copyButtonIcons,"aria-hidden":"true",children:[(0,i.jsx)(_e,{className:we.copyButtonIcon}),(0,i.jsx)(Be,{className:we.copyButtonSuccessIcon})]})})}function Ee(e){return(0,i.jsx)("svg",{viewBox:"0 0 24 24",...e,children:(0,i.jsx)("path",{fill:"currentColor",d:"M4 19h6v-2H4v2zM20 5H4v2h16V5zm-3 6H4v2h13.25c1.1 0 2 .9 2 2s-.9 2-2 2H15v-2l-3 3l3 3v-2h2c2.21 0 4-1.79 4-4s-1.79-4-4-4z"})})}const He={wordWrapButtonIcon:"wordWrapButtonIcon_InWb",wordWrapButtonEnabled:"wordWrapButtonEnabled_xg9q"};function Me(e){let{className:t,onClick:n,isEnabled:s}=e;const a=(0,g.T)({id:"theme.CodeBlock.wordWrapToggle",message:"Toggle word wrap",description:"The title attribute for toggle word wrapping button of code block lines"});return(0,i.jsx)("button",{type:"button",onClick:n,className:(0,u.A)("clean-btn",t,s&&He.wordWrapButtonEnabled),"aria-label":a,title:a,children:(0,i.jsx)(Ee,{className:He.wordWrapButtonIcon,"aria-hidden":"true"})})}function Ie(e){let{children:t,className:n="",metastring:a,title:o,showLineNumbers:c,language:l}=e;const{prism:{defaultLanguage:r,magicComments:d}}=(0,U.p)(),m=function(e){return e?.toLowerCase()}(l??function(e){const t=e.split(" ").find((e=>e.startsWith("language-")));return t?.replace(/language-/,"")}(n)??r),h=le(),p=function(){const[e,t]=(0,s.useState)(!1),[n,a]=(0,s.useState)(!1),o=(0,s.useRef)(null),i=(0,s.useCallback)((()=>{const n=o.current.querySelector("code");e?n.removeAttribute("style"):(n.style.whiteSpace="pre-wrap",n.style.overflowWrap="anywhere"),t((e=>!e))}),[o,e]),c=(0,s.useCallback)((()=>{const{scrollWidth:e,clientWidth:t}=o.current,n=e>t||o.current.querySelector("code").hasAttribute("style");a(n)}),[o]);return Ce(o,c),(0,s.useEffect)((()=>{c()}),[e,c]),(0,s.useEffect)((()=>(window.addEventListener("resize",c,{passive:!0}),()=>{window.removeEventListener("resize",c)})),[c]),{codeBlockRef:o,isEnabled:e,isCodeScrollable:n,toggle:i}}(),f=function(e){return e?.match(ue)?.groups.title??""}(a)||o,{lineClassNames:x,code:b}=be(t,{metastring:a,language:m,magicComments:d}),g=c??function(e){return Boolean(e?.includes("showLineNumbers"))}(a);return(0,i.jsxs)(ve,{as:"div",className:(0,u.A)(n,m&&!n.includes(`language-${m}`)&&`language-${m}`),children:[f&&(0,i.jsx)("div",{className:je.codeBlockTitle,children:f}),(0,i.jsxs)("div",{className:je.codeBlockContent,children:[(0,i.jsx)(ke.f4,{theme:h,code:b,language:m??"text",children:e=>{let{className:t,style:n,tokens:s,getLineProps:a,getTokenProps:o}=e;return(0,i.jsx)("pre",{tabIndex:0,ref:p.codeBlockRef,className:(0,u.A)(t,je.codeBlock,"thin-scrollbar"),style:n,children:(0,i.jsx)("code",{className:(0,u.A)(je.codeBlockLines,g&&je.codeBlockLinesWithNumbering),children:s.map(((e,t)=>(0,i.jsx)(ye,{line:e,getLineProps:a,getTokenProps:o,classNames:x[t],showLineNumbers:g},t)))})})}}),(0,i.jsxs)("div",{className:je.buttonGroup,children:[(p.isEnabled||p.isCodeScrollable)&&(0,i.jsx)(Me,{className:je.codeButton,onClick:()=>p.toggle(),isEnabled:p.isEnabled}),(0,i.jsx)(Te,{className:je.codeButton,code:b})]})]})]})}function Se(e){let{children:t,...n}=e;const a=(0,ie.A)(),o=function(e){return s.Children.toArray(e).some((e=>(0,s.isValidElement)(e)))?e:Array.isArray(e)?e.join(""):e}(t),c="string"==typeof o?Ie:Ne;return(0,i.jsx)(c,{...n,children:o},String(a))}function Ue(e){return(0,i.jsx)("code",{...e})}var Re=n(2717);const ze={details:"details_Ptag",isBrowser:"isBrowser_BWKI",collapsibleContent:"collapsibleContent_tM82"};function Oe(e){return!!e&&("SUMMARY"===e.tagName||Oe(e.parentElement))}function Ve(e,t){return!!e&&(e===t||Ve(e.parentElement,t))}function Pe(e){let{summary:t,children:n,...a}=e;(0,Re.A)().collectAnchor(a.id);const o=(0,ie.A)(),c=(0,s.useRef)(null),{collapsed:l,setCollapsed:r}=(0,S.u)({initialState:!a.open}),[d,m]=(0,s.useState)(a.open),h=s.isValidElement(t)?t:(0,i.jsx)("summary",{children:t??"Details"});return(0,i.jsxs)("details",{...a,ref:c,open:d,"data-collapsed":l,className:(0,u.A)(ze.details,o&&ze.isBrowser,a.className),onMouseDown:e=>{Oe(e.target)&&e.detail>1&&e.preventDefault()},onClick:e=>{e.stopPropagation();const t=e.target;Oe(t)&&Ve(t,c.current)&&(e.preventDefault(),l?(r(!1),m(!0)):r(!0))},children:[h,(0,i.jsx)(S.N,{lazy:!1,collapsed:l,disableSSRStyle:!0,onCollapseTransitionEnd:e=>{r(e),m(!e)},children:(0,i.jsx)("div",{className:ze.collapsibleContent,children:n})})]})}const We={details:"details_JFdN"},Ge="alert alert--info";function De(e){let{...t}=e;return(0,i.jsx)(Pe,{...t,className:(0,u.A)(Ge,We.details,t.className)})}function $e(e){const t=s.Children.toArray(e.children),n=t.find((e=>s.isValidElement(e)&&"summary"===e.type)),a=(0,i.jsx)(i.Fragment,{children:t.filter((e=>e!==n))});return(0,i.jsx)(De,{...e,summary:n,children:a})}function Fe(e){return(0,i.jsx)(se.A,{...e})}const qe={containsTaskList:"containsTaskList_pO87"};function Ze(e){if(void 0!==e)return(0,u.A)(e,e?.includes("contains-task-list")&&qe.containsTaskList)}const Ke={img:"img_pcT_"};function Qe(e){const{mdxAdmonitionTitle:t,rest:n}=function(e){const t=s.Children.toArray(e),n=t.find((e=>s.isValidElement(e)&&"mdxAdmonitionTitle"===e.type)),a=t.filter((e=>e!==n)),o=n?.props.children;return{mdxAdmonitionTitle:o,rest:a.length>0?(0,i.jsx)(i.Fragment,{children:a}):null}}(e.children),a=e.title??t;return{...e,...a&&{title:a},children:n}}const Ye={admonition:"admonition_ZDKB",admonitionHeading:"admonitionHeading_R3Ez",admonitionIcon:"admonitionIcon_F19i",admonitionContent:"admonitionContent_Zzre"};function Je(e){let{type:t,className:n,children:s}=e;return(0,i.jsx)("div",{className:(0,u.A)(b.G.common.admonition,b.G.common.admonitionType(t),Ye.admonition,n),children:s})}function Xe(e){let{icon:t,title:n}=e;return(0,i.jsxs)("div",{className:Ye.admonitionHeading,children:[(0,i.jsx)("span",{className:Ye.admonitionIcon,children:t}),n]})}function et(e){let{children:t}=e;return t?(0,i.jsx)("div",{className:Ye.admonitionContent,children:t}):null}function tt(e){const{type:t,icon:n,title:s,children:a,className:o}=e;return(0,i.jsxs)(Je,{type:t,className:o,children:[(0,i.jsx)(Xe,{title:s,icon:n}),(0,i.jsx)(et,{children:a})]})}function nt(e){return(0,i.jsx)("svg",{viewBox:"0 0 14 16",...e,children:(0,i.jsx)("path",{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})})}const st={icon:(0,i.jsx)(nt,{}),title:(0,i.jsx)(g.A,{id:"theme.admonition.note",description:"The default label used for the Note admonition (:::note)",children:"note"})};function at(e){return(0,i.jsx)(tt,{...st,...e,className:(0,u.A)("alert alert--secondary",e.className),children:e.children})}function ot(e){return(0,i.jsx)("svg",{viewBox:"0 0 12 16",...e,children:(0,i.jsx)("path",{fillRule:"evenodd",d:"M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"})})}const it={icon:(0,i.jsx)(ot,{}),title:(0,i.jsx)(g.A,{id:"theme.admonition.tip",description:"The default label used for the Tip admonition (:::tip)",children:"tip"})};function ct(e){return(0,i.jsx)(tt,{...it,...e,className:(0,u.A)("alert alert--success",e.className),children:e.children})}function lt(e){return(0,i.jsx)("svg",{viewBox:"0 0 14 16",...e,children:(0,i.jsx)("path",{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})})}const rt={icon:(0,i.jsx)(lt,{}),title:(0,i.jsx)(g.A,{id:"theme.admonition.info",description:"The default label used for the Info admonition (:::info)",children:"info"})};function dt(e){return(0,i.jsx)(tt,{...rt,...e,className:(0,u.A)("alert alert--info",e.className),children:e.children})}function ut(e){return(0,i.jsx)("svg",{viewBox:"0 0 16 16",...e,children:(0,i.jsx)("path",{fillRule:"evenodd",d:"M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"})})}const mt={icon:(0,i.jsx)(ut,{}),title:(0,i.jsx)(g.A,{id:"theme.admonition.warning",description:"The default label used for the Warning admonition (:::warning)",children:"warning"})};function ht(e){return(0,i.jsx)("svg",{viewBox:"0 0 12 16",...e,children:(0,i.jsx)("path",{fillRule:"evenodd",d:"M5.05.31c.81 2.17.41 3.38-.52 4.31C3.55 5.67 1.98 6.45.9 7.98c-1.45 2.05-1.7 6.53 3.53 7.7-2.2-1.16-2.67-4.52-.3-6.61-.61 2.03.53 3.33 1.94 2.86 1.39-.47 2.3.53 2.27 1.67-.02.78-.31 1.44-1.13 1.81 3.42-.59 4.78-3.42 4.78-5.56 0-2.84-2.53-3.22-1.25-5.61-1.52.13-2.03 1.13-1.89 2.75.09 1.08-1.02 1.8-1.86 1.33-.67-.41-.66-1.19-.06-1.78C8.18 5.31 8.68 2.45 5.05.32L5.03.3l.02.01z"})})}const pt={icon:(0,i.jsx)(ht,{}),title:(0,i.jsx)(g.A,{id:"theme.admonition.danger",description:"The default label used for the Danger admonition (:::danger)",children:"danger"})};const ft={icon:(0,i.jsx)(ut,{}),title:(0,i.jsx)(g.A,{id:"theme.admonition.caution",description:"The default label used for the Caution admonition (:::caution)",children:"caution"})};const xt={...{note:at,tip:ct,info:dt,warning:function(e){return(0,i.jsx)(tt,{...mt,...e,className:(0,u.A)("alert alert--warning",e.className),children:e.children})},danger:function(e){return(0,i.jsx)(tt,{...pt,...e,className:(0,u.A)("alert alert--danger",e.className),children:e.children})}},...{secondary:e=>(0,i.jsx)(at,{title:"secondary",...e}),important:e=>(0,i.jsx)(dt,{title:"important",...e}),success:e=>(0,i.jsx)(ct,{title:"success",...e}),caution:function(e){return(0,i.jsx)(tt,{...ft,...e,className:(0,u.A)("alert alert--warning",e.className),children:e.children})}}};function bt(e){const t=Qe(e),n=(s=t.type,xt[s]||(console.warn(`No admonition component found for admonition type "${s}". Using Info as fallback.`),xt.info));var s;return(0,i.jsx)(n,{...t})}var gt=n(4412);const vt={Head:oe.A,details:$e,Details:$e,code:function(e){return function(e){return void 0!==e.children&&s.Children.toArray(e.children).every((e=>"string"==typeof e&&!e.includes("\n")))}(e)?(0,i.jsx)(Ue,{...e}):(0,i.jsx)(Se,{...e})},a:function(e){return(0,i.jsx)(v.A,{...e})},pre:function(e){return(0,i.jsx)(i.Fragment,{children:e.children})},ul:function(e){return(0,i.jsx)("ul",{...e,className:Ze(e.className)})},li:function(e){return(0,Re.A)().collectAnchor(e.id),(0,i.jsx)("li",{...e})},img:function(e){return(0,i.jsx)("img",{decoding:"async",loading:"lazy",...e,className:(t=e.className,(0,u.A)(t,Ke.img))});var t},h1:e=>(0,i.jsx)(Fe,{as:"h1",...e}),h2:e=>(0,i.jsx)(Fe,{as:"h2",...e}),h3:e=>(0,i.jsx)(Fe,{as:"h3",...e}),h4:e=>(0,i.jsx)(Fe,{as:"h4",...e}),h5:e=>(0,i.jsx)(Fe,{as:"h5",...e}),h6:e=>(0,i.jsx)(Fe,{as:"h6",...e}),admonition:bt,mermaid:gt.A};function jt(e){let{children:t}=e;return(0,i.jsx)(ae.x,{components:vt,children:t})}function Nt(e){let{children:t}=e;const n=function(){const{metadata:e,frontMatter:t,contentTitle:n}=r();return t.hide_title||void 0!==n?null:e.title}();return(0,i.jsxs)("div",{className:(0,u.A)(b.G.docs.docMarkdown,"markdown"),children:[n&&(0,i.jsx)("header",{children:(0,i.jsx)(se.A,{as:"h1",children:n})}),(0,i.jsx)(jt,{children:t})]})}var At=n(4803);function Ct(){return(0,i.jsx)(g.A,{id:"theme.unlistedContent.title",description:"The unlisted content banner title",children:"Unlisted page"})}function kt(){return(0,i.jsx)(g.A,{id:"theme.unlistedContent.message",description:"The unlisted content banner message",children:"This page is unlisted. Search engines will not index it, and only users having a direct link can access it."})}function Lt(){return(0,i.jsx)(oe.A,{children:(0,i.jsx)("meta",{name:"robots",content:"noindex, nofollow"})})}function yt(e){let{className:t}=e;return(0,i.jsx)(bt,{type:"caution",title:(0,i.jsx)(Ct,{}),className:(0,u.A)(t,b.G.common.unlistedBanner),children:(0,i.jsx)(kt,{})})}function _t(e){return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Lt,{}),(0,i.jsx)(yt,{...e})]})}const Bt={docItemContainer:"docItemContainer_PHQX",docItemCol:"docItemCol_WL6M"};function wt(e){let{children:t}=e;const n=function(){const{frontMatter:e,toc:t}=r(),n=(0,m.l)(),s=e.hide_table_of_contents,a=!s&&t.length>0;return{hidden:s,mobile:a?(0,i.jsx)(Y,{}):void 0,desktop:!a||"desktop"!==n&&"ssr"!==n?void 0:(0,i.jsx)(ne,{})}}(),{metadata:{unlisted:s}}=r();return(0,i.jsxs)("div",{className:"row",children:[(0,i.jsxs)("div",{className:(0,u.A)("col",!n.hidden&&Bt.docItemCol),children:[s&&(0,i.jsx)(_t,{}),(0,i.jsx)(f.A,{}),(0,i.jsxs)("div",{className:Bt.docItemContainer,children:[(0,i.jsxs)("article",{children:[(0,i.jsx)(At.A,{}),(0,i.jsx)(x.A,{}),n.mobile,(0,i.jsx)(Nt,{children:t}),(0,i.jsx)(I,{})]}),(0,i.jsx)(p,{})]})]}),n.desktop&&(0,i.jsx)("div",{className:"col col--3",children:n.desktop})]})}function Tt(e){const t=`docs-doc-id-${e.content.metadata.id}`,n=e.content;return(0,i.jsx)(l,{content:e.content,children:(0,i.jsxs)(a.e3,{className:t,children:[(0,i.jsx)(d,{}),(0,i.jsx)(wt,{children:(0,i.jsx)(n,{})})]})})}},5898:(e,t,n)=>{"use strict";n.d(t,{A:()=>l});n(8318);var s=n(7084),a=n(3372),o=n(908),i=n(9214);function c(e){const{permalink:t,title:n,subLabel:s,isNext:c}=e;return(0,i.jsxs)(o.A,{className:(0,a.A)("pagination-nav__link",c?"pagination-nav__link--next":"pagination-nav__link--prev"),to:t,children:[s&&(0,i.jsx)("div",{className:"pagination-nav__sublabel",children:s}),(0,i.jsx)("div",{className:"pagination-nav__label",children:n})]})}function l(e){const{previous:t,next:n}=e;return(0,i.jsxs)("nav",{className:"pagination-nav docusaurus-mt-lg","aria-label":(0,s.T)({id:"theme.docs.paginator.navAriaLabel",message:"Docs pages",description:"The ARIA label for the docs pagination"}),children:[t&&(0,i.jsx)(c,{...t,subLabel:(0,i.jsx)(s.A,{id:"theme.docs.paginator.previous",description:"The label used to navigate to the previous doc",children:"Previous"})}),n&&(0,i.jsx)(c,{...n,subLabel:(0,i.jsx)(s.A,{id:"theme.docs.paginator.next",description:"The label used to navigate to the next doc",children:"Next"}),isNext:!0})]})}},1145:(e,t,n)=>{"use strict";n.d(t,{A:()=>l});n(8318);var s=n(3372),a=n(7084),o=n(9023),i=n(4148),c=n(9214);function l(e){let{className:t}=e;const n=(0,i.r)();return n.badge?(0,c.jsx)("span",{className:(0,s.A)(t,o.G.docs.docVersionBadge,"badge badge--secondary"),children:(0,c.jsx)(a.A,{id:"theme.docs.versionBadge.label",values:{versionLabel:n.label},children:"Version: {versionLabel}"})}):null}},3440:(e,t,n)=>{"use strict";n.d(t,{A:()=>x});n(8318);var s=n(3372),a=n(9780),o=n(908),i=n(7084),c=n(5404),l=n(9023),r=n(8933),d=n(4148),u=n(9214);const m={unreleased:function(e){let{siteTitle:t,versionMetadata:n}=e;return(0,u.jsx)(i.A,{id:"theme.docs.versions.unreleasedVersionLabel",description:"The label used to tell the user that he's browsing an unreleased doc version",values:{siteTitle:t,versionLabel:(0,u.jsx)("b",{children:n.label})},children:"This is unreleased documentation for {siteTitle} {versionLabel} version."})},unmaintained:function(e){let{siteTitle:t,versionMetadata:n}=e;return(0,u.jsx)(i.A,{id:"theme.docs.versions.unmaintainedVersionLabel",description:"The label used to tell the user that he's browsing an unmaintained doc version",values:{siteTitle:t,versionLabel:(0,u.jsx)("b",{children:n.label})},children:"This is documentation for {siteTitle} {versionLabel}, which is no longer actively maintained."})}};function h(e){const t=m[e.versionMetadata.banner];return(0,u.jsx)(t,{...e})}function p(e){let{versionLabel:t,to:n,onClick:s}=e;return(0,u.jsx)(i.A,{id:"theme.docs.versions.latestVersionSuggestionLabel",description:"The label used to tell the user to check the latest version",values:{versionLabel:t,latestVersionLink:(0,u.jsx)("b",{children:(0,u.jsx)(o.A,{to:n,onClick:s,children:(0,u.jsx)(i.A,{id:"theme.docs.versions.latestVersionLinkLabel",description:"The label used for the latest version suggestion link label",children:"latest version"})})})},children:"For up-to-date documentation, see the {latestVersionLink} ({versionLabel})."})}function f(e){let{className:t,versionMetadata:n}=e;const{siteConfig:{title:o}}=(0,a.A)(),{pluginId:i}=(0,c.vT)({failfast:!0}),{savePreferredVersionName:d}=(0,r.g1)(i),{latestDocSuggestion:m,latestVersionSuggestion:f}=(0,c.HW)(i),x=m??(b=f).docs.find((e=>e.id===b.mainDocId));var b;return(0,u.jsxs)("div",{className:(0,s.A)(t,l.G.docs.docVersionBanner,"alert alert--warning margin-bottom--md"),role:"alert",children:[(0,u.jsx)("div",{children:(0,u.jsx)(h,{siteTitle:o,versionMetadata:n})}),(0,u.jsx)("div",{className:"margin-top--md",children:(0,u.jsx)(p,{versionLabel:f.label,to:x.path,onClick:()=>d(f.name)})})]})}function x(e){let{className:t}=e;const n=(0,d.r)();return n.banner?(0,u.jsx)(f,{className:t,versionMetadata:n}):null}},1357:(e,t)=>{function n(e){let t,n=[];for(let s of e.split(",").map((e=>e.trim())))if(/^-?\d+$/.test(s))n.push(parseInt(s,10));else if(t=s.match(/^(-?\d+)(-|\.\.\.?|\u2025|\u2026|\u22EF)(-?\d+)$/)){let[e,s,a,o]=t;if(s&&o){s=parseInt(s),o=parseInt(o);const e=s {"use strict";n.d(t,{R:()=>i,x:()=>c});var s=n(8318);const a={},o=s.createContext(a);function i(e){const t=s.useContext(o);return s.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function c(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(a):e.components||a:i(e.components),s.createElement(o.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/17896441.640a1676.js b/assets/js/17896441.640a1676.js new file mode 100644 index 00000000..9b26c516 --- /dev/null +++ b/assets/js/17896441.640a1676.js @@ -0,0 +1 @@ +(self.webpackChunkgreenfield_js_sdk_docs=self.webpackChunkgreenfield_js_sdk_docs||[]).push([[401],{2124:(e,t,n)=>{"use strict";n.d(t,{A:()=>b});n(8318);var s=n(3372),a=n(9166),o=n(8263),i=n(8412),c=n(8965),l=n(6093),r=n(5378),d=n(9214);function u(e){return(0,d.jsx)("svg",{viewBox:"0 0 24 24",...e,children:(0,d.jsx)("path",{d:"M10 19v-5h4v5c0 .55.45 1 1 1h3c.55 0 1-.45 1-1v-7h1.7c.46 0 .68-.57.33-.87L12.67 3.6c-.38-.34-.96-.34-1.34 0l-8.36 7.53c-.34.3-.13.87.33.87H5v7c0 .55.45 1 1 1h3c.55 0 1-.45 1-1z",fill:"currentColor"})})}const m={breadcrumbHomeIcon:"breadcrumbHomeIcon_RqSR"};function h(){const e=(0,r.A)("/");return(0,d.jsx)("li",{className:"breadcrumbs__item",children:(0,d.jsx)(c.A,{"aria-label":(0,l.T)({id:"theme.docs.breadcrumbs.home",message:"Home page",description:"The ARIA label for the home page in the breadcrumbs"}),className:"breadcrumbs__link",href:e,children:(0,d.jsx)(u,{className:m.breadcrumbHomeIcon})})})}const p={breadcrumbsContainer:"breadcrumbsContainer_lZus"};function f(e){let{children:t,href:n,isLast:s}=e;const a="breadcrumbs__link";return s?(0,d.jsx)("span",{className:a,itemProp:"name",children:t}):n?(0,d.jsx)(c.A,{className:a,href:n,itemProp:"item",children:(0,d.jsx)("span",{itemProp:"name",children:t})}):(0,d.jsx)("span",{className:a,children:t})}function x(e){let{children:t,active:n,index:a,addMicrodata:o}=e;return(0,d.jsxs)("li",{...o&&{itemScope:!0,itemProp:"itemListElement",itemType:"https://schema.org/ListItem"},className:(0,s.A)("breadcrumbs__item",{"breadcrumbs__item--active":n}),children:[t,(0,d.jsx)("meta",{itemProp:"position",content:String(a+1)})]})}function b(){const e=(0,o.OF)(),t=(0,i.Dt)();return e?(0,d.jsx)("nav",{className:(0,s.A)(a.G.docs.docBreadcrumbs,p.breadcrumbsContainer),"aria-label":(0,l.T)({id:"theme.docs.breadcrumbs.navAriaLabel",message:"Breadcrumbs",description:"The ARIA label for the breadcrumbs"}),children:(0,d.jsxs)("ul",{className:"breadcrumbs",itemScope:!0,itemType:"https://schema.org/BreadcrumbList",children:[t&&(0,d.jsx)(h,{}),e.map(((t,n)=>{const s=n===e.length-1,a="category"===t.type&&t.linkUnlisted?void 0:t.href;return(0,d.jsx)(x,{active:s,index:n,addMicrodata:!!a,children:(0,d.jsx)(f,{href:a,isLast:s,children:t.label})},n)}))]})}):null}},4687:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>Tt});var s=n(8318),a=n(7173),o=n(9271),i=n(9214);const c=s.createContext(null);function l(e){let{children:t,content:n}=e;const a=function(e){return(0,s.useMemo)((()=>({metadata:e.metadata,frontMatter:e.frontMatter,assets:e.assets,contentTitle:e.contentTitle,toc:e.toc})),[e])}(n);return(0,i.jsx)(c.Provider,{value:a,children:t})}function r(){const e=(0,s.useContext)(c);if(null===e)throw new o.dV("DocProvider");return e}function d(){const{metadata:e,frontMatter:t,assets:n}=r();return(0,i.jsx)(a.be,{title:e.title,description:e.description,keywords:t.keywords,image:n.image??t.image})}var u=n(3372),m=n(4208),h=n(2388);function p(){const{metadata:e}=r();return(0,i.jsx)(h.A,{previous:e.previous,next:e.next})}var f=n(1917),x=n(7086),b=n(9166),g=n(6093),v=n(8965);const j={tag:"tag_BKO8",tagRegular:"tagRegular_vReb",tagWithCount:"tagWithCount_QlZQ"};function N(e){let{permalink:t,label:n,count:s}=e;return(0,i.jsxs)(v.A,{href:t,className:(0,u.A)(j.tag,s?j.tagWithCount:j.tagRegular),children:[n,s&&(0,i.jsx)("span",{children:s})]})}const A={tags:"tags_yFON",tag:"tag_zToO"};function C(e){let{tags:t}=e;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("b",{children:(0,i.jsx)(g.A,{id:"theme.tags.tagsListLabel",description:"The label alongside a tag list",children:"Tags:"})}),(0,i.jsx)("ul",{className:(0,u.A)(A.tags,"padding--none","margin-left--sm"),children:t.map((e=>{let{label:t,permalink:n}=e;return(0,i.jsx)("li",{className:A.tag,children:(0,i.jsx)(N,{label:t,permalink:n})},n)}))})]})}const k={iconEdit:"iconEdit_pI7w"};function L(e){let{className:t,...n}=e;return(0,i.jsx)("svg",{fill:"currentColor",height:"20",width:"20",viewBox:"0 0 40 40",className:(0,u.A)(k.iconEdit,t),"aria-hidden":"true",...n,children:(0,i.jsx)("g",{children:(0,i.jsx)("path",{d:"m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"})})})}function y(e){let{editUrl:t}=e;return(0,i.jsxs)(v.A,{to:t,className:b.G.common.editThisPage,children:[(0,i.jsx)(L,{}),(0,i.jsx)(g.A,{id:"theme.common.editThisPage",description:"The link label to edit the current page",children:"Edit this page"})]})}var _=n(7713);function B(e){void 0===e&&(e={});const{i18n:{currentLocale:t}}=(0,_.A)(),n=function(){const{i18n:{currentLocale:e,localeConfigs:t}}=(0,_.A)();return t[e].calendar}();return new Intl.DateTimeFormat(t,{calendar:n,...e})}function w(e){let{lastUpdatedAt:t}=e;const n=new Date(t),s=B({day:"numeric",month:"short",year:"numeric",timeZone:"UTC"}).format(n);return(0,i.jsx)(g.A,{id:"theme.lastUpdated.atDate",description:"The words used to describe on which date a page has been last updated",values:{date:(0,i.jsx)("b",{children:(0,i.jsx)("time",{dateTime:n.toISOString(),itemProp:"dateModified",children:s})})},children:" on {date}"})}function T(e){let{lastUpdatedBy:t}=e;return(0,i.jsx)(g.A,{id:"theme.lastUpdated.byUser",description:"The words used to describe by who the page has been last updated",values:{user:(0,i.jsx)("b",{children:t})},children:" by {user}"})}function E(e){let{lastUpdatedAt:t,lastUpdatedBy:n}=e;return(0,i.jsxs)("span",{className:b.G.common.lastUpdated,children:[(0,i.jsx)(g.A,{id:"theme.lastUpdated.lastUpdatedAtBy",description:"The sentence used to display when a page has been last updated, and by who",values:{atDate:t?(0,i.jsx)(w,{lastUpdatedAt:t}):"",byUser:n?(0,i.jsx)(T,{lastUpdatedBy:n}):""},children:"Last updated{atDate}{byUser}"}),!1]})}const H={lastUpdated:"lastUpdated_MoxG"};function M(e){let{className:t,editUrl:n,lastUpdatedAt:s,lastUpdatedBy:a}=e;return(0,i.jsxs)("div",{className:(0,u.A)("row",t),children:[(0,i.jsx)("div",{className:"col",children:n&&(0,i.jsx)(y,{editUrl:n})}),(0,i.jsx)("div",{className:(0,u.A)("col",H.lastUpdated),children:(s||a)&&(0,i.jsx)(E,{lastUpdatedAt:s,lastUpdatedBy:a})})]})}function I(){const{metadata:e}=r(),{editUrl:t,lastUpdatedAt:n,lastUpdatedBy:s,tags:a}=e,o=a.length>0,c=!!(t||n||s);return o||c?(0,i.jsxs)("footer",{className:(0,u.A)(b.G.docs.docFooter,"docusaurus-mt-lg"),children:[o&&(0,i.jsx)("div",{className:(0,u.A)("row margin-top--sm",b.G.docs.docFooterTagsRow),children:(0,i.jsx)("div",{className:"col",children:(0,i.jsx)(C,{tags:a})})}),c&&(0,i.jsx)(M,{className:(0,u.A)("margin-top--sm",b.G.docs.docFooterEditMetaRow),editUrl:t,lastUpdatedAt:n,lastUpdatedBy:s})]}):null}var S=n(9725),U=n(8725);function R(e){const t=e.map((e=>({...e,parentIndex:-1,children:[]}))),n=Array(7).fill(-1);t.forEach(((e,t)=>{const s=n.slice(2,e.level);e.parentIndex=Math.max(...s),n[e.level]=t}));const s=[];return t.forEach((e=>{const{parentIndex:n,...a}=e;n>=0?t[n].children.push(a):s.push(a)})),s}function z(e){let{toc:t,minHeadingLevel:n,maxHeadingLevel:s}=e;return t.flatMap((e=>{const t=z({toc:e.children,minHeadingLevel:n,maxHeadingLevel:s});return function(e){return e.level>=n&&e.level<=s}(e)?[{...e,children:t}]:t}))}function O(e){const t=e.getBoundingClientRect();return t.top===t.bottom?O(e.parentNode):t}function V(e,t){let{anchorTopOffset:n}=t;const s=e.find((e=>O(e).top>=n));if(s){return function(e){return e.top>0&&e.bottom {e.current=t?0:document.querySelector(".navbar").clientHeight}),[t]),e}function W(e){const t=(0,s.useRef)(void 0),n=P();(0,s.useEffect)((()=>{if(!e)return()=>{};const{linkClassName:s,linkActiveClassName:a,minHeadingLevel:o,maxHeadingLevel:i}=e;function c(){const e=function(e){return Array.from(document.getElementsByClassName(e))}(s),c=function(e){let{minHeadingLevel:t,maxHeadingLevel:n}=e;const s=[];for(let a=t;a<=n;a+=1)s.push(`h${a}.anchor`);return Array.from(document.querySelectorAll(s.join()))}({minHeadingLevel:o,maxHeadingLevel:i}),l=V(c,{anchorTopOffset:n.current}),r=e.find((e=>l&&l.id===function(e){return decodeURIComponent(e.href.substring(e.href.indexOf("#")+1))}(e)));e.forEach((e=>{!function(e,n){n?(t.current&&t.current!==e&&t.current.classList.remove(a),e.classList.add(a),t.current=e):e.classList.remove(a)}(e,e===r)}))}return document.addEventListener("scroll",c),document.addEventListener("resize",c),c(),()=>{document.removeEventListener("scroll",c),document.removeEventListener("resize",c)}}),[e,n])}function G(e){let{toc:t,className:n,linkClassName:s,isChild:a}=e;return t.length?(0,i.jsx)("ul",{className:a?void 0:n,children:t.map((e=>(0,i.jsxs)("li",{children:[(0,i.jsx)(v.A,{to:`#${e.id}`,className:s??void 0,dangerouslySetInnerHTML:{__html:e.value}}),(0,i.jsx)(G,{isChild:!0,toc:e.children,className:n,linkClassName:s})]},e.id)))}):null}const D=s.memo(G);function $(e){let{toc:t,className:n="table-of-contents table-of-contents__left-border",linkClassName:a="table-of-contents__link",linkActiveClassName:o,minHeadingLevel:c,maxHeadingLevel:l,...r}=e;const d=(0,U.p)(),u=c??d.tableOfContents.minHeadingLevel,m=l??d.tableOfContents.maxHeadingLevel,h=function(e){let{toc:t,minHeadingLevel:n,maxHeadingLevel:a}=e;return(0,s.useMemo)((()=>z({toc:R(t),minHeadingLevel:n,maxHeadingLevel:a})),[t,n,a])}({toc:t,minHeadingLevel:u,maxHeadingLevel:m});return W((0,s.useMemo)((()=>{if(a&&o)return{linkClassName:a,linkActiveClassName:o,minHeadingLevel:u,maxHeadingLevel:m}}),[a,o,u,m])),(0,i.jsx)(D,{toc:h,className:n,linkClassName:a,...r})}const F={tocCollapsibleButton:"tocCollapsibleButton_DVlm",tocCollapsibleButtonExpanded:"tocCollapsibleButtonExpanded_GY6s"};function q(e){let{collapsed:t,...n}=e;return(0,i.jsx)("button",{type:"button",...n,className:(0,u.A)("clean-btn",F.tocCollapsibleButton,!t&&F.tocCollapsibleButtonExpanded,n.className),children:(0,i.jsx)(g.A,{id:"theme.TOCCollapsible.toggleButtonLabel",description:"The label used by the button on the collapsible TOC component",children:"On this page"})})}const Z={tocCollapsible:"tocCollapsible_rxqM",tocCollapsibleContent:"tocCollapsibleContent_GEnM",tocCollapsibleExpanded:"tocCollapsibleExpanded_HFuJ"};function K(e){let{toc:t,className:n,minHeadingLevel:s,maxHeadingLevel:a}=e;const{collapsed:o,toggleCollapsed:c}=(0,S.u)({initialState:!0});return(0,i.jsxs)("div",{className:(0,u.A)(Z.tocCollapsible,!o&&Z.tocCollapsibleExpanded,n),children:[(0,i.jsx)(q,{collapsed:o,onClick:c}),(0,i.jsx)(S.N,{lazy:!0,className:Z.tocCollapsibleContent,collapsed:o,children:(0,i.jsx)($,{toc:t,minHeadingLevel:s,maxHeadingLevel:a})})]})}const Q={tocMobile:"tocMobile_5cyu"};function Y(){const{toc:e,frontMatter:t}=r();return(0,i.jsx)(K,{toc:e,minHeadingLevel:t.toc_min_heading_level,maxHeadingLevel:t.toc_max_heading_level,className:(0,u.A)(b.G.docs.docTocMobile,Q.tocMobile)})}const J={tableOfContents:"tableOfContents_Ebbx",docItemContainer:"docItemContainer_zvOP"},X="table-of-contents__link toc-highlight",ee="table-of-contents__link--active";function te(e){let{className:t,...n}=e;return(0,i.jsx)("div",{className:(0,u.A)(J.tableOfContents,"thin-scrollbar",t),children:(0,i.jsx)($,{...n,linkClassName:X,linkActiveClassName:ee})})}function ne(){const{toc:e,frontMatter:t}=r();return(0,i.jsx)(te,{toc:e,minHeadingLevel:t.toc_min_heading_level,maxHeadingLevel:t.toc_max_heading_level,className:b.G.docs.docTocDesktop})}var se=n(146),ae=n(3159),oe=n(1675),ie=n(5180),ce=n(8310);function le(){const{prism:e}=(0,U.p)(),{colorMode:t}=(0,ce.G)(),n=e.theme,s=e.darkTheme||n;return"dark"===t?s:n}var re=n(1357),de=n.n(re);const ue=/title=(? ["'])(?.*?)\1/,me=/\{(? [\d,-]+)\}/,he={js:{start:"\\/\\/",end:""},jsBlock:{start:"\\/\\*",end:"\\*\\/"},jsx:{start:"\\{\\s*\\/\\*",end:"\\*\\/\\s*\\}"},bash:{start:"#",end:""},html:{start:"\x3c!--",end:"--\x3e"}},pe={...he,lua:{start:"--",end:""},wasm:{start:"\\;\\;",end:""},tex:{start:"%",end:""},vb:{start:"['\u2018\u2019]",end:""},vbnet:{start:"(?:_\\s*)?['\u2018\u2019]",end:""},rem:{start:"[Rr][Ee][Mm]\\b",end:""},f90:{start:"!",end:""},ml:{start:"\\(\\*",end:"\\*\\)"},cobol:{start:"\\*>",end:""}},fe=Object.keys(he);function xe(e,t){const n=e.map((e=>{const{start:n,end:s}=pe[e];return`(?:${n}\\s*(${t.flatMap((e=>[e.line,e.block?.start,e.block?.end].filter(Boolean))).join("|")})\\s*${s})`})).join("|");return new RegExp(`^\\s*(?:${n})\\s*$`)}function be(e,t){let n=e.replace(/\n$/,"");const{language:s,magicComments:a,metastring:o}=t;if(o&&me.test(o)){const e=o.match(me).groups.range;if(0===a.length)throw new Error(`A highlight range has been given in code block's metastring (\`\`\` ${o}), but no magic comment config is available. Docusaurus applies the first magic comment entry's className for metastring ranges.`);const t=a[0].className,s=de()(e).filter((e=>e>0)).map((e=>[e-1,[t]]));return{lineClassNames:Object.fromEntries(s),code:n}}if(void 0===s)return{lineClassNames:{},code:n};const i=function(e,t){switch(e){case"js":case"javascript":case"ts":case"typescript":return xe(["js","jsBlock"],t);case"jsx":case"tsx":return xe(["js","jsBlock","jsx"],t);case"html":return xe(["js","jsBlock","html"],t);case"python":case"py":case"bash":return xe(["bash"],t);case"markdown":case"md":return xe(["html","jsx","bash"],t);case"tex":case"latex":case"matlab":return xe(["tex"],t);case"lua":case"haskell":case"sql":return xe(["lua"],t);case"wasm":return xe(["wasm"],t);case"vb":case"vba":case"visual-basic":return xe(["vb","rem"],t);case"vbnet":return xe(["vbnet","rem"],t);case"batch":return xe(["rem"],t);case"basic":return xe(["rem","f90"],t);case"fsharp":return xe(["js","ml"],t);case"ocaml":case"sml":return xe(["ml"],t);case"fortran":return xe(["f90"],t);case"cobol":return xe(["cobol"],t);default:return xe(fe,t)}}(s,a),c=n.split("\n"),l=Object.fromEntries(a.map((e=>[e.className,{start:0,range:""}]))),r=Object.fromEntries(a.filter((e=>e.line)).map((e=>{let{className:t,line:n}=e;return[n,t]}))),d=Object.fromEntries(a.filter((e=>e.block)).map((e=>{let{className:t,block:n}=e;return[n.start,t]}))),u=Object.fromEntries(a.filter((e=>e.block)).map((e=>{let{className:t,block:n}=e;return[n.end,t]})));for(let h=0;h void 0!==e));r[t]?l[r[t]].range+=`${h},`:d[t]?l[d[t]].start=h:u[t]&&(l[u[t]].range+=`${l[u[t]].start}-${h-1},`),c.splice(h,1)}n=c.join("\n");const m={};return Object.entries(l).forEach((e=>{let[t,{range:n}]=e;de()(n).forEach((e=>{m[e]??=[],m[e].push(t)}))})),{lineClassNames:m,code:n}}const ge={codeBlockContainer:"codeBlockContainer_GZNp"};function ve(e){let{as:t,...n}=e;const s=function(e){const t={color:"--prism-color",backgroundColor:"--prism-background-color"},n={};return Object.entries(e.plain).forEach((e=>{let[s,a]=e;const o=t[s];o&&"string"==typeof a&&(n[o]=a)})),n}(le());return(0,i.jsx)(t,{...n,style:s,className:(0,u.A)(n.className,ge.codeBlockContainer,b.G.common.codeBlock)})}const je={codeBlockContent:"codeBlockContent_p3BZ",codeBlockTitle:"codeBlockTitle_a7Bi",codeBlock:"codeBlock_gOL6",codeBlockStandalone:"codeBlockStandalone_AcKV",codeBlockLines:"codeBlockLines_C1CL",codeBlockLinesWithNumbering:"codeBlockLinesWithNumbering_A_u_",buttonGroup:"buttonGroup_YXlW"};function Ne(e){let{children:t,className:n}=e;return(0,i.jsx)(ve,{as:"pre",tabIndex:0,className:(0,u.A)(je.codeBlockStandalone,"thin-scrollbar",n),children:(0,i.jsx)("code",{className:je.codeBlockLines,children:t})})}const Ae={attributes:!0,characterData:!0,childList:!0,subtree:!0};function Ce(e,t){const[n,a]=(0,s.useState)(),i=(0,s.useCallback)((()=>{a(e.current?.closest("[role=tabpanel][hidden]"))}),[e,a]);(0,s.useEffect)((()=>{i()}),[i]),function(e,t,n){void 0===n&&(n=Ae);const a=(0,o._q)(t),i=(0,o.Be)(n);(0,s.useEffect)((()=>{const t=new MutationObserver(a);return e&&t.observe(e,i),()=>t.disconnect()}),[e,a,i])}(n,(e=>{e.forEach((e=>{"attributes"===e.type&&"hidden"===e.attributeName&&(t(),i())}))}),{attributes:!0,characterData:!1,childList:!1,subtree:!1})}var ke=n(9095);const Le={codeLine:"codeLine_ptHe",codeLineNumber:"codeLineNumber_eWxL",codeLineContent:"codeLineContent_V0Ww"};function ye(e){let{line:t,classNames:n,showLineNumbers:s,getLineProps:a,getTokenProps:o}=e;1===t.length&&"\n"===t[0].content&&(t[0].content="");const c=a({line:t,className:(0,u.A)(n,s&&Le.codeLine)}),l=t.map(((e,t)=>(0,i.jsx)("span",{...o({token:e,key:t})},t)));return(0,i.jsxs)("span",{...c,children:[s?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("span",{className:Le.codeLineNumber}),(0,i.jsx)("span",{className:Le.codeLineContent,children:l})]}):l,(0,i.jsx)("br",{})]})}function _e(e){return(0,i.jsx)("svg",{viewBox:"0 0 24 24",...e,children:(0,i.jsx)("path",{fill:"currentColor",d:"M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"})})}function Be(e){return(0,i.jsx)("svg",{viewBox:"0 0 24 24",...e,children:(0,i.jsx)("path",{fill:"currentColor",d:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"})})}const we={copyButtonCopied:"copyButtonCopied_xwQT",copyButtonIcons:"copyButtonIcons_P3LL",copyButtonIcon:"copyButtonIcon_cekT",copyButtonSuccessIcon:"copyButtonSuccessIcon_i9ru"};function Te(e){let{code:t,className:n}=e;const[a,o]=(0,s.useState)(!1),c=(0,s.useRef)(void 0),l=(0,s.useCallback)((()=>{!function(e,t){let{target:n=document.body}=void 0===t?{}:t;if("string"!=typeof e)throw new TypeError(`Expected parameter \`text\` to be a \`string\`, got \`${typeof e}\`.`);const s=document.createElement("textarea"),a=document.activeElement;s.value=e,s.setAttribute("readonly",""),s.style.contain="strict",s.style.position="absolute",s.style.left="-9999px",s.style.fontSize="12pt";const o=document.getSelection(),i=o.rangeCount>0&&o.getRangeAt(0);n.append(s),s.select(),s.selectionStart=0,s.selectionEnd=e.length;let c=!1;try{c=document.execCommand("copy")}catch{}s.remove(),i&&(o.removeAllRanges(),o.addRange(i)),a&&a.focus()}(t),o(!0),c.current=window.setTimeout((()=>{o(!1)}),1e3)}),[t]);return(0,s.useEffect)((()=>()=>window.clearTimeout(c.current)),[]),(0,i.jsx)("button",{type:"button","aria-label":a?(0,g.T)({id:"theme.CodeBlock.copied",message:"Copied",description:"The copied button label on code blocks"}):(0,g.T)({id:"theme.CodeBlock.copyButtonAriaLabel",message:"Copy code to clipboard",description:"The ARIA label for copy code blocks button"}),title:(0,g.T)({id:"theme.CodeBlock.copy",message:"Copy",description:"The copy button label on code blocks"}),className:(0,u.A)("clean-btn",n,we.copyButton,a&&we.copyButtonCopied),onClick:l,children:(0,i.jsxs)("span",{className:we.copyButtonIcons,"aria-hidden":"true",children:[(0,i.jsx)(_e,{className:we.copyButtonIcon}),(0,i.jsx)(Be,{className:we.copyButtonSuccessIcon})]})})}function Ee(e){return(0,i.jsx)("svg",{viewBox:"0 0 24 24",...e,children:(0,i.jsx)("path",{fill:"currentColor",d:"M4 19h6v-2H4v2zM20 5H4v2h16V5zm-3 6H4v2h13.25c1.1 0 2 .9 2 2s-.9 2-2 2H15v-2l-3 3l3 3v-2h2c2.21 0 4-1.79 4-4s-1.79-4-4-4z"})})}const He={wordWrapButtonIcon:"wordWrapButtonIcon_InWb",wordWrapButtonEnabled:"wordWrapButtonEnabled_xg9q"};function Me(e){let{className:t,onClick:n,isEnabled:s}=e;const a=(0,g.T)({id:"theme.CodeBlock.wordWrapToggle",message:"Toggle word wrap",description:"The title attribute for toggle word wrapping button of code block lines"});return(0,i.jsx)("button",{type:"button",onClick:n,className:(0,u.A)("clean-btn",t,s&&He.wordWrapButtonEnabled),"aria-label":a,title:a,children:(0,i.jsx)(Ee,{className:He.wordWrapButtonIcon,"aria-hidden":"true"})})}function Ie(e){let{children:t,className:n="",metastring:a,title:o,showLineNumbers:c,language:l}=e;const{prism:{defaultLanguage:r,magicComments:d}}=(0,U.p)(),m=function(e){return e?.toLowerCase()}(l??function(e){const t=e.split(" ").find((e=>e.startsWith("language-")));return t?.replace(/language-/,"")}(n)??r),h=le(),p=function(){const[e,t]=(0,s.useState)(!1),[n,a]=(0,s.useState)(!1),o=(0,s.useRef)(null),i=(0,s.useCallback)((()=>{const n=o.current.querySelector("code");e?n.removeAttribute("style"):(n.style.whiteSpace="pre-wrap",n.style.overflowWrap="anywhere"),t((e=>!e))}),[o,e]),c=(0,s.useCallback)((()=>{const{scrollWidth:e,clientWidth:t}=o.current,n=e>t||o.current.querySelector("code").hasAttribute("style");a(n)}),[o]);return Ce(o,c),(0,s.useEffect)((()=>{c()}),[e,c]),(0,s.useEffect)((()=>(window.addEventListener("resize",c,{passive:!0}),()=>{window.removeEventListener("resize",c)})),[c]),{codeBlockRef:o,isEnabled:e,isCodeScrollable:n,toggle:i}}(),f=function(e){return e?.match(ue)?.groups.title??""}(a)||o,{lineClassNames:x,code:b}=be(t,{metastring:a,language:m,magicComments:d}),g=c??function(e){return Boolean(e?.includes("showLineNumbers"))}(a);return(0,i.jsxs)(ve,{as:"div",className:(0,u.A)(n,m&&!n.includes(`language-${m}`)&&`language-${m}`),children:[f&&(0,i.jsx)("div",{className:je.codeBlockTitle,children:f}),(0,i.jsxs)("div",{className:je.codeBlockContent,children:[(0,i.jsx)(ke.f4,{theme:h,code:b,language:m??"text",children:e=>{let{className:t,style:n,tokens:s,getLineProps:a,getTokenProps:o}=e;return(0,i.jsx)("pre",{tabIndex:0,ref:p.codeBlockRef,className:(0,u.A)(t,je.codeBlock,"thin-scrollbar"),style:n,children:(0,i.jsx)("code",{className:(0,u.A)(je.codeBlockLines,g&&je.codeBlockLinesWithNumbering),children:s.map(((e,t)=>(0,i.jsx)(ye,{line:e,getLineProps:a,getTokenProps:o,classNames:x[t],showLineNumbers:g},t)))})})}}),(0,i.jsxs)("div",{className:je.buttonGroup,children:[(p.isEnabled||p.isCodeScrollable)&&(0,i.jsx)(Me,{className:je.codeButton,onClick:()=>p.toggle(),isEnabled:p.isEnabled}),(0,i.jsx)(Te,{className:je.codeButton,code:b})]})]})]})}function Se(e){let{children:t,...n}=e;const a=(0,ie.A)(),o=function(e){return s.Children.toArray(e).some((e=>(0,s.isValidElement)(e)))?e:Array.isArray(e)?e.join(""):e}(t),c="string"==typeof o?Ie:Ne;return(0,i.jsx)(c,{...n,children:o},String(a))}function Ue(e){return(0,i.jsx)("code",{...e})}var Re=n(8337);const ze={details:"details_Ptag",isBrowser:"isBrowser_BWKI",collapsibleContent:"collapsibleContent_tM82"};function Oe(e){return!!e&&("SUMMARY"===e.tagName||Oe(e.parentElement))}function Ve(e,t){return!!e&&(e===t||Ve(e.parentElement,t))}function Pe(e){let{summary:t,children:n,...a}=e;(0,Re.A)().collectAnchor(a.id);const o=(0,ie.A)(),c=(0,s.useRef)(null),{collapsed:l,setCollapsed:r}=(0,S.u)({initialState:!a.open}),[d,m]=(0,s.useState)(a.open),h=s.isValidElement(t)?t:(0,i.jsx)("summary",{children:t??"Details"});return(0,i.jsxs)("details",{...a,ref:c,open:d,"data-collapsed":l,className:(0,u.A)(ze.details,o&&ze.isBrowser,a.className),onMouseDown:e=>{Oe(e.target)&&e.detail>1&&e.preventDefault()},onClick:e=>{e.stopPropagation();const t=e.target;Oe(t)&&Ve(t,c.current)&&(e.preventDefault(),l?(r(!1),m(!0)):r(!0))},children:[h,(0,i.jsx)(S.N,{lazy:!1,collapsed:l,disableSSRStyle:!0,onCollapseTransitionEnd:e=>{r(e),m(!e)},children:(0,i.jsx)("div",{className:ze.collapsibleContent,children:n})})]})}const We={details:"details_JFdN"},Ge="alert alert--info";function De(e){let{...t}=e;return(0,i.jsx)(Pe,{...t,className:(0,u.A)(Ge,We.details,t.className)})}function $e(e){const t=s.Children.toArray(e.children),n=t.find((e=>s.isValidElement(e)&&"summary"===e.type)),a=(0,i.jsx)(i.Fragment,{children:t.filter((e=>e!==n))});return(0,i.jsx)(De,{...e,summary:n,children:a})}function Fe(e){return(0,i.jsx)(se.A,{...e})}const qe={containsTaskList:"containsTaskList_pO87"};function Ze(e){if(void 0!==e)return(0,u.A)(e,e?.includes("contains-task-list")&&qe.containsTaskList)}const Ke={img:"img_pcT_"};function Qe(e){const{mdxAdmonitionTitle:t,rest:n}=function(e){const t=s.Children.toArray(e),n=t.find((e=>s.isValidElement(e)&&"mdxAdmonitionTitle"===e.type)),a=t.filter((e=>e!==n)),o=n?.props.children;return{mdxAdmonitionTitle:o,rest:a.length>0?(0,i.jsx)(i.Fragment,{children:a}):null}}(e.children),a=e.title??t;return{...e,...a&&{title:a},children:n}}const Ye={admonition:"admonition_ZDKB",admonitionHeading:"admonitionHeading_R3Ez",admonitionIcon:"admonitionIcon_F19i",admonitionContent:"admonitionContent_Zzre"};function Je(e){let{type:t,className:n,children:s}=e;return(0,i.jsx)("div",{className:(0,u.A)(b.G.common.admonition,b.G.common.admonitionType(t),Ye.admonition,n),children:s})}function Xe(e){let{icon:t,title:n}=e;return(0,i.jsxs)("div",{className:Ye.admonitionHeading,children:[(0,i.jsx)("span",{className:Ye.admonitionIcon,children:t}),n]})}function et(e){let{children:t}=e;return t?(0,i.jsx)("div",{className:Ye.admonitionContent,children:t}):null}function tt(e){const{type:t,icon:n,title:s,children:a,className:o}=e;return(0,i.jsxs)(Je,{type:t,className:o,children:[(0,i.jsx)(Xe,{title:s,icon:n}),(0,i.jsx)(et,{children:a})]})}function nt(e){return(0,i.jsx)("svg",{viewBox:"0 0 14 16",...e,children:(0,i.jsx)("path",{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})})}const st={icon:(0,i.jsx)(nt,{}),title:(0,i.jsx)(g.A,{id:"theme.admonition.note",description:"The default label used for the Note admonition (:::note)",children:"note"})};function at(e){return(0,i.jsx)(tt,{...st,...e,className:(0,u.A)("alert alert--secondary",e.className),children:e.children})}function ot(e){return(0,i.jsx)("svg",{viewBox:"0 0 12 16",...e,children:(0,i.jsx)("path",{fillRule:"evenodd",d:"M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"})})}const it={icon:(0,i.jsx)(ot,{}),title:(0,i.jsx)(g.A,{id:"theme.admonition.tip",description:"The default label used for the Tip admonition (:::tip)",children:"tip"})};function ct(e){return(0,i.jsx)(tt,{...it,...e,className:(0,u.A)("alert alert--success",e.className),children:e.children})}function lt(e){return(0,i.jsx)("svg",{viewBox:"0 0 14 16",...e,children:(0,i.jsx)("path",{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})})}const rt={icon:(0,i.jsx)(lt,{}),title:(0,i.jsx)(g.A,{id:"theme.admonition.info",description:"The default label used for the Info admonition (:::info)",children:"info"})};function dt(e){return(0,i.jsx)(tt,{...rt,...e,className:(0,u.A)("alert alert--info",e.className),children:e.children})}function ut(e){return(0,i.jsx)("svg",{viewBox:"0 0 16 16",...e,children:(0,i.jsx)("path",{fillRule:"evenodd",d:"M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"})})}const mt={icon:(0,i.jsx)(ut,{}),title:(0,i.jsx)(g.A,{id:"theme.admonition.warning",description:"The default label used for the Warning admonition (:::warning)",children:"warning"})};function ht(e){return(0,i.jsx)("svg",{viewBox:"0 0 12 16",...e,children:(0,i.jsx)("path",{fillRule:"evenodd",d:"M5.05.31c.81 2.17.41 3.38-.52 4.31C3.55 5.67 1.98 6.45.9 7.98c-1.45 2.05-1.7 6.53 3.53 7.7-2.2-1.16-2.67-4.52-.3-6.61-.61 2.03.53 3.33 1.94 2.86 1.39-.47 2.3.53 2.27 1.67-.02.78-.31 1.44-1.13 1.81 3.42-.59 4.78-3.42 4.78-5.56 0-2.84-2.53-3.22-1.25-5.61-1.52.13-2.03 1.13-1.89 2.75.09 1.08-1.02 1.8-1.86 1.33-.67-.41-.66-1.19-.06-1.78C8.18 5.31 8.68 2.45 5.05.32L5.03.3l.02.01z"})})}const pt={icon:(0,i.jsx)(ht,{}),title:(0,i.jsx)(g.A,{id:"theme.admonition.danger",description:"The default label used for the Danger admonition (:::danger)",children:"danger"})};const ft={icon:(0,i.jsx)(ut,{}),title:(0,i.jsx)(g.A,{id:"theme.admonition.caution",description:"The default label used for the Caution admonition (:::caution)",children:"caution"})};const xt={...{note:at,tip:ct,info:dt,warning:function(e){return(0,i.jsx)(tt,{...mt,...e,className:(0,u.A)("alert alert--warning",e.className),children:e.children})},danger:function(e){return(0,i.jsx)(tt,{...pt,...e,className:(0,u.A)("alert alert--danger",e.className),children:e.children})}},...{secondary:e=>(0,i.jsx)(at,{title:"secondary",...e}),important:e=>(0,i.jsx)(dt,{title:"important",...e}),success:e=>(0,i.jsx)(ct,{title:"success",...e}),caution:function(e){return(0,i.jsx)(tt,{...ft,...e,className:(0,u.A)("alert alert--warning",e.className),children:e.children})}}};function bt(e){const t=Qe(e),n=(s=t.type,xt[s]||(console.warn(`No admonition component found for admonition type "${s}". Using Info as fallback.`),xt.info));var s;return(0,i.jsx)(n,{...t})}var gt=n(9369);const vt={Head:oe.A,details:$e,Details:$e,code:function(e){return function(e){return void 0!==e.children&&s.Children.toArray(e.children).every((e=>"string"==typeof e&&!e.includes("\n")))}(e)?(0,i.jsx)(Ue,{...e}):(0,i.jsx)(Se,{...e})},a:function(e){return(0,i.jsx)(v.A,{...e})},pre:function(e){return(0,i.jsx)(i.Fragment,{children:e.children})},ul:function(e){return(0,i.jsx)("ul",{...e,className:Ze(e.className)})},li:function(e){return(0,Re.A)().collectAnchor(e.id),(0,i.jsx)("li",{...e})},img:function(e){return(0,i.jsx)("img",{decoding:"async",loading:"lazy",...e,className:(t=e.className,(0,u.A)(t,Ke.img))});var t},h1:e=>(0,i.jsx)(Fe,{as:"h1",...e}),h2:e=>(0,i.jsx)(Fe,{as:"h2",...e}),h3:e=>(0,i.jsx)(Fe,{as:"h3",...e}),h4:e=>(0,i.jsx)(Fe,{as:"h4",...e}),h5:e=>(0,i.jsx)(Fe,{as:"h5",...e}),h6:e=>(0,i.jsx)(Fe,{as:"h6",...e}),admonition:bt,mermaid:gt.A};function jt(e){let{children:t}=e;return(0,i.jsx)(ae.x,{components:vt,children:t})}function Nt(e){let{children:t}=e;const n=function(){const{metadata:e,frontMatter:t,contentTitle:n}=r();return t.hide_title||void 0!==n?null:e.title}();return(0,i.jsxs)("div",{className:(0,u.A)(b.G.docs.docMarkdown,"markdown"),children:[n&&(0,i.jsx)("header",{children:(0,i.jsx)(se.A,{as:"h1",children:n})}),(0,i.jsx)(jt,{children:t})]})}var At=n(2124);function Ct(){return(0,i.jsx)(g.A,{id:"theme.unlistedContent.title",description:"The unlisted content banner title",children:"Unlisted page"})}function kt(){return(0,i.jsx)(g.A,{id:"theme.unlistedContent.message",description:"The unlisted content banner message",children:"This page is unlisted. Search engines will not index it, and only users having a direct link can access it."})}function Lt(){return(0,i.jsx)(oe.A,{children:(0,i.jsx)("meta",{name:"robots",content:"noindex, nofollow"})})}function yt(e){let{className:t}=e;return(0,i.jsx)(bt,{type:"caution",title:(0,i.jsx)(Ct,{}),className:(0,u.A)(t,b.G.common.unlistedBanner),children:(0,i.jsx)(kt,{})})}function _t(e){return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Lt,{}),(0,i.jsx)(yt,{...e})]})}const Bt={docItemContainer:"docItemContainer_PHQX",docItemCol:"docItemCol_WL6M"};function wt(e){let{children:t}=e;const n=function(){const{frontMatter:e,toc:t}=r(),n=(0,m.l)(),s=e.hide_table_of_contents,a=!s&&t.length>0;return{hidden:s,mobile:a?(0,i.jsx)(Y,{}):void 0,desktop:!a||"desktop"!==n&&"ssr"!==n?void 0:(0,i.jsx)(ne,{})}}(),{metadata:{unlisted:s}}=r();return(0,i.jsxs)("div",{className:"row",children:[(0,i.jsxs)("div",{className:(0,u.A)("col",!n.hidden&&Bt.docItemCol),children:[s&&(0,i.jsx)(_t,{}),(0,i.jsx)(f.A,{}),(0,i.jsxs)("div",{className:Bt.docItemContainer,children:[(0,i.jsxs)("article",{children:[(0,i.jsx)(At.A,{}),(0,i.jsx)(x.A,{}),n.mobile,(0,i.jsx)(Nt,{children:t}),(0,i.jsx)(I,{})]}),(0,i.jsx)(p,{})]})]}),n.desktop&&(0,i.jsx)("div",{className:"col col--3",children:n.desktop})]})}function Tt(e){const t=`docs-doc-id-${e.content.metadata.id}`,n=e.content;return(0,i.jsx)(l,{content:e.content,children:(0,i.jsxs)(a.e3,{className:t,children:[(0,i.jsx)(d,{}),(0,i.jsx)(wt,{children:(0,i.jsx)(n,{})})]})})}},2388:(e,t,n)=>{"use strict";n.d(t,{A:()=>l});n(8318);var s=n(6093),a=n(3372),o=n(8965),i=n(9214);function c(e){const{permalink:t,title:n,subLabel:s,isNext:c}=e;return(0,i.jsxs)(o.A,{className:(0,a.A)("pagination-nav__link",c?"pagination-nav__link--next":"pagination-nav__link--prev"),to:t,children:[s&&(0,i.jsx)("div",{className:"pagination-nav__sublabel",children:s}),(0,i.jsx)("div",{className:"pagination-nav__label",children:n})]})}function l(e){const{previous:t,next:n}=e;return(0,i.jsxs)("nav",{className:"pagination-nav docusaurus-mt-lg","aria-label":(0,s.T)({id:"theme.docs.paginator.navAriaLabel",message:"Docs pages",description:"The ARIA label for the docs pagination"}),children:[t&&(0,i.jsx)(c,{...t,subLabel:(0,i.jsx)(s.A,{id:"theme.docs.paginator.previous",description:"The label used to navigate to the previous doc",children:"Previous"})}),n&&(0,i.jsx)(c,{...n,subLabel:(0,i.jsx)(s.A,{id:"theme.docs.paginator.next",description:"The label used to navigate to the next doc",children:"Next"}),isNext:!0})]})}},7086:(e,t,n)=>{"use strict";n.d(t,{A:()=>l});n(8318);var s=n(3372),a=n(6093),o=n(9166),i=n(8563),c=n(9214);function l(e){let{className:t}=e;const n=(0,i.r)();return n.badge?(0,c.jsx)("span",{className:(0,s.A)(t,o.G.docs.docVersionBadge,"badge badge--secondary"),children:(0,c.jsx)(a.A,{id:"theme.docs.versionBadge.label",values:{versionLabel:n.label},children:"Version: {versionLabel}"})}):null}},1917:(e,t,n)=>{"use strict";n.d(t,{A:()=>x});n(8318);var s=n(3372),a=n(7713),o=n(8965),i=n(6093),c=n(8420),l=n(9166),r=n(7076),d=n(8563),u=n(9214);const m={unreleased:function(e){let{siteTitle:t,versionMetadata:n}=e;return(0,u.jsx)(i.A,{id:"theme.docs.versions.unreleasedVersionLabel",description:"The label used to tell the user that he's browsing an unreleased doc version",values:{siteTitle:t,versionLabel:(0,u.jsx)("b",{children:n.label})},children:"This is unreleased documentation for {siteTitle} {versionLabel} version."})},unmaintained:function(e){let{siteTitle:t,versionMetadata:n}=e;return(0,u.jsx)(i.A,{id:"theme.docs.versions.unmaintainedVersionLabel",description:"The label used to tell the user that he's browsing an unmaintained doc version",values:{siteTitle:t,versionLabel:(0,u.jsx)("b",{children:n.label})},children:"This is documentation for {siteTitle} {versionLabel}, which is no longer actively maintained."})}};function h(e){const t=m[e.versionMetadata.banner];return(0,u.jsx)(t,{...e})}function p(e){let{versionLabel:t,to:n,onClick:s}=e;return(0,u.jsx)(i.A,{id:"theme.docs.versions.latestVersionSuggestionLabel",description:"The label used to tell the user to check the latest version",values:{versionLabel:t,latestVersionLink:(0,u.jsx)("b",{children:(0,u.jsx)(o.A,{to:n,onClick:s,children:(0,u.jsx)(i.A,{id:"theme.docs.versions.latestVersionLinkLabel",description:"The label used for the latest version suggestion link label",children:"latest version"})})})},children:"For up-to-date documentation, see the {latestVersionLink} ({versionLabel})."})}function f(e){let{className:t,versionMetadata:n}=e;const{siteConfig:{title:o}}=(0,a.A)(),{pluginId:i}=(0,c.vT)({failfast:!0}),{savePreferredVersionName:d}=(0,r.g1)(i),{latestDocSuggestion:m,latestVersionSuggestion:f}=(0,c.HW)(i),x=m??(b=f).docs.find((e=>e.id===b.mainDocId));var b;return(0,u.jsxs)("div",{className:(0,s.A)(t,l.G.docs.docVersionBanner,"alert alert--warning margin-bottom--md"),role:"alert",children:[(0,u.jsx)("div",{children:(0,u.jsx)(h,{siteTitle:o,versionMetadata:n})}),(0,u.jsx)("div",{className:"margin-top--md",children:(0,u.jsx)(p,{versionLabel:f.label,to:x.path,onClick:()=>d(f.name)})})]})}function x(e){let{className:t}=e;const n=(0,d.r)();return n.banner?(0,u.jsx)(f,{className:t,versionMetadata:n}):null}},1357:(e,t)=>{function n(e){let t,n=[];for(let s of e.split(",").map((e=>e.trim())))if(/^-?\d+$/.test(s))n.push(parseInt(s,10));else if(t=s.match(/^(-?\d+)(-|\.\.\.?|\u2025|\u2026|\u22EF)(-?\d+)$/)){let[e,s,a,o]=t;if(s&&o){s=parseInt(s),o=parseInt(o);const e=s {"use strict";n.d(t,{R:()=>i,x:()=>c});var s=n(8318);const a={},o=s.createContext(a);function i(e){const t=s.useContext(o);return s.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function c(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(a):e.components||a:i(e.components),s.createElement(o.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/209101c8.4a5eb224.js b/assets/js/209101c8.4a5eb224.js new file mode 100644 index 00000000..99ff5e94 --- /dev/null +++ b/assets/js/209101c8.4a5eb224.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkgreenfield_js_sdk_docs=self.webpackChunkgreenfield_js_sdk_docs||[]).push([[471],{18:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>u,contentTitle:()=>o,default:()=>f,frontMatter:()=>s,metadata:()=>c,toc:()=>d});var r=n(9214),a=n(3159),l=n(6159),i=n(7264);const s={id:"greenfield-client",title:"Greenfield Client",sidebar_position:1},o="Create Greenfield Client",c={id:"client/greenfield-client",title:"Greenfield Client",description:"| params | description |",source:"@site/docs/client/greenfield.mdx",sourceDirName:"client",slug:"/client/greenfield-client",permalink:"/greenfield-js-sdk/client/greenfield-client",draft:!1,unlisted:!1,editUrl:"https://github.com/bnb-chain/greenfield-js-sdk/tree/main/doc-site/docs/client/greenfield.mdx",tags:[],version:"current",sidebarPosition:1,frontMatter:{id:"greenfield-client",title:"Greenfield Client",sidebar_position:1},sidebar:"GettingStartSidebar",previous:{title:"Client",permalink:"/greenfield-js-sdk/category/client"},next:{title:"Tx Client",permalink:"/greenfield-js-sdk/client/tx-client"}},u={},d=[];function h(e){const t={a:"a",code:"code",h1:"h1",li:"li",p:"p",pre:"pre",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,a.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(t.h1,{id:"create-greenfield-client",children:"Create Greenfield Client"}),"\n",(0,r.jsxs)(t.table,{children:[(0,r.jsx)(t.thead,{children:(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.th,{children:"params"}),(0,r.jsx)(t.th,{children:"description"})]})}),(0,r.jsxs)(t.tbody,{children:[(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"GRPC_URL"}),(0,r.jsx)(t.td,{children:"Greenfield grpc url"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"GREEN_CHAIN_ID"}),(0,r.jsx)(t.td,{children:"Greenfield chain id"})]})]})]}),"\n",(0,r.jsxs)(l.A,{groupId:"example",children:[(0,r.jsx)(i.A,{value:"Browser",label:"Browser",children:(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-js",children:"import { Client } from '@bnb-chain/greenfield-js-sdk';\nconst client = Client.create(GRPC_URL, GREEN_CHAIN_ID);\n"})})}),(0,r.jsx)(i.A,{value:"Nodejs",label:"Nodejs",children:(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-js",children:"const { Client } = require('@bnb-chain/greenfield-js-sdk');\nconst client = Client.create(GRPC_URL, GREEN_CHAIN_ID);\n"})})})]}),"\n",(0,r.jsx)(t.p,{children:"The JS SDK consists of two parts:"}),"\n",(0,r.jsxs)(t.ul,{children:["\n",(0,r.jsx)(t.li,{children:(0,r.jsx)(t.a,{href:"https://greenfield-chain.bnbchain.org/openapi#/Query/StorageParams",children:"BlockChain API"})}),"\n",(0,r.jsx)(t.li,{children:(0,r.jsx)(t.a,{href:"https://github.com/bnb-chain/greenfield-storage-provider/tree/master/docs/storage-provider-rest-api",children:"Storage Provider API"})}),"\n"]})]})}function f(e={}){const{wrapper:t}={...(0,a.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(h,{...e})}):h(e)}},7264:(e,t,n)=>{n.d(t,{A:()=>i});n(8318);var r=n(3372);const a={tabItem:"tabItem_SosH"};var l=n(9214);function i(e){let{children:t,hidden:n,className:i}=e;return(0,l.jsx)("div",{role:"tabpanel",className:(0,r.A)(a.tabItem,i),hidden:n,children:t})}},6159:(e,t,n)=>{n.d(t,{A:()=>C});var r=n(8318),a=n(3372),l=n(2157),i=n(6325),s=n(848),o=n(5014),c=n(3799),u=n(6765);function d(e){return r.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,r.isValidElement)(e)&&function(e){const{props:t}=e;return!!t&&"object"==typeof t&&"value"in t}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function h(e){const{values:t,children:n}=e;return(0,r.useMemo)((()=>{const e=t??function(e){return d(e).map((e=>{let{props:{value:t,label:n,attributes:r,default:a}}=e;return{value:t,label:n,attributes:r,default:a}}))}(n);return function(e){const t=(0,c.X)(e,((e,t)=>e.value===t.value));if(t.length>0)throw new Error(`Docusaurus error: Duplicate values "${t.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[t,n])}function f(e){let{value:t,tabValues:n}=e;return n.some((e=>e.value===t))}function p(e){let{queryString:t=!1,groupId:n}=e;const a=(0,i.W6)(),l=function(e){let{queryString:t=!1,groupId:n}=e;if("string"==typeof t)return t;if(!1===t)return null;if(!0===t&&!n)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return n??null}({queryString:t,groupId:n});return[(0,o.aZ)(l),(0,r.useCallback)((e=>{if(!l)return;const t=new URLSearchParams(a.location.search);t.set(l,e),a.replace({...a.location,search:t.toString()})}),[l,a])]}function b(e){const{defaultValue:t,queryString:n=!1,groupId:a}=e,l=h(e),[i,o]=(0,r.useState)((()=>function(e){let{defaultValue:t,tabValues:n}=e;if(0===n.length)throw new Error("Docusaurus error: the component requires at least one children component");if(t){if(!f({value:t,tabValues:n}))throw new Error(`Docusaurus error: The has a defaultValue "${t}" but none of its children has the corresponding value. Available values are: ${n.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return t}const r=n.find((e=>e.default))??n[0];if(!r)throw new Error("Unexpected error: 0 tabValues");return r.value}({defaultValue:t,tabValues:l}))),[c,d]=p({queryString:n,groupId:a}),[b,m]=function(e){let{groupId:t}=e;const n=function(e){return e?`docusaurus.tab.${e}`:null}(t),[a,l]=(0,u.Dv)(n);return[a,(0,r.useCallback)((e=>{n&&l.set(e)}),[n,l])]}({groupId:a}),g=(()=>{const e=c??b;return f({value:e,tabValues:l})?e:null})();(0,s.A)((()=>{g&&o(g)}),[g]);return{selectedValue:i,selectValue:(0,r.useCallback)((e=>{if(!f({value:e,tabValues:l}))throw new Error(`Can't select invalid tab value=${e}`);o(e),d(e),m(e)}),[d,m,l]),tabValues:l}}var m=n(5180);const g={tabList:"tabList_u4OX",tabItem:"tabItem_nyVU"};var x=n(9214);function v(e){let{className:t,block:n,selectedValue:r,selectValue:i,tabValues:s}=e;const o=[],{blockElementScrollPositionUntilNextRender:c}=(0,l.a_)(),u=e=>{const t=e.currentTarget,n=o.indexOf(t),a=s[n].value;a!==r&&(c(t),i(a))},d=e=>{let t=null;switch(e.key){case"Enter":u(e);break;case"ArrowRight":{const n=o.indexOf(e.currentTarget)+1;t=o[n]??o[0];break}case"ArrowLeft":{const n=o.indexOf(e.currentTarget)-1;t=o[n]??o[o.length-1];break}}t?.focus()};return(0,x.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,a.A)("tabs",{"tabs--block":n},t),children:s.map((e=>{let{value:t,label:n,attributes:l}=e;return(0,x.jsx)("li",{role:"tab",tabIndex:r===t?0:-1,"aria-selected":r===t,ref:e=>o.push(e),onKeyDown:d,onClick:u,...l,className:(0,a.A)("tabs__item",g.tabItem,l?.className,{"tabs__item--active":r===t}),children:n??t},t)}))})}function j(e){let{lazy:t,children:n,selectedValue:a}=e;const l=(Array.isArray(n)?n:[n]).filter(Boolean);if(t){const e=l.find((e=>e.props.value===a));return e?(0,r.cloneElement)(e,{className:"margin-top--md"}):null}return(0,x.jsx)("div",{className:"margin-top--md",children:l.map(((e,t)=>(0,r.cloneElement)(e,{key:t,hidden:e.props.value!==a})))})}function y(e){const t=b(e);return(0,x.jsxs)("div",{className:(0,a.A)("tabs-container",g.tabList),children:[(0,x.jsx)(v,{...e,...t}),(0,x.jsx)(j,{...e,...t})]})}function C(e){const t=(0,m.A)();return(0,x.jsx)(y,{...e,children:d(e.children)},String(t))}},3159:(e,t,n)=>{n.d(t,{R:()=>i,x:()=>s});var r=n(8318);const a={},l=r.createContext(a);function i(e){const t=r.useContext(l);return r.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function s(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(a):e.components||a:i(e.components),r.createElement(l.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/209101c8.7516d55f.js b/assets/js/209101c8.7516d55f.js deleted file mode 100644 index 8a828b13..00000000 --- a/assets/js/209101c8.7516d55f.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkgreenfield_js_sdk_docs=self.webpackChunkgreenfield_js_sdk_docs||[]).push([[471],{18:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>u,contentTitle:()=>o,default:()=>f,frontMatter:()=>i,metadata:()=>c,toc:()=>d});var r=n(9214),l=n(3159),a=n(5303),s=n(1744);const i={id:"greenfield-client",title:"Greenfield Client",sidebar_position:1},o="Create Greenfield Client",c={id:"client/greenfield-client",title:"Greenfield Client",description:"| params | description |",source:"@site/docs/client/greenfield.mdx",sourceDirName:"client",slug:"/client/greenfield-client",permalink:"/greenfield-js-sdk/client/greenfield-client",draft:!1,unlisted:!1,editUrl:"https://github.com/bnb-chain/greenfield-js-sdk/tree/main/doc-site/docs/client/greenfield.mdx",tags:[],version:"current",sidebarPosition:1,frontMatter:{id:"greenfield-client",title:"Greenfield Client",sidebar_position:1},sidebar:"GettingStartSidebar",previous:{title:"Client",permalink:"/greenfield-js-sdk/category/client"},next:{title:"Tx Client",permalink:"/greenfield-js-sdk/client/tx-client"}},u={},d=[];function h(e){const t={a:"a",code:"code",h1:"h1",li:"li",p:"p",pre:"pre",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,l.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(t.h1,{id:"create-greenfield-client",children:"Create Greenfield Client"}),"\n",(0,r.jsxs)(t.table,{children:[(0,r.jsx)(t.thead,{children:(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.th,{children:"params"}),(0,r.jsx)(t.th,{children:"description"})]})}),(0,r.jsxs)(t.tbody,{children:[(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"GRPC_URL"}),(0,r.jsx)(t.td,{children:"Greenfield grpc url"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"GREEN_CHAIN_ID"}),(0,r.jsx)(t.td,{children:"Greenfield chain id"})]})]})]}),"\n",(0,r.jsxs)(a.A,{groupId:"example",children:[(0,r.jsx)(s.A,{value:"Browser",label:"Browser",children:(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-js",children:"import { Client } from '@bnb-chain/greenfield-js-sdk';\nconst client = Client.create(GRPC_URL, GREEN_CHAIN_ID);\n"})})}),(0,r.jsx)(s.A,{value:"Nodejs",label:"Nodejs",children:(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-js",children:"const { Client } = require('@bnb-chain/greenfield-js-sdk');\nconst client = Client.create(GRPC_URL, GREEN_CHAIN_ID);\n"})})})]}),"\n",(0,r.jsx)(t.p,{children:"The JS SDK consists of two parts:"}),"\n",(0,r.jsxs)(t.ul,{children:["\n",(0,r.jsxs)(t.li,{children:["Chain: ",(0,r.jsx)(t.a,{href:"https://docs.bnbchain.org/greenfield-docs/docs/api/blockchain-rest",children:"https://docs.bnbchain.org/greenfield-docs/docs/api/blockchain-rest"})]}),"\n",(0,r.jsxs)(t.li,{children:["Storage Provider: ",(0,r.jsx)(t.a,{href:"https://docs.bnbchain.org/greenfield-docs/docs/api/storage-provider-rest",children:"https://docs.bnbchain.org/greenfield-docs/docs/api/storage-provider-rest"})]}),"\n"]})]})}function f(e={}){const{wrapper:t}={...(0,l.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(h,{...e})}):h(e)}},1744:(e,t,n)=>{n.d(t,{A:()=>s});n(8318);var r=n(3372);const l={tabItem:"tabItem_SosH"};var a=n(9214);function s(e){let{children:t,hidden:n,className:s}=e;return(0,a.jsx)("div",{role:"tabpanel",className:(0,r.A)(l.tabItem,s),hidden:n,children:t})}},5303:(e,t,n)=>{n.d(t,{A:()=>C});var r=n(8318),l=n(3372),a=n(6888),s=n(6325),i=n(7503),o=n(8997),c=n(2554),u=n(3074);function d(e){return r.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,r.isValidElement)(e)&&function(e){const{props:t}=e;return!!t&&"object"==typeof t&&"value"in t}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function h(e){const{values:t,children:n}=e;return(0,r.useMemo)((()=>{const e=t??function(e){return d(e).map((e=>{let{props:{value:t,label:n,attributes:r,default:l}}=e;return{value:t,label:n,attributes:r,default:l}}))}(n);return function(e){const t=(0,c.X)(e,((e,t)=>e.value===t.value));if(t.length>0)throw new Error(`Docusaurus error: Duplicate values "${t.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[t,n])}function f(e){let{value:t,tabValues:n}=e;return n.some((e=>e.value===t))}function p(e){let{queryString:t=!1,groupId:n}=e;const l=(0,s.W6)(),a=function(e){let{queryString:t=!1,groupId:n}=e;if("string"==typeof t)return t;if(!1===t)return null;if(!0===t&&!n)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return n??null}({queryString:t,groupId:n});return[(0,o.aZ)(a),(0,r.useCallback)((e=>{if(!a)return;const t=new URLSearchParams(l.location.search);t.set(a,e),l.replace({...l.location,search:t.toString()})}),[a,l])]}function b(e){const{defaultValue:t,queryString:n=!1,groupId:l}=e,a=h(e),[s,o]=(0,r.useState)((()=>function(e){let{defaultValue:t,tabValues:n}=e;if(0===n.length)throw new Error("Docusaurus error: the component requires at least one children component");if(t){if(!f({value:t,tabValues:n}))throw new Error(`Docusaurus error: The has a defaultValue "${t}" but none of its children has the corresponding value. Available values are: ${n.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return t}const r=n.find((e=>e.default))??n[0];if(!r)throw new Error("Unexpected error: 0 tabValues");return r.value}({defaultValue:t,tabValues:a}))),[c,d]=p({queryString:n,groupId:l}),[b,m]=function(e){let{groupId:t}=e;const n=function(e){return e?`docusaurus.tab.${e}`:null}(t),[l,a]=(0,u.Dv)(n);return[l,(0,r.useCallback)((e=>{n&&a.set(e)}),[n,a])]}({groupId:l}),g=(()=>{const e=c??b;return f({value:e,tabValues:a})?e:null})();(0,i.A)((()=>{g&&o(g)}),[g]);return{selectedValue:s,selectValue:(0,r.useCallback)((e=>{if(!f({value:e,tabValues:a}))throw new Error(`Can't select invalid tab value=${e}`);o(e),d(e),m(e)}),[d,m,a]),tabValues:a}}var m=n(269);const g={tabList:"tabList_u4OX",tabItem:"tabItem_nyVU"};var x=n(9214);function v(e){let{className:t,block:n,selectedValue:r,selectValue:s,tabValues:i}=e;const o=[],{blockElementScrollPositionUntilNextRender:c}=(0,a.a_)(),u=e=>{const t=e.currentTarget,n=o.indexOf(t),l=i[n].value;l!==r&&(c(t),s(l))},d=e=>{let t=null;switch(e.key){case"Enter":u(e);break;case"ArrowRight":{const n=o.indexOf(e.currentTarget)+1;t=o[n]??o[0];break}case"ArrowLeft":{const n=o.indexOf(e.currentTarget)-1;t=o[n]??o[o.length-1];break}}t?.focus()};return(0,x.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,l.A)("tabs",{"tabs--block":n},t),children:i.map((e=>{let{value:t,label:n,attributes:a}=e;return(0,x.jsx)("li",{role:"tab",tabIndex:r===t?0:-1,"aria-selected":r===t,ref:e=>o.push(e),onKeyDown:d,onClick:u,...a,className:(0,l.A)("tabs__item",g.tabItem,a?.className,{"tabs__item--active":r===t}),children:n??t},t)}))})}function j(e){let{lazy:t,children:n,selectedValue:l}=e;const a=(Array.isArray(n)?n:[n]).filter(Boolean);if(t){const e=a.find((e=>e.props.value===l));return e?(0,r.cloneElement)(e,{className:"margin-top--md"}):null}return(0,x.jsx)("div",{className:"margin-top--md",children:a.map(((e,t)=>(0,r.cloneElement)(e,{key:t,hidden:e.props.value!==l})))})}function y(e){const t=b(e);return(0,x.jsxs)("div",{className:(0,l.A)("tabs-container",g.tabList),children:[(0,x.jsx)(v,{...e,...t}),(0,x.jsx)(j,{...e,...t})]})}function C(e){const t=(0,m.A)();return(0,x.jsx)(y,{...e,children:d(e.children)},String(t))}},3159:(e,t,n)=>{n.d(t,{R:()=>s,x:()=>i});var r=n(8318);const l={},a=r.createContext(l);function s(e){const t=r.useContext(a);return r.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function i(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(l):e.components||l:s(e.components),r.createElement(a.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/23206eaf.26c99049.js b/assets/js/23206eaf.26c99049.js new file mode 100644 index 00000000..4855d3f6 --- /dev/null +++ b/assets/js/23206eaf.26c99049.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkgreenfield_js_sdk_docs=self.webpackChunkgreenfield_js_sdk_docs||[]).push([[794],{2885:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>c,contentTitle:()=>l,default:()=>d,frontMatter:()=>a,metadata:()=>s,toc:()=>h});var i=t(9214),r=t(3159);const a={id:"query-client",title:"Query Client",sidebar_position:2},l=void 0,s={id:"client/query-client",title:"Query Client",description:"It's an encapsulation of the BlockChain API",source:"@site/docs/client/query-client.mdx",sourceDirName:"client",slug:"/client/query-client",permalink:"/greenfield-js-sdk/client/query-client",draft:!1,unlisted:!1,editUrl:"https://github.com/bnb-chain/greenfield-js-sdk/tree/main/doc-site/docs/client/query-client.mdx",tags:[],version:"current",sidebarPosition:2,frontMatter:{id:"query-client",title:"Query Client",sidebar_position:2},sidebar:"GettingStartSidebar",previous:{title:"Tx Client",permalink:"/greenfield-js-sdk/client/tx-client"},next:{title:"Storage Provider Client",permalink:"/greenfield-js-sdk/client/sp-client"}},c={},h=[{value:"getAuthQueryClient",id:"getauthqueryclient",level:2},{value:"getBankQueryClient",id:"getbankqueryclient",level:2},{value:"getBridgeQueryClient",id:"getbridgequeryclient",level:2},{value:"getChallengeQueryClient",id:"getchallengequeryclient",level:2},{value:"getCrosschainQueryClient",id:"getcrosschainqueryclient",level:2},{value:"getFeeGrantQueryClient",id:"getfeegrantqueryclient",level:2},{value:"getGashubClient",id:"getgashubclient",level:2},{value:"getPaymentQueryClient",id:"getpaymentqueryclient",level:2},{value:"getSpQueryClient",id:"getspqueryclient",level:2},{value:"getStorageQueryClient",id:"getstoragequeryclient",level:2},{value:"getVirtualGroupClient",id:"getvirtualgroupclient",level:2}];function o(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",p:"p",pre:"pre",...(0,r.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(n.p,{children:["It's an encapsulation of the ",(0,i.jsx)(n.a,{href:"https://greenfield-chain.bnbchain.org/openapi#/Query/StorageParams",children:"BlockChain API"})]}),"\n",(0,i.jsx)(n.admonition,{type:"info",children:(0,i.jsxs)(n.p,{children:["In most cases, you probably don't need to use the ",(0,i.jsx)(n.code,{children:"Query Client"})," directly."]})}),"\n",(0,i.jsx)(n.h2,{id:"getauthqueryclient",children:"getAuthQueryClient"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-jsx",metastring:'title="example"',children:"const rpc = await client.queryClient.getAuthQueryClient();\nawait rpc.Account({\n address: '0x0000000000000000000000000000000000000001',\n});\n"})}),"\n",(0,i.jsxs)(n.p,{children:["More APIs: ",(0,i.jsx)(n.a,{href:"https://greenfield-chain.bnbchain.org/openapi#/Query/AccountInfo",children:"https://greenfield-chain.bnbchain.org/openapi#/Query/AccountInfo"})]}),"\n",(0,i.jsx)(n.h2,{id:"getbankqueryclient",children:"getBankQueryClient"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-jsx",metastring:'title="example"',children:"const rpc = await client.queryClient.getBankQueryClient();\nawait rpc.Balance({\n address: '0x0000000000000000000000000000000000000001',\n denom: 'BNB',\n});\n"})}),"\n",(0,i.jsxs)(n.p,{children:["More APIs: ",(0,i.jsx)(n.a,{href:"https://greenfield-chain.bnbchain.org/openapi#/Query/AccountInfo",children:"https://greenfield-chain.bnbchain.org/openapi#/Query/AccountInfo"})]}),"\n",(0,i.jsx)(n.h2,{id:"getbridgequeryclient",children:"getBridgeQueryClient"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-jsx",metastring:'title="example"',children:"const rpc = await client.queryClient.getBridgeQueryClient();\nawait rpc.Params();\n"})}),"\n",(0,i.jsxs)(n.p,{children:["More APIs: ",(0,i.jsx)(n.a,{href:"https://greenfield-chain.bnbchain.org/openapi#/Query/BridgeParams",children:"https://greenfield-chain.bnbchain.org/openapi#/Query/BridgeParams"})]}),"\n",(0,i.jsx)(n.h2,{id:"getchallengequeryclient",children:"getChallengeQueryClient"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-jsx",metastring:'title="example"',children:"const rpc = await client.queryClient.getChallengeQueryClient();\nawait rpc.Params();\n"})}),"\n",(0,i.jsxs)(n.p,{children:["More APIs: ",(0,i.jsx)(n.a,{href:"https://greenfield-chain.bnbchain.org/openapi#/Query/AttestedChallenge",children:"https://greenfield-chain.bnbchain.org/openapi#/Query/AttestedChallenge"})]}),"\n",(0,i.jsx)(n.h2,{id:"getcrosschainqueryclient",children:"getCrosschainQueryClient"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-jsx",metastring:'title="example"',children:"const rpc = await client.queryClient.getCrosschainQueryClient();\nawait rpc.Params();\n"})}),"\n",(0,i.jsxs)(n.p,{children:["More apis: ",(0,i.jsx)(n.a,{href:"https://greenfield-chain.bnbchain.org/openapi#/Query/AttestedChallenge",children:"https://greenfield-chain.bnbchain.org/openapi#/Query/AttestedChallenge"})]}),"\n",(0,i.jsx)(n.h2,{id:"getfeegrantqueryclient",children:"getFeeGrantQueryClient"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-jsx",metastring:'title="example"',children:"const rpc = await client.queryClient.getFeeGrantQueryClient();\nawait rpc.Params();\n"})}),"\n",(0,i.jsxs)(n.p,{children:["More APIs: ",(0,i.jsx)(n.a,{href:"https://greenfield-chain.bnbchain.org/openapi#/Query/Allowance",children:"https://greenfield-chain.bnbchain.org/openapi#/Query/Allowance"})]}),"\n",(0,i.jsx)(n.h2,{id:"getgashubclient",children:"getGashubClient"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-jsx",metastring:'title="example"',children:"const rpc = await this.queryClient.getGashubClient();\nawait rpc.MsgGasParams(request);\n"})}),"\n",(0,i.jsxs)(n.p,{children:["More APIs: ",(0,i.jsx)(n.a,{href:"https://greenfield-chain.bnbchain.org/openapi#/Query/MsgGasParams",children:"https://greenfield-chain.bnbchain.org/openapi#/Query/MsgGasParams"})]}),"\n",(0,i.jsx)(n.h2,{id:"getpaymentqueryclient",children:"getPaymentQueryClient"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-jsx",metastring:'title="example"',children:"const rpc = await this.queryClient.getPaymentQueryClient();\nawait rpc.Params();\n"})}),"\n",(0,i.jsxs)(n.p,{children:["More APIs: ",(0,i.jsx)(n.a,{href:"https://greenfield-chain.bnbchain.org/openapi#/Query/MsgGasParams",children:"https://greenfield-chain.bnbchain.org/openapi#/Query/MsgGasParams"})]}),"\n",(0,i.jsx)(n.h2,{id:"getspqueryclient",children:"getSpQueryClient"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-jsx",metastring:'title="example"',children:"const rpc = await this.queryClient.getSpQueryClient();\nawait rpc.Params();\n"})}),"\n",(0,i.jsxs)(n.p,{children:["More APIs: ",(0,i.jsx)(n.a,{href:"https://greenfield-chain.bnbchain.org/openapi#/Query/QueryGlobalSpStorePriceByTime",children:"https://greenfield-chain.bnbchain.org/openapi#/Query/QueryGlobalSpStorePriceByTime"})]}),"\n",(0,i.jsx)(n.h2,{id:"getstoragequeryclient",children:"getStorageQueryClient"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-jsx",metastring:'title="example"',children:"const rpc = await client.queryClient.getStorageQueryClient();\nawait rpc.HeadBucketById({\n bucketId: '1',\n});\n"})}),"\n",(0,i.jsxs)(n.p,{children:["More APIs: ",(0,i.jsx)(n.a,{href:"https://greenfield-chain.bnbchain.org/openapi#/Query/QueryGroupMembersExist",children:"https://greenfield-chain.bnbchain.org/openapi#/Query/QueryGroupMembersExist"})]}),"\n",(0,i.jsx)(n.h2,{id:"getvirtualgroupclient",children:"getVirtualGroupClient"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-jsx",metastring:'title="example"',children:"const rpc = await client.queryClient.getVirtualGroupClient();\nawait rpc.Params();\n"})}),"\n",(0,i.jsxs)(n.p,{children:["More APIs: ",(0,i.jsx)(n.a,{href:"https://greenfield-chain.bnbchain.org/openapi#/Query/AvailableGlobalVirtualGroupFamilies",children:"https://greenfield-chain.bnbchain.org/openapi#/Query/AvailableGlobalVirtualGroupFamilies"})]})]})}function d(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(o,{...e})}):o(e)}},3159:(e,n,t)=>{t.d(n,{R:()=>l,x:()=>s});var i=t(8318);const r={},a=i.createContext(r);function l(e){const n=i.useContext(a);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function s(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:l(e.components),i.createElement(a.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/23206eaf.330b83e0.js b/assets/js/23206eaf.330b83e0.js deleted file mode 100644 index 99c2f3da..00000000 --- a/assets/js/23206eaf.330b83e0.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkgreenfield_js_sdk_docs=self.webpackChunkgreenfield_js_sdk_docs||[]).push([[794],{2885:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>c,contentTitle:()=>l,default:()=>g,frontMatter:()=>s,metadata:()=>a,toc:()=>d});var i=t(9214),r=t(3159);const s={id:"query-client",title:"Query Client",sidebar_position:2},l=void 0,a={id:"client/query-client",title:"Query Client",description:"It's an encapsulation of the",source:"@site/docs/client/query-client.mdx",sourceDirName:"client",slug:"/client/query-client",permalink:"/greenfield-js-sdk/client/query-client",draft:!1,unlisted:!1,editUrl:"https://github.com/bnb-chain/greenfield-js-sdk/tree/main/doc-site/docs/client/query-client.mdx",tags:[],version:"current",sidebarPosition:2,frontMatter:{id:"query-client",title:"Query Client",sidebar_position:2},sidebar:"GettingStartSidebar",previous:{title:"Tx Client",permalink:"/greenfield-js-sdk/client/tx-client"},next:{title:"Storage Provider Client",permalink:"/greenfield-js-sdk/client/sp-client"}},c={},d=[{value:"getAuthQueryClient",id:"getauthqueryclient",level:2},{value:"getBankQueryClient",id:"getbankqueryclient",level:2},{value:"getBridgeQueryClient",id:"getbridgequeryclient",level:2},{value:"getChallengeQueryClient",id:"getchallengequeryclient",level:2},{value:"getCrosschainQueryClient",id:"getcrosschainqueryclient",level:2},{value:"getFeeGrantQueryClient",id:"getfeegrantqueryclient",level:2},{value:"getGashubClient",id:"getgashubclient",level:2},{value:"getPaymentQueryClient",id:"getpaymentqueryclient",level:2},{value:"getSpQueryClient",id:"getspqueryclient",level:2},{value:"getStorageQueryClient",id:"getstoragequeryclient",level:2},{value:"getVirtualGroupClient",id:"getvirtualgroupclient",level:2}];function o(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",p:"p",pre:"pre",...(0,r.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(n.p,{children:["It's an encapsulation of the\n",(0,i.jsx)(n.a,{href:"https://docs.bnbchain.org/greenfield-docs/docs/api/blockchain-rest",children:"Blockchain API"}),"."]}),"\n",(0,i.jsx)(n.admonition,{type:"info",children:(0,i.jsxs)(n.p,{children:["In most cases, you probably don't need to use the ",(0,i.jsx)(n.code,{children:"Query Client"})," directly."]})}),"\n",(0,i.jsx)(n.h2,{id:"getauthqueryclient",children:"getAuthQueryClient"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-jsx",metastring:'title="example"',children:"const rpc = await client.queryClient.getAuthQueryClient();\nawait rpc.Account({\n address: '0x0000000000000000000000000000000000000001',\n});\n"})}),"\n",(0,i.jsxs)(n.p,{children:["More APIs: ",(0,i.jsx)(n.a,{href:"https://docs.bnbchain.org/greenfield-docs/docs/greenfield-api/account-info",children:"https://docs.bnbchain.org/greenfield-docs/docs/greenfield-api/account-info"})]}),"\n",(0,i.jsx)(n.h2,{id:"getbankqueryclient",children:"getBankQueryClient"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-jsx",metastring:'title="example"',children:"const rpc = await client.queryClient.getBankQueryClient();\nawait rpc.Balance({\n address: '0x0000000000000000000000000000000000000001',\n denom: 'BNB',\n});\n"})}),"\n",(0,i.jsxs)(n.p,{children:["More APIs: ",(0,i.jsx)(n.a,{href:"https://docs.bnbchain.org/greenfield-docs/docs/greenfield-api/account-info",children:"https://docs.bnbchain.org/greenfield-docs/docs/greenfield-api/account-info"})]}),"\n",(0,i.jsx)(n.h2,{id:"getbridgequeryclient",children:"getBridgeQueryClient"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-jsx",metastring:'title="example"',children:"const rpc = await client.queryClient.getBridgeQueryClient();\nawait rpc.Params();\n"})}),"\n",(0,i.jsxs)(n.p,{children:["More APIs: ",(0,i.jsx)(n.a,{href:"https://docs.bnbchain.org/greenfield-docs/docs/greenfield-api/bridge-params",children:"https://docs.bnbchain.org/greenfield-docs/docs/greenfield-api/bridge-params"})]}),"\n",(0,i.jsx)(n.h2,{id:"getchallengequeryclient",children:"getChallengeQueryClient"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-jsx",metastring:'title="example"',children:"const rpc = await client.queryClient.getChallengeQueryClient();\nawait rpc.Params();\n"})}),"\n",(0,i.jsxs)(n.p,{children:["More APIs: ",(0,i.jsx)(n.a,{href:"https://docs.bnbchain.org/greenfield-docs/docs/greenfield-api/attested-challenge",children:"https://docs.bnbchain.org/greenfield-docs/docs/greenfield-api/attested-challenge"})]}),"\n",(0,i.jsx)(n.h2,{id:"getcrosschainqueryclient",children:"getCrosschainQueryClient"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-jsx",metastring:'title="example"',children:"const rpc = await client.queryClient.getCrosschainQueryClient();\nawait rpc.Params();\n"})}),"\n",(0,i.jsxs)(n.p,{children:["More apis: ",(0,i.jsx)(n.a,{href:"https://docs.bnbchain.org/greenfield-docs/docs/greenfield-api/attested-challenge",children:"https://docs.bnbchain.org/greenfield-docs/docs/greenfield-api/attested-challenge"})]}),"\n",(0,i.jsx)(n.h2,{id:"getfeegrantqueryclient",children:"getFeeGrantQueryClient"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-jsx",metastring:'title="example"',children:"const rpc = await client.queryClient.getFeeGrantQueryClient();\nawait rpc.Params();\n"})}),"\n",(0,i.jsxs)(n.p,{children:["More APIs: ",(0,i.jsx)(n.a,{href:"https://docs.bnbchain.org/greenfield-docs/docs/greenfield-api/allowance",children:"https://docs.bnbchain.org/greenfield-docs/docs/greenfield-api/allowance"})]}),"\n",(0,i.jsx)(n.h2,{id:"getgashubclient",children:"getGashubClient"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-jsx",metastring:'title="example"',children:"const rpc = await this.queryClient.getGashubClient();\nawait rpc.MsgGasParams(request);\n"})}),"\n",(0,i.jsxs)(n.p,{children:["More APIs: ",(0,i.jsx)(n.a,{href:"https://docs.bnbchain.org/greenfield-docs/docs/greenfield-api/msg-gas-params",children:"https://docs.bnbchain.org/greenfield-docs/docs/greenfield-api/msg-gas-params"})]}),"\n",(0,i.jsx)(n.h2,{id:"getpaymentqueryclient",children:"getPaymentQueryClient"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-jsx",metastring:'title="example"',children:"const rpc = await this.queryClient.getPaymentQueryClient();\nawait rpc.Params();\n"})}),"\n",(0,i.jsxs)(n.p,{children:["More APIs: ",(0,i.jsx)(n.a,{href:"https://docs.bnbchain.org/greenfield-docs/docs/greenfield-api/msg-gas-params",children:"https://docs.bnbchain.org/greenfield-docs/docs/greenfield-api/msg-gas-params"})]}),"\n",(0,i.jsx)(n.h2,{id:"getspqueryclient",children:"getSpQueryClient"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-jsx",metastring:'title="example"',children:"const rpc = await this.queryClient.getSpQueryClient();\nawait rpc.Params();\n"})}),"\n",(0,i.jsxs)(n.p,{children:["More APIs:\n",(0,i.jsx)(n.a,{href:"https://docs.bnbchain.org/greenfield-docs/docs/greenfield-api/query-global-sp-store-price-by-time",children:"https://docs.bnbchain.org/greenfield-docs/docs/greenfield-api/query-global-sp-store-price-by-time"})]}),"\n",(0,i.jsx)(n.h2,{id:"getstoragequeryclient",children:"getStorageQueryClient"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-jsx",metastring:'title="example"',children:"const rpc = await client.queryClient.getStorageQueryClient();\nawait rpc.HeadBucketById({\n bucketId: '1',\n});\n"})}),"\n",(0,i.jsxs)(n.p,{children:["More APIs: ",(0,i.jsx)(n.a,{href:"https://docs.bnbchain.org/greenfield-docs/docs/greenfield-api/query-group-members-exist",children:"https://docs.bnbchain.org/greenfield-docs/docs/greenfield-api/query-group-members-exist"})]}),"\n",(0,i.jsx)(n.h2,{id:"getvirtualgroupclient",children:"getVirtualGroupClient"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-jsx",metastring:'title="example"',children:"const rpc = await client.queryClient.getVirtualGroupClient();\nawait rpc.Params();\n"})}),"\n",(0,i.jsxs)(n.p,{children:["More APIs:\n",(0,i.jsx)(n.a,{href:"https://docs.bnbchain.org/greenfield-docs/docs/greenfield-api/available-global-virtual-group-families",children:"https://docs.bnbchain.org/greenfield-docs/docs/greenfield-api/available-global-virtual-group-families"})]})]})}function g(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(o,{...e})}):o(e)}},3159:(e,n,t)=>{t.d(n,{R:()=>l,x:()=>a});var i=t(8318);const r={},s=i.createContext(r);function l(e){const n=i.useContext(s);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function a(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:l(e.components),i.createElement(s.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/241.76697110.js b/assets/js/348.0f1fd375.js similarity index 98% rename from assets/js/241.76697110.js rename to assets/js/348.0f1fd375.js index c8d71282..797e6b4c 100644 --- a/assets/js/241.76697110.js +++ b/assets/js/348.0f1fd375.js @@ -1,2 +1,2 @@ -/*! For license information please see 241.76697110.js.LICENSE.txt */ -"use strict";(self.webpackChunkgreenfield_js_sdk_docs=self.webpackChunkgreenfield_js_sdk_docs||[]).push([[241],{5196:(e,t,n)=>{t.__esModule=!0,t.default=void 0;var r=i(n(8318)),o=i(n(7026));function i(e){return e&&e.__esModule?e:{default:e}}function a(){return a=Object.assign?Object.assign.bind():function(e){for(var t=1;t {t.__esModule=!0,t.default=void 0;var r=i(n(8318)),o=i(n(7026));function i(e){return e&&e.__esModule?e:{default:e}}function a(){return a=Object.assign?Object.assign.bind():function(e){for(var t=1;t {t.__esModule=!0,t.default=void 0;var r=i(n(8318)),o=i(n(7026));function i(e){return e&&e.__esModule?e:{default:e}}function a(){return a=Object.assign?Object.assign.bind():function(e){for(var t=1;t {t.__esModule=!0,t.default=void 0;var r=i(n(8318)),o=i(n(7026));function i(e){return e&&e.__esModule?e:{default:e}}function a(){return a=Object.assign?Object.assign.bind():function(e){for(var t=1;t {t.__esModule=!0,t.default=void 0;var r=i(n(8318)),o=i(n(3108));function i(e){return e&&e.__esModule?e:{default:e}}var a=function(e){var t=e.size,n=void 0===t?24:t,o=e.fill,i=void 0===o?"#000":o,a=e.className,s=e.path;return r.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:n,height:n,viewBox:"0 0 24 24",className:a},r.default.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}),r.default.createElement("path",{fill:i,d:s}))};a.propTypes={size:o.default.number,fill:o.default.string,className:o.default.string,path:o.default.string.isRequired};var s=a;t.default=s},4493:(e,t,n)=>{t.__esModule=!0,t.default=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=f(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var a=o?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(r,i,a):r[i]=e[i]}r.default=e,n&&n.set(e,r);return r}(n(8318)),o=u(n(3108)),i=n(63),a=u(n(5849)),s=n(7991),l=n(3462),c=n(2135);function u(e){return e&&e.__esModule?e:{default:e}}function f(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(f=function(e){return e?n:t})(e)}function d(){return d=Object.assign?Object.assign.bind():function(e){for(var t=1;t 1?(0,c.guessMaxImageWidth)(n.state.dimensions):0,supportsWebp:c.supportsWebp}),t=n.props.getUrl,r=t?t(e):e.src,o=n.props.shouldAutoDownload(h(h({},n.state),{},{size:e.size}));n.setState({pickedSrc:e,shouldAutoDownload:o,url:r},(function(){o&&n.load(!1)}))}})),m(v(n),"onLeave",(function(){n.state.loadState!==b||n.state.userTriggered||(n.setState({inViewport:!1}),n.cancel(!1))})),n.state={loadState:w,connection:c.nativeConnection?{downlink:navigator.connection.downlink,rtt:navigator.connection.rtt,effectiveType:navigator.connection.effectiveType}:null,onLine:!0,overThreshold:!1,inViewport:!1,userTriggered:!1,possiblySlowNetwork:!1},n}n=e,(t=o).prototype=Object.create(n.prototype),t.prototype.constructor=t,g(t,n);var s=o.prototype;return s.componentDidMount=function(){var e=this;c.nativeConnection?(this.updateConnection=function(){navigator.onLine&&e.state.loadState===w&&e.setState({connection:{effectiveType:navigator.connection.effectiveType,downlink:navigator.connection.downlink,rtt:navigator.connection.rtt}})},navigator.connection.addEventListener("onchange",this.updateConnection)):this.props.threshold&&(this.possiblySlowNetworkListener=function(t){if(e.state.loadState===w){var n=t.detail.possiblySlowNetwork;!e.state.possiblySlowNetwork&&n&&e.setState({possiblySlowNetwork:n})}},window.document.addEventListener("possiblySlowNetwork",this.possiblySlowNetworkListener)),this.updateOnlineStatus=function(){return e.setState({onLine:navigator.onLine})},this.updateOnlineStatus(),window.addEventListener("online",this.updateOnlineStatus),window.addEventListener("offline",this.updateOnlineStatus)},s.componentWillUnmount=function(){this.clear(),c.nativeConnection?navigator.connection.removeEventListener("onchange",this.updateConnection):this.props.threshold&&window.document.removeEventListener("possiblySlowNetwork",this.possiblySlowNetworkListener),window.removeEventListener("online",this.updateOnlineStatus),window.removeEventListener("offline",this.updateOnlineStatus)},s.clear=function(){this.loader&&(this.loader.cancel(),this.loader=void 0)},s.cancel=function(e){b===this.state.loadState&&(this.clear(),this.loadStateChange(w,e))},s.loadStateChange=function(e,t,n){void 0===n&&(n=null),this.setState({loadState:e,overThreshold:!1,userTriggered:!!t,loadInfo:n})},s.render=function(){var e=this,t=this.props.getIcon(this.state),n=this.props.getMessage(t,this.state);return r.default.createElement(i.Waypoint,{onEnter:this.onEnter,onLeave:this.onLeave},r.default.createElement(a.default,d({},this.props,(0,c.fallbackParams)(this.props),{onClick:this.onClick,icon:t,src:this.state.url||"",onDimensions:function(t){return e.setState({dimensions:t})},message:n})))},o}(r.Component);t.default=S,m(S,"propTypes",{threshold:o.default.number,getUrl:o.default.func,srcSet:o.default.arrayOf(o.default.shape({width:o.default.number.isRequired,src:o.default.string,size:o.default.number,format:o.default.oneOf(["jpeg","jpg","webp","png","gif"])})).isRequired,shouldAutoDownload:o.default.func,getMessage:o.default.func,getIcon:o.default.func,loader:o.default.oneOf(["image","xhr"]),width:o.default.number.isRequired,height:o.default.number.isRequired,placeholder:o.default.oneOfType([o.default.shape({color:o.default.string.isRequired}),o.default.shape({lqip:o.default.string.isRequired})]).isRequired,icons:o.default.object.isRequired,theme:o.default.object.isRequired}),m(S,"defaultProps",{shouldAutoDownload:function(e){var t=e.connection,n=e.size,r=e.threshold;if(e.possiblySlowNetwork)return!1;if(!t)return!0;var o=t.downlink,i=t.rtt;switch(t.effectiveType){case"slow-2g":case"2g":return!1;case"3g":return!!(o&&n&&r)&&8*n/(1e3*o)+i {t.__esModule=!0,t.default=void 0;var r=s(n(8318)),o=s(n(4493)),i=s(n(7404)),a=s(n(8615));function s(e){return e&&e.__esModule?e:{default:e}}function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function c(e){for(var t=1;t {t.__esModule=!0,t.default=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=l(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var a=o?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(r,i,a):r[i]=e[i]}r.default=e,n&&n.set(e,r);return r}(n(8318)),o=s(n(3108)),i=s(n(6109)),a=n(7991);function s(e){return e&&e.__esModule?e:{default:e}}function l(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(l=function(e){return e?n:t})(e)}function c(){return c=Object.assign?Object.assign.bind():function(e){for(var t=1;t {t.__esModule=!0,t.default=void 0;t.default=function(){for(var e,t=[],n=arguments.length,r=new Array(n),o=0;o 1?t.join(" "):t[0],style:e}}},7991:(e,t)=>{t.__esModule=!0,t.loadStates=t.icons=void 0;var n="loading",r="loaded",o="error",i={load:"load",loading:n,loaded:r,error:o,noicon:"noicon",offline:"offline"};t.icons=i;var a={initial:"initial",loading:n,loaded:r,error:o};t.loadStates=a},2135:(e,t)=>{t.__esModule=!0,t.supportsWebp=t.ssr=t.selectSrc=t.nativeConnection=t.guessMaxImageWidth=t.fallbackParams=t.bytesToSize=void 0;var n="undefined"==typeof window||"ReactSnap"===window.navigator.userAgent;t.ssr=n;var r=!n&&!!window.navigator.connection;t.nativeConnection=r;t.guessMaxImageWidth=function(e,t){if(n)return 0;t||(t=window);var r,o=e.width,i=t.screen,a=i.width,s=i.height,l=document.documentElement,c=t.innerWidth||l.clientWidth,u=t.innerHeight||l.clientHeight,f=t.devicePixelRatio||1;if(a>c){var d=document.getElementsByTagName("body")[0],p=c-o;r=(d.clientHeight>u||d.clientHeight>s)&&p<=15?a-p:o/c*a}else r=o;return r*f};t.bytesToSize=function(e){var t=["Bytes","KB","MB","GB","TB"];if(0===e)return"n/a";var n=parseInt(Math.floor(Math.log(e)/Math.log(1024)),10);return 0===n?e+" "+t[n]:(e/Math.pow(1024,n)).toFixed(1)+" "+t[n]};var o=function(){if(n)return!1;var e=document.createElement("canvas");return!(!e.getContext||!e.getContext("2d"))&&0===e.toDataURL("image/webp").indexOf("data:image/webp")}();t.supportsWebp=o;var i=function(e){return"webp"===e.format||e.src&&e.src.match(/\.webp($|\?.*)/i)};t.selectSrc=function(e){var t,n,r=e.srcSet,o=e.maxImageWidth,a=e.supportsWebp;if(0===r.length)throw new Error("Need at least one item in srcSet");if(a)0===(t=r.filter(i)).length&&(t=r);else if(0===(t=r.filter((function(e){return!i(e)}))).length)throw new Error("Need at least one supported format item in srcSet");var s=t.filter((function(e){return e.width>=o}));return 0===s.length?(s=t,n=Math.max.apply(null,s.map((function(e){return e.width})))):n=Math.min.apply(null,s.map((function(e){return e.width}))),t.filter((function(e){return e.width===n}))[0]};t.fallbackParams=function(e){var t=e.srcSet,r=e.getUrl;if(!n)return{};var o=t.filter((function(e){return!i(e)})),a=o[0];return{nsSrcSet:o.map((function(e){return(r?r(e):e.src)+" "+e.width+"w"})).join(","),nsSrc:r?r(a):a.src,ssr:n}}},7404:(e,t,n)=>{t.__esModule=!0,t.default=void 0;var r,o=c(n(5196)),i=c(n(1477)),a=c(n(5902)),s=c(n(6006)),l=n(7991);function c(e){return e&&e.__esModule?e:{default:e}}var u=l.icons.load,f=l.icons.loading,d=l.icons.loaded,p=l.icons.error,h=l.icons.noicon,v=l.icons.offline,g=((r={})[u]=o.default,r[f]=s.default,r[d]=null,r[p]=a.default,r[h]=null,r[v]=i.default,r);t.default=g},3462:(e,t,n)=>{t.__esModule=!0,t.xhrLoader=t.timeout=t.imageLoader=t.combineCancel=void 0;var r=n(6983);function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t {t.__esModule=!0,t.default=void 0;t.default={placeholder:{backgroundSize:"cover",backgroundRepeat:"no-repeat",position:"relative"},img:{width:"100%",height:"auto",maxWidth:"100%",marginBottom:"-4px"},icon:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",textAlign:"center"},noscript:{position:"absolute",top:0,left:0}}},6983:(e,t)=>{t.__esModule=!0,t.unfetch=t.UnfetchAbortController=void 0;t.UnfetchAbortController=function(){var e=this;this.signal={onabort:function(){}},this.abort=function(){return e.signal.onabort()}};t.unfetch=function(e,t){return t=t||{},new Promise((function(n,r){var o=new XMLHttpRequest;for(var i in o.open(t.method||"get",e,!0),t.headers)o.setRequestHeader(i,t.headers[i]);function a(){var e,t=[],n=[],r={};return o.getAllResponseHeaders().replace(/^(.*?):\s*?([\s\S]*?)$/gm,(function(o,i,a){t.push(i=i.toLowerCase()),n.push([i,a]),e=r[i],r[i]=e?e+","+a:a})),{ok:2==(o.status/100|0),status:o.status,statusText:o.statusText,url:o.responseURL,clone:a,text:function(){return Promise.resolve(o.responseText)},json:function(){return Promise.resolve(o.responseText).then(JSON.parse)},blob:function(){return Promise.resolve(new Blob([o.response]))},headers:{keys:function(){return t},entries:function(){return n},get:function(e){return r[e.toLowerCase()]},has:function(e){return e.toLowerCase()in r}}}}o.withCredentials="include"===t.credentials,o.onload=function(){n(a())},o.onerror=r,t.signal&&(t.signal.onabort=function(){o.onerror=o.onload=void 0,o.abort()}),o.send(t.body)}))}},7101:(e,t,n)=>{var r;t.A=void 0;var o=((r=n(9887))&&r.__esModule?r:{default:r}).default;t.A=o},6923:(e,t,n)=>{n.d(t,{A:()=>s});n(8318);var r=n(7101),o=n(7084),i=n(9214);function a(e,t){switch(e){case"noicon":case"loaded":return null;case"loading":return(0,o.T)({id:"theme.IdealImageMessage.loading",message:"Loading...",description:"When the full-scale image is loading"});case"load":{const{pickedSrc:e}=t,{size:n}=e,r=n?` (${function(e){const t=["B","KB","MB","GB","TB"];if(0===e)return"n/a";const n=Math.floor(Math.log(e)/Math.log(1024));return 0===n?`${e} ${t[n]}`:`${(e/1024**n).toFixed(1)} ${t[n]}`}(n)})`:"";return(0,o.T)({id:"theme.IdealImageMessage.load",message:"Click to load{sizeMessage}",description:"To prompt users to load the full image. sizeMessage is a parenthesized size figure."},{sizeMessage:r})}case"offline":return(0,o.T)({id:"theme.IdealImageMessage.offline",message:"Your browser is offline. Image not loaded",description:"When the user is viewing an offline document"});case"error":{const{loadInfo:e}=t;return 404===e?(0,o.T)({id:"theme.IdealImageMessage.404error",message:"404. Image not found",description:"When the image is not found"}):(0,o.T)({id:"theme.IdealImageMessage.error",message:"Error. Click to reload",description:"When the image fails to load for unknown error"})}default:throw new Error(`Wrong icon: ${e}`)}}function s(e){const{img:t,...n}=e;return"string"==typeof t||"default"in t?(0,i.jsx)("img",{src:"string"==typeof t?t:t.default,...n}):(0,i.jsx)(r.A,{...n,height:t.src.height??100,width:t.src.width??100,placeholder:{lqip:t.preSrc},src:t.src.src,srcSet:t.src.images.map((e=>({...e,src:e.path}))),getMessage:a})}},6588:(e,t)=>{var n,r=Symbol.for("react.element"),o=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),l=Symbol.for("react.provider"),c=Symbol.for("react.context"),u=Symbol.for("react.server_context"),f=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),p=Symbol.for("react.suspense_list"),h=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),g=Symbol.for("react.offscreen");function m(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case i:case s:case a:case d:case p:return e;default:switch(e=e&&e.$$typeof){case u:case c:case f:case v:case h:case l:return e;default:return t}}case o:return t}}}n=Symbol.for("react.module.reference"),t.isForwardRef=function(e){return m(e)===f}},4448:(e,t,n)=>{e.exports=n(6588)},63:(e,t,n)=>{n.r(t),n.d(t,{Waypoint:()=>E});var r=n(5411),o=!("undefined"==typeof window||!window.document||!window.document.createElement);var i=void 0;function a(){return void 0===i&&(i=function(){if(!o)return!1;if(!window.addEventListener||!window.removeEventListener||!Object.defineProperty)return!1;var e=!1;try{var t=Object.defineProperty({},"passive",{get:function(){e=!0}}),n=function(){};window.addEventListener("testPassiveEventSupport",n,t),window.removeEventListener("testPassiveEventSupport",n,t)}catch(r){}return e}()),i}function s(e){e.handlers===e.nextHandlers&&(e.nextHandlers=e.handlers.slice())}function l(e){this.target=e,this.events={}}l.prototype.getEventHandlers=function(e,t){var n,r=String(e)+" "+String((n=t)?!0===n?100:(0|n.capture)+(n.passive<<1)+(n.once<<2):0);return this.events[r]||(this.events[r]={handlers:[],handleEvent:void 0},this.events[r].nextHandlers=this.events[r].handlers),this.events[r]},l.prototype.handleEvent=function(e,t,n){var r=this.getEventHandlers(e,t);r.handlers=r.nextHandlers,r.handlers.forEach((function(e){e&&e(n)}))},l.prototype.add=function(e,t,n){var r=this,o=this.getEventHandlers(e,n);s(o),0===o.nextHandlers.length&&(o.handleEvent=this.handleEvent.bind(this,e,n),this.target.addEventListener(e,o.handleEvent,n)),o.nextHandlers.push(t);var i=!0;return function(){if(i){i=!1,s(o);var a=o.nextHandlers.indexOf(t);o.nextHandlers.splice(a,1),0===o.nextHandlers.length&&(r.target&&r.target.removeEventListener(e,o.handleEvent,n),o.handleEvent=void 0)}}};var c="__consolidated_events_handlers__";function u(e,t,n,r){e[c]||(e[c]=new l(e));var o=function(e){if(e)return a()?e:!!e.capture}(r);return e[c].add(t,n,o)}var f=n(8318),d=n(4448);function p(e,t){var n,r=(n=e,!isNaN(parseFloat(n))&&isFinite(n)?parseFloat(n):"px"===n.slice(-2)?parseFloat(n.slice(0,-2)):void 0);if("number"==typeof r)return r;var o=function(e){if("%"===e.slice(-1))return parseFloat(e.slice(0,-1))/100}(e);return"number"==typeof o?o*t:void 0}var h="above",v="inside",g="below",m="invisible";function w(e){return"string"==typeof e.type}var b;var y=[];function O(e){y.push(e),b||(b=setTimeout((function(){var e;for(b=null;e=y.shift();)e()}),0));var t=!0;return function(){if(t){t=!1;var n=y.indexOf(e);-1!==n&&(y.splice(n,1),!y.length&&b&&(clearTimeout(b),b=null))}}}var S="undefined"!=typeof window,j={debug:!1,scrollableAncestor:void 0,children:void 0,topOffset:"0px",bottomOffset:"0px",horizontal:!1,onEnter:function(){},onLeave:function(){},onPositionChange:function(){},fireOnRapidScroll:!0},E=function(e){function t(t){var n;return(n=e.call(this,t)||this).refElement=function(e){n._ref=e},n}(0,r.A)(t,e);var o=t.prototype;return o.componentDidMount=function(){var e=this;S&&(this.cancelOnNextTick=O((function(){e.cancelOnNextTick=null;var t=e.props,n=t.children;t.debug;!function(e,t){if(e&&!w(e)&&!t)throw new Error(" needs a DOM element to compute boundaries. The child you passed is neither a DOM element (e.g. ) nor does it use the innerRef prop.\n\nSee https://goo.gl/LrBNgw for more info.")}(n,e._ref),e._handleScroll=e._handleScroll.bind(e),e.scrollableAncestor=e._findScrollableAncestor(),e.scrollEventListenerUnsubscribe=u(e.scrollableAncestor,"scroll",e._handleScroll,{passive:!0}),e.resizeEventListenerUnsubscribe=u(window,"resize",e._handleScroll,{passive:!0}),e._handleScroll(null)})))},o.componentDidUpdate=function(){var e=this;S&&this.scrollableAncestor&&(this.cancelOnNextTick||(this.cancelOnNextTick=O((function(){e.cancelOnNextTick=null,e._handleScroll(null)}))))},o.componentWillUnmount=function(){S&&(this.scrollEventListenerUnsubscribe&&this.scrollEventListenerUnsubscribe(),this.resizeEventListenerUnsubscribe&&this.resizeEventListenerUnsubscribe(),this.cancelOnNextTick&&this.cancelOnNextTick())},o._findScrollableAncestor=function(){var e=this.props,t=e.horizontal,r=e.scrollableAncestor;if(r)return function(e){return"window"===e?n.g.window:e}(r);for(var o=this._ref;o.parentNode;){if((o=o.parentNode)===document.body)return window;var i=window.getComputedStyle(o),a=(t?i.getPropertyValue("overflow-x"):i.getPropertyValue("overflow-y"))||i.getPropertyValue("overflow");if("auto"===a||"scroll"===a||"overlay"===a)return o}return window},o._handleScroll=function(e){if(this._ref){var t=this._getBounds(),n=function(e){return e.viewportBottom-e.viewportTop==0?m:e.viewportTop<=e.waypointTop&&e.waypointTop<=e.viewportBottom||e.viewportTop<=e.waypointBottom&&e.waypointBottom<=e.viewportBottom||e.waypointTop<=e.viewportTop&&e.viewportBottom<=e.waypointBottom?v:e.viewportBottom{n.d(t,{R:()=>a,x:()=>s});var r=n(8318);const o={},i=r.createContext(o);function a(e){const t=r.useContext(i);return r.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function s(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:a(e.components),r.createElement(i.Provider,{value:t},e.children)}}}]); \ No newline at end of file +/*! For license information please see 348.0f1fd375.js.LICENSE.txt */ +"use strict";(self.webpackChunkgreenfield_js_sdk_docs=self.webpackChunkgreenfield_js_sdk_docs||[]).push([[348],{5196:(e,t,n)=>{t.__esModule=!0,t.default=void 0;var r=i(n(8318)),o=i(n(7026));function i(e){return e&&e.__esModule?e:{default:e}}function a(){return a=Object.assign?Object.assign.bind():function(e){for(var t=1;t {t.__esModule=!0,t.default=void 0;var r=i(n(8318)),o=i(n(7026));function i(e){return e&&e.__esModule?e:{default:e}}function a(){return a=Object.assign?Object.assign.bind():function(e){for(var t=1;t {t.__esModule=!0,t.default=void 0;var r=i(n(8318)),o=i(n(7026));function i(e){return e&&e.__esModule?e:{default:e}}function a(){return a=Object.assign?Object.assign.bind():function(e){for(var t=1;t {t.__esModule=!0,t.default=void 0;var r=i(n(8318)),o=i(n(7026));function i(e){return e&&e.__esModule?e:{default:e}}function a(){return a=Object.assign?Object.assign.bind():function(e){for(var t=1;t {t.__esModule=!0,t.default=void 0;var r=i(n(8318)),o=i(n(3108));function i(e){return e&&e.__esModule?e:{default:e}}var a=function(e){var t=e.size,n=void 0===t?24:t,o=e.fill,i=void 0===o?"#000":o,a=e.className,s=e.path;return r.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:n,height:n,viewBox:"0 0 24 24",className:a},r.default.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}),r.default.createElement("path",{fill:i,d:s}))};a.propTypes={size:o.default.number,fill:o.default.string,className:o.default.string,path:o.default.string.isRequired};var s=a;t.default=s},4493:(e,t,n)=>{t.__esModule=!0,t.default=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=f(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var a=o?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(r,i,a):r[i]=e[i]}r.default=e,n&&n.set(e,r);return r}(n(8318)),o=u(n(3108)),i=n(63),a=u(n(5849)),s=n(7991),l=n(3462),c=n(2135);function u(e){return e&&e.__esModule?e:{default:e}}function f(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(f=function(e){return e?n:t})(e)}function d(){return d=Object.assign?Object.assign.bind():function(e){for(var t=1;t 1?(0,c.guessMaxImageWidth)(n.state.dimensions):0,supportsWebp:c.supportsWebp}),t=n.props.getUrl,r=t?t(e):e.src,o=n.props.shouldAutoDownload(h(h({},n.state),{},{size:e.size}));n.setState({pickedSrc:e,shouldAutoDownload:o,url:r},(function(){o&&n.load(!1)}))}})),m(v(n),"onLeave",(function(){n.state.loadState!==b||n.state.userTriggered||(n.setState({inViewport:!1}),n.cancel(!1))})),n.state={loadState:w,connection:c.nativeConnection?{downlink:navigator.connection.downlink,rtt:navigator.connection.rtt,effectiveType:navigator.connection.effectiveType}:null,onLine:!0,overThreshold:!1,inViewport:!1,userTriggered:!1,possiblySlowNetwork:!1},n}n=e,(t=o).prototype=Object.create(n.prototype),t.prototype.constructor=t,g(t,n);var s=o.prototype;return s.componentDidMount=function(){var e=this;c.nativeConnection?(this.updateConnection=function(){navigator.onLine&&e.state.loadState===w&&e.setState({connection:{effectiveType:navigator.connection.effectiveType,downlink:navigator.connection.downlink,rtt:navigator.connection.rtt}})},navigator.connection.addEventListener("onchange",this.updateConnection)):this.props.threshold&&(this.possiblySlowNetworkListener=function(t){if(e.state.loadState===w){var n=t.detail.possiblySlowNetwork;!e.state.possiblySlowNetwork&&n&&e.setState({possiblySlowNetwork:n})}},window.document.addEventListener("possiblySlowNetwork",this.possiblySlowNetworkListener)),this.updateOnlineStatus=function(){return e.setState({onLine:navigator.onLine})},this.updateOnlineStatus(),window.addEventListener("online",this.updateOnlineStatus),window.addEventListener("offline",this.updateOnlineStatus)},s.componentWillUnmount=function(){this.clear(),c.nativeConnection?navigator.connection.removeEventListener("onchange",this.updateConnection):this.props.threshold&&window.document.removeEventListener("possiblySlowNetwork",this.possiblySlowNetworkListener),window.removeEventListener("online",this.updateOnlineStatus),window.removeEventListener("offline",this.updateOnlineStatus)},s.clear=function(){this.loader&&(this.loader.cancel(),this.loader=void 0)},s.cancel=function(e){b===this.state.loadState&&(this.clear(),this.loadStateChange(w,e))},s.loadStateChange=function(e,t,n){void 0===n&&(n=null),this.setState({loadState:e,overThreshold:!1,userTriggered:!!t,loadInfo:n})},s.render=function(){var e=this,t=this.props.getIcon(this.state),n=this.props.getMessage(t,this.state);return r.default.createElement(i.Waypoint,{onEnter:this.onEnter,onLeave:this.onLeave},r.default.createElement(a.default,d({},this.props,(0,c.fallbackParams)(this.props),{onClick:this.onClick,icon:t,src:this.state.url||"",onDimensions:function(t){return e.setState({dimensions:t})},message:n})))},o}(r.Component);t.default=S,m(S,"propTypes",{threshold:o.default.number,getUrl:o.default.func,srcSet:o.default.arrayOf(o.default.shape({width:o.default.number.isRequired,src:o.default.string,size:o.default.number,format:o.default.oneOf(["jpeg","jpg","webp","png","gif"])})).isRequired,shouldAutoDownload:o.default.func,getMessage:o.default.func,getIcon:o.default.func,loader:o.default.oneOf(["image","xhr"]),width:o.default.number.isRequired,height:o.default.number.isRequired,placeholder:o.default.oneOfType([o.default.shape({color:o.default.string.isRequired}),o.default.shape({lqip:o.default.string.isRequired})]).isRequired,icons:o.default.object.isRequired,theme:o.default.object.isRequired}),m(S,"defaultProps",{shouldAutoDownload:function(e){var t=e.connection,n=e.size,r=e.threshold;if(e.possiblySlowNetwork)return!1;if(!t)return!0;var o=t.downlink,i=t.rtt;switch(t.effectiveType){case"slow-2g":case"2g":return!1;case"3g":return!!(o&&n&&r)&&8*n/(1e3*o)+i {t.__esModule=!0,t.default=void 0;var r=s(n(8318)),o=s(n(4493)),i=s(n(7404)),a=s(n(8615));function s(e){return e&&e.__esModule?e:{default:e}}function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function c(e){for(var t=1;t {t.__esModule=!0,t.default=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=l(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var a=o?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(r,i,a):r[i]=e[i]}r.default=e,n&&n.set(e,r);return r}(n(8318)),o=s(n(3108)),i=s(n(6109)),a=n(7991);function s(e){return e&&e.__esModule?e:{default:e}}function l(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(l=function(e){return e?n:t})(e)}function c(){return c=Object.assign?Object.assign.bind():function(e){for(var t=1;t {t.__esModule=!0,t.default=void 0;t.default=function(){for(var e,t=[],n=arguments.length,r=new Array(n),o=0;o 1?t.join(" "):t[0],style:e}}},7991:(e,t)=>{t.__esModule=!0,t.loadStates=t.icons=void 0;var n="loading",r="loaded",o="error",i={load:"load",loading:n,loaded:r,error:o,noicon:"noicon",offline:"offline"};t.icons=i;var a={initial:"initial",loading:n,loaded:r,error:o};t.loadStates=a},2135:(e,t)=>{t.__esModule=!0,t.supportsWebp=t.ssr=t.selectSrc=t.nativeConnection=t.guessMaxImageWidth=t.fallbackParams=t.bytesToSize=void 0;var n="undefined"==typeof window||"ReactSnap"===window.navigator.userAgent;t.ssr=n;var r=!n&&!!window.navigator.connection;t.nativeConnection=r;t.guessMaxImageWidth=function(e,t){if(n)return 0;t||(t=window);var r,o=e.width,i=t.screen,a=i.width,s=i.height,l=document.documentElement,c=t.innerWidth||l.clientWidth,u=t.innerHeight||l.clientHeight,f=t.devicePixelRatio||1;if(a>c){var d=document.getElementsByTagName("body")[0],p=c-o;r=(d.clientHeight>u||d.clientHeight>s)&&p<=15?a-p:o/c*a}else r=o;return r*f};t.bytesToSize=function(e){var t=["Bytes","KB","MB","GB","TB"];if(0===e)return"n/a";var n=parseInt(Math.floor(Math.log(e)/Math.log(1024)),10);return 0===n?e+" "+t[n]:(e/Math.pow(1024,n)).toFixed(1)+" "+t[n]};var o=function(){if(n)return!1;var e=document.createElement("canvas");return!(!e.getContext||!e.getContext("2d"))&&0===e.toDataURL("image/webp").indexOf("data:image/webp")}();t.supportsWebp=o;var i=function(e){return"webp"===e.format||e.src&&e.src.match(/\.webp($|\?.*)/i)};t.selectSrc=function(e){var t,n,r=e.srcSet,o=e.maxImageWidth,a=e.supportsWebp;if(0===r.length)throw new Error("Need at least one item in srcSet");if(a)0===(t=r.filter(i)).length&&(t=r);else if(0===(t=r.filter((function(e){return!i(e)}))).length)throw new Error("Need at least one supported format item in srcSet");var s=t.filter((function(e){return e.width>=o}));return 0===s.length?(s=t,n=Math.max.apply(null,s.map((function(e){return e.width})))):n=Math.min.apply(null,s.map((function(e){return e.width}))),t.filter((function(e){return e.width===n}))[0]};t.fallbackParams=function(e){var t=e.srcSet,r=e.getUrl;if(!n)return{};var o=t.filter((function(e){return!i(e)})),a=o[0];return{nsSrcSet:o.map((function(e){return(r?r(e):e.src)+" "+e.width+"w"})).join(","),nsSrc:r?r(a):a.src,ssr:n}}},7404:(e,t,n)=>{t.__esModule=!0,t.default=void 0;var r,o=c(n(5196)),i=c(n(1477)),a=c(n(5902)),s=c(n(6006)),l=n(7991);function c(e){return e&&e.__esModule?e:{default:e}}var u=l.icons.load,f=l.icons.loading,d=l.icons.loaded,p=l.icons.error,h=l.icons.noicon,v=l.icons.offline,g=((r={})[u]=o.default,r[f]=s.default,r[d]=null,r[p]=a.default,r[h]=null,r[v]=i.default,r);t.default=g},3462:(e,t,n)=>{t.__esModule=!0,t.xhrLoader=t.timeout=t.imageLoader=t.combineCancel=void 0;var r=n(6983);function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t {t.__esModule=!0,t.default=void 0;t.default={placeholder:{backgroundSize:"cover",backgroundRepeat:"no-repeat",position:"relative"},img:{width:"100%",height:"auto",maxWidth:"100%",marginBottom:"-4px"},icon:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",textAlign:"center"},noscript:{position:"absolute",top:0,left:0}}},6983:(e,t)=>{t.__esModule=!0,t.unfetch=t.UnfetchAbortController=void 0;t.UnfetchAbortController=function(){var e=this;this.signal={onabort:function(){}},this.abort=function(){return e.signal.onabort()}};t.unfetch=function(e,t){return t=t||{},new Promise((function(n,r){var o=new XMLHttpRequest;for(var i in o.open(t.method||"get",e,!0),t.headers)o.setRequestHeader(i,t.headers[i]);function a(){var e,t=[],n=[],r={};return o.getAllResponseHeaders().replace(/^(.*?):\s*?([\s\S]*?)$/gm,(function(o,i,a){t.push(i=i.toLowerCase()),n.push([i,a]),e=r[i],r[i]=e?e+","+a:a})),{ok:2==(o.status/100|0),status:o.status,statusText:o.statusText,url:o.responseURL,clone:a,text:function(){return Promise.resolve(o.responseText)},json:function(){return Promise.resolve(o.responseText).then(JSON.parse)},blob:function(){return Promise.resolve(new Blob([o.response]))},headers:{keys:function(){return t},entries:function(){return n},get:function(e){return r[e.toLowerCase()]},has:function(e){return e.toLowerCase()in r}}}}o.withCredentials="include"===t.credentials,o.onload=function(){n(a())},o.onerror=r,t.signal&&(t.signal.onabort=function(){o.onerror=o.onload=void 0,o.abort()}),o.send(t.body)}))}},7101:(e,t,n)=>{var r;t.A=void 0;var o=((r=n(9887))&&r.__esModule?r:{default:r}).default;t.A=o},9816:(e,t,n)=>{n.d(t,{A:()=>s});n(8318);var r=n(7101),o=n(6093),i=n(9214);function a(e,t){switch(e){case"noicon":case"loaded":return null;case"loading":return(0,o.T)({id:"theme.IdealImageMessage.loading",message:"Loading...",description:"When the full-scale image is loading"});case"load":{const{pickedSrc:e}=t,{size:n}=e,r=n?` (${function(e){const t=["B","KB","MB","GB","TB"];if(0===e)return"n/a";const n=Math.floor(Math.log(e)/Math.log(1024));return 0===n?`${e} ${t[n]}`:`${(e/1024**n).toFixed(1)} ${t[n]}`}(n)})`:"";return(0,o.T)({id:"theme.IdealImageMessage.load",message:"Click to load{sizeMessage}",description:"To prompt users to load the full image. sizeMessage is a parenthesized size figure."},{sizeMessage:r})}case"offline":return(0,o.T)({id:"theme.IdealImageMessage.offline",message:"Your browser is offline. Image not loaded",description:"When the user is viewing an offline document"});case"error":{const{loadInfo:e}=t;return 404===e?(0,o.T)({id:"theme.IdealImageMessage.404error",message:"404. Image not found",description:"When the image is not found"}):(0,o.T)({id:"theme.IdealImageMessage.error",message:"Error. Click to reload",description:"When the image fails to load for unknown error"})}default:throw new Error(`Wrong icon: ${e}`)}}function s(e){const{img:t,...n}=e;return"string"==typeof t||"default"in t?(0,i.jsx)("img",{src:"string"==typeof t?t:t.default,...n}):(0,i.jsx)(r.A,{...n,height:t.src.height??100,width:t.src.width??100,placeholder:{lqip:t.preSrc},src:t.src.src,srcSet:t.src.images.map((e=>({...e,src:e.path}))),getMessage:a})}},6588:(e,t)=>{var n,r=Symbol.for("react.element"),o=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),l=Symbol.for("react.provider"),c=Symbol.for("react.context"),u=Symbol.for("react.server_context"),f=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),p=Symbol.for("react.suspense_list"),h=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),g=Symbol.for("react.offscreen");function m(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case i:case s:case a:case d:case p:return e;default:switch(e=e&&e.$$typeof){case u:case c:case f:case v:case h:case l:return e;default:return t}}case o:return t}}}n=Symbol.for("react.module.reference"),t.isForwardRef=function(e){return m(e)===f}},4448:(e,t,n)=>{e.exports=n(6588)},63:(e,t,n)=>{n.r(t),n.d(t,{Waypoint:()=>E});var r=n(7764),o=!("undefined"==typeof window||!window.document||!window.document.createElement);var i=void 0;function a(){return void 0===i&&(i=function(){if(!o)return!1;if(!window.addEventListener||!window.removeEventListener||!Object.defineProperty)return!1;var e=!1;try{var t=Object.defineProperty({},"passive",{get:function(){e=!0}}),n=function(){};window.addEventListener("testPassiveEventSupport",n,t),window.removeEventListener("testPassiveEventSupport",n,t)}catch(r){}return e}()),i}function s(e){e.handlers===e.nextHandlers&&(e.nextHandlers=e.handlers.slice())}function l(e){this.target=e,this.events={}}l.prototype.getEventHandlers=function(e,t){var n,r=String(e)+" "+String((n=t)?!0===n?100:(0|n.capture)+(n.passive<<1)+(n.once<<2):0);return this.events[r]||(this.events[r]={handlers:[],handleEvent:void 0},this.events[r].nextHandlers=this.events[r].handlers),this.events[r]},l.prototype.handleEvent=function(e,t,n){var r=this.getEventHandlers(e,t);r.handlers=r.nextHandlers,r.handlers.forEach((function(e){e&&e(n)}))},l.prototype.add=function(e,t,n){var r=this,o=this.getEventHandlers(e,n);s(o),0===o.nextHandlers.length&&(o.handleEvent=this.handleEvent.bind(this,e,n),this.target.addEventListener(e,o.handleEvent,n)),o.nextHandlers.push(t);var i=!0;return function(){if(i){i=!1,s(o);var a=o.nextHandlers.indexOf(t);o.nextHandlers.splice(a,1),0===o.nextHandlers.length&&(r.target&&r.target.removeEventListener(e,o.handleEvent,n),o.handleEvent=void 0)}}};var c="__consolidated_events_handlers__";function u(e,t,n,r){e[c]||(e[c]=new l(e));var o=function(e){if(e)return a()?e:!!e.capture}(r);return e[c].add(t,n,o)}var f=n(8318),d=n(4448);function p(e,t){var n,r=(n=e,!isNaN(parseFloat(n))&&isFinite(n)?parseFloat(n):"px"===n.slice(-2)?parseFloat(n.slice(0,-2)):void 0);if("number"==typeof r)return r;var o=function(e){if("%"===e.slice(-1))return parseFloat(e.slice(0,-1))/100}(e);return"number"==typeof o?o*t:void 0}var h="above",v="inside",g="below",m="invisible";function w(e){return"string"==typeof e.type}var b;var y=[];function O(e){y.push(e),b||(b=setTimeout((function(){var e;for(b=null;e=y.shift();)e()}),0));var t=!0;return function(){if(t){t=!1;var n=y.indexOf(e);-1!==n&&(y.splice(n,1),!y.length&&b&&(clearTimeout(b),b=null))}}}var S="undefined"!=typeof window,j={debug:!1,scrollableAncestor:void 0,children:void 0,topOffset:"0px",bottomOffset:"0px",horizontal:!1,onEnter:function(){},onLeave:function(){},onPositionChange:function(){},fireOnRapidScroll:!0},E=function(e){function t(t){var n;return(n=e.call(this,t)||this).refElement=function(e){n._ref=e},n}(0,r.A)(t,e);var o=t.prototype;return o.componentDidMount=function(){var e=this;S&&(this.cancelOnNextTick=O((function(){e.cancelOnNextTick=null;var t=e.props,n=t.children;t.debug;!function(e,t){if(e&&!w(e)&&!t)throw new Error(" needs a DOM element to compute boundaries. The child you passed is neither a DOM element (e.g. ) nor does it use the innerRef prop.\n\nSee https://goo.gl/LrBNgw for more info.")}(n,e._ref),e._handleScroll=e._handleScroll.bind(e),e.scrollableAncestor=e._findScrollableAncestor(),e.scrollEventListenerUnsubscribe=u(e.scrollableAncestor,"scroll",e._handleScroll,{passive:!0}),e.resizeEventListenerUnsubscribe=u(window,"resize",e._handleScroll,{passive:!0}),e._handleScroll(null)})))},o.componentDidUpdate=function(){var e=this;S&&this.scrollableAncestor&&(this.cancelOnNextTick||(this.cancelOnNextTick=O((function(){e.cancelOnNextTick=null,e._handleScroll(null)}))))},o.componentWillUnmount=function(){S&&(this.scrollEventListenerUnsubscribe&&this.scrollEventListenerUnsubscribe(),this.resizeEventListenerUnsubscribe&&this.resizeEventListenerUnsubscribe(),this.cancelOnNextTick&&this.cancelOnNextTick())},o._findScrollableAncestor=function(){var e=this.props,t=e.horizontal,r=e.scrollableAncestor;if(r)return function(e){return"window"===e?n.g.window:e}(r);for(var o=this._ref;o.parentNode;){if((o=o.parentNode)===document.body)return window;var i=window.getComputedStyle(o),a=(t?i.getPropertyValue("overflow-x"):i.getPropertyValue("overflow-y"))||i.getPropertyValue("overflow");if("auto"===a||"scroll"===a||"overlay"===a)return o}return window},o._handleScroll=function(e){if(this._ref){var t=this._getBounds(),n=function(e){return e.viewportBottom-e.viewportTop==0?m:e.viewportTop<=e.waypointTop&&e.waypointTop<=e.viewportBottom||e.viewportTop<=e.waypointBottom&&e.waypointBottom<=e.viewportBottom||e.waypointTop<=e.viewportTop&&e.viewportBottom<=e.waypointBottom?v:e.viewportBottom{n.d(t,{R:()=>a,x:()=>s});var r=n(8318);const o={},i=r.createContext(o);function a(e){const t=r.useContext(i);return r.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function s(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:a(e.components),r.createElement(i.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/241.76697110.js.LICENSE.txt b/assets/js/348.0f1fd375.js.LICENSE.txt similarity index 100% rename from assets/js/241.76697110.js.LICENSE.txt rename to assets/js/348.0f1fd375.js.LICENSE.txt diff --git a/assets/js/351.3af149d0.js b/assets/js/351.3af149d0.js deleted file mode 100644 index 975bc50f..00000000 --- a/assets/js/351.3af149d0.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkgreenfield_js_sdk_docs=self.webpackChunkgreenfield_js_sdk_docs||[]).push([[351],{2145:(e,t,n)=>{n.d(t,{A:()=>d});n(8318);var s=n(3372),i=n(7084),o=n(5418),r=n(9214);function d(e){let{className:t}=e;return(0,r.jsx)("main",{className:(0,s.A)("container margin-vert--xl",t),children:(0,r.jsx)("div",{className:"row",children:(0,r.jsxs)("div",{className:"col col--6 col--offset-3",children:[(0,r.jsx)(o.A,{as:"h1",className:"hero__title",children:(0,r.jsx)(i.A,{id:"theme.NotFound.title",description:"The title of the 404 page",children:"Page Not Found"})}),(0,r.jsx)("p",{children:(0,r.jsx)(i.A,{id:"theme.NotFound.p1",description:"The first paragraph of the 404 page",children:"We could not find what you were looking for."})}),(0,r.jsx)("p",{children:(0,r.jsx)(i.A,{id:"theme.NotFound.p2",description:"The 2nd paragraph of the 404 page",children:"Please contact the owner of the site that linked you to the original URL and let them know their link is broken."})})]})})})}},2351:(e,t,n)=>{n.r(t),n.d(t,{default:()=>a});n(8318);var s=n(7084),i=n(5679),o=n(5601),r=n(2145),d=n(9214);function a(){const e=(0,s.T)({id:"theme.NotFound.title",message:"Page Not Found"});return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(i.be,{title:e}),(0,d.jsx)(o.A,{children:(0,d.jsx)(r.A,{})})]})}}}]); \ No newline at end of file diff --git a/assets/js/3beee713.0414273d.js b/assets/js/3beee713.2312b806.js similarity index 96% rename from assets/js/3beee713.0414273d.js rename to assets/js/3beee713.2312b806.js index 91de7873..ffa58af5 100644 --- a/assets/js/3beee713.0414273d.js +++ b/assets/js/3beee713.2312b806.js @@ -1 +1 @@ -"use strict";(self.webpackChunkgreenfield_js_sdk_docs=self.webpackChunkgreenfield_js_sdk_docs||[]).push([[290],{6976:(e,t,n)=>{n.d(t,{Ay:()=>o,RM:()=>a});var s=n(9214),r=n(3159);const a=[];function i(e){const t={a:"a",admonition:"admonition",p:"p",...(0,r.R)(),...e.components};return(0,s.jsx)(t.admonition,{type:"tip",children:(0,s.jsxs)(t.p,{children:["This is only ",(0,s.jsx)(t.a,{href:"/client/tx-client",children:"construct"})," tx, next need ",(0,s.jsx)(t.a,{href:"/client/tx-client#simulate",children:"simulate"})," and\n",(0,s.jsx)(t.a,{href:"/client/tx-client#broadcast",children:"broadcast"})]})})}function o(e={}){const{wrapper:t}={...(0,r.R)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(i,{...e})}):i(e)}},7430:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>c,contentTitle:()=>o,default:()=>h,frontMatter:()=>i,metadata:()=>d,toc:()=>l});var s=n(9214),r=n(3159),a=n(4375);n(6976);const i={id:"gashub",title:"Gashub"},o=void 0,d={id:"api/gashub",title:"Gashub",description:"getMsgGasParams",source:"@site/docs/api/gashub.mdx",sourceDirName:"api",slug:"/api/gashub",permalink:"/greenfield-js-sdk/api/gashub",draft:!1,unlisted:!1,editUrl:"https://github.com/bnb-chain/greenfield-js-sdk/tree/main/doc-site/docs/api/gashub.mdx",tags:[],version:"current",frontMatter:{id:"gashub",title:"Gashub"},sidebar:"GettingStartSidebar",previous:{title:"Feegrant",permalink:"/greenfield-js-sdk/api/feegrant"},next:{title:"Group",permalink:"/greenfield-js-sdk/api/group"}},c={},l=[{value:"getMsgGasParams ",id:"getmsggasparams-",level:2}];function p(e){const t={a:"a",code:"code",h2:"h2",pre:"pre",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,r.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(t.h2,{id:"getmsggasparams-",children:["getMsgGasParams ",(0,s.jsx)(a.A,{type:"Query"})]}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"params"}),(0,s.jsx)(t.th,{children:"description"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"msgTypeUrls"}),(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"/constants/msg-type-url",children:"Message Type URL"})})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"pagination"}),(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"/types/pagination",children:"Pagination"})})]})]})]}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-jsx",metastring:'title="example"',children:"await client.gashub.getMsgGasParams({\n msgTypeUrls: [],\n pagination: {\n countTotal: true,\n key: Uint8Array.from([]),\n limit: Long.fromInt(10),\n offset: Long.fromInt(0),\n reverse: false,\n },\n});\n"})})]})}function h(e={}){const{wrapper:t}={...(0,r.R)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(p,{...e})}):p(e)}},4375:(e,t,n)=>{n.d(t,{A:()=>r});n(8318);var s=n(9214);const r=e=>{const{type:t}=e;return(0,s.jsx)("span",{style:{backgroundColor:"#25c2a0",borderRadius:"5px",color:"#FFF",fontSize:14,padding:2},children:t})}},3159:(e,t,n)=>{n.d(t,{R:()=>i,x:()=>o});var s=n(8318);const r={},a=s.createContext(r);function i(e){const t=s.useContext(a);return s.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function o(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:i(e.components),s.createElement(a.Provider,{value:t},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkgreenfield_js_sdk_docs=self.webpackChunkgreenfield_js_sdk_docs||[]).push([[290],{6976:(e,t,n)=>{n.d(t,{Ay:()=>o,RM:()=>a});var s=n(9214),r=n(3159);const a=[];function i(e){const t={a:"a",admonition:"admonition",p:"p",...(0,r.R)(),...e.components};return(0,s.jsx)(t.admonition,{type:"tip",children:(0,s.jsxs)(t.p,{children:["This is only ",(0,s.jsx)(t.a,{href:"/client/tx-client",children:"construct"})," tx, next need ",(0,s.jsx)(t.a,{href:"/client/tx-client#simulate",children:"simulate"})," and\n",(0,s.jsx)(t.a,{href:"/client/tx-client#broadcast",children:"broadcast"})]})})}function o(e={}){const{wrapper:t}={...(0,r.R)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(i,{...e})}):i(e)}},7430:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>c,contentTitle:()=>o,default:()=>h,frontMatter:()=>i,metadata:()=>d,toc:()=>l});var s=n(9214),r=n(3159),a=n(1180);n(6976);const i={id:"gashub",title:"Gashub"},o=void 0,d={id:"api/gashub",title:"Gashub",description:"getMsgGasParams",source:"@site/docs/api/gashub.mdx",sourceDirName:"api",slug:"/api/gashub",permalink:"/greenfield-js-sdk/api/gashub",draft:!1,unlisted:!1,editUrl:"https://github.com/bnb-chain/greenfield-js-sdk/tree/main/doc-site/docs/api/gashub.mdx",tags:[],version:"current",frontMatter:{id:"gashub",title:"Gashub"},sidebar:"GettingStartSidebar",previous:{title:"Feegrant",permalink:"/greenfield-js-sdk/api/feegrant"},next:{title:"Group",permalink:"/greenfield-js-sdk/api/group"}},c={},l=[{value:"getMsgGasParams ",id:"getmsggasparams-",level:2}];function p(e){const t={a:"a",code:"code",h2:"h2",pre:"pre",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,r.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(t.h2,{id:"getmsggasparams-",children:["getMsgGasParams ",(0,s.jsx)(a.A,{type:"Query"})]}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"params"}),(0,s.jsx)(t.th,{children:"description"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"msgTypeUrls"}),(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"/constants/msg-type-url",children:"Message Type URL"})})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"pagination"}),(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"/types/pagination",children:"Pagination"})})]})]})]}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-jsx",metastring:'title="example"',children:"await client.gashub.getMsgGasParams({\n msgTypeUrls: [],\n pagination: {\n countTotal: true,\n key: Uint8Array.from([]),\n limit: Long.fromInt(10),\n offset: Long.fromInt(0),\n reverse: false,\n },\n});\n"})})]})}function h(e={}){const{wrapper:t}={...(0,r.R)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(p,{...e})}):p(e)}},1180:(e,t,n)=>{n.d(t,{A:()=>r});n(8318);var s=n(9214);const r=e=>{const{type:t}=e;return(0,s.jsx)("span",{style:{backgroundColor:"#25c2a0",borderRadius:"5px",color:"#FFF",fontSize:14,padding:2},children:t})}},3159:(e,t,n)=>{n.d(t,{R:()=>i,x:()=>o});var s=n(8318);const r={},a=s.createContext(r);function i(e){const t=s.useContext(a);return s.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function o(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:i(e.components),s.createElement(a.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/43352d7e.dd77a248.js b/assets/js/43352d7e.5faa0bad.js similarity index 97% rename from assets/js/43352d7e.dd77a248.js rename to assets/js/43352d7e.5faa0bad.js index a12f7af2..f0980d3f 100644 --- a/assets/js/43352d7e.dd77a248.js +++ b/assets/js/43352d7e.5faa0bad.js @@ -1 +1 @@ -"use strict";(self.webpackChunkgreenfield_js_sdk_docs=self.webpackChunkgreenfield_js_sdk_docs||[]).push([[114],{6976:(e,t,i)=>{i.d(t,{Ay:()=>s,RM:()=>a});var l=i(9214),r=i(3159);const a=[];function n(e){const t={a:"a",admonition:"admonition",p:"p",...(0,r.R)(),...e.components};return(0,l.jsx)(t.admonition,{type:"tip",children:(0,l.jsxs)(t.p,{children:["This is only ",(0,l.jsx)(t.a,{href:"/client/tx-client",children:"construct"})," tx, next need ",(0,l.jsx)(t.a,{href:"/client/tx-client#simulate",children:"simulate"})," and\n",(0,l.jsx)(t.a,{href:"/client/tx-client#broadcast",children:"broadcast"})]})})}function s(e={}){const{wrapper:t}={...(0,r.R)(),...e.components};return t?(0,l.jsx)(t,{...e,children:(0,l.jsx)(n,{...e})}):n(e)}},8612:(e,t,i)=>{i.r(t),i.d(t,{assets:()=>d,contentTitle:()=>s,default:()=>p,frontMatter:()=>n,metadata:()=>o,toc:()=>c});var l=i(9214),r=i(3159),a=i(4375);i(6976);const n={id:"virtual-group",title:"VirtualGroup"},s=void 0,o={id:"api/virtual-group",title:"VirtualGroup",description:"getGlobalVirtualGroup",source:"@site/docs/api/virtualGroup.mdx",sourceDirName:"api",slug:"/api/virtual-group",permalink:"/greenfield-js-sdk/api/virtual-group",draft:!1,unlisted:!1,editUrl:"https://github.com/bnb-chain/greenfield-js-sdk/tree/main/doc-site/docs/api/virtualGroup.mdx",tags:[],version:"current",frontMatter:{id:"virtual-group",title:"VirtualGroup"},sidebar:"GettingStartSidebar",previous:{title:"Sp",permalink:"/greenfield-js-sdk/api/sp"},next:{title:"constants",permalink:"/greenfield-js-sdk/category/constants"}},d={},c=[{value:"getGlobalVirtualGroup ",id:"getglobalvirtualgroup-",level:2},{value:"getGlobalVirtualGroupByFamilyID ",id:"getglobalvirtualgroupbyfamilyid-",level:2},{value:"getGlobalVirtualGroupFamily ",id:"getglobalvirtualgroupfamily-",level:2},{value:"getGlobalVirtualGroupFamilies ",id:"getglobalvirtualgroupfamilies-",level:2}];function u(e){const t={a:"a",code:"code",h2:"h2",p:"p",pre:"pre",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,r.R)(),...e.components};return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(t.h2,{id:"getglobalvirtualgroup-",children:["getGlobalVirtualGroup ",(0,l.jsx)(a.A,{type:"Query"})]}),"\n",(0,l.jsxs)(t.table,{children:[(0,l.jsx)(t.thead,{children:(0,l.jsxs)(t.tr,{children:[(0,l.jsx)(t.th,{children:"params"}),(0,l.jsx)(t.th,{children:"description"})]})}),(0,l.jsx)(t.tbody,{children:(0,l.jsxs)(t.tr,{children:[(0,l.jsx)(t.td,{children:"globalVirtualGroupId"}),(0,l.jsx)(t.td,{children:"virtual group id"})]})})]}),"\n",(0,l.jsx)(t.pre,{children:(0,l.jsx)(t.code,{className:"language-jsx",metastring:'title="example"',children:"await client.virtualGroup.getGlobalVirtualGroup({\n globalVirtualGroupId: 11,\n});\n"})}),"\n",(0,l.jsxs)(t.h2,{id:"getglobalvirtualgroupbyfamilyid-",children:["getGlobalVirtualGroupByFamilyID ",(0,l.jsx)(a.A,{type:"Query"})]}),"\n",(0,l.jsx)(t.p,{children:"Query the virtual group family by ID."}),"\n",(0,l.jsx)(t.p,{children:"Virtual group family(VGF) serve as a means of grouping global virtual groups. Each bucket must be\nassociated with a unique global virtual group family and cannot cross families."}),"\n",(0,l.jsxs)(t.table,{children:[(0,l.jsx)(t.thead,{children:(0,l.jsxs)(t.tr,{children:[(0,l.jsx)(t.th,{children:"params"}),(0,l.jsx)(t.th,{children:"description"})]})}),(0,l.jsx)(t.tbody,{children:(0,l.jsxs)(t.tr,{children:[(0,l.jsx)(t.td,{children:"globalVirtualGroupFamilyId"}),(0,l.jsx)(t.td,{children:"VGF id"})]})})]}),"\n",(0,l.jsx)(t.pre,{children:(0,l.jsx)(t.code,{className:"language-jsx",metastring:'title="example"',children:"await client.virtualGroup.getGlobalVirtualGroupByFamilyID({\n globalVirtualGroupFamilyId: 11,\n});\n"})}),"\n",(0,l.jsxs)(t.h2,{id:"getglobalvirtualgroupfamily-",children:["getGlobalVirtualGroupFamily ",(0,l.jsx)(a.A,{type:"Query"})]}),"\n",(0,l.jsxs)(t.table,{children:[(0,l.jsx)(t.thead,{children:(0,l.jsxs)(t.tr,{children:[(0,l.jsx)(t.th,{children:"params"}),(0,l.jsx)(t.th,{children:"description"})]})}),(0,l.jsx)(t.tbody,{children:(0,l.jsxs)(t.tr,{children:[(0,l.jsx)(t.td,{children:"familyId"}),(0,l.jsx)(t.td,{children:"family id"})]})})]}),"\n",(0,l.jsx)(t.pre,{children:(0,l.jsx)(t.code,{className:"language-jsx",metastring:'title="example"',children:"await client.virtualGroup.getGlobalVirtualGroupFamily({\n familyId: 11,\n});\n"})}),"\n",(0,l.jsxs)(t.h2,{id:"getglobalvirtualgroupfamilies-",children:["getGlobalVirtualGroupFamilies ",(0,l.jsx)(a.A,{type:"Query"})]}),"\n",(0,l.jsx)(t.p,{children:"Get All global virtual group families."}),"\n",(0,l.jsxs)(t.table,{children:[(0,l.jsx)(t.thead,{children:(0,l.jsxs)(t.tr,{children:[(0,l.jsx)(t.th,{children:"params"}),(0,l.jsx)(t.th,{children:"description"})]})}),(0,l.jsx)(t.tbody,{children:(0,l.jsxs)(t.tr,{children:[(0,l.jsx)(t.td,{children:"pagination"}),(0,l.jsx)(t.td,{children:(0,l.jsx)(t.a,{href:"/types/pagination",children:"Pagination"})})]})})]}),"\n",(0,l.jsx)(t.pre,{children:(0,l.jsx)(t.code,{className:"language-jsx",metastring:'title="example"',children:"await client.virtualGroup.getGlobalVirtualGroupFamilies({\n pagination: {\n countTotal: true,\n key: Uint8Array.from([]),\n limit: Long.fromInt(10),\n offset: Long.fromInt(0),\n reverse: false,\n },\n});\n"})})]})}function p(e={}){const{wrapper:t}={...(0,r.R)(),...e.components};return t?(0,l.jsx)(t,{...e,children:(0,l.jsx)(u,{...e})}):u(e)}},4375:(e,t,i)=>{i.d(t,{A:()=>r});i(8318);var l=i(9214);const r=e=>{const{type:t}=e;return(0,l.jsx)("span",{style:{backgroundColor:"#25c2a0",borderRadius:"5px",color:"#FFF",fontSize:14,padding:2},children:t})}},3159:(e,t,i)=>{i.d(t,{R:()=>n,x:()=>s});var l=i(8318);const r={},a=l.createContext(r);function n(e){const t=l.useContext(a);return l.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function s(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:n(e.components),l.createElement(a.Provider,{value:t},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkgreenfield_js_sdk_docs=self.webpackChunkgreenfield_js_sdk_docs||[]).push([[114],{6976:(e,t,i)=>{i.d(t,{Ay:()=>s,RM:()=>a});var l=i(9214),r=i(3159);const a=[];function n(e){const t={a:"a",admonition:"admonition",p:"p",...(0,r.R)(),...e.components};return(0,l.jsx)(t.admonition,{type:"tip",children:(0,l.jsxs)(t.p,{children:["This is only ",(0,l.jsx)(t.a,{href:"/client/tx-client",children:"construct"})," tx, next need ",(0,l.jsx)(t.a,{href:"/client/tx-client#simulate",children:"simulate"})," and\n",(0,l.jsx)(t.a,{href:"/client/tx-client#broadcast",children:"broadcast"})]})})}function s(e={}){const{wrapper:t}={...(0,r.R)(),...e.components};return t?(0,l.jsx)(t,{...e,children:(0,l.jsx)(n,{...e})}):n(e)}},8612:(e,t,i)=>{i.r(t),i.d(t,{assets:()=>d,contentTitle:()=>s,default:()=>p,frontMatter:()=>n,metadata:()=>o,toc:()=>c});var l=i(9214),r=i(3159),a=i(1180);i(6976);const n={id:"virtual-group",title:"VirtualGroup"},s=void 0,o={id:"api/virtual-group",title:"VirtualGroup",description:"getGlobalVirtualGroup",source:"@site/docs/api/virtualGroup.mdx",sourceDirName:"api",slug:"/api/virtual-group",permalink:"/greenfield-js-sdk/api/virtual-group",draft:!1,unlisted:!1,editUrl:"https://github.com/bnb-chain/greenfield-js-sdk/tree/main/doc-site/docs/api/virtualGroup.mdx",tags:[],version:"current",frontMatter:{id:"virtual-group",title:"VirtualGroup"},sidebar:"GettingStartSidebar",previous:{title:"Sp",permalink:"/greenfield-js-sdk/api/sp"},next:{title:"constants",permalink:"/greenfield-js-sdk/category/constants"}},d={},c=[{value:"getGlobalVirtualGroup ",id:"getglobalvirtualgroup-",level:2},{value:"getGlobalVirtualGroupByFamilyID ",id:"getglobalvirtualgroupbyfamilyid-",level:2},{value:"getGlobalVirtualGroupFamily ",id:"getglobalvirtualgroupfamily-",level:2},{value:"getGlobalVirtualGroupFamilies ",id:"getglobalvirtualgroupfamilies-",level:2}];function u(e){const t={a:"a",code:"code",h2:"h2",p:"p",pre:"pre",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,r.R)(),...e.components};return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(t.h2,{id:"getglobalvirtualgroup-",children:["getGlobalVirtualGroup ",(0,l.jsx)(a.A,{type:"Query"})]}),"\n",(0,l.jsxs)(t.table,{children:[(0,l.jsx)(t.thead,{children:(0,l.jsxs)(t.tr,{children:[(0,l.jsx)(t.th,{children:"params"}),(0,l.jsx)(t.th,{children:"description"})]})}),(0,l.jsx)(t.tbody,{children:(0,l.jsxs)(t.tr,{children:[(0,l.jsx)(t.td,{children:"globalVirtualGroupId"}),(0,l.jsx)(t.td,{children:"virtual group id"})]})})]}),"\n",(0,l.jsx)(t.pre,{children:(0,l.jsx)(t.code,{className:"language-jsx",metastring:'title="example"',children:"await client.virtualGroup.getGlobalVirtualGroup({\n globalVirtualGroupId: 11,\n});\n"})}),"\n",(0,l.jsxs)(t.h2,{id:"getglobalvirtualgroupbyfamilyid-",children:["getGlobalVirtualGroupByFamilyID ",(0,l.jsx)(a.A,{type:"Query"})]}),"\n",(0,l.jsx)(t.p,{children:"Query the virtual group family by ID."}),"\n",(0,l.jsx)(t.p,{children:"Virtual group family(VGF) serve as a means of grouping global virtual groups. Each bucket must be\nassociated with a unique global virtual group family and cannot cross families."}),"\n",(0,l.jsxs)(t.table,{children:[(0,l.jsx)(t.thead,{children:(0,l.jsxs)(t.tr,{children:[(0,l.jsx)(t.th,{children:"params"}),(0,l.jsx)(t.th,{children:"description"})]})}),(0,l.jsx)(t.tbody,{children:(0,l.jsxs)(t.tr,{children:[(0,l.jsx)(t.td,{children:"globalVirtualGroupFamilyId"}),(0,l.jsx)(t.td,{children:"VGF id"})]})})]}),"\n",(0,l.jsx)(t.pre,{children:(0,l.jsx)(t.code,{className:"language-jsx",metastring:'title="example"',children:"await client.virtualGroup.getGlobalVirtualGroupByFamilyID({\n globalVirtualGroupFamilyId: 11,\n});\n"})}),"\n",(0,l.jsxs)(t.h2,{id:"getglobalvirtualgroupfamily-",children:["getGlobalVirtualGroupFamily ",(0,l.jsx)(a.A,{type:"Query"})]}),"\n",(0,l.jsxs)(t.table,{children:[(0,l.jsx)(t.thead,{children:(0,l.jsxs)(t.tr,{children:[(0,l.jsx)(t.th,{children:"params"}),(0,l.jsx)(t.th,{children:"description"})]})}),(0,l.jsx)(t.tbody,{children:(0,l.jsxs)(t.tr,{children:[(0,l.jsx)(t.td,{children:"familyId"}),(0,l.jsx)(t.td,{children:"family id"})]})})]}),"\n",(0,l.jsx)(t.pre,{children:(0,l.jsx)(t.code,{className:"language-jsx",metastring:'title="example"',children:"await client.virtualGroup.getGlobalVirtualGroupFamily({\n familyId: 11,\n});\n"})}),"\n",(0,l.jsxs)(t.h2,{id:"getglobalvirtualgroupfamilies-",children:["getGlobalVirtualGroupFamilies ",(0,l.jsx)(a.A,{type:"Query"})]}),"\n",(0,l.jsx)(t.p,{children:"Get All global virtual group families."}),"\n",(0,l.jsxs)(t.table,{children:[(0,l.jsx)(t.thead,{children:(0,l.jsxs)(t.tr,{children:[(0,l.jsx)(t.th,{children:"params"}),(0,l.jsx)(t.th,{children:"description"})]})}),(0,l.jsx)(t.tbody,{children:(0,l.jsxs)(t.tr,{children:[(0,l.jsx)(t.td,{children:"pagination"}),(0,l.jsx)(t.td,{children:(0,l.jsx)(t.a,{href:"/types/pagination",children:"Pagination"})})]})})]}),"\n",(0,l.jsx)(t.pre,{children:(0,l.jsx)(t.code,{className:"language-jsx",metastring:'title="example"',children:"await client.virtualGroup.getGlobalVirtualGroupFamilies({\n pagination: {\n countTotal: true,\n key: Uint8Array.from([]),\n limit: Long.fromInt(10),\n offset: Long.fromInt(0),\n reverse: false,\n },\n});\n"})})]})}function p(e={}){const{wrapper:t}={...(0,r.R)(),...e.components};return t?(0,l.jsx)(t,{...e,children:(0,l.jsx)(u,{...e})}):u(e)}},1180:(e,t,i)=>{i.d(t,{A:()=>r});i(8318);var l=i(9214);const r=e=>{const{type:t}=e;return(0,l.jsx)("span",{style:{backgroundColor:"#25c2a0",borderRadius:"5px",color:"#FFF",fontSize:14,padding:2},children:t})}},3159:(e,t,i)=>{i.d(t,{R:()=>n,x:()=>s});var l=i(8318);const r={},a=l.createContext(r);function n(e){const t=l.useContext(a);return l.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function s(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:n(e.components),l.createElement(a.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/45e29900.03461a05.js b/assets/js/45e29900.03461a05.js new file mode 100644 index 00000000..ea6bd8c6 --- /dev/null +++ b/assets/js/45e29900.03461a05.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkgreenfield_js_sdk_docs=self.webpackChunkgreenfield_js_sdk_docs||[]).push([[941],{6976:(e,r,n)=>{n.d(r,{Ay:()=>o,RM:()=>i});var t=n(9214),s=n(3159);const i=[];function a(e){const r={a:"a",admonition:"admonition",p:"p",...(0,s.R)(),...e.components};return(0,t.jsx)(r.admonition,{type:"tip",children:(0,t.jsxs)(r.p,{children:["This is only ",(0,t.jsx)(r.a,{href:"/client/tx-client",children:"construct"})," tx, next need ",(0,t.jsx)(r.a,{href:"/client/tx-client#simulate",children:"simulate"})," and\n",(0,t.jsx)(r.a,{href:"/client/tx-client#broadcast",children:"broadcast"})]})})}function o(e={}){const{wrapper:r}={...(0,s.R)(),...e.components};return r?(0,t.jsx)(r,{...e,children:(0,t.jsx)(a,{...e})}):a(e)}},1837:(e,r,n)=>{n.r(r),n.d(r,{assets:()=>h,contentTitle:()=>c,default:()=>j,frontMatter:()=>d,metadata:()=>u,toc:()=>p});var t=n(9214),s=n(3159),i=n(1180),a=n(6976),o=n(6159),l=n(7264);const d={id:"group",title:"Group"},c=void 0,u={id:"api/group",title:"Group",description:"createGroup",source:"@site/docs/api/group.mdx",sourceDirName:"api",slug:"/api/group",permalink:"/greenfield-js-sdk/api/group",draft:!1,unlisted:!1,editUrl:"https://github.com/bnb-chain/greenfield-js-sdk/tree/main/doc-site/docs/api/group.mdx",tags:[],version:"current",frontMatter:{id:"group",title:"Group"},sidebar:"GettingStartSidebar",previous:{title:"Gashub",permalink:"/greenfield-js-sdk/api/gashub"},next:{title:"Object",permalink:"/greenfield-js-sdk/api/object"}},h={},p=[{value:"createGroup ",id:"creategroup-",level:2},...a.RM,{value:"deleteGroup ",id:"deletegroup-",level:2},...a.RM,{value:"getBucketPolicyOfGroup ",id:"getbucketpolicyofgroup-",level:2},{value:"getObjectPolicyOfGroup ",id:"getobjectpolicyofgroup-",level:2},{value:"headGroup ",id:"headgroup-",level:2},{value:"headGroupMember ",id:"headgroupmember-",level:2},{value:"leaveGroup ",id:"leavegroup-",level:2},...a.RM,{value:"putGroupPolicy ",id:"putgrouppolicy-",level:2},...a.RM,{value:"updateGroupExtra ",id:"updategroupextra-",level:2},...a.RM,{value:"updateGroupMember",id:"updategroupmember",level:2},...a.RM];function x(e){const r={a:"a",admonition:"admonition",code:"code",h2:"h2",li:"li",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,s.R)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(r.h2,{id:"creategroup-",children:["createGroup ",(0,t.jsx)(i.A,{type:"Tx"})]}),"\n",(0,t.jsxs)(r.p,{children:["Create a new group without group members on Greenfield blockchain, and group members can be added by\n",(0,t.jsx)(r.a,{href:"#updategroupmember",children:"updateGroupMember"})," transaction."]}),"\n",(0,t.jsxs)(r.p,{children:["A ",(0,t.jsx)(r.code,{children:"Group"})," is a collection of accounts that share the same permissions, allowing them to be handled\nas a single entity."]}),"\n",(0,t.jsx)(r.p,{children:"Examples of permissions include:"}),"\n",(0,t.jsxs)(r.ul,{children:["\n",(0,t.jsxs)(r.li,{children:[(0,t.jsx)(r.code,{children:"Put"}),", ",(0,t.jsx)(r.code,{children:"List"}),", ",(0,t.jsx)(r.code,{children:"Get"}),", ",(0,t.jsx)(r.code,{children:"Delete"}),", ",(0,t.jsx)(r.code,{children:"Copy"}),", and ",(0,t.jsx)(r.code,{children:"Execute"})," data objects;"]}),"\n",(0,t.jsxs)(r.li,{children:[(0,t.jsx)(r.code,{children:"Create"}),", ",(0,t.jsx)(r.code,{children:"Delete"}),", and ",(0,t.jsx)(r.code,{children:"List"})," buckets"]}),"\n",(0,t.jsxs)(r.li,{children:[(0,t.jsx)(r.code,{children:"Create"}),", ",(0,t.jsx)(r.code,{children:"Delete"}),", ",(0,t.jsx)(r.code,{children:"ListMembers"}),", ",(0,t.jsx)(r.code,{children:"Leave groups"})]}),"\n",(0,t.jsxs)(r.li,{children:[(0,t.jsx)(r.code,{children:"Create"}),", ",(0,t.jsx)(r.code,{children:"Associate payment accounts"})]}),"\n",(0,t.jsxs)(r.li,{children:[(0,t.jsx)(r.code,{children:"Grant"}),", ",(0,t.jsx)(r.code,{children:"Revoke"})," the above permissions"]}),"\n"]}),"\n",(0,t.jsxs)(r.p,{children:["For more details regarding ",(0,t.jsx)(r.code,{children:"Group"}),", please refer to ",(0,t.jsx)(r.a,{href:"https://github.com/bnb-chain/greenfield/blob/master/docs/modules/permission.md",children:"permisson"}),"."]}),"\n",(0,t.jsxs)(r.table,{children:[(0,t.jsx)(r.thead,{children:(0,t.jsxs)(r.tr,{children:[(0,t.jsx)(r.th,{children:"params"}),(0,t.jsx)(r.th,{children:"description"})]})}),(0,t.jsxs)(r.tbody,{children:[(0,t.jsxs)(r.tr,{children:[(0,t.jsx)(r.td,{children:"creator"}),(0,t.jsx)(r.td,{children:"the account address of group owner who create the group"})]}),(0,t.jsxs)(r.tr,{children:[(0,t.jsx)(r.td,{children:"groupName"}),(0,t.jsx)(r.td,{children:"the name of the group. it's not globally unique"})]}),(0,t.jsxs)(r.tr,{children:[(0,t.jsx)(r.td,{children:"extra"}),(0,t.jsx)(r.td,{children:"extra info for the group"})]})]})]}),"\n",(0,t.jsx)(r.pre,{children:(0,t.jsx)(r.code,{className:"language-jsx",metastring:'title="example"',children:"const tx = await client.group.createGroup({\n creator: '0x00..',\n groupName: 'group_name',\n extra: 'extra_info',\n});\n"})}),"\n",(0,t.jsx)(a.Ay,{}),"\n",(0,t.jsxs)(r.h2,{id:"deletegroup-",children:["deleteGroup ",(0,t.jsx)(i.A,{type:"Tx"})]}),"\n",(0,t.jsxs)(r.p,{children:["Delete a group on Greenfield blockchain. The sender ",(0,t.jsx)(r.strong,{children:"MUST"})," only be the group owner, group members\nor others would fail to send this transaction."]}),"\n",(0,t.jsx)(r.admonition,{type:"warning",children:(0,t.jsx)(r.p,{children:"Deleting a group will result in granted permission revoked. Members within the group will no longer\nhave access to resources (bucket, object) which granted permission on."})}),"\n",(0,t.jsxs)(r.table,{children:[(0,t.jsx)(r.thead,{children:(0,t.jsxs)(r.tr,{children:[(0,t.jsx)(r.th,{children:"params"}),(0,t.jsx)(r.th,{children:"description"})]})}),(0,t.jsxs)(r.tbody,{children:[(0,t.jsxs)(r.tr,{children:[(0,t.jsx)(r.td,{children:"operator"}),(0,t.jsx)(r.td,{children:"the account address of the operator who has the DeleteGroup permission of the group to be deleted"})]}),(0,t.jsxs)(r.tr,{children:[(0,t.jsx)(r.td,{children:"groupName"}),(0,t.jsx)(r.td,{children:"the name of the group which to be deleted"})]})]})]}),"\n",(0,t.jsx)(r.pre,{children:(0,t.jsx)(r.code,{className:"language-jsx",metastring:'title="example"',children:"const tx = await client.group.deleteGroup({\n groupName: 'group_name',\n operator: '0x00..',\n});\n"})}),"\n",(0,t.jsx)(a.Ay,{}),"\n",(0,t.jsxs)(r.h2,{id:"getbucketpolicyofgroup-",children:["getBucketPolicyOfGroup ",(0,t.jsx)(i.A,{type:"Query"})]}),"\n",(0,t.jsx)(r.p,{children:"Queries a bucket of policy that grants permission to a group."}),"\n",(0,t.jsxs)(r.table,{children:[(0,t.jsx)(r.thead,{children:(0,t.jsxs)(r.tr,{children:[(0,t.jsx)(r.th,{children:"params"}),(0,t.jsx)(r.th,{children:"description"})]})}),(0,t.jsxs)(r.tbody,{children:[(0,t.jsxs)(r.tr,{children:[(0,t.jsx)(r.td,{children:"bucketName"}),(0,t.jsx)(r.td,{children:"bucket name"})]}),(0,t.jsxs)(r.tr,{children:[(0,t.jsx)(r.td,{children:"groupId"}),(0,t.jsx)(r.td,{children:"group id"})]})]})]}),"\n",(0,t.jsx)(r.pre,{children:(0,t.jsx)(r.code,{className:"language-jsx",metastring:'title="example"',children:"await client.group.getBucketPolicyOfGroup('bucket_name', 1);\n"})}),"\n",(0,t.jsxs)(r.h2,{id:"getobjectpolicyofgroup-",children:["getObjectPolicyOfGroup ",(0,t.jsx)(i.A,{type:"Query"})]}),"\n",(0,t.jsx)(r.p,{children:"Queries a object of policy that grants permission to a group."}),"\n",(0,t.jsxs)(r.table,{children:[(0,t.jsx)(r.thead,{children:(0,t.jsxs)(r.tr,{children:[(0,t.jsx)(r.th,{children:"params"}),(0,t.jsx)(r.th,{children:"description"})]})}),(0,t.jsxs)(r.tbody,{children:[(0,t.jsxs)(r.tr,{children:[(0,t.jsx)(r.td,{children:"bucketName"}),(0,t.jsx)(r.td,{children:"bucket name"})]}),(0,t.jsxs)(r.tr,{children:[(0,t.jsx)(r.td,{children:"objectName"}),(0,t.jsx)(r.td,{children:"object name"})]}),(0,t.jsxs)(r.tr,{children:[(0,t.jsx)(r.td,{children:"groupId"}),(0,t.jsx)(r.td,{children:"group id"})]})]})]}),"\n",(0,t.jsx)(r.pre,{children:(0,t.jsx)(r.code,{className:"language-jsx",metastring:'title="example"',children:"await client.group.getObjectPolicyOfGroup('bucket_name', 'object_name', 1);\n"})}),"\n",(0,t.jsxs)(r.h2,{id:"headgroup-",children:["headGroup ",(0,t.jsx)(i.A,{type:"Query"})]}),"\n",(0,t.jsx)(r.p,{children:"Query the groupInfo on chain, return the group info if exists."}),"\n",(0,t.jsxs)(r.table,{children:[(0,t.jsx)(r.thead,{children:(0,t.jsxs)(r.tr,{children:[(0,t.jsx)(r.th,{children:"params"}),(0,t.jsx)(r.th,{children:"description"})]})}),(0,t.jsxs)(r.tbody,{children:[(0,t.jsxs)(r.tr,{children:[(0,t.jsx)(r.td,{children:"groupName"}),(0,t.jsx)(r.td,{children:"group name"})]}),(0,t.jsxs)(r.tr,{children:[(0,t.jsx)(r.td,{children:"groupOwner"}),(0,t.jsx)(r.td,{children:"owner of group"})]})]})]}),"\n",(0,t.jsx)(r.pre,{children:(0,t.jsx)(r.code,{className:"language-jsx",metastring:'title="example"',children:"await client.group.headGroup('group_name', '0x00..');\n"})}),"\n",(0,t.jsxs)(r.h2,{id:"headgroupmember-",children:["headGroupMember ",(0,t.jsx)(i.A,{type:"Query"})]}),"\n",(0,t.jsx)(r.p,{children:"Query the group member info on chain, return true if the member exists in group."}),"\n",(0,t.jsxs)(r.table,{children:[(0,t.jsx)(r.thead,{children:(0,t.jsxs)(r.tr,{children:[(0,t.jsx)(r.th,{children:"params"}),(0,t.jsx)(r.th,{children:"description"})]})}),(0,t.jsxs)(r.tbody,{children:[(0,t.jsxs)(r.tr,{children:[(0,t.jsx)(r.td,{children:"groupName"}),(0,t.jsx)(r.td,{children:"group name"})]}),(0,t.jsxs)(r.tr,{children:[(0,t.jsx)(r.td,{children:"groupOwner"}),(0,t.jsx)(r.td,{children:"owner of group"})]}),(0,t.jsxs)(r.tr,{children:[(0,t.jsx)(r.td,{children:"member"}),(0,t.jsx)(r.td,{children:"member of group"})]})]})]}),"\n",(0,t.jsx)(r.pre,{children:(0,t.jsx)(r.code,{className:"language-jsx",metastring:'title="example"',children:"await client.group.headGroupMember(\n 'groupName',\n '0x00..',\n '0x903904936a4328fac5477c0d96acf2E2bCaCD33d',\n);\n"})}),"\n",(0,t.jsxs)(r.h2,{id:"leavegroup-",children:["leaveGroup ",(0,t.jsx)(i.A,{type:"Tx"})]}),"\n",(0,t.jsx)(r.p,{children:"Leave a group. A group member initially leaves a group."}),"\n",(0,t.jsxs)(r.table,{children:[(0,t.jsx)(r.thead,{children:(0,t.jsxs)(r.tr,{children:[(0,t.jsx)(r.th,{children:"params"}),(0,t.jsx)(r.th,{children:"description"})]})}),(0,t.jsxs)(r.tbody,{children:[(0,t.jsxs)(r.tr,{children:[(0,t.jsx)(r.td,{children:"address"}),(0,t.jsx)(r.td,{children:"operator address"})]}),(0,t.jsxs)(r.tr,{children:[(0,t.jsx)(r.td,{children:"member"}),(0,t.jsx)(r.td,{children:"the account address of the member who want to leave the group"})]}),(0,t.jsxs)(r.tr,{children:[(0,t.jsx)(r.td,{children:"groupOwner"}),(0,t.jsx)(r.td,{children:"the owner of the group you want to leave"})]}),(0,t.jsxs)(r.tr,{children:[(0,t.jsx)(r.td,{children:"groupName"}),(0,t.jsx)(r.td,{children:"the name of the group you want to leave"})]})]})]}),"\n",(0,t.jsx)(r.pre,{children:(0,t.jsx)(r.code,{className:"language-jsx",metastring:'title="example"',children:"await client.group.leaveGroup(\n '0x...', // address\n {\n member: '0x...',\n groupOwner: '0x...',\n groupName: 'group_name',\n },\n);\n"})}),"\n",(0,t.jsx)(a.Ay,{}),"\n",(0,t.jsxs)(r.h2,{id:"putgrouppolicy-",children:["putGroupPolicy ",(0,t.jsx)(i.A,{type:"Tx"})]}),"\n",(0,t.jsx)(r.p,{children:"Apply group policy to user specified by principalAddr, the sender needs to be the owner of the\ngroup."}),"\n",(0,t.jsxs)(r.table,{children:[(0,t.jsx)(r.thead,{children:(0,t.jsxs)(r.tr,{children:[(0,t.jsx)(r.th,{children:"params"}),(0,t.jsx)(r.th,{children:"description"})]})}),(0,t.jsxs)(r.tbody,{children:[(0,t.jsxs)(r.tr,{children:[(0,t.jsx)(r.td,{children:"owner"}),(0,t.jsx)(r.td,{children:"owner of group"})]}),(0,t.jsxs)(r.tr,{children:[(0,t.jsx)(r.td,{children:"groupName"}),(0,t.jsx)(r.td,{children:"name of group"})]})]})]}),"\n",(0,t.jsx)(r.pre,{children:(0,t.jsx)(r.code,{className:"language-tsx",metastring:'title="example"',children:"import { PermissionTypes } from '@bnb-chain/greenfield-js-sdk';\nconst statement: PermissionTypes.Statement = {\n effect: PermissionTypes.Effect.EFFECT_ALLOW,\n actions: [PermissionTypes.ActionType.ACTION_UPDATE_GROUP_MEMBER],\n resources: [],\n};\n\nawait client.group.putGroupPolicy(\n '0x...', // owner\n 'group_name',\n {\n operator: '0x...', // address\n statements: [statement],\n principal: {\n type: PermissionTypes.PrincipalType.PRINCIPAL_TYPE_GNFD_ACCOUNT,\n value: '0x0000000000000000000000000000000000000001',\n },\n },\n);\n"})}),"\n",(0,t.jsx)(a.Ay,{}),"\n",(0,t.jsxs)(r.h2,{id:"updategroupextra-",children:["updateGroupExtra ",(0,t.jsx)(i.A,{type:"Tx"})]}),"\n",(0,t.jsx)(r.p,{children:"Update a group extra."}),"\n",(0,t.jsxs)(r.table,{children:[(0,t.jsx)(r.thead,{children:(0,t.jsxs)(r.tr,{children:[(0,t.jsx)(r.th,{children:"params"}),(0,t.jsx)(r.th,{children:"description"})]})}),(0,t.jsxs)(r.tbody,{children:[(0,t.jsxs)(r.tr,{children:[(0,t.jsx)(r.td,{children:"operator"}),(0,t.jsx)(r.td,{children:"the account address of the operator who has the UpdateGroupMember permission of the group"})]}),(0,t.jsxs)(r.tr,{children:[(0,t.jsx)(r.td,{children:"groupOwner"}),(0,t.jsx)(r.td,{children:"the account address of the group owner"})]}),(0,t.jsxs)(r.tr,{children:[(0,t.jsx)(r.td,{children:"groupName"}),(0,t.jsx)(r.td,{children:"the name of the group which to be updated"})]}),(0,t.jsxs)(r.tr,{children:[(0,t.jsx)(r.td,{children:"extra"}),(0,t.jsx)(r.td,{children:"extra info for the group to update"})]})]})]}),"\n",(0,t.jsx)(r.pre,{children:(0,t.jsx)(r.code,{className:"language-jsx",metastring:'title="example"',children:"await client.group.updateGroupExtra({\n operator: '0x...',\n groupOwner: '0x...',\n groupName: 'group_name',\n extra: 'extra info',\n});\n"})}),"\n",(0,t.jsx)(a.Ay,{}),"\n",(0,t.jsx)(r.h2,{id:"updategroupmember",children:"updateGroupMember"}),"\n",(0,t.jsx)(r.p,{children:"Update a group by adding or removing members. The sender can be the group owner or any individual\naccount(Principle) that has been granted permission by the group owner."}),"\n",(0,t.jsxs)(r.table,{children:[(0,t.jsx)(r.thead,{children:(0,t.jsxs)(r.tr,{children:[(0,t.jsx)(r.th,{children:"params"}),(0,t.jsx)(r.th,{children:"description"})]})}),(0,t.jsxs)(r.tbody,{children:[(0,t.jsxs)(r.tr,{children:[(0,t.jsx)(r.td,{children:"operator"}),(0,t.jsx)(r.td,{children:"the account address of the operator who has the UpdateGroupMember permission of the group"})]}),(0,t.jsxs)(r.tr,{children:[(0,t.jsx)(r.td,{children:"groupOwner"}),(0,t.jsx)(r.td,{children:"the account address of the group owner"})]}),(0,t.jsxs)(r.tr,{children:[(0,t.jsx)(r.td,{children:"groupName"}),(0,t.jsx)(r.td,{children:"the name of the group which to be updated"})]}),(0,t.jsxs)(r.tr,{children:[(0,t.jsx)(r.td,{children:"membersToAdd"}),(0,t.jsx)(r.td,{children:"MsgGroupMember[]"})]}),(0,t.jsxs)(r.tr,{children:[(0,t.jsx)(r.td,{children:"membersToDelete"}),(0,t.jsx)(r.td,{children:"string[]"})]})]})]}),"\n",(0,t.jsxs)(o.A,{children:[(0,t.jsx)(l.A,{value:"add",label:"add members",children:(0,t.jsx)(r.pre,{children:(0,t.jsx)(r.code,{className:"language-jsx",metastring:'title="example"',children:"await client.group.updateGroupMember({\n operator: '0x..',\n groupOwner: '0x..',\n groupName: 'group_name',\n membersToAdd: [\n {\n expirationTime: toTimestamp(date),\n member: '0x903904936a4328fac5477c0d96acf2E2bCaCD33d',\n },\n ],\n membersToDelete: [],\n});\n"})})}),(0,t.jsx)(l.A,{value:"del",label:"delete members",children:(0,t.jsx)(r.pre,{children:(0,t.jsx)(r.code,{className:"language-jsx",metastring:'title="example"',children:"await client.group.updateGroupMember({\n operator: '0x..',\n groupOwner: '0x..',\n groupName: 'group_name',\n membersToAdd: [],\n membersToDelete: ['0x903904936a4328fac5477c0d96acf2E2bCaCD33d'],\n});\n"})})})]}),"\n",(0,t.jsx)(a.Ay,{})]})}function j(e={}){const{wrapper:r}={...(0,s.R)(),...e.components};return r?(0,t.jsx)(r,{...e,children:(0,t.jsx)(x,{...e})}):x(e)}},1180:(e,r,n)=>{n.d(r,{A:()=>s});n(8318);var t=n(9214);const s=e=>{const{type:r}=e;return(0,t.jsx)("span",{style:{backgroundColor:"#25c2a0",borderRadius:"5px",color:"#FFF",fontSize:14,padding:2},children:r})}},7264:(e,r,n)=>{n.d(r,{A:()=>a});n(8318);var t=n(3372);const s={tabItem:"tabItem_SosH"};var i=n(9214);function a(e){let{children:r,hidden:n,className:a}=e;return(0,i.jsx)("div",{role:"tabpanel",className:(0,t.A)(s.tabItem,a),hidden:n,children:r})}},6159:(e,r,n)=>{n.d(r,{A:()=>w});var t=n(8318),s=n(3372),i=n(2157),a=n(6325),o=n(848),l=n(5014),d=n(3799),c=n(6765);function u(e){return t.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,t.isValidElement)(e)&&function(e){const{props:r}=e;return!!r&&"object"==typeof r&&"value"in r}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function h(e){const{values:r,children:n}=e;return(0,t.useMemo)((()=>{const e=r??function(e){return u(e).map((e=>{let{props:{value:r,label:n,attributes:t,default:s}}=e;return{value:r,label:n,attributes:t,default:s}}))}(n);return function(e){const r=(0,d.X)(e,((e,r)=>e.value===r.value));if(r.length>0)throw new Error(`Docusaurus error: Duplicate values "${r.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[r,n])}function p(e){let{value:r,tabValues:n}=e;return n.some((e=>e.value===r))}function x(e){let{queryString:r=!1,groupId:n}=e;const s=(0,a.W6)(),i=function(e){let{queryString:r=!1,groupId:n}=e;if("string"==typeof r)return r;if(!1===r)return null;if(!0===r&&!n)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return n??null}({queryString:r,groupId:n});return[(0,l.aZ)(i),(0,t.useCallback)((e=>{if(!i)return;const r=new URLSearchParams(s.location.search);r.set(i,e),s.replace({...s.location,search:r.toString()})}),[i,s])]}function j(e){const{defaultValue:r,queryString:n=!1,groupId:s}=e,i=h(e),[a,l]=(0,t.useState)((()=>function(e){let{defaultValue:r,tabValues:n}=e;if(0===n.length)throw new Error("Docusaurus error: the component requires at least one children component");if(r){if(!p({value:r,tabValues:n}))throw new Error(`Docusaurus error: The has a defaultValue "${r}" but none of its children has the corresponding value. Available values are: ${n.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return r}const t=n.find((e=>e.default))??n[0];if(!t)throw new Error("Unexpected error: 0 tabValues");return t.value}({defaultValue:r,tabValues:i}))),[d,u]=x({queryString:n,groupId:s}),[j,m]=function(e){let{groupId:r}=e;const n=function(e){return e?`docusaurus.tab.${e}`:null}(r),[s,i]=(0,c.Dv)(n);return[s,(0,t.useCallback)((e=>{n&&i.set(e)}),[n,i])]}({groupId:s}),g=(()=>{const e=d??j;return p({value:e,tabValues:i})?e:null})();(0,o.A)((()=>{g&&l(g)}),[g]);return{selectedValue:a,selectValue:(0,t.useCallback)((e=>{if(!p({value:e,tabValues:i}))throw new Error(`Can't select invalid tab value=${e}`);l(e),u(e),m(e)}),[u,m,i]),tabValues:i}}var m=n(5180);const g={tabList:"tabList_u4OX",tabItem:"tabItem_nyVU"};var b=n(9214);function f(e){let{className:r,block:n,selectedValue:t,selectValue:a,tabValues:o}=e;const l=[],{blockElementScrollPositionUntilNextRender:d}=(0,i.a_)(),c=e=>{const r=e.currentTarget,n=l.indexOf(r),s=o[n].value;s!==t&&(d(r),a(s))},u=e=>{let r=null;switch(e.key){case"Enter":c(e);break;case"ArrowRight":{const n=l.indexOf(e.currentTarget)+1;r=l[n]??l[0];break}case"ArrowLeft":{const n=l.indexOf(e.currentTarget)-1;r=l[n]??l[l.length-1];break}}r?.focus()};return(0,b.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,s.A)("tabs",{"tabs--block":n},r),children:o.map((e=>{let{value:r,label:n,attributes:i}=e;return(0,b.jsx)("li",{role:"tab",tabIndex:t===r?0:-1,"aria-selected":t===r,ref:e=>l.push(e),onKeyDown:u,onClick:c,...i,className:(0,s.A)("tabs__item",g.tabItem,i?.className,{"tabs__item--active":t===r}),children:n??r},r)}))})}function y(e){let{lazy:r,children:n,selectedValue:s}=e;const i=(Array.isArray(n)?n:[n]).filter(Boolean);if(r){const e=i.find((e=>e.props.value===s));return e?(0,t.cloneElement)(e,{className:"margin-top--md"}):null}return(0,b.jsx)("div",{className:"margin-top--md",children:i.map(((e,r)=>(0,t.cloneElement)(e,{key:r,hidden:e.props.value!==s})))})}function v(e){const r=j(e);return(0,b.jsxs)("div",{className:(0,s.A)("tabs-container",g.tabList),children:[(0,b.jsx)(f,{...e,...r}),(0,b.jsx)(y,{...e,...r})]})}function w(e){const r=(0,m.A)();return(0,b.jsx)(v,{...e,children:u(e.children)},String(r))}},3159:(e,r,n)=>{n.d(r,{R:()=>a,x:()=>o});var t=n(8318);const s={},i=t.createContext(s);function a(e){const r=t.useContext(i);return t.useMemo((function(){return"function"==typeof e?e(r):{...r,...e}}),[r,e])}function o(e){let r;return r=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:a(e.components),t.createElement(i.Provider,{value:r},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/45e29900.75ccb142.js b/assets/js/45e29900.75ccb142.js deleted file mode 100644 index a5386840..00000000 --- a/assets/js/45e29900.75ccb142.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkgreenfield_js_sdk_docs=self.webpackChunkgreenfield_js_sdk_docs||[]).push([[941],{6976:(e,r,n)=>{n.d(r,{Ay:()=>o,RM:()=>i});var t=n(9214),s=n(3159);const i=[];function a(e){const r={a:"a",admonition:"admonition",p:"p",...(0,s.R)(),...e.components};return(0,t.jsx)(r.admonition,{type:"tip",children:(0,t.jsxs)(r.p,{children:["This is only ",(0,t.jsx)(r.a,{href:"/client/tx-client",children:"construct"})," tx, next need ",(0,t.jsx)(r.a,{href:"/client/tx-client#simulate",children:"simulate"})," and\n",(0,t.jsx)(r.a,{href:"/client/tx-client#broadcast",children:"broadcast"})]})})}function o(e={}){const{wrapper:r}={...(0,s.R)(),...e.components};return r?(0,t.jsx)(r,{...e,children:(0,t.jsx)(a,{...e})}):a(e)}},1837:(e,r,n)=>{n.r(r),n.d(r,{assets:()=>h,contentTitle:()=>c,default:()=>j,frontMatter:()=>d,metadata:()=>u,toc:()=>p});var t=n(9214),s=n(3159),i=n(4375),a=n(6976),o=n(5303),l=n(1744);const d={id:"group",title:"Group"},c=void 0,u={id:"api/group",title:"Group",description:"createGroup",source:"@site/docs/api/group.mdx",sourceDirName:"api",slug:"/api/group",permalink:"/greenfield-js-sdk/api/group",draft:!1,unlisted:!1,editUrl:"https://github.com/bnb-chain/greenfield-js-sdk/tree/main/doc-site/docs/api/group.mdx",tags:[],version:"current",frontMatter:{id:"group",title:"Group"},sidebar:"GettingStartSidebar",previous:{title:"Gashub",permalink:"/greenfield-js-sdk/api/gashub"},next:{title:"Object",permalink:"/greenfield-js-sdk/api/object"}},h={},p=[{value:"createGroup ",id:"creategroup-",level:2},...a.RM,{value:"deleteGroup ",id:"deletegroup-",level:2},...a.RM,{value:"getBucketPolicyOfGroup ",id:"getbucketpolicyofgroup-",level:2},{value:"getObjectPolicyOfGroup ",id:"getobjectpolicyofgroup-",level:2},{value:"headGroup ",id:"headgroup-",level:2},{value:"headGroupMember ",id:"headgroupmember-",level:2},{value:"leaveGroup ",id:"leavegroup-",level:2},...a.RM,{value:"putGroupPolicy ",id:"putgrouppolicy-",level:2},...a.RM,{value:"updateGroupExtra ",id:"updategroupextra-",level:2},...a.RM,{value:"updateGroupMember",id:"updategroupmember",level:2},...a.RM];function x(e){const r={a:"a",admonition:"admonition",code:"code",h2:"h2",li:"li",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,s.R)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(r.h2,{id:"creategroup-",children:["createGroup ",(0,t.jsx)(i.A,{type:"Tx"})]}),"\n",(0,t.jsxs)(r.p,{children:["Create a new group without group members on Greenfield blockchain, and group members can be added by\n",(0,t.jsx)(r.a,{href:"#updategroupmember",children:"updateGroupMember"})," transaction."]}),"\n",(0,t.jsxs)(r.p,{children:["A ",(0,t.jsx)(r.code,{children:"Group"})," is a collection of accounts that share the same permissions, allowing them to be handled\nas a single entity."]}),"\n",(0,t.jsx)(r.p,{children:"Examples of permissions include:"}),"\n",(0,t.jsxs)(r.ul,{children:["\n",(0,t.jsxs)(r.li,{children:[(0,t.jsx)(r.code,{children:"Put"}),", ",(0,t.jsx)(r.code,{children:"List"}),", ",(0,t.jsx)(r.code,{children:"Get"}),", ",(0,t.jsx)(r.code,{children:"Delete"}),", ",(0,t.jsx)(r.code,{children:"Copy"}),", and ",(0,t.jsx)(r.code,{children:"Execute"})," data objects;"]}),"\n",(0,t.jsxs)(r.li,{children:[(0,t.jsx)(r.code,{children:"Create"}),", ",(0,t.jsx)(r.code,{children:"Delete"}),", and ",(0,t.jsx)(r.code,{children:"List"})," buckets"]}),"\n",(0,t.jsxs)(r.li,{children:[(0,t.jsx)(r.code,{children:"Create"}),", ",(0,t.jsx)(r.code,{children:"Delete"}),", ",(0,t.jsx)(r.code,{children:"ListMembers"}),", ",(0,t.jsx)(r.code,{children:"Leave groups"})]}),"\n",(0,t.jsxs)(r.li,{children:[(0,t.jsx)(r.code,{children:"Create"}),", ",(0,t.jsx)(r.code,{children:"Associate payment accounts"})]}),"\n",(0,t.jsxs)(r.li,{children:[(0,t.jsx)(r.code,{children:"Grant"}),", ",(0,t.jsx)(r.code,{children:"Revoke"})," the above permissions"]}),"\n"]}),"\n",(0,t.jsxs)(r.p,{children:["For more details regarding ",(0,t.jsx)(r.code,{children:"Group"}),", please refer to\n",(0,t.jsx)(r.a,{href:"https://docs.bnbchain.org/greenfield-docs/docs/guide/greenfield-blockchain/modules/permission",children:"https://docs.bnbchain.org/greenfield-docs/docs/guide/greenfield-blockchain/modules/permission"}),"."]}),"\n",(0,t.jsxs)(r.table,{children:[(0,t.jsx)(r.thead,{children:(0,t.jsxs)(r.tr,{children:[(0,t.jsx)(r.th,{children:"params"}),(0,t.jsx)(r.th,{children:"description"})]})}),(0,t.jsxs)(r.tbody,{children:[(0,t.jsxs)(r.tr,{children:[(0,t.jsx)(r.td,{children:"creator"}),(0,t.jsx)(r.td,{children:"the account address of group owner who create the group"})]}),(0,t.jsxs)(r.tr,{children:[(0,t.jsx)(r.td,{children:"groupName"}),(0,t.jsx)(r.td,{children:"the name of the group. it's not globally unique"})]}),(0,t.jsxs)(r.tr,{children:[(0,t.jsx)(r.td,{children:"extra"}),(0,t.jsx)(r.td,{children:"extra info for the group"})]})]})]}),"\n",(0,t.jsx)(r.pre,{children:(0,t.jsx)(r.code,{className:"language-jsx",metastring:'title="example"',children:"const tx = await client.group.createGroup({\n creator: '0x00..',\n groupName: 'group_name',\n extra: 'extra_info',\n});\n"})}),"\n",(0,t.jsx)(a.Ay,{}),"\n",(0,t.jsxs)(r.h2,{id:"deletegroup-",children:["deleteGroup ",(0,t.jsx)(i.A,{type:"Tx"})]}),"\n",(0,t.jsxs)(r.p,{children:["Delete a group on Greenfield blockchain. The sender ",(0,t.jsx)(r.strong,{children:"MUST"})," only be the group owner, group members\nor others would fail to send this transaction."]}),"\n",(0,t.jsx)(r.admonition,{type:"warning",children:(0,t.jsx)(r.p,{children:"Deleting a group will result in granted permission revoked. Members within the group will no longer\nhave access to resources (bucket, object) which granted permission on."})}),"\n",(0,t.jsxs)(r.table,{children:[(0,t.jsx)(r.thead,{children:(0,t.jsxs)(r.tr,{children:[(0,t.jsx)(r.th,{children:"params"}),(0,t.jsx)(r.th,{children:"description"})]})}),(0,t.jsxs)(r.tbody,{children:[(0,t.jsxs)(r.tr,{children:[(0,t.jsx)(r.td,{children:"operator"}),(0,t.jsx)(r.td,{children:"the account address of the operator who has the DeleteGroup permission of the group to be deleted"})]}),(0,t.jsxs)(r.tr,{children:[(0,t.jsx)(r.td,{children:"groupName"}),(0,t.jsx)(r.td,{children:"the name of the group which to be deleted"})]})]})]}),"\n",(0,t.jsx)(r.pre,{children:(0,t.jsx)(r.code,{className:"language-jsx",metastring:'title="example"',children:"const tx = await client.group.deleteGroup({\n groupName: 'group_name',\n operator: '0x00..',\n});\n"})}),"\n",(0,t.jsx)(a.Ay,{}),"\n",(0,t.jsxs)(r.h2,{id:"getbucketpolicyofgroup-",children:["getBucketPolicyOfGroup ",(0,t.jsx)(i.A,{type:"Query"})]}),"\n",(0,t.jsx)(r.p,{children:"Queries a bucket of policy that grants permission to a group."}),"\n",(0,t.jsxs)(r.table,{children:[(0,t.jsx)(r.thead,{children:(0,t.jsxs)(r.tr,{children:[(0,t.jsx)(r.th,{children:"params"}),(0,t.jsx)(r.th,{children:"description"})]})}),(0,t.jsxs)(r.tbody,{children:[(0,t.jsxs)(r.tr,{children:[(0,t.jsx)(r.td,{children:"bucketName"}),(0,t.jsx)(r.td,{children:"bucket name"})]}),(0,t.jsxs)(r.tr,{children:[(0,t.jsx)(r.td,{children:"groupId"}),(0,t.jsx)(r.td,{children:"group id"})]})]})]}),"\n",(0,t.jsx)(r.pre,{children:(0,t.jsx)(r.code,{className:"language-jsx",metastring:'title="example"',children:"await client.group.getBucketPolicyOfGroup('bucket_name', 1);\n"})}),"\n",(0,t.jsxs)(r.h2,{id:"getobjectpolicyofgroup-",children:["getObjectPolicyOfGroup ",(0,t.jsx)(i.A,{type:"Query"})]}),"\n",(0,t.jsx)(r.p,{children:"Queries a object of policy that grants permission to a group."}),"\n",(0,t.jsxs)(r.table,{children:[(0,t.jsx)(r.thead,{children:(0,t.jsxs)(r.tr,{children:[(0,t.jsx)(r.th,{children:"params"}),(0,t.jsx)(r.th,{children:"description"})]})}),(0,t.jsxs)(r.tbody,{children:[(0,t.jsxs)(r.tr,{children:[(0,t.jsx)(r.td,{children:"bucketName"}),(0,t.jsx)(r.td,{children:"bucket name"})]}),(0,t.jsxs)(r.tr,{children:[(0,t.jsx)(r.td,{children:"objectName"}),(0,t.jsx)(r.td,{children:"object name"})]}),(0,t.jsxs)(r.tr,{children:[(0,t.jsx)(r.td,{children:"groupId"}),(0,t.jsx)(r.td,{children:"group id"})]})]})]}),"\n",(0,t.jsx)(r.pre,{children:(0,t.jsx)(r.code,{className:"language-jsx",metastring:'title="example"',children:"await client.group.getObjectPolicyOfGroup('bucket_name', 'object_name', 1);\n"})}),"\n",(0,t.jsxs)(r.h2,{id:"headgroup-",children:["headGroup ",(0,t.jsx)(i.A,{type:"Query"})]}),"\n",(0,t.jsx)(r.p,{children:"Query the groupInfo on chain, return the group info if exists."}),"\n",(0,t.jsxs)(r.table,{children:[(0,t.jsx)(r.thead,{children:(0,t.jsxs)(r.tr,{children:[(0,t.jsx)(r.th,{children:"params"}),(0,t.jsx)(r.th,{children:"description"})]})}),(0,t.jsxs)(r.tbody,{children:[(0,t.jsxs)(r.tr,{children:[(0,t.jsx)(r.td,{children:"groupName"}),(0,t.jsx)(r.td,{children:"group name"})]}),(0,t.jsxs)(r.tr,{children:[(0,t.jsx)(r.td,{children:"groupOwner"}),(0,t.jsx)(r.td,{children:"owner of group"})]})]})]}),"\n",(0,t.jsx)(r.pre,{children:(0,t.jsx)(r.code,{className:"language-jsx",metastring:'title="example"',children:"await client.group.headGroup('group_name', '0x00..');\n"})}),"\n",(0,t.jsxs)(r.h2,{id:"headgroupmember-",children:["headGroupMember ",(0,t.jsx)(i.A,{type:"Query"})]}),"\n",(0,t.jsx)(r.p,{children:"Query the group member info on chain, return true if the member exists in group."}),"\n",(0,t.jsxs)(r.table,{children:[(0,t.jsx)(r.thead,{children:(0,t.jsxs)(r.tr,{children:[(0,t.jsx)(r.th,{children:"params"}),(0,t.jsx)(r.th,{children:"description"})]})}),(0,t.jsxs)(r.tbody,{children:[(0,t.jsxs)(r.tr,{children:[(0,t.jsx)(r.td,{children:"groupName"}),(0,t.jsx)(r.td,{children:"group name"})]}),(0,t.jsxs)(r.tr,{children:[(0,t.jsx)(r.td,{children:"groupOwner"}),(0,t.jsx)(r.td,{children:"owner of group"})]}),(0,t.jsxs)(r.tr,{children:[(0,t.jsx)(r.td,{children:"member"}),(0,t.jsx)(r.td,{children:"member of group"})]})]})]}),"\n",(0,t.jsx)(r.pre,{children:(0,t.jsx)(r.code,{className:"language-jsx",metastring:'title="example"',children:"await client.group.headGroupMember(\n 'groupName',\n '0x00..',\n '0x903904936a4328fac5477c0d96acf2E2bCaCD33d',\n);\n"})}),"\n",(0,t.jsxs)(r.h2,{id:"leavegroup-",children:["leaveGroup ",(0,t.jsx)(i.A,{type:"Tx"})]}),"\n",(0,t.jsx)(r.p,{children:"Leave a group. A group member initially leaves a group."}),"\n",(0,t.jsxs)(r.table,{children:[(0,t.jsx)(r.thead,{children:(0,t.jsxs)(r.tr,{children:[(0,t.jsx)(r.th,{children:"params"}),(0,t.jsx)(r.th,{children:"description"})]})}),(0,t.jsxs)(r.tbody,{children:[(0,t.jsxs)(r.tr,{children:[(0,t.jsx)(r.td,{children:"address"}),(0,t.jsx)(r.td,{children:"operator address"})]}),(0,t.jsxs)(r.tr,{children:[(0,t.jsx)(r.td,{children:"member"}),(0,t.jsx)(r.td,{children:"the account address of the member who want to leave the group"})]}),(0,t.jsxs)(r.tr,{children:[(0,t.jsx)(r.td,{children:"groupOwner"}),(0,t.jsx)(r.td,{children:"the owner of the group you want to leave"})]}),(0,t.jsxs)(r.tr,{children:[(0,t.jsx)(r.td,{children:"groupName"}),(0,t.jsx)(r.td,{children:"the name of the group you want to leave"})]})]})]}),"\n",(0,t.jsx)(r.pre,{children:(0,t.jsx)(r.code,{className:"language-jsx",metastring:'title="example"',children:"await client.group.leaveGroup(\n '0x...', // address\n {\n member: '0x...',\n groupOwner: '0x...',\n groupName: 'group_name',\n },\n);\n"})}),"\n",(0,t.jsx)(a.Ay,{}),"\n",(0,t.jsxs)(r.h2,{id:"putgrouppolicy-",children:["putGroupPolicy ",(0,t.jsx)(i.A,{type:"Tx"})]}),"\n",(0,t.jsx)(r.p,{children:"Apply group policy to user specified by principalAddr, the sender needs to be the owner of the\ngroup."}),"\n",(0,t.jsxs)(r.table,{children:[(0,t.jsx)(r.thead,{children:(0,t.jsxs)(r.tr,{children:[(0,t.jsx)(r.th,{children:"params"}),(0,t.jsx)(r.th,{children:"description"})]})}),(0,t.jsxs)(r.tbody,{children:[(0,t.jsxs)(r.tr,{children:[(0,t.jsx)(r.td,{children:"owner"}),(0,t.jsx)(r.td,{children:"owner of group"})]}),(0,t.jsxs)(r.tr,{children:[(0,t.jsx)(r.td,{children:"groupName"}),(0,t.jsx)(r.td,{children:"name of group"})]})]})]}),"\n",(0,t.jsx)(r.pre,{children:(0,t.jsx)(r.code,{className:"language-tsx",metastring:'title="example"',children:"import { PermissionTypes } from '@bnb-chain/greenfield-js-sdk';\nconst statement: PermissionTypes.Statement = {\n effect: PermissionTypes.Effect.EFFECT_ALLOW,\n actions: [PermissionTypes.ActionType.ACTION_UPDATE_GROUP_MEMBER],\n resources: [],\n};\n\nawait client.group.putGroupPolicy(\n '0x...', // owner\n 'group_name',\n {\n operator: '0x...', // address\n statements: [statement],\n principal: {\n type: PermissionTypes.PrincipalType.PRINCIPAL_TYPE_GNFD_ACCOUNT,\n value: '0x0000000000000000000000000000000000000001',\n },\n },\n);\n"})}),"\n",(0,t.jsx)(a.Ay,{}),"\n",(0,t.jsxs)(r.h2,{id:"updategroupextra-",children:["updateGroupExtra ",(0,t.jsx)(i.A,{type:"Tx"})]}),"\n",(0,t.jsx)(r.p,{children:"Update a group extra."}),"\n",(0,t.jsxs)(r.table,{children:[(0,t.jsx)(r.thead,{children:(0,t.jsxs)(r.tr,{children:[(0,t.jsx)(r.th,{children:"params"}),(0,t.jsx)(r.th,{children:"description"})]})}),(0,t.jsxs)(r.tbody,{children:[(0,t.jsxs)(r.tr,{children:[(0,t.jsx)(r.td,{children:"operator"}),(0,t.jsx)(r.td,{children:"the account address of the operator who has the UpdateGroupMember permission of the group"})]}),(0,t.jsxs)(r.tr,{children:[(0,t.jsx)(r.td,{children:"groupOwner"}),(0,t.jsx)(r.td,{children:"the account address of the group owner"})]}),(0,t.jsxs)(r.tr,{children:[(0,t.jsx)(r.td,{children:"groupName"}),(0,t.jsx)(r.td,{children:"the name of the group which to be updated"})]}),(0,t.jsxs)(r.tr,{children:[(0,t.jsx)(r.td,{children:"extra"}),(0,t.jsx)(r.td,{children:"extra info for the group to update"})]})]})]}),"\n",(0,t.jsx)(r.pre,{children:(0,t.jsx)(r.code,{className:"language-jsx",metastring:'title="example"',children:"await client.group.updateGroupExtra({\n operator: '0x...',\n groupOwner: '0x...',\n groupName: 'group_name',\n extra: 'extra info',\n});\n"})}),"\n",(0,t.jsx)(a.Ay,{}),"\n",(0,t.jsx)(r.h2,{id:"updategroupmember",children:"updateGroupMember"}),"\n",(0,t.jsx)(r.p,{children:"Update a group by adding or removing members. The sender can be the group owner or any individual\naccount(Principle) that has been granted permission by the group owner."}),"\n",(0,t.jsxs)(r.table,{children:[(0,t.jsx)(r.thead,{children:(0,t.jsxs)(r.tr,{children:[(0,t.jsx)(r.th,{children:"params"}),(0,t.jsx)(r.th,{children:"description"})]})}),(0,t.jsxs)(r.tbody,{children:[(0,t.jsxs)(r.tr,{children:[(0,t.jsx)(r.td,{children:"operator"}),(0,t.jsx)(r.td,{children:"the account address of the operator who has the UpdateGroupMember permission of the group"})]}),(0,t.jsxs)(r.tr,{children:[(0,t.jsx)(r.td,{children:"groupOwner"}),(0,t.jsx)(r.td,{children:"the account address of the group owner"})]}),(0,t.jsxs)(r.tr,{children:[(0,t.jsx)(r.td,{children:"groupName"}),(0,t.jsx)(r.td,{children:"the name of the group which to be updated"})]}),(0,t.jsxs)(r.tr,{children:[(0,t.jsx)(r.td,{children:"membersToAdd"}),(0,t.jsx)(r.td,{children:"MsgGroupMember[]"})]}),(0,t.jsxs)(r.tr,{children:[(0,t.jsx)(r.td,{children:"membersToDelete"}),(0,t.jsx)(r.td,{children:"string[]"})]})]})]}),"\n",(0,t.jsxs)(o.A,{children:[(0,t.jsx)(l.A,{value:"add",label:"add members",children:(0,t.jsx)(r.pre,{children:(0,t.jsx)(r.code,{className:"language-jsx",metastring:'title="example"',children:"await client.group.updateGroupMember({\n operator: '0x..',\n groupOwner: '0x..',\n groupName: 'group_name',\n membersToAdd: [\n {\n expirationTime: toTimestamp(date),\n member: '0x903904936a4328fac5477c0d96acf2E2bCaCD33d',\n },\n ],\n membersToDelete: [],\n});\n"})})}),(0,t.jsx)(l.A,{value:"del",label:"delete members",children:(0,t.jsx)(r.pre,{children:(0,t.jsx)(r.code,{className:"language-jsx",metastring:'title="example"',children:"await client.group.updateGroupMember({\n operator: '0x..',\n groupOwner: '0x..',\n groupName: 'group_name',\n membersToAdd: [],\n membersToDelete: ['0x903904936a4328fac5477c0d96acf2E2bCaCD33d'],\n});\n"})})})]}),"\n",(0,t.jsx)(a.Ay,{})]})}function j(e={}){const{wrapper:r}={...(0,s.R)(),...e.components};return r?(0,t.jsx)(r,{...e,children:(0,t.jsx)(x,{...e})}):x(e)}},4375:(e,r,n)=>{n.d(r,{A:()=>s});n(8318);var t=n(9214);const s=e=>{const{type:r}=e;return(0,t.jsx)("span",{style:{backgroundColor:"#25c2a0",borderRadius:"5px",color:"#FFF",fontSize:14,padding:2},children:r})}},1744:(e,r,n)=>{n.d(r,{A:()=>a});n(8318);var t=n(3372);const s={tabItem:"tabItem_SosH"};var i=n(9214);function a(e){let{children:r,hidden:n,className:a}=e;return(0,i.jsx)("div",{role:"tabpanel",className:(0,t.A)(s.tabItem,a),hidden:n,children:r})}},5303:(e,r,n)=>{n.d(r,{A:()=>w});var t=n(8318),s=n(3372),i=n(6888),a=n(6325),o=n(7503),l=n(8997),d=n(2554),c=n(3074);function u(e){return t.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,t.isValidElement)(e)&&function(e){const{props:r}=e;return!!r&&"object"==typeof r&&"value"in r}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function h(e){const{values:r,children:n}=e;return(0,t.useMemo)((()=>{const e=r??function(e){return u(e).map((e=>{let{props:{value:r,label:n,attributes:t,default:s}}=e;return{value:r,label:n,attributes:t,default:s}}))}(n);return function(e){const r=(0,d.X)(e,((e,r)=>e.value===r.value));if(r.length>0)throw new Error(`Docusaurus error: Duplicate values "${r.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[r,n])}function p(e){let{value:r,tabValues:n}=e;return n.some((e=>e.value===r))}function x(e){let{queryString:r=!1,groupId:n}=e;const s=(0,a.W6)(),i=function(e){let{queryString:r=!1,groupId:n}=e;if("string"==typeof r)return r;if(!1===r)return null;if(!0===r&&!n)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return n??null}({queryString:r,groupId:n});return[(0,l.aZ)(i),(0,t.useCallback)((e=>{if(!i)return;const r=new URLSearchParams(s.location.search);r.set(i,e),s.replace({...s.location,search:r.toString()})}),[i,s])]}function j(e){const{defaultValue:r,queryString:n=!1,groupId:s}=e,i=h(e),[a,l]=(0,t.useState)((()=>function(e){let{defaultValue:r,tabValues:n}=e;if(0===n.length)throw new Error("Docusaurus error: the component requires at least one children component");if(r){if(!p({value:r,tabValues:n}))throw new Error(`Docusaurus error: The has a defaultValue "${r}" but none of its children has the corresponding value. Available values are: ${n.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return r}const t=n.find((e=>e.default))??n[0];if(!t)throw new Error("Unexpected error: 0 tabValues");return t.value}({defaultValue:r,tabValues:i}))),[d,u]=x({queryString:n,groupId:s}),[j,m]=function(e){let{groupId:r}=e;const n=function(e){return e?`docusaurus.tab.${e}`:null}(r),[s,i]=(0,c.Dv)(n);return[s,(0,t.useCallback)((e=>{n&&i.set(e)}),[n,i])]}({groupId:s}),g=(()=>{const e=d??j;return p({value:e,tabValues:i})?e:null})();(0,o.A)((()=>{g&&l(g)}),[g]);return{selectedValue:a,selectValue:(0,t.useCallback)((e=>{if(!p({value:e,tabValues:i}))throw new Error(`Can't select invalid tab value=${e}`);l(e),u(e),m(e)}),[u,m,i]),tabValues:i}}var m=n(269);const g={tabList:"tabList_u4OX",tabItem:"tabItem_nyVU"};var b=n(9214);function f(e){let{className:r,block:n,selectedValue:t,selectValue:a,tabValues:o}=e;const l=[],{blockElementScrollPositionUntilNextRender:d}=(0,i.a_)(),c=e=>{const r=e.currentTarget,n=l.indexOf(r),s=o[n].value;s!==t&&(d(r),a(s))},u=e=>{let r=null;switch(e.key){case"Enter":c(e);break;case"ArrowRight":{const n=l.indexOf(e.currentTarget)+1;r=l[n]??l[0];break}case"ArrowLeft":{const n=l.indexOf(e.currentTarget)-1;r=l[n]??l[l.length-1];break}}r?.focus()};return(0,b.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,s.A)("tabs",{"tabs--block":n},r),children:o.map((e=>{let{value:r,label:n,attributes:i}=e;return(0,b.jsx)("li",{role:"tab",tabIndex:t===r?0:-1,"aria-selected":t===r,ref:e=>l.push(e),onKeyDown:u,onClick:c,...i,className:(0,s.A)("tabs__item",g.tabItem,i?.className,{"tabs__item--active":t===r}),children:n??r},r)}))})}function y(e){let{lazy:r,children:n,selectedValue:s}=e;const i=(Array.isArray(n)?n:[n]).filter(Boolean);if(r){const e=i.find((e=>e.props.value===s));return e?(0,t.cloneElement)(e,{className:"margin-top--md"}):null}return(0,b.jsx)("div",{className:"margin-top--md",children:i.map(((e,r)=>(0,t.cloneElement)(e,{key:r,hidden:e.props.value!==s})))})}function v(e){const r=j(e);return(0,b.jsxs)("div",{className:(0,s.A)("tabs-container",g.tabList),children:[(0,b.jsx)(f,{...e,...r}),(0,b.jsx)(y,{...e,...r})]})}function w(e){const r=(0,m.A)();return(0,b.jsx)(v,{...e,children:u(e.children)},String(r))}},3159:(e,r,n)=>{n.d(r,{R:()=>a,x:()=>o});var t=n(8318);const s={},i=t.createContext(s);function a(e){const r=t.useContext(i);return t.useMemo((function(){return"function"==typeof e?e(r):{...r,...e}}),[r,e])}function o(e){let r;return r=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:a(e.components),t.createElement(i.Provider,{value:r},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/469c860f.4716b88c.js b/assets/js/469c860f.4df9785a.js similarity index 86% rename from assets/js/469c860f.4716b88c.js rename to assets/js/469c860f.4df9785a.js index 9d2eeea5..a9603fca 100644 --- a/assets/js/469c860f.4716b88c.js +++ b/assets/js/469c860f.4df9785a.js @@ -1 +1 @@ -"use strict";(self.webpackChunkgreenfield_js_sdk_docs=self.webpackChunkgreenfield_js_sdk_docs||[]).push([[977],{6976:(e,t,n)=>{n.d(t,{Ay:()=>a,RM:()=>i});var s=n(9214),r=n(3159);const i=[];function c(e){const t={a:"a",admonition:"admonition",p:"p",...(0,r.R)(),...e.components};return(0,s.jsx)(t.admonition,{type:"tip",children:(0,s.jsxs)(t.p,{children:["This is only ",(0,s.jsx)(t.a,{href:"/client/tx-client",children:"construct"})," tx, next need ",(0,s.jsx)(t.a,{href:"/client/tx-client#simulate",children:"simulate"})," and\n",(0,s.jsx)(t.a,{href:"/client/tx-client#broadcast",children:"broadcast"})]})})}function a(e={}){const{wrapper:t}={...(0,r.R)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(c,{...e})}):c(e)}},6916:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>h,contentTitle:()=>o,default:()=>j,frontMatter:()=>l,metadata:()=>u,toc:()=>p});var s=n(9214),r=n(3159),i=n(5303),c=n(1744),a=n(4375),d=n(6976);const l={id:"bucket",title:"Bucket"},o=void 0,u={id:"api/bucket",title:"Bucket",description:"createBucket",source:"@site/docs/api/bucket.mdx",sourceDirName:"api",slug:"/api/bucket",permalink:"/greenfield-js-sdk/api/bucket",draft:!1,unlisted:!1,editUrl:"https://github.com/bnb-chain/greenfield-js-sdk/tree/main/doc-site/docs/api/bucket.mdx",tags:[],version:"current",frontMatter:{id:"bucket",title:"Bucket"},sidebar:"GettingStartSidebar",previous:{title:"Account",permalink:"/greenfield-js-sdk/api/account"},next:{title:"Crosschain",permalink:"/greenfield-js-sdk/api/crosschain"}},h={},p=[{value:"createBucket ",id:"createbucket--",level:2},{value:"deleteBucket ",id:"deletebucket-",level:2},...d.RM,{value:"deleteBucketPolicy ",id:"deletebucketpolicy-",level:2},...d.RM,{value:"getBucketMeta ",id:"getbucketmeta-",level:2},{value:"getBucketPolicy ",id:"getbucketpolicy-",level:2},{value:"getBucketReadQuota ",id:"getbucketreadquota-",level:2},{value:"headBucket ",id:"headbucket-",level:2},{value:"headBucketById ",id:"headbucketbyid-",level:2},{value:"headBucketExtra ",id:"headbucketextra-",level:2},{value:"listBucketReadRecords ",id:"listbucketreadrecords-",level:2},{value:"listBuckets ",id:"listbuckets-",level:2},{value:"listBucketsByIds ",id:"listbucketsbyids-",level:2},{value:"listBucketsByPaymentAccount ",id:"listbucketsbypaymentaccount-",level:2},{value:"putBucketPolicy ",id:"putbucketpolicy-",level:2},...d.RM,{value:"updateBucketInfo ",id:"updatebucketinfo-",level:2},...d.RM];function x(e){const t={a:"a",code:"code",h2:"h2",p:"p",pre:"pre",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,r.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(t.h2,{id:"createbucket--",children:["createBucket ",(0,s.jsx)(a.A,{type:"Storage Provider"})," ",(0,s.jsx)(a.A,{type:"Tx"})]}),"\n",(0,s.jsx)(t.p,{children:"Create a new bucket in greenfield. This API sends a request to the storage provider to get approval\nfor creating bucket and sends the createBucket transaction to the Greenfield."}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"params"}),(0,s.jsx)(t.th,{children:"description"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"bucketName"}),(0,s.jsx)(t.td,{children:"bucket name"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"creator"}),(0,s.jsx)(t.td,{children:"creator account address"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"visibility"}),(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"/types/visibility",children:"VisibilityType"})})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"chargedReadQuota"}),(0,s.jsxs)(t.td,{children:[(0,s.jsx)(t.a,{href:"/types/long",children:"Long"}),"defines the traffic quota that you read from primary sp"]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"primarySpAddress"}),(0,s.jsx)(t.td,{children:"primary sp address"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"paymentAddress"}),(0,s.jsx)(t.td,{children:"payment address"})]})]})]}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-js",children:"const tx = await client.bucket.createBucket(\n {\n bucketName: 'bucket_name',\n creator: '0x...',\n visibility: VisibilityType.VISIBILITY_TYPE_PUBLIC_READ,\n chargedReadQuota: Long.fromString('0'),\n primarySpAddress: '0x....',\n paymentAddress: address,\n }\n);\n"})}),"\n",(0,s.jsxs)(t.h2,{id:"deletebucket-",children:["deleteBucket ",(0,s.jsx)(a.A,{type:"Tx"})]}),"\n",(0,s.jsx)(t.p,{children:"Send DeleteBucket msg to greenfield chain and return txn hash."}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"params"}),(0,s.jsx)(t.th,{children:"description"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"bucketName"}),(0,s.jsx)(t.td,{children:"The name of the bucket to be deleted"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"operator"}),(0,s.jsx)(t.td,{children:"operator account address"})]})]})]}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-js",children:"const tx = await client.bucket.deleteBucket({\n bucketName: bucketName,\n operator: address,\n});\n"})}),"\n",(0,s.jsx)(d.Ay,{}),"\n",(0,s.jsxs)(t.h2,{id:"deletebucketpolicy-",children:["deleteBucketPolicy ",(0,s.jsx)(a.A,{type:"Tx"})]}),"\n",(0,s.jsx)(t.p,{children:"Delete the bucket policy of the principal."}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"params"}),(0,s.jsx)(t.th,{children:"description"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"operator"}),(0,s.jsx)(t.td,{})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"bucketName"}),(0,s.jsx)(t.td,{children:"The bucket name identifies the bucket"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"principalAddr"}),(0,s.jsx)(t.td,{children:"Principal define the roles that can grant permissions"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"principalType"}),(0,s.jsx)(t.td,{children:"PrincipalType refers to the identity type of system users or entities."})]})]})]}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-js",children:"const tx = await client.bucket.deleteBucketPolicy(\n address,\n bucketName,\n address,\n 'PRINCIPAL_TYPE_GNFD_ACCOUNT',\n);\n"})}),"\n",(0,s.jsx)(d.Ay,{}),"\n",(0,s.jsxs)(t.h2,{id:"getbucketmeta-",children:["getBucketMeta ",(0,s.jsx)(a.A,{type:"Storage Provider"})]}),"\n",(0,s.jsx)(t.p,{children:"This API is used to get bucket meta by bucket name."}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"params"}),(0,s.jsx)(t.th,{children:"description"})]})}),(0,s.jsx)(t.tbody,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"bucketName"}),(0,s.jsx)(t.td,{children:"bucket name"})]})})]}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-js",children:"const bucketInfo = await client.bucket.getBucketMeta({\n bucketName: 'bucketName',\n});\n"})}),"\n",(0,s.jsxs)(t.h2,{id:"getbucketpolicy-",children:["getBucketPolicy ",(0,s.jsx)(a.A,{type:"Query"})]}),"\n",(0,s.jsx)(t.p,{children:"Get the bucket policy info of the user specified by principalAddr."}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-jsx",metastring:'title="Browser | Nodejs"',children:"import { GRNToString, newBucketGRN } from '@bnb-chain/greenfield-js-sdk';\nawait client.bucket.getBucketPolicy({\n resource: GRNToString(newBucketGRN(bucketName)),\n principalAddress: '0x00..',\n});\n"})}),"\n",(0,s.jsxs)(t.h2,{id:"getbucketreadquota-",children:["getBucketReadQuota ",(0,s.jsx)(a.A,{type:"Storage Provider"})]}),"\n",(0,s.jsx)(t.p,{children:"Query the quota info of the specific bucket of current month."}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"params"}),(0,s.jsx)(t.th,{children:"description"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"bucketName"}),(0,s.jsx)(t.td,{children:"bucket name"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"authType"}),(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"/client/sp-client#authtype",children:"AuthType"})})]})]})]}),"\n",(0,s.jsxs)(i.A,{groupId:"example",children:[(0,s.jsx)(c.A,{value:"Browser",label:"Browser",children:(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-jsx",children:"const tx = await client.bucket.getBucketReadQuota(\n {\n bucketName: 'bucketName',\n },\n // highlight-start\n {\n type: 'EDDSA',\n seed: offChainData.seedString,\n domain: window.location.origin,\n address,\n },\n // highlight-end\n);\n"})})}),(0,s.jsx)(c.A,{value:"Nodejs",label:"Nodejs",children:(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-js",children:"const tx = await client.bucket.getBucketReadQuota(\n {\n bucketName: 'bucketName',\n },\n // highlight-start\n {\n type: 'ECDSA',\n privateKey: ACCOUNT_PRIVATEKEY,\n },\n // highlight-end\n);\n"})})})]}),"\n",(0,s.jsxs)(t.h2,{id:"headbucket-",children:["headBucket ",(0,s.jsx)(a.A,{type:"Query"})]}),"\n",(0,s.jsx)(t.p,{children:"query the bucketInfo on chain, return the bucket info if exists."}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"params"}),(0,s.jsx)(t.th,{children:"description"})]})}),(0,s.jsx)(t.tbody,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"bucketName"}),(0,s.jsx)(t.td,{children:"bucket name"})]})})]}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-jsx",metastring:'title="Browser | Nodejs"',children:"const bucketInfo = await client.bucket.headBucket(bucketName);\n"})}),"\n",(0,s.jsxs)(t.h2,{id:"headbucketbyid-",children:["headBucketById ",(0,s.jsx)(a.A,{type:"Query"})]}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"params"}),(0,s.jsx)(t.th,{children:"description"})]})}),(0,s.jsx)(t.tbody,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"bucketId"}),(0,s.jsx)(t.td,{children:"bucket id"})]})})]}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-jsx",metastring:'title="Browser | Nodejs"',children:"const bucketInfo = await client.bucket.headBucketById(bucketId);\n"})}),"\n",(0,s.jsxs)(t.h2,{id:"headbucketextra-",children:["headBucketExtra ",(0,s.jsx)(a.A,{type:"Query"})]}),"\n",(0,s.jsx)(t.p,{children:"Queries a bucket extra info (with gvg bindings and price time) with specify name."}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"params"}),(0,s.jsx)(t.th,{children:"description"})]})}),(0,s.jsx)(t.tbody,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"bucketName"}),(0,s.jsx)(t.td,{children:"bucket name"})]})})]}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-jsx",metastring:'title="Browser | Nodejs"',children:"const bucketInfo = await client.bucket.headBucketExtra('bucketName');\n"})}),"\n",(0,s.jsxs)(t.h2,{id:"listbucketreadrecords-",children:["listBucketReadRecords ",(0,s.jsx)(a.A,{type:"Storage Provider"})]}),"\n",(0,s.jsx)(t.p,{children:"List the download record info of the specific bucket of the current month."}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"params"}),(0,s.jsx)(t.th,{children:"description"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"bucketName"}),(0,s.jsx)(t.td,{children:"bucket name"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"authType"}),(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"/client/sp-client#authtype",children:"AuthType"})})]})]})]}),"\n",(0,s.jsxs)(i.A,{groupId:"example",children:[(0,s.jsx)(c.A,{value:"Browser",label:"Browser",children:(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-jsx",children:"const tx = await client.bucket.listBucketReadRecords(\n {\n bucketName: 'bucketName',\n startTimeStamp,\n endTimeStamp,\n maxRecords: 1000,\n },\n // highlight-start\n {\n type: 'EDDSA',\n domain: window.location.origin,\n seed: offChainData.seedString,\n address,\n },\n // highlight-end\n);\n"})})}),(0,s.jsx)(c.A,{value:"Nodejs",label:"Nodejs",children:(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-js",children:"const tx = await client.bucket.listBucketReadRecords(\n {\n bucketName: 'bucketName',\n startTimeStamp,\n endTimeStamp,\n maxRecords: 1000,\n },\n // highlight-start\n {\n type: 'ECDSA',\n privateKey: ACCOUNT_PRIVATEKEY,\n },\n // highlight-end\n);\n"})})})]}),"\n",(0,s.jsxs)(t.h2,{id:"listbuckets-",children:["listBuckets ",(0,s.jsx)(a.A,{type:"Storage Provider"})]}),"\n",(0,s.jsx)(t.p,{children:"Lists the bucket info of the user."}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"params"}),(0,s.jsx)(t.th,{children:"description"})]})}),(0,s.jsx)(t.tbody,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"address"}),(0,s.jsx)(t.td,{children:"user account"})]})})]}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-jsx",metastring:'title="Browser | Nodejs"',children:"const res = await client.bucket.listBuckets({\n address: '0x...',\n});\n"})}),"\n",(0,s.jsxs)(t.h2,{id:"listbucketsbyids-",children:["listBucketsByIds ",(0,s.jsx)(a.A,{type:"Storage Provider"})]}),"\n",(0,s.jsx)(t.p,{children:"Lists the bucket info of the user."}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"params"}),(0,s.jsx)(t.th,{children:"description"})]})}),(0,s.jsx)(t.tbody,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"ids"}),(0,s.jsx)(t.td,{children:"bucket ids array"})]})})]}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-jsx",metastring:'title="Browser | Nodejs"',children:"await client.bucket.listBucketsByIds({\n ids: ['1', '2'],\n});\n"})}),"\n",(0,s.jsxs)(t.h2,{id:"listbucketsbypaymentaccount-",children:["listBucketsByPaymentAccount ",(0,s.jsx)(a.A,{type:"Storage Provider"})]}),"\n",(0,s.jsx)(t.p,{children:"List bucket info by payment account."}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"params"}),(0,s.jsx)(t.th,{children:"description"})]})}),(0,s.jsx)(t.tbody,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"paymentAccount"}),(0,s.jsx)(t.td,{children:"payment account address"})]})})]}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-jsx",metastring:'title="Browser | Nodejs"',children:"const res = await client.bucket.listBucketsByPaymentAccount({\n paymentAccount: '0x00...',\n});\n"})}),"\n",(0,s.jsxs)(t.h2,{id:"putbucketpolicy-",children:["putBucketPolicy ",(0,s.jsx)(a.A,{type:"Tx"})]}),"\n",(0,s.jsx)(t.p,{children:"Apply bucket policy to the principal, return the txn hash."}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"params"}),(0,s.jsx)(t.th,{children:"description"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"bucketName"}),(0,s.jsx)(t.td,{children:"bucket name"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"statements"}),(0,s.jsx)(t.td,{children:"Policies outline the specific details of permissions, including the Effect, ActionList, and Resources."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"principal"}),(0,s.jsx)(t.td,{children:"Indicates the marshaled principal content of greenfield permission types, users can generate it by NewPrincipalWithAccount or NewPrincipalWithGroupId method."})]})]})]}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-jsx",metastring:'title="Browser | Nodejs"',children:"import { GRNToString, newBucketGRN, PermissionTypes } from '@bnb-chain/greenfield-js-sdk';\nconst statement: PermissionTypes.Statement = {\n effect: PermissionTypes.Effect.EFFECT_ALLOW,\n actions: [PermissionTypes.ActionType.ACTION_UPDATE_BUCKET_INFO],\n resources: [GRNToString(newBucketGRN(bucketName))],\n};\nconst tx = await client.bucket.putBucketPolicy(bucketName, {\n operator: address,\n statements: [statement],\n principal: {\n type: PermissionTypes.PrincipalType.PRINCIPAL_TYPE_GNFD_ACCOUNT,\n value: '0x0000000000000000000000000000000000000001',\n },\n});\n"})}),"\n",(0,s.jsx)(d.Ay,{}),"\n",(0,s.jsxs)(t.h2,{id:"updatebucketinfo-",children:["updateBucketInfo ",(0,s.jsx)(a.A,{type:"Tx"})]}),"\n",(0,s.jsx)(t.p,{children:"Update the bucket meta on chain, including read quota, payment address or visibility. It will send\nthe MsgUpdateBucketInfo msg to greenfield to update the meta."}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"params"}),(0,s.jsx)(t.th,{children:"description"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"bucketName"}),(0,s.jsx)(t.td,{children:"bucket name"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"operator"}),(0,s.jsx)(t.td,{children:"operator account address"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"visibility"}),(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"/types/visibility",children:"VisibilityType"})})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"paymentAddress"}),(0,s.jsx)(t.td,{children:"payment address"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"chargedReadQuota"}),(0,s.jsx)(t.td,{children:"defines the traffic quota that you read from primary sp"})]})]})]}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-jsx",metastring:'title="Browser | Nodejs"',children:"await client.bucket.updateBucketInfo({\n bucketName: bucketName,\n operator: address,\n visibility: 1,\n paymentAddress: address,\n chargedReadQuota: '100',\n});\n"})}),"\n",(0,s.jsx)(d.Ay,{})]})}function j(e={}){const{wrapper:t}={...(0,r.R)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(x,{...e})}):x(e)}},4375:(e,t,n)=>{n.d(t,{A:()=>r});n(8318);var s=n(9214);const r=e=>{const{type:t}=e;return(0,s.jsx)("span",{style:{backgroundColor:"#25c2a0",borderRadius:"5px",color:"#FFF",fontSize:14,padding:2},children:t})}},1744:(e,t,n)=>{n.d(t,{A:()=>c});n(8318);var s=n(3372);const r={tabItem:"tabItem_SosH"};var i=n(9214);function c(e){let{children:t,hidden:n,className:c}=e;return(0,i.jsx)("div",{role:"tabpanel",className:(0,s.A)(r.tabItem,c),hidden:n,children:t})}},5303:(e,t,n)=>{n.d(t,{A:()=>A});var s=n(8318),r=n(3372),i=n(6888),c=n(6325),a=n(7503),d=n(8997),l=n(2554),o=n(3074);function u(e){return s.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,s.isValidElement)(e)&&function(e){const{props:t}=e;return!!t&&"object"==typeof t&&"value"in t}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function h(e){const{values:t,children:n}=e;return(0,s.useMemo)((()=>{const e=t??function(e){return u(e).map((e=>{let{props:{value:t,label:n,attributes:s,default:r}}=e;return{value:t,label:n,attributes:s,default:r}}))}(n);return function(e){const t=(0,l.X)(e,((e,t)=>e.value===t.value));if(t.length>0)throw new Error(`Docusaurus error: Duplicate values "${t.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[t,n])}function p(e){let{value:t,tabValues:n}=e;return n.some((e=>e.value===t))}function x(e){let{queryString:t=!1,groupId:n}=e;const r=(0,c.W6)(),i=function(e){let{queryString:t=!1,groupId:n}=e;if("string"==typeof t)return t;if(!1===t)return null;if(!0===t&&!n)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return n??null}({queryString:t,groupId:n});return[(0,d.aZ)(i),(0,s.useCallback)((e=>{if(!i)return;const t=new URLSearchParams(r.location.search);t.set(i,e),r.replace({...r.location,search:t.toString()})}),[i,r])]}function j(e){const{defaultValue:t,queryString:n=!1,groupId:r}=e,i=h(e),[c,d]=(0,s.useState)((()=>function(e){let{defaultValue:t,tabValues:n}=e;if(0===n.length)throw new Error("Docusaurus error: the component requires at least one children component");if(t){if(!p({value:t,tabValues:n}))throw new Error(`Docusaurus error: The has a defaultValue "${t}" but none of its children has the corresponding value. Available values are: ${n.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return t}const s=n.find((e=>e.default))??n[0];if(!s)throw new Error("Unexpected error: 0 tabValues");return s.value}({defaultValue:t,tabValues:i}))),[l,u]=x({queryString:n,groupId:r}),[j,b]=function(e){let{groupId:t}=e;const n=function(e){return e?`docusaurus.tab.${e}`:null}(t),[r,i]=(0,o.Dv)(n);return[r,(0,s.useCallback)((e=>{n&&i.set(e)}),[n,i])]}({groupId:r}),m=(()=>{const e=l??j;return p({value:e,tabValues:i})?e:null})();(0,a.A)((()=>{m&&d(m)}),[m]);return{selectedValue:c,selectValue:(0,s.useCallback)((e=>{if(!p({value:e,tabValues:i}))throw new Error(`Can't select invalid tab value=${e}`);d(e),u(e),b(e)}),[u,b,i]),tabValues:i}}var b=n(269);const m={tabList:"tabList_u4OX",tabItem:"tabItem_nyVU"};var y=n(9214);function k(e){let{className:t,block:n,selectedValue:s,selectValue:c,tabValues:a}=e;const d=[],{blockElementScrollPositionUntilNextRender:l}=(0,i.a_)(),o=e=>{const t=e.currentTarget,n=d.indexOf(t),r=a[n].value;r!==s&&(l(t),c(r))},u=e=>{let t=null;switch(e.key){case"Enter":o(e);break;case"ArrowRight":{const n=d.indexOf(e.currentTarget)+1;t=d[n]??d[0];break}case"ArrowLeft":{const n=d.indexOf(e.currentTarget)-1;t=d[n]??d[d.length-1];break}}t?.focus()};return(0,y.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,r.A)("tabs",{"tabs--block":n},t),children:a.map((e=>{let{value:t,label:n,attributes:i}=e;return(0,y.jsx)("li",{role:"tab",tabIndex:s===t?0:-1,"aria-selected":s===t,ref:e=>d.push(e),onKeyDown:u,onClick:o,...i,className:(0,r.A)("tabs__item",m.tabItem,i?.className,{"tabs__item--active":s===t}),children:n??t},t)}))})}function g(e){let{lazy:t,children:n,selectedValue:r}=e;const i=(Array.isArray(n)?n:[n]).filter(Boolean);if(t){const e=i.find((e=>e.props.value===r));return e?(0,s.cloneElement)(e,{className:"margin-top--md"}):null}return(0,y.jsx)("div",{className:"margin-top--md",children:i.map(((e,t)=>(0,s.cloneElement)(e,{key:t,hidden:e.props.value!==r})))})}function f(e){const t=j(e);return(0,y.jsxs)("div",{className:(0,r.A)("tabs-container",m.tabList),children:[(0,y.jsx)(k,{...e,...t}),(0,y.jsx)(g,{...e,...t})]})}function A(e){const t=(0,b.A)();return(0,y.jsx)(f,{...e,children:u(e.children)},String(t))}},3159:(e,t,n)=>{n.d(t,{R:()=>c,x:()=>a});var s=n(8318);const r={},i=s.createContext(r);function c(e){const t=s.useContext(i);return s.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function a(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:c(e.components),s.createElement(i.Provider,{value:t},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkgreenfield_js_sdk_docs=self.webpackChunkgreenfield_js_sdk_docs||[]).push([[977],{6976:(e,t,n)=>{n.d(t,{Ay:()=>a,RM:()=>i});var s=n(9214),r=n(3159);const i=[];function c(e){const t={a:"a",admonition:"admonition",p:"p",...(0,r.R)(),...e.components};return(0,s.jsx)(t.admonition,{type:"tip",children:(0,s.jsxs)(t.p,{children:["This is only ",(0,s.jsx)(t.a,{href:"/client/tx-client",children:"construct"})," tx, next need ",(0,s.jsx)(t.a,{href:"/client/tx-client#simulate",children:"simulate"})," and\n",(0,s.jsx)(t.a,{href:"/client/tx-client#broadcast",children:"broadcast"})]})})}function a(e={}){const{wrapper:t}={...(0,r.R)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(c,{...e})}):c(e)}},6916:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>h,contentTitle:()=>o,default:()=>j,frontMatter:()=>l,metadata:()=>u,toc:()=>p});var s=n(9214),r=n(3159),i=n(6159),c=n(7264),a=n(1180),d=n(6976);const l={id:"bucket",title:"Bucket"},o=void 0,u={id:"api/bucket",title:"Bucket",description:"createBucket",source:"@site/docs/api/bucket.mdx",sourceDirName:"api",slug:"/api/bucket",permalink:"/greenfield-js-sdk/api/bucket",draft:!1,unlisted:!1,editUrl:"https://github.com/bnb-chain/greenfield-js-sdk/tree/main/doc-site/docs/api/bucket.mdx",tags:[],version:"current",frontMatter:{id:"bucket",title:"Bucket"},sidebar:"GettingStartSidebar",previous:{title:"Account",permalink:"/greenfield-js-sdk/api/account"},next:{title:"Crosschain",permalink:"/greenfield-js-sdk/api/crosschain"}},h={},p=[{value:"createBucket ",id:"createbucket--",level:2},{value:"deleteBucket ",id:"deletebucket-",level:2},...d.RM,{value:"deleteBucketPolicy ",id:"deletebucketpolicy-",level:2},...d.RM,{value:"getBucketMeta ",id:"getbucketmeta-",level:2},{value:"getBucketPolicy ",id:"getbucketpolicy-",level:2},{value:"getBucketReadQuota ",id:"getbucketreadquota-",level:2},{value:"headBucket ",id:"headbucket-",level:2},{value:"headBucketById ",id:"headbucketbyid-",level:2},{value:"headBucketExtra ",id:"headbucketextra-",level:2},{value:"listBucketReadRecords ",id:"listbucketreadrecords-",level:2},{value:"listBuckets ",id:"listbuckets-",level:2},{value:"listBucketsByIds ",id:"listbucketsbyids-",level:2},{value:"listBucketsByPaymentAccount ",id:"listbucketsbypaymentaccount-",level:2},{value:"putBucketPolicy ",id:"putbucketpolicy-",level:2},...d.RM,{value:"updateBucketInfo ",id:"updatebucketinfo-",level:2},...d.RM];function x(e){const t={a:"a",code:"code",h2:"h2",p:"p",pre:"pre",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,r.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(t.h2,{id:"createbucket--",children:["createBucket ",(0,s.jsx)(a.A,{type:"Storage Provider"})," ",(0,s.jsx)(a.A,{type:"Tx"})]}),"\n",(0,s.jsx)(t.p,{children:"Create a new bucket in greenfield. This API sends a request to the storage provider to get approval\nfor creating bucket and sends the createBucket transaction to the Greenfield."}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"params"}),(0,s.jsx)(t.th,{children:"description"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"bucketName"}),(0,s.jsx)(t.td,{children:"bucket name"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"creator"}),(0,s.jsx)(t.td,{children:"creator account address"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"visibility"}),(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"/types/visibility",children:"VisibilityType"})})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"chargedReadQuota"}),(0,s.jsxs)(t.td,{children:[(0,s.jsx)(t.a,{href:"/types/long",children:"Long"}),"defines the traffic quota that you read from primary sp"]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"primarySpAddress"}),(0,s.jsx)(t.td,{children:"primary sp address"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"paymentAddress"}),(0,s.jsx)(t.td,{children:"payment address"})]})]})]}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-js",children:"const tx = await client.bucket.createBucket(\n {\n bucketName: 'bucket_name',\n creator: '0x...',\n visibility: VisibilityType.VISIBILITY_TYPE_PUBLIC_READ,\n chargedReadQuota: Long.fromString('0'),\n primarySpAddress: '0x....',\n paymentAddress: address,\n }\n);\n"})}),"\n",(0,s.jsxs)(t.h2,{id:"deletebucket-",children:["deleteBucket ",(0,s.jsx)(a.A,{type:"Tx"})]}),"\n",(0,s.jsx)(t.p,{children:"Send DeleteBucket msg to greenfield chain and return txn hash."}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"params"}),(0,s.jsx)(t.th,{children:"description"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"bucketName"}),(0,s.jsx)(t.td,{children:"The name of the bucket to be deleted"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"operator"}),(0,s.jsx)(t.td,{children:"operator account address"})]})]})]}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-js",children:"const tx = await client.bucket.deleteBucket({\n bucketName: bucketName,\n operator: address,\n});\n"})}),"\n",(0,s.jsx)(d.Ay,{}),"\n",(0,s.jsxs)(t.h2,{id:"deletebucketpolicy-",children:["deleteBucketPolicy ",(0,s.jsx)(a.A,{type:"Tx"})]}),"\n",(0,s.jsx)(t.p,{children:"Delete the bucket policy of the principal."}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"params"}),(0,s.jsx)(t.th,{children:"description"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"operator"}),(0,s.jsx)(t.td,{})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"bucketName"}),(0,s.jsx)(t.td,{children:"The bucket name identifies the bucket"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"principalAddr"}),(0,s.jsx)(t.td,{children:"Principal define the roles that can grant permissions"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"principalType"}),(0,s.jsx)(t.td,{children:"PrincipalType refers to the identity type of system users or entities."})]})]})]}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-js",children:"const tx = await client.bucket.deleteBucketPolicy(\n address,\n bucketName,\n address,\n 'PRINCIPAL_TYPE_GNFD_ACCOUNT',\n);\n"})}),"\n",(0,s.jsx)(d.Ay,{}),"\n",(0,s.jsxs)(t.h2,{id:"getbucketmeta-",children:["getBucketMeta ",(0,s.jsx)(a.A,{type:"Storage Provider"})]}),"\n",(0,s.jsx)(t.p,{children:"This API is used to get bucket meta by bucket name."}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"params"}),(0,s.jsx)(t.th,{children:"description"})]})}),(0,s.jsx)(t.tbody,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"bucketName"}),(0,s.jsx)(t.td,{children:"bucket name"})]})})]}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-js",children:"const bucketInfo = await client.bucket.getBucketMeta({\n bucketName: 'bucketName',\n});\n"})}),"\n",(0,s.jsxs)(t.h2,{id:"getbucketpolicy-",children:["getBucketPolicy ",(0,s.jsx)(a.A,{type:"Query"})]}),"\n",(0,s.jsx)(t.p,{children:"Get the bucket policy info of the user specified by principalAddr."}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-jsx",metastring:'title="Browser | Nodejs"',children:"import { GRNToString, newBucketGRN } from '@bnb-chain/greenfield-js-sdk';\nawait client.bucket.getBucketPolicy({\n resource: GRNToString(newBucketGRN(bucketName)),\n principalAddress: '0x00..',\n});\n"})}),"\n",(0,s.jsxs)(t.h2,{id:"getbucketreadquota-",children:["getBucketReadQuota ",(0,s.jsx)(a.A,{type:"Storage Provider"})]}),"\n",(0,s.jsx)(t.p,{children:"Query the quota info of the specific bucket of current month."}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"params"}),(0,s.jsx)(t.th,{children:"description"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"bucketName"}),(0,s.jsx)(t.td,{children:"bucket name"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"authType"}),(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"/client/sp-client#authtype",children:"AuthType"})})]})]})]}),"\n",(0,s.jsxs)(i.A,{groupId:"example",children:[(0,s.jsx)(c.A,{value:"Browser",label:"Browser",children:(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-jsx",children:"const tx = await client.bucket.getBucketReadQuota(\n {\n bucketName: 'bucketName',\n },\n // highlight-start\n {\n type: 'EDDSA',\n seed: offChainData.seedString,\n domain: window.location.origin,\n address,\n },\n // highlight-end\n);\n"})})}),(0,s.jsx)(c.A,{value:"Nodejs",label:"Nodejs",children:(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-js",children:"const tx = await client.bucket.getBucketReadQuota(\n {\n bucketName: 'bucketName',\n },\n // highlight-start\n {\n type: 'ECDSA',\n privateKey: ACCOUNT_PRIVATEKEY,\n },\n // highlight-end\n);\n"})})})]}),"\n",(0,s.jsxs)(t.h2,{id:"headbucket-",children:["headBucket ",(0,s.jsx)(a.A,{type:"Query"})]}),"\n",(0,s.jsx)(t.p,{children:"query the bucketInfo on chain, return the bucket info if exists."}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"params"}),(0,s.jsx)(t.th,{children:"description"})]})}),(0,s.jsx)(t.tbody,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"bucketName"}),(0,s.jsx)(t.td,{children:"bucket name"})]})})]}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-jsx",metastring:'title="Browser | Nodejs"',children:"const bucketInfo = await client.bucket.headBucket(bucketName);\n"})}),"\n",(0,s.jsxs)(t.h2,{id:"headbucketbyid-",children:["headBucketById ",(0,s.jsx)(a.A,{type:"Query"})]}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"params"}),(0,s.jsx)(t.th,{children:"description"})]})}),(0,s.jsx)(t.tbody,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"bucketId"}),(0,s.jsx)(t.td,{children:"bucket id"})]})})]}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-jsx",metastring:'title="Browser | Nodejs"',children:"const bucketInfo = await client.bucket.headBucketById(bucketId);\n"})}),"\n",(0,s.jsxs)(t.h2,{id:"headbucketextra-",children:["headBucketExtra ",(0,s.jsx)(a.A,{type:"Query"})]}),"\n",(0,s.jsx)(t.p,{children:"Queries a bucket extra info (with gvg bindings and price time) with specify name."}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"params"}),(0,s.jsx)(t.th,{children:"description"})]})}),(0,s.jsx)(t.tbody,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"bucketName"}),(0,s.jsx)(t.td,{children:"bucket name"})]})})]}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-jsx",metastring:'title="Browser | Nodejs"',children:"const bucketInfo = await client.bucket.headBucketExtra('bucketName');\n"})}),"\n",(0,s.jsxs)(t.h2,{id:"listbucketreadrecords-",children:["listBucketReadRecords ",(0,s.jsx)(a.A,{type:"Storage Provider"})]}),"\n",(0,s.jsx)(t.p,{children:"List the download record info of the specific bucket of the current month."}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"params"}),(0,s.jsx)(t.th,{children:"description"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"bucketName"}),(0,s.jsx)(t.td,{children:"bucket name"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"authType"}),(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"/client/sp-client#authtype",children:"AuthType"})})]})]})]}),"\n",(0,s.jsxs)(i.A,{groupId:"example",children:[(0,s.jsx)(c.A,{value:"Browser",label:"Browser",children:(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-jsx",children:"const tx = await client.bucket.listBucketReadRecords(\n {\n bucketName: 'bucketName',\n startTimeStamp,\n endTimeStamp,\n maxRecords: 1000,\n },\n // highlight-start\n {\n type: 'EDDSA',\n domain: window.location.origin,\n seed: offChainData.seedString,\n address,\n },\n // highlight-end\n);\n"})})}),(0,s.jsx)(c.A,{value:"Nodejs",label:"Nodejs",children:(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-js",children:"const tx = await client.bucket.listBucketReadRecords(\n {\n bucketName: 'bucketName',\n startTimeStamp,\n endTimeStamp,\n maxRecords: 1000,\n },\n // highlight-start\n {\n type: 'ECDSA',\n privateKey: ACCOUNT_PRIVATEKEY,\n },\n // highlight-end\n);\n"})})})]}),"\n",(0,s.jsxs)(t.h2,{id:"listbuckets-",children:["listBuckets ",(0,s.jsx)(a.A,{type:"Storage Provider"})]}),"\n",(0,s.jsx)(t.p,{children:"Lists the bucket info of the user."}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"params"}),(0,s.jsx)(t.th,{children:"description"})]})}),(0,s.jsx)(t.tbody,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"address"}),(0,s.jsx)(t.td,{children:"user account"})]})})]}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-jsx",metastring:'title="Browser | Nodejs"',children:"const res = await client.bucket.listBuckets({\n address: '0x...',\n});\n"})}),"\n",(0,s.jsxs)(t.h2,{id:"listbucketsbyids-",children:["listBucketsByIds ",(0,s.jsx)(a.A,{type:"Storage Provider"})]}),"\n",(0,s.jsx)(t.p,{children:"Lists the bucket info of the user."}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"params"}),(0,s.jsx)(t.th,{children:"description"})]})}),(0,s.jsx)(t.tbody,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"ids"}),(0,s.jsx)(t.td,{children:"bucket ids array"})]})})]}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-jsx",metastring:'title="Browser | Nodejs"',children:"await client.bucket.listBucketsByIds({\n ids: ['1', '2'],\n});\n"})}),"\n",(0,s.jsxs)(t.h2,{id:"listbucketsbypaymentaccount-",children:["listBucketsByPaymentAccount ",(0,s.jsx)(a.A,{type:"Storage Provider"})]}),"\n",(0,s.jsx)(t.p,{children:"List bucket info by payment account."}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"params"}),(0,s.jsx)(t.th,{children:"description"})]})}),(0,s.jsx)(t.tbody,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"paymentAccount"}),(0,s.jsx)(t.td,{children:"payment account address"})]})})]}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-jsx",metastring:'title="Browser | Nodejs"',children:"const res = await client.bucket.listBucketsByPaymentAccount({\n paymentAccount: '0x00...',\n});\n"})}),"\n",(0,s.jsxs)(t.h2,{id:"putbucketpolicy-",children:["putBucketPolicy ",(0,s.jsx)(a.A,{type:"Tx"})]}),"\n",(0,s.jsx)(t.p,{children:"Apply bucket policy to the principal, return the txn hash."}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"params"}),(0,s.jsx)(t.th,{children:"description"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"bucketName"}),(0,s.jsx)(t.td,{children:"bucket name"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"statements"}),(0,s.jsx)(t.td,{children:"Policies outline the specific details of permissions, including the Effect, ActionList, and Resources."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"principal"}),(0,s.jsx)(t.td,{children:"Indicates the marshaled principal content of greenfield permission types, users can generate it by NewPrincipalWithAccount or NewPrincipalWithGroupId method."})]})]})]}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-jsx",metastring:'title="Browser | Nodejs"',children:"import { GRNToString, newBucketGRN, PermissionTypes } from '@bnb-chain/greenfield-js-sdk';\nconst statement: PermissionTypes.Statement = {\n effect: PermissionTypes.Effect.EFFECT_ALLOW,\n actions: [PermissionTypes.ActionType.ACTION_UPDATE_BUCKET_INFO],\n resources: [GRNToString(newBucketGRN(bucketName))],\n};\nconst tx = await client.bucket.putBucketPolicy(bucketName, {\n operator: address,\n statements: [statement],\n principal: {\n type: PermissionTypes.PrincipalType.PRINCIPAL_TYPE_GNFD_ACCOUNT,\n value: '0x0000000000000000000000000000000000000001',\n },\n});\n"})}),"\n",(0,s.jsx)(d.Ay,{}),"\n",(0,s.jsxs)(t.h2,{id:"updatebucketinfo-",children:["updateBucketInfo ",(0,s.jsx)(a.A,{type:"Tx"})]}),"\n",(0,s.jsx)(t.p,{children:"Update the bucket meta on chain, including read quota, payment address or visibility. It will send\nthe MsgUpdateBucketInfo msg to greenfield to update the meta."}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"params"}),(0,s.jsx)(t.th,{children:"description"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"bucketName"}),(0,s.jsx)(t.td,{children:"bucket name"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"operator"}),(0,s.jsx)(t.td,{children:"operator account address"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"visibility"}),(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"/types/visibility",children:"VisibilityType"})})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"paymentAddress"}),(0,s.jsx)(t.td,{children:"payment address"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"chargedReadQuota"}),(0,s.jsx)(t.td,{children:"defines the traffic quota that you read from primary sp"})]})]})]}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-jsx",metastring:'title="Browser | Nodejs"',children:"await client.bucket.updateBucketInfo({\n bucketName: bucketName,\n operator: address,\n visibility: 1,\n paymentAddress: address,\n chargedReadQuota: '100',\n});\n"})}),"\n",(0,s.jsx)(d.Ay,{})]})}function j(e={}){const{wrapper:t}={...(0,r.R)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(x,{...e})}):x(e)}},1180:(e,t,n)=>{n.d(t,{A:()=>r});n(8318);var s=n(9214);const r=e=>{const{type:t}=e;return(0,s.jsx)("span",{style:{backgroundColor:"#25c2a0",borderRadius:"5px",color:"#FFF",fontSize:14,padding:2},children:t})}},7264:(e,t,n)=>{n.d(t,{A:()=>c});n(8318);var s=n(3372);const r={tabItem:"tabItem_SosH"};var i=n(9214);function c(e){let{children:t,hidden:n,className:c}=e;return(0,i.jsx)("div",{role:"tabpanel",className:(0,s.A)(r.tabItem,c),hidden:n,children:t})}},6159:(e,t,n)=>{n.d(t,{A:()=>A});var s=n(8318),r=n(3372),i=n(2157),c=n(6325),a=n(848),d=n(5014),l=n(3799),o=n(6765);function u(e){return s.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,s.isValidElement)(e)&&function(e){const{props:t}=e;return!!t&&"object"==typeof t&&"value"in t}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function h(e){const{values:t,children:n}=e;return(0,s.useMemo)((()=>{const e=t??function(e){return u(e).map((e=>{let{props:{value:t,label:n,attributes:s,default:r}}=e;return{value:t,label:n,attributes:s,default:r}}))}(n);return function(e){const t=(0,l.X)(e,((e,t)=>e.value===t.value));if(t.length>0)throw new Error(`Docusaurus error: Duplicate values "${t.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[t,n])}function p(e){let{value:t,tabValues:n}=e;return n.some((e=>e.value===t))}function x(e){let{queryString:t=!1,groupId:n}=e;const r=(0,c.W6)(),i=function(e){let{queryString:t=!1,groupId:n}=e;if("string"==typeof t)return t;if(!1===t)return null;if(!0===t&&!n)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return n??null}({queryString:t,groupId:n});return[(0,d.aZ)(i),(0,s.useCallback)((e=>{if(!i)return;const t=new URLSearchParams(r.location.search);t.set(i,e),r.replace({...r.location,search:t.toString()})}),[i,r])]}function j(e){const{defaultValue:t,queryString:n=!1,groupId:r}=e,i=h(e),[c,d]=(0,s.useState)((()=>function(e){let{defaultValue:t,tabValues:n}=e;if(0===n.length)throw new Error("Docusaurus error: the component requires at least one children component");if(t){if(!p({value:t,tabValues:n}))throw new Error(`Docusaurus error: The has a defaultValue "${t}" but none of its children has the corresponding value. Available values are: ${n.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return t}const s=n.find((e=>e.default))??n[0];if(!s)throw new Error("Unexpected error: 0 tabValues");return s.value}({defaultValue:t,tabValues:i}))),[l,u]=x({queryString:n,groupId:r}),[j,b]=function(e){let{groupId:t}=e;const n=function(e){return e?`docusaurus.tab.${e}`:null}(t),[r,i]=(0,o.Dv)(n);return[r,(0,s.useCallback)((e=>{n&&i.set(e)}),[n,i])]}({groupId:r}),m=(()=>{const e=l??j;return p({value:e,tabValues:i})?e:null})();(0,a.A)((()=>{m&&d(m)}),[m]);return{selectedValue:c,selectValue:(0,s.useCallback)((e=>{if(!p({value:e,tabValues:i}))throw new Error(`Can't select invalid tab value=${e}`);d(e),u(e),b(e)}),[u,b,i]),tabValues:i}}var b=n(5180);const m={tabList:"tabList_u4OX",tabItem:"tabItem_nyVU"};var y=n(9214);function k(e){let{className:t,block:n,selectedValue:s,selectValue:c,tabValues:a}=e;const d=[],{blockElementScrollPositionUntilNextRender:l}=(0,i.a_)(),o=e=>{const t=e.currentTarget,n=d.indexOf(t),r=a[n].value;r!==s&&(l(t),c(r))},u=e=>{let t=null;switch(e.key){case"Enter":o(e);break;case"ArrowRight":{const n=d.indexOf(e.currentTarget)+1;t=d[n]??d[0];break}case"ArrowLeft":{const n=d.indexOf(e.currentTarget)-1;t=d[n]??d[d.length-1];break}}t?.focus()};return(0,y.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,r.A)("tabs",{"tabs--block":n},t),children:a.map((e=>{let{value:t,label:n,attributes:i}=e;return(0,y.jsx)("li",{role:"tab",tabIndex:s===t?0:-1,"aria-selected":s===t,ref:e=>d.push(e),onKeyDown:u,onClick:o,...i,className:(0,r.A)("tabs__item",m.tabItem,i?.className,{"tabs__item--active":s===t}),children:n??t},t)}))})}function g(e){let{lazy:t,children:n,selectedValue:r}=e;const i=(Array.isArray(n)?n:[n]).filter(Boolean);if(t){const e=i.find((e=>e.props.value===r));return e?(0,s.cloneElement)(e,{className:"margin-top--md"}):null}return(0,y.jsx)("div",{className:"margin-top--md",children:i.map(((e,t)=>(0,s.cloneElement)(e,{key:t,hidden:e.props.value!==r})))})}function f(e){const t=j(e);return(0,y.jsxs)("div",{className:(0,r.A)("tabs-container",m.tabList),children:[(0,y.jsx)(k,{...e,...t}),(0,y.jsx)(g,{...e,...t})]})}function A(e){const t=(0,b.A)();return(0,y.jsx)(f,{...e,children:u(e.children)},String(t))}},3159:(e,t,n)=>{n.d(t,{R:()=>c,x:()=>a});var s=n(8318);const r={},i=s.createContext(r);function c(e){const t=s.useContext(i);return s.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function a(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:c(e.components),s.createElement(i.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/5b8570a6.a0fcced3.js b/assets/js/5b8570a6.6373a53e.js similarity index 88% rename from assets/js/5b8570a6.a0fcced3.js rename to assets/js/5b8570a6.6373a53e.js index 4c6b61f5..b8fd5a1c 100644 --- a/assets/js/5b8570a6.a0fcced3.js +++ b/assets/js/5b8570a6.6373a53e.js @@ -1 +1 @@ -"use strict";(self.webpackChunkgreenfield_js_sdk_docs=self.webpackChunkgreenfield_js_sdk_docs||[]).push([[727],{6976:(e,t,n)=>{n.d(t,{Ay:()=>l,RM:()=>i});var s=n(9214),r=n(3159);const i=[];function c(e){const t={a:"a",admonition:"admonition",p:"p",...(0,r.R)(),...e.components};return(0,s.jsx)(t.admonition,{type:"tip",children:(0,s.jsxs)(t.p,{children:["This is only ",(0,s.jsx)(t.a,{href:"/client/tx-client",children:"construct"})," tx, next need ",(0,s.jsx)(t.a,{href:"/client/tx-client#simulate",children:"simulate"})," and\n",(0,s.jsx)(t.a,{href:"/client/tx-client#broadcast",children:"broadcast"})]})})}function l(e={}){const{wrapper:t}={...(0,r.R)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(c,{...e})}):c(e)}},8163:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>j,contentTitle:()=>o,default:()=>b,frontMatter:()=>a,metadata:()=>h,toc:()=>x});var s=n(9214),r=n(3159),i=n(4375),c=n(6976),l=n(5303),d=n(1744);const a={id:"object",title:"Object"},o=void 0,h={id:"api/object",title:"Object",description:"cancelCreateObject",source:"@site/docs/api/object.mdx",sourceDirName:"api",slug:"/api/object",permalink:"/greenfield-js-sdk/api/object",draft:!1,unlisted:!1,editUrl:"https://github.com/bnb-chain/greenfield-js-sdk/tree/main/doc-site/docs/api/object.mdx",tags:[],version:"current",frontMatter:{id:"object",title:"Object"},sidebar:"GettingStartSidebar",previous:{title:"Group",permalink:"/greenfield-js-sdk/api/group"},next:{title:"Payment",permalink:"/greenfield-js-sdk/api/payment"}},j={},x=[{value:"cancelCreateObject ",id:"cancelcreateobject-",level:2},{value:"createFolder ",id:"createfolder--",level:2},...c.RM,{value:"createObject",id:"createobject",level:2},...c.RM,{value:"deleteObject ",id:"deleteobject-",level:2},...c.RM,{value:"deleteObjectPolicy ",id:"deleteobjectpolicy-",level:2},...c.RM,{value:"downloadFile ",id:"downloadfile-",level:2},{value:"getObjectPolicy ",id:"getobjectpolicy-",level:2},{value:"getObjectPreviewUrl ",id:"getobjectpreviewurl-",level:2},{value:"headObject ",id:"headobject-",level:2},{value:"headObjectById ",id:"headobjectbyid-",level:2},{value:"listObjects ",id:"listobjects-",level:2},{value:"listObjectsByIds ",id:"listobjectsbyids-",level:2},{value:"listObjectPolicies ",id:"listobjectpolicies-",level:2},{value:"putObjectPolicy ",id:"putobjectpolicy-",level:2},...c.RM,{value:"updateObjectInfo ",id:"updateobjectinfo-",level:2},...c.RM,{value:"uploadObject ",id:"uploadobject-",level:2}];function p(e){const t={a:"a",code:"code",h2:"h2",p:"p",pre:"pre",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,r.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(t.h2,{id:"cancelcreateobject-",children:["cancelCreateObject ",(0,s.jsx)(i.A,{type:"Tx"})]}),"\n",(0,s.jsxs)(t.p,{children:["Send ",(0,s.jsx)(t.code,{children:"CancelCreateObject"})," txn to greenfield chain."]}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"params"}),(0,s.jsx)(t.th,{children:"description"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"operator"}),(0,s.jsx)(t.td,{children:"the account address of the operator"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"bucketName"}),(0,s.jsx)(t.td,{children:"the name of the bucket"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"objectName"}),(0,s.jsx)(t.td,{children:"the name of the object"})]})]})]}),"\n",(0,s.jsxs)(t.h2,{id:"createfolder--",children:["createFolder ",(0,s.jsx)(i.A,{type:"Storage Provider"})," ",(0,s.jsx)(i.A,{type:"Tx"})]}),"\n",(0,s.jsx)(t.p,{children:"Send create empty object txn to greenfield chain."}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"params"}),(0,s.jsx)(t.th,{children:"description"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"bucketName"}),(0,s.jsx)(t.td,{children:"bucket name"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"objectName"}),(0,s.jsxs)(t.td,{children:["folder name, end with ",(0,s.jsx)(t.code,{children:"/"})]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"creator"}),(0,s.jsx)(t.td,{children:"the creator of object"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"visibility"}),(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"/types/visibility",children:"VisibilityType"})})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"redundancyType"}),(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"/types/redundancy",children:"RedundancyType"})})]})]})]}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-jsx",children:"const tx = await client.object.createFolder(\n {\n bucketName: createObjectInfo.bucketName,\n objectName: createObjectInfo.objectName + '/',\n creator: address,\n redundancyType: RedundancyType.REDUNDANCY_EC_TYPE,\n visibility: VisibilityType.VISIBILITY_TYPE_PRIVATE,\n }\n);\n"})}),"\n",(0,s.jsx)(c.Ay,{}),"\n",(0,s.jsx)(t.h2,{id:"createobject",children:"createObject"}),"\n",(0,s.jsx)(t.p,{children:"Creating object and send createObject txn to greenfield chain."}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"params"}),(0,s.jsx)(t.th,{children:"description"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"bucketName"}),(0,s.jsx)(t.td,{children:"bucket name"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"objectName"}),(0,s.jsx)(t.td,{children:"object name"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"creator"}),(0,s.jsx)(t.td,{children:"the creator of object"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"visibility"}),(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"/types/visibility",children:"VisibilityType"})})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"contentType"}),(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/API/File/type",children:"file type"})})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"redundancyType"}),(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"/types/redundancy",children:"RedundancyType"})})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"payloadSize"}),(0,s.jsxs)(t.td,{children:["file content ",(0,s.jsx)(t.a,{href:"/types/long",children:"Long"}),"length"]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"expectChecksums"}),(0,s.jsx)(t.td,{children:"file's expectChecksums"})]})]})]}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-jsx",children:"const tx = await client.object.createObject(\n {\n bucketName: 'bucket_name',\n objectName: 'object_name',\n creator: '0x...',\n visibility: VisibilityType.VISIBILITY_TYPE_PRIVATE,\n contentType: 'json',\n redundancyType: RedundancyType.REDUNDANCY_EC_TYPE,\n payloadSize: Long.fromInt(13311),\n expectCheckSums: expectCheckSums.map((x) => bytesFromBase64(x)),\n }\n);\n"})}),"\n",(0,s.jsx)(c.Ay,{}),"\n",(0,s.jsxs)(t.h2,{id:"deleteobject-",children:["deleteObject ",(0,s.jsx)(i.A,{type:"Tx"})]}),"\n",(0,s.jsx)(t.p,{children:"Send DeleteObject msg to greenfield chain and return txn hash."}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"params"}),(0,s.jsx)(t.th,{children:"description"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"operator"}),(0,s.jsx)(t.td,{children:"the account address of the operator who has the DeleteObject permission of the object to be deleted"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"bucketName"}),(0,s.jsx)(t.td,{children:"the name of the bucket where the object which to be deleted is stored"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"objectName"}),(0,s.jsx)(t.td,{children:"the name of the object which to be deleted"})]})]})]}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-jsx",metastring:'title="Browser / Nodejs Example"',children:"const tx = await client.object.deleteObject({\n bucketName: 'bucket_name',\n objectName: 'object_name',\n operator: '0x000..',\n});\n"})}),"\n",(0,s.jsx)(c.Ay,{}),"\n",(0,s.jsxs)(t.h2,{id:"deleteobjectpolicy-",children:["deleteObjectPolicy ",(0,s.jsx)(i.A,{type:"Tx"})]}),"\n",(0,s.jsx)(t.p,{children:"Delete the object policy of the principal."}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"params"}),(0,s.jsx)(t.th,{children:"description"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"operator"}),(0,s.jsx)(t.td,{children:"the granter who grant the permission to another principal"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"bucketName"}),(0,s.jsx)(t.td,{children:"the name of the bucket"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"objectName"}),(0,s.jsx)(t.td,{children:"the name of the object"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"principalAddr"}),(0,s.jsx)(t.td,{children:"principal address"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"principal"}),(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"/types/principal",children:"PrincipalType"})})]})]})]}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-jsx",metastring:'title="Browser / Nodejs Example"',children:"const tx = await client.object.deleteObjectPolicy(\n '0x000..', // operator\n 'bucket_name', // bucket name\n 'object_name', // object name\n '0x000..', // principalAddr\n 'PRINCIPAL_TYPE_GNFD_GROUP', // PrincipalType\n);\n"})}),"\n",(0,s.jsx)(c.Ay,{}),"\n",(0,s.jsxs)(t.h2,{id:"downloadfile-",children:["downloadFile ",(0,s.jsx)(i.A,{type:"Storage Provider"})]}),"\n",(0,s.jsx)(t.p,{children:"Download s3 object payload and return the related object info."}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"params"}),(0,s.jsx)(t.th,{children:"description"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"bucketName"}),(0,s.jsx)(t.td,{children:"bucket name"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"objectName"}),(0,s.jsx)(t.td,{children:"object name"})]})]})]}),"\n",(0,s.jsxs)(l.A,{groupId:"example",children:[(0,s.jsx)(d.A,{value:"Browser",label:"Browser",children:(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-jsx",children:"await client.object.downloadFile(\n {\n bucketName,\n objectName,\n },\n // highlight-start\n {\n type: 'EDDSA',\n address,\n domain: window.location.origin,\n seed: offChainData.seedString,\n },\n // highlight-end\n);\n"})})}),(0,s.jsx)(d.A,{value:"Nodejs",label:"Nodejs",children:(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-js",children:"await client.object.downloadFile(\n {\n bucketName,\n objectName,\n },\n // highlight-start\n {\n type: 'ECDSA',\n privateKey: ACCOUNT_PRIVATEKEY,\n },\n // highlight-end\n);\n"})})})]}),"\n",(0,s.jsxs)(t.h2,{id:"getobjectpolicy-",children:["getObjectPolicy ",(0,s.jsx)(i.A,{type:"Query"})]}),"\n",(0,s.jsx)(t.p,{children:"Get the object policy info of the user specified by principalAddr."}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"params"}),(0,s.jsx)(t.th,{children:"description"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"bucketName"}),(0,s.jsx)(t.td,{children:"bucket name"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"objectName"}),(0,s.jsx)(t.td,{children:"object name"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"principalAddr"}),(0,s.jsx)(t.td,{children:"principal address"})]})]})]}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-jsx",metastring:'title="example"',children:"const tx = await client.object.getObjectPolicy('bucket_name', 'object_name', '0x...');\n"})}),"\n",(0,s.jsxs)(t.h2,{id:"getobjectpreviewurl-",children:["getObjectPreviewUrl ",(0,s.jsx)(i.A,{type:"Storage Provider"})]}),"\n",(0,s.jsx)(t.p,{children:"Get the object preview url."}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-jsx",metastring:'title="Browser"',children:"const res = await client.object.getObjectPreviewUrl(\n {\n bucketName: 'bucket_name',\n objectName: 'object_name',\n queryMap: {\n view: '1',\n 'X-Gnfd-User-Address': address,\n 'X-Gnfd-App-Domain': window.location.origin,\n 'X-Gnfd-Expiry-Timestamp': '2023-09-03T09%3A23%3A39Z',\n },\n },\n {\n type: 'EDDSA',\n address,\n domain: window.location.origin,\n seed: offChainData.seedString,\n },\n);\n"})}),"\n",(0,s.jsxs)(t.h2,{id:"headobject-",children:["headObject ",(0,s.jsx)(i.A,{type:"Query"})]}),"\n",(0,s.jsx)(t.p,{children:"Query the objectInfo on chain to check the object id, return the object info if exists."}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"params"}),(0,s.jsx)(t.th,{children:"description"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"bucketName"}),(0,s.jsx)(t.td,{children:"bucket name"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"objectName"}),(0,s.jsx)(t.td,{children:"object name"})]})]})]}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-jsx",metastring:'title="example"',children:"await client.object.headObject(bucketName, objectName);\n"})}),"\n",(0,s.jsxs)(t.h2,{id:"headobjectbyid-",children:["headObjectById ",(0,s.jsx)(i.A,{type:"Query"})]}),"\n",(0,s.jsx)(t.p,{children:"Query the objectInfo on chain by object id, return the object info if exists."}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-jsx",metastring:'title="example"',children:"await client.object.headObjectById('12');\n"})}),"\n",(0,s.jsxs)(t.h2,{id:"listobjects-",children:["listObjects ",(0,s.jsx)(i.A,{type:"Storage Provider"})]}),"\n",(0,s.jsx)(t.p,{children:"Lists the object info of the bucket."}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"params"}),(0,s.jsx)(t.th,{children:"description"})]})}),(0,s.jsx)(t.tbody,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"bucketName"}),(0,s.jsx)(t.td,{children:"bucket name"})]})})]}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-jsx",metastring:'title="example"',children:"const res = await client.object.listObjects({\n bucketName,\n});\n"})}),"\n",(0,s.jsxs)(t.h2,{id:"listobjectsbyids-",children:["listObjectsByIds ",(0,s.jsx)(i.A,{type:"Storage Provider"})]}),"\n",(0,s.jsx)(t.p,{children:"List objects by object ids."}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"params"}),(0,s.jsx)(t.th,{children:"description"})]})}),(0,s.jsx)(t.tbody,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"ids"}),(0,s.jsx)(t.td,{children:"object ids array"})]})})]}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-jsx",metastring:'title="example"',children:"await client.object.listObjectsByIds({\n ids: ['1', '2'],\n});\n"})}),"\n",(0,s.jsxs)(t.h2,{id:"listobjectpolicies-",children:["listObjectPolicies ",(0,s.jsx)(i.A,{type:"Storage Provider"})]}),"\n",(0,s.jsx)(t.p,{children:"List object policies by object info and action type."}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"params"}),(0,s.jsx)(t.th,{children:"description"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"bucketName"}),(0,s.jsx)(t.td,{children:"bucket name"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"objectName"}),(0,s.jsx)(t.td,{children:"object name"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"actionType"}),(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"/types/action",children:"ActionType"})})]})]})]}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-jsx",metastring:'title="example"',children:"const res = await client.object.listObjectPolicies({\n bucketName: 'bucket_name',\n objectName: 'object_name',\n actionType: 'ACTION_GET_OBJECT',\n});\n"})}),"\n",(0,s.jsxs)(t.h2,{id:"putobjectpolicy-",children:["putObjectPolicy ",(0,s.jsx)(i.A,{type:"Tx"})]}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"params"}),(0,s.jsx)(t.th,{children:"description"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"operator"}),(0,s.jsx)(t.td,{children:"operator address"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"principal"}),(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"/types/principal",children:"Principal"})})]})]})]}),"\n",(0,s.jsx)(t.p,{children:"Apply object policy to the principal, return the txn hash."}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-jsx",metastring:'title="example"',children:"import { PermissionTypes } from '@bnb-chain/greenfield-js-sdk';\nconst statement: PermissionTypes.Statement = {\n effect: PermissionTypes.Effect.EFFECT_ALLOW,\n actions: [PermissionTypes.ActionType.ACTION_GET_OBJECT],\n resources: [],\n};\nawait client.object.putObjectPolicy('bucket_name', 'object_name', {\n operator: '0x...',\n statements: [statement],\n principal: {\n type: PermissionTypes.PrincipalType.PRINCIPAL_TYPE_GNFD_ACCOUNT,\n value: '0x0000000000000000000000000000000000000001',\n },\n});\n"})}),"\n",(0,s.jsx)(c.Ay,{}),"\n",(0,s.jsxs)(t.h2,{id:"updateobjectinfo-",children:["updateObjectInfo ",(0,s.jsx)(i.A,{type:"Tx"})]}),"\n",(0,s.jsx)(t.p,{children:"Update object info by sending message to greenfield."}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"params"}),(0,s.jsx)(t.th,{children:"description"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"bucketName"}),(0,s.jsx)(t.td,{children:"bucket name"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"objectName"}),(0,s.jsx)(t.td,{children:"object name"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"operator"}),(0,s.jsx)(t.td,{children:"operator address"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"visibility"}),(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"/types/visibility",children:"VisibilityType"})})]})]})]}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-jsx",metastring:'title="example"',children:"const tx = await client.object.updateObjectInfo({\n bucketName: 'bucket_name',\n objectName: 'object_name',\n operator: '0x...',\n visibility: 'VISIBILITY_TYPE_PUBLIC_READ',\n});\n"})}),"\n",(0,s.jsx)(c.Ay,{}),"\n",(0,s.jsxs)(t.h2,{id:"uploadobject-",children:["uploadObject ",(0,s.jsx)(i.A,{type:"Storage Provider"})]}),"\n",(0,s.jsx)(t.p,{children:"Uploading the object to bucket."}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"params"}),(0,s.jsx)(t.th,{children:"description"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"bucketName"}),(0,s.jsx)(t.td,{children:"bucket name"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"objectName"}),(0,s.jsx)(t.td,{children:"object name"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"body"}),(0,s.jsx)(t.td,{children:"file"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"txnHash"}),(0,s.jsxs)(t.td,{children:[(0,s.jsx)(t.a,{href:"#createobject",children:"createObject"})," 's hash"]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"authType"}),(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"/client/sp-client#authtype",children:"AuthType"})})]})]})]}),"\n",(0,s.jsxs)(l.A,{groupId:"example",children:[(0,s.jsx)(d.A,{value:"Browser",label:"Browser",children:(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-jsx",children:"const uploadRes = await client.object.uploadObject(\n {\n bucketName: createObjectInfo.bucketName,\n objectName: createObjectInfo.objectName,\n body: file,\n txnHash: txHash,\n },\n // highlight-start\n {\n type: 'EDDSA',\n domain: window.location.origin,\n seed: offChainData.seedString,\n address,\n },\n // highlight-end\n);\n"})})}),(0,s.jsx)(d.A,{value:"Nodejs",label:"Nodejs",children:(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-js",children:"const uploadRes = await client.object.uploadObject(\n {\n bucketName: bucketName,\n objectName: objectName,\n body: fileBuffer,\n txnHash: createObjectTxRes.transactionHash,\n },\n // highlight-start\n {\n type: 'ECDSA',\n privateKey: ACCOUNT_PRIVATEKEY,\n },\n // highlight-end\n);\n"})})})]})]})}function b(e={}){const{wrapper:t}={...(0,r.R)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(p,{...e})}):p(e)}},4375:(e,t,n)=>{n.d(t,{A:()=>r});n(8318);var s=n(9214);const r=e=>{const{type:t}=e;return(0,s.jsx)("span",{style:{backgroundColor:"#25c2a0",borderRadius:"5px",color:"#FFF",fontSize:14,padding:2},children:t})}},1744:(e,t,n)=>{n.d(t,{A:()=>c});n(8318);var s=n(3372);const r={tabItem:"tabItem_SosH"};var i=n(9214);function c(e){let{children:t,hidden:n,className:c}=e;return(0,i.jsx)("div",{role:"tabpanel",className:(0,s.A)(r.tabItem,c),hidden:n,children:t})}},5303:(e,t,n)=>{n.d(t,{A:()=>T});var s=n(8318),r=n(3372),i=n(6888),c=n(6325),l=n(7503),d=n(8997),a=n(2554),o=n(3074);function h(e){return s.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,s.isValidElement)(e)&&function(e){const{props:t}=e;return!!t&&"object"==typeof t&&"value"in t}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function j(e){const{values:t,children:n}=e;return(0,s.useMemo)((()=>{const e=t??function(e){return h(e).map((e=>{let{props:{value:t,label:n,attributes:s,default:r}}=e;return{value:t,label:n,attributes:s,default:r}}))}(n);return function(e){const t=(0,a.X)(e,((e,t)=>e.value===t.value));if(t.length>0)throw new Error(`Docusaurus error: Duplicate values "${t.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[t,n])}function x(e){let{value:t,tabValues:n}=e;return n.some((e=>e.value===t))}function p(e){let{queryString:t=!1,groupId:n}=e;const r=(0,c.W6)(),i=function(e){let{queryString:t=!1,groupId:n}=e;if("string"==typeof t)return t;if(!1===t)return null;if(!0===t&&!n)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return n??null}({queryString:t,groupId:n});return[(0,d.aZ)(i),(0,s.useCallback)((e=>{if(!i)return;const t=new URLSearchParams(r.location.search);t.set(i,e),r.replace({...r.location,search:t.toString()})}),[i,r])]}function b(e){const{defaultValue:t,queryString:n=!1,groupId:r}=e,i=j(e),[c,d]=(0,s.useState)((()=>function(e){let{defaultValue:t,tabValues:n}=e;if(0===n.length)throw new Error("Docusaurus error: the component requires at least one children component");if(t){if(!x({value:t,tabValues:n}))throw new Error(`Docusaurus error: The has a defaultValue "${t}" but none of its children has the corresponding value. Available values are: ${n.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return t}const s=n.find((e=>e.default))??n[0];if(!s)throw new Error("Unexpected error: 0 tabValues");return s.value}({defaultValue:t,tabValues:i}))),[a,h]=p({queryString:n,groupId:r}),[b,u]=function(e){let{groupId:t}=e;const n=function(e){return e?`docusaurus.tab.${e}`:null}(t),[r,i]=(0,o.Dv)(n);return[r,(0,s.useCallback)((e=>{n&&i.set(e)}),[n,i])]}({groupId:r}),m=(()=>{const e=a??b;return x({value:e,tabValues:i})?e:null})();(0,l.A)((()=>{m&&d(m)}),[m]);return{selectedValue:c,selectValue:(0,s.useCallback)((e=>{if(!x({value:e,tabValues:i}))throw new Error(`Can't select invalid tab value=${e}`);d(e),h(e),u(e)}),[h,u,i]),tabValues:i}}var u=n(269);const m={tabList:"tabList_u4OX",tabItem:"tabItem_nyVU"};var y=n(9214);function f(e){let{className:t,block:n,selectedValue:s,selectValue:c,tabValues:l}=e;const d=[],{blockElementScrollPositionUntilNextRender:a}=(0,i.a_)(),o=e=>{const t=e.currentTarget,n=d.indexOf(t),r=l[n].value;r!==s&&(a(t),c(r))},h=e=>{let t=null;switch(e.key){case"Enter":o(e);break;case"ArrowRight":{const n=d.indexOf(e.currentTarget)+1;t=d[n]??d[0];break}case"ArrowLeft":{const n=d.indexOf(e.currentTarget)-1;t=d[n]??d[d.length-1];break}}t?.focus()};return(0,y.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,r.A)("tabs",{"tabs--block":n},t),children:l.map((e=>{let{value:t,label:n,attributes:i}=e;return(0,y.jsx)("li",{role:"tab",tabIndex:s===t?0:-1,"aria-selected":s===t,ref:e=>d.push(e),onKeyDown:h,onClick:o,...i,className:(0,r.A)("tabs__item",m.tabItem,i?.className,{"tabs__item--active":s===t}),children:n??t},t)}))})}function g(e){let{lazy:t,children:n,selectedValue:r}=e;const i=(Array.isArray(n)?n:[n]).filter(Boolean);if(t){const e=i.find((e=>e.props.value===r));return e?(0,s.cloneElement)(e,{className:"margin-top--md"}):null}return(0,y.jsx)("div",{className:"margin-top--md",children:i.map(((e,t)=>(0,s.cloneElement)(e,{key:t,hidden:e.props.value!==r})))})}function v(e){const t=b(e);return(0,y.jsxs)("div",{className:(0,r.A)("tabs-container",m.tabList),children:[(0,y.jsx)(f,{...e,...t}),(0,y.jsx)(g,{...e,...t})]})}function T(e){const t=(0,u.A)();return(0,y.jsx)(v,{...e,children:h(e.children)},String(t))}},3159:(e,t,n)=>{n.d(t,{R:()=>c,x:()=>l});var s=n(8318);const r={},i=s.createContext(r);function c(e){const t=s.useContext(i);return s.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function l(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:c(e.components),s.createElement(i.Provider,{value:t},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkgreenfield_js_sdk_docs=self.webpackChunkgreenfield_js_sdk_docs||[]).push([[727],{6976:(e,t,n)=>{n.d(t,{Ay:()=>l,RM:()=>i});var s=n(9214),r=n(3159);const i=[];function c(e){const t={a:"a",admonition:"admonition",p:"p",...(0,r.R)(),...e.components};return(0,s.jsx)(t.admonition,{type:"tip",children:(0,s.jsxs)(t.p,{children:["This is only ",(0,s.jsx)(t.a,{href:"/client/tx-client",children:"construct"})," tx, next need ",(0,s.jsx)(t.a,{href:"/client/tx-client#simulate",children:"simulate"})," and\n",(0,s.jsx)(t.a,{href:"/client/tx-client#broadcast",children:"broadcast"})]})})}function l(e={}){const{wrapper:t}={...(0,r.R)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(c,{...e})}):c(e)}},8163:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>j,contentTitle:()=>o,default:()=>b,frontMatter:()=>a,metadata:()=>h,toc:()=>x});var s=n(9214),r=n(3159),i=n(1180),c=n(6976),l=n(6159),d=n(7264);const a={id:"object",title:"Object"},o=void 0,h={id:"api/object",title:"Object",description:"cancelCreateObject",source:"@site/docs/api/object.mdx",sourceDirName:"api",slug:"/api/object",permalink:"/greenfield-js-sdk/api/object",draft:!1,unlisted:!1,editUrl:"https://github.com/bnb-chain/greenfield-js-sdk/tree/main/doc-site/docs/api/object.mdx",tags:[],version:"current",frontMatter:{id:"object",title:"Object"},sidebar:"GettingStartSidebar",previous:{title:"Group",permalink:"/greenfield-js-sdk/api/group"},next:{title:"Payment",permalink:"/greenfield-js-sdk/api/payment"}},j={},x=[{value:"cancelCreateObject ",id:"cancelcreateobject-",level:2},{value:"createFolder ",id:"createfolder--",level:2},...c.RM,{value:"createObject",id:"createobject",level:2},...c.RM,{value:"deleteObject ",id:"deleteobject-",level:2},...c.RM,{value:"deleteObjectPolicy ",id:"deleteobjectpolicy-",level:2},...c.RM,{value:"downloadFile ",id:"downloadfile-",level:2},{value:"getObjectPolicy ",id:"getobjectpolicy-",level:2},{value:"getObjectPreviewUrl ",id:"getobjectpreviewurl-",level:2},{value:"headObject ",id:"headobject-",level:2},{value:"headObjectById ",id:"headobjectbyid-",level:2},{value:"listObjects ",id:"listobjects-",level:2},{value:"listObjectsByIds ",id:"listobjectsbyids-",level:2},{value:"listObjectPolicies ",id:"listobjectpolicies-",level:2},{value:"putObjectPolicy ",id:"putobjectpolicy-",level:2},...c.RM,{value:"updateObjectInfo ",id:"updateobjectinfo-",level:2},...c.RM,{value:"uploadObject ",id:"uploadobject-",level:2}];function p(e){const t={a:"a",code:"code",h2:"h2",p:"p",pre:"pre",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,r.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(t.h2,{id:"cancelcreateobject-",children:["cancelCreateObject ",(0,s.jsx)(i.A,{type:"Tx"})]}),"\n",(0,s.jsxs)(t.p,{children:["Send ",(0,s.jsx)(t.code,{children:"CancelCreateObject"})," txn to greenfield chain."]}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"params"}),(0,s.jsx)(t.th,{children:"description"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"operator"}),(0,s.jsx)(t.td,{children:"the account address of the operator"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"bucketName"}),(0,s.jsx)(t.td,{children:"the name of the bucket"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"objectName"}),(0,s.jsx)(t.td,{children:"the name of the object"})]})]})]}),"\n",(0,s.jsxs)(t.h2,{id:"createfolder--",children:["createFolder ",(0,s.jsx)(i.A,{type:"Storage Provider"})," ",(0,s.jsx)(i.A,{type:"Tx"})]}),"\n",(0,s.jsx)(t.p,{children:"Send create empty object txn to greenfield chain."}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"params"}),(0,s.jsx)(t.th,{children:"description"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"bucketName"}),(0,s.jsx)(t.td,{children:"bucket name"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"objectName"}),(0,s.jsxs)(t.td,{children:["folder name, end with ",(0,s.jsx)(t.code,{children:"/"})]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"creator"}),(0,s.jsx)(t.td,{children:"the creator of object"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"visibility"}),(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"/types/visibility",children:"VisibilityType"})})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"redundancyType"}),(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"/types/redundancy",children:"RedundancyType"})})]})]})]}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-jsx",children:"const tx = await client.object.createFolder(\n {\n bucketName: createObjectInfo.bucketName,\n objectName: createObjectInfo.objectName + '/',\n creator: address,\n redundancyType: RedundancyType.REDUNDANCY_EC_TYPE,\n visibility: VisibilityType.VISIBILITY_TYPE_PRIVATE,\n }\n);\n"})}),"\n",(0,s.jsx)(c.Ay,{}),"\n",(0,s.jsx)(t.h2,{id:"createobject",children:"createObject"}),"\n",(0,s.jsx)(t.p,{children:"Creating object and send createObject txn to greenfield chain."}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"params"}),(0,s.jsx)(t.th,{children:"description"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"bucketName"}),(0,s.jsx)(t.td,{children:"bucket name"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"objectName"}),(0,s.jsx)(t.td,{children:"object name"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"creator"}),(0,s.jsx)(t.td,{children:"the creator of object"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"visibility"}),(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"/types/visibility",children:"VisibilityType"})})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"contentType"}),(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/API/File/type",children:"file type"})})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"redundancyType"}),(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"/types/redundancy",children:"RedundancyType"})})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"payloadSize"}),(0,s.jsxs)(t.td,{children:["file content ",(0,s.jsx)(t.a,{href:"/types/long",children:"Long"}),"length"]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"expectChecksums"}),(0,s.jsx)(t.td,{children:"file's expectChecksums"})]})]})]}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-jsx",children:"const tx = await client.object.createObject(\n {\n bucketName: 'bucket_name',\n objectName: 'object_name',\n creator: '0x...',\n visibility: VisibilityType.VISIBILITY_TYPE_PRIVATE,\n contentType: 'json',\n redundancyType: RedundancyType.REDUNDANCY_EC_TYPE,\n payloadSize: Long.fromInt(13311),\n expectCheckSums: expectCheckSums.map((x) => bytesFromBase64(x)),\n }\n);\n"})}),"\n",(0,s.jsx)(c.Ay,{}),"\n",(0,s.jsxs)(t.h2,{id:"deleteobject-",children:["deleteObject ",(0,s.jsx)(i.A,{type:"Tx"})]}),"\n",(0,s.jsx)(t.p,{children:"Send DeleteObject msg to greenfield chain and return txn hash."}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"params"}),(0,s.jsx)(t.th,{children:"description"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"operator"}),(0,s.jsx)(t.td,{children:"the account address of the operator who has the DeleteObject permission of the object to be deleted"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"bucketName"}),(0,s.jsx)(t.td,{children:"the name of the bucket where the object which to be deleted is stored"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"objectName"}),(0,s.jsx)(t.td,{children:"the name of the object which to be deleted"})]})]})]}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-jsx",metastring:'title="Browser / Nodejs Example"',children:"const tx = await client.object.deleteObject({\n bucketName: 'bucket_name',\n objectName: 'object_name',\n operator: '0x000..',\n});\n"})}),"\n",(0,s.jsx)(c.Ay,{}),"\n",(0,s.jsxs)(t.h2,{id:"deleteobjectpolicy-",children:["deleteObjectPolicy ",(0,s.jsx)(i.A,{type:"Tx"})]}),"\n",(0,s.jsx)(t.p,{children:"Delete the object policy of the principal."}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"params"}),(0,s.jsx)(t.th,{children:"description"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"operator"}),(0,s.jsx)(t.td,{children:"the granter who grant the permission to another principal"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"bucketName"}),(0,s.jsx)(t.td,{children:"the name of the bucket"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"objectName"}),(0,s.jsx)(t.td,{children:"the name of the object"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"principalAddr"}),(0,s.jsx)(t.td,{children:"principal address"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"principal"}),(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"/types/principal",children:"PrincipalType"})})]})]})]}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-jsx",metastring:'title="Browser / Nodejs Example"',children:"const tx = await client.object.deleteObjectPolicy(\n '0x000..', // operator\n 'bucket_name', // bucket name\n 'object_name', // object name\n '0x000..', // principalAddr\n 'PRINCIPAL_TYPE_GNFD_GROUP', // PrincipalType\n);\n"})}),"\n",(0,s.jsx)(c.Ay,{}),"\n",(0,s.jsxs)(t.h2,{id:"downloadfile-",children:["downloadFile ",(0,s.jsx)(i.A,{type:"Storage Provider"})]}),"\n",(0,s.jsx)(t.p,{children:"Download s3 object payload and return the related object info."}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"params"}),(0,s.jsx)(t.th,{children:"description"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"bucketName"}),(0,s.jsx)(t.td,{children:"bucket name"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"objectName"}),(0,s.jsx)(t.td,{children:"object name"})]})]})]}),"\n",(0,s.jsxs)(l.A,{groupId:"example",children:[(0,s.jsx)(d.A,{value:"Browser",label:"Browser",children:(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-jsx",children:"await client.object.downloadFile(\n {\n bucketName,\n objectName,\n },\n // highlight-start\n {\n type: 'EDDSA',\n address,\n domain: window.location.origin,\n seed: offChainData.seedString,\n },\n // highlight-end\n);\n"})})}),(0,s.jsx)(d.A,{value:"Nodejs",label:"Nodejs",children:(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-js",children:"await client.object.downloadFile(\n {\n bucketName,\n objectName,\n },\n // highlight-start\n {\n type: 'ECDSA',\n privateKey: ACCOUNT_PRIVATEKEY,\n },\n // highlight-end\n);\n"})})})]}),"\n",(0,s.jsxs)(t.h2,{id:"getobjectpolicy-",children:["getObjectPolicy ",(0,s.jsx)(i.A,{type:"Query"})]}),"\n",(0,s.jsx)(t.p,{children:"Get the object policy info of the user specified by principalAddr."}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"params"}),(0,s.jsx)(t.th,{children:"description"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"bucketName"}),(0,s.jsx)(t.td,{children:"bucket name"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"objectName"}),(0,s.jsx)(t.td,{children:"object name"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"principalAddr"}),(0,s.jsx)(t.td,{children:"principal address"})]})]})]}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-jsx",metastring:'title="example"',children:"const tx = await client.object.getObjectPolicy('bucket_name', 'object_name', '0x...');\n"})}),"\n",(0,s.jsxs)(t.h2,{id:"getobjectpreviewurl-",children:["getObjectPreviewUrl ",(0,s.jsx)(i.A,{type:"Storage Provider"})]}),"\n",(0,s.jsx)(t.p,{children:"Get the object preview url."}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-jsx",metastring:'title="Browser"',children:"const res = await client.object.getObjectPreviewUrl(\n {\n bucketName: 'bucket_name',\n objectName: 'object_name',\n queryMap: {\n view: '1',\n 'X-Gnfd-User-Address': address,\n 'X-Gnfd-App-Domain': window.location.origin,\n 'X-Gnfd-Expiry-Timestamp': '2023-09-03T09%3A23%3A39Z',\n },\n },\n {\n type: 'EDDSA',\n address,\n domain: window.location.origin,\n seed: offChainData.seedString,\n },\n);\n"})}),"\n",(0,s.jsxs)(t.h2,{id:"headobject-",children:["headObject ",(0,s.jsx)(i.A,{type:"Query"})]}),"\n",(0,s.jsx)(t.p,{children:"Query the objectInfo on chain to check the object id, return the object info if exists."}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"params"}),(0,s.jsx)(t.th,{children:"description"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"bucketName"}),(0,s.jsx)(t.td,{children:"bucket name"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"objectName"}),(0,s.jsx)(t.td,{children:"object name"})]})]})]}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-jsx",metastring:'title="example"',children:"await client.object.headObject(bucketName, objectName);\n"})}),"\n",(0,s.jsxs)(t.h2,{id:"headobjectbyid-",children:["headObjectById ",(0,s.jsx)(i.A,{type:"Query"})]}),"\n",(0,s.jsx)(t.p,{children:"Query the objectInfo on chain by object id, return the object info if exists."}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-jsx",metastring:'title="example"',children:"await client.object.headObjectById('12');\n"})}),"\n",(0,s.jsxs)(t.h2,{id:"listobjects-",children:["listObjects ",(0,s.jsx)(i.A,{type:"Storage Provider"})]}),"\n",(0,s.jsx)(t.p,{children:"Lists the object info of the bucket."}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"params"}),(0,s.jsx)(t.th,{children:"description"})]})}),(0,s.jsx)(t.tbody,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"bucketName"}),(0,s.jsx)(t.td,{children:"bucket name"})]})})]}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-jsx",metastring:'title="example"',children:"const res = await client.object.listObjects({\n bucketName,\n});\n"})}),"\n",(0,s.jsxs)(t.h2,{id:"listobjectsbyids-",children:["listObjectsByIds ",(0,s.jsx)(i.A,{type:"Storage Provider"})]}),"\n",(0,s.jsx)(t.p,{children:"List objects by object ids."}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"params"}),(0,s.jsx)(t.th,{children:"description"})]})}),(0,s.jsx)(t.tbody,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"ids"}),(0,s.jsx)(t.td,{children:"object ids array"})]})})]}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-jsx",metastring:'title="example"',children:"await client.object.listObjectsByIds({\n ids: ['1', '2'],\n});\n"})}),"\n",(0,s.jsxs)(t.h2,{id:"listobjectpolicies-",children:["listObjectPolicies ",(0,s.jsx)(i.A,{type:"Storage Provider"})]}),"\n",(0,s.jsx)(t.p,{children:"List object policies by object info and action type."}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"params"}),(0,s.jsx)(t.th,{children:"description"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"bucketName"}),(0,s.jsx)(t.td,{children:"bucket name"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"objectName"}),(0,s.jsx)(t.td,{children:"object name"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"actionType"}),(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"/types/action",children:"ActionType"})})]})]})]}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-jsx",metastring:'title="example"',children:"const res = await client.object.listObjectPolicies({\n bucketName: 'bucket_name',\n objectName: 'object_name',\n actionType: 'ACTION_GET_OBJECT',\n});\n"})}),"\n",(0,s.jsxs)(t.h2,{id:"putobjectpolicy-",children:["putObjectPolicy ",(0,s.jsx)(i.A,{type:"Tx"})]}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"params"}),(0,s.jsx)(t.th,{children:"description"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"operator"}),(0,s.jsx)(t.td,{children:"operator address"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"principal"}),(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"/types/principal",children:"Principal"})})]})]})]}),"\n",(0,s.jsx)(t.p,{children:"Apply object policy to the principal, return the txn hash."}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-jsx",metastring:'title="example"',children:"import { PermissionTypes } from '@bnb-chain/greenfield-js-sdk';\nconst statement: PermissionTypes.Statement = {\n effect: PermissionTypes.Effect.EFFECT_ALLOW,\n actions: [PermissionTypes.ActionType.ACTION_GET_OBJECT],\n resources: [],\n};\nawait client.object.putObjectPolicy('bucket_name', 'object_name', {\n operator: '0x...',\n statements: [statement],\n principal: {\n type: PermissionTypes.PrincipalType.PRINCIPAL_TYPE_GNFD_ACCOUNT,\n value: '0x0000000000000000000000000000000000000001',\n },\n});\n"})}),"\n",(0,s.jsx)(c.Ay,{}),"\n",(0,s.jsxs)(t.h2,{id:"updateobjectinfo-",children:["updateObjectInfo ",(0,s.jsx)(i.A,{type:"Tx"})]}),"\n",(0,s.jsx)(t.p,{children:"Update object info by sending message to greenfield."}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"params"}),(0,s.jsx)(t.th,{children:"description"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"bucketName"}),(0,s.jsx)(t.td,{children:"bucket name"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"objectName"}),(0,s.jsx)(t.td,{children:"object name"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"operator"}),(0,s.jsx)(t.td,{children:"operator address"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"visibility"}),(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"/types/visibility",children:"VisibilityType"})})]})]})]}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-jsx",metastring:'title="example"',children:"const tx = await client.object.updateObjectInfo({\n bucketName: 'bucket_name',\n objectName: 'object_name',\n operator: '0x...',\n visibility: 'VISIBILITY_TYPE_PUBLIC_READ',\n});\n"})}),"\n",(0,s.jsx)(c.Ay,{}),"\n",(0,s.jsxs)(t.h2,{id:"uploadobject-",children:["uploadObject ",(0,s.jsx)(i.A,{type:"Storage Provider"})]}),"\n",(0,s.jsx)(t.p,{children:"Uploading the object to bucket."}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"params"}),(0,s.jsx)(t.th,{children:"description"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"bucketName"}),(0,s.jsx)(t.td,{children:"bucket name"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"objectName"}),(0,s.jsx)(t.td,{children:"object name"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"body"}),(0,s.jsx)(t.td,{children:"file"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"txnHash"}),(0,s.jsxs)(t.td,{children:[(0,s.jsx)(t.a,{href:"#createobject",children:"createObject"})," 's hash"]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"authType"}),(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"/client/sp-client#authtype",children:"AuthType"})})]})]})]}),"\n",(0,s.jsxs)(l.A,{groupId:"example",children:[(0,s.jsx)(d.A,{value:"Browser",label:"Browser",children:(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-jsx",children:"const uploadRes = await client.object.uploadObject(\n {\n bucketName: createObjectInfo.bucketName,\n objectName: createObjectInfo.objectName,\n body: file,\n txnHash: txHash,\n },\n // highlight-start\n {\n type: 'EDDSA',\n domain: window.location.origin,\n seed: offChainData.seedString,\n address,\n },\n // highlight-end\n);\n"})})}),(0,s.jsx)(d.A,{value:"Nodejs",label:"Nodejs",children:(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-js",children:"const uploadRes = await client.object.uploadObject(\n {\n bucketName: bucketName,\n objectName: objectName,\n body: fileBuffer,\n txnHash: createObjectTxRes.transactionHash,\n },\n // highlight-start\n {\n type: 'ECDSA',\n privateKey: ACCOUNT_PRIVATEKEY,\n },\n // highlight-end\n);\n"})})})]})]})}function b(e={}){const{wrapper:t}={...(0,r.R)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(p,{...e})}):p(e)}},1180:(e,t,n)=>{n.d(t,{A:()=>r});n(8318);var s=n(9214);const r=e=>{const{type:t}=e;return(0,s.jsx)("span",{style:{backgroundColor:"#25c2a0",borderRadius:"5px",color:"#FFF",fontSize:14,padding:2},children:t})}},7264:(e,t,n)=>{n.d(t,{A:()=>c});n(8318);var s=n(3372);const r={tabItem:"tabItem_SosH"};var i=n(9214);function c(e){let{children:t,hidden:n,className:c}=e;return(0,i.jsx)("div",{role:"tabpanel",className:(0,s.A)(r.tabItem,c),hidden:n,children:t})}},6159:(e,t,n)=>{n.d(t,{A:()=>T});var s=n(8318),r=n(3372),i=n(2157),c=n(6325),l=n(848),d=n(5014),a=n(3799),o=n(6765);function h(e){return s.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,s.isValidElement)(e)&&function(e){const{props:t}=e;return!!t&&"object"==typeof t&&"value"in t}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function j(e){const{values:t,children:n}=e;return(0,s.useMemo)((()=>{const e=t??function(e){return h(e).map((e=>{let{props:{value:t,label:n,attributes:s,default:r}}=e;return{value:t,label:n,attributes:s,default:r}}))}(n);return function(e){const t=(0,a.X)(e,((e,t)=>e.value===t.value));if(t.length>0)throw new Error(`Docusaurus error: Duplicate values "${t.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[t,n])}function x(e){let{value:t,tabValues:n}=e;return n.some((e=>e.value===t))}function p(e){let{queryString:t=!1,groupId:n}=e;const r=(0,c.W6)(),i=function(e){let{queryString:t=!1,groupId:n}=e;if("string"==typeof t)return t;if(!1===t)return null;if(!0===t&&!n)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return n??null}({queryString:t,groupId:n});return[(0,d.aZ)(i),(0,s.useCallback)((e=>{if(!i)return;const t=new URLSearchParams(r.location.search);t.set(i,e),r.replace({...r.location,search:t.toString()})}),[i,r])]}function b(e){const{defaultValue:t,queryString:n=!1,groupId:r}=e,i=j(e),[c,d]=(0,s.useState)((()=>function(e){let{defaultValue:t,tabValues:n}=e;if(0===n.length)throw new Error("Docusaurus error: the component requires at least one children component");if(t){if(!x({value:t,tabValues:n}))throw new Error(`Docusaurus error: The has a defaultValue "${t}" but none of its children has the corresponding value. Available values are: ${n.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return t}const s=n.find((e=>e.default))??n[0];if(!s)throw new Error("Unexpected error: 0 tabValues");return s.value}({defaultValue:t,tabValues:i}))),[a,h]=p({queryString:n,groupId:r}),[b,u]=function(e){let{groupId:t}=e;const n=function(e){return e?`docusaurus.tab.${e}`:null}(t),[r,i]=(0,o.Dv)(n);return[r,(0,s.useCallback)((e=>{n&&i.set(e)}),[n,i])]}({groupId:r}),m=(()=>{const e=a??b;return x({value:e,tabValues:i})?e:null})();(0,l.A)((()=>{m&&d(m)}),[m]);return{selectedValue:c,selectValue:(0,s.useCallback)((e=>{if(!x({value:e,tabValues:i}))throw new Error(`Can't select invalid tab value=${e}`);d(e),h(e),u(e)}),[h,u,i]),tabValues:i}}var u=n(5180);const m={tabList:"tabList_u4OX",tabItem:"tabItem_nyVU"};var y=n(9214);function f(e){let{className:t,block:n,selectedValue:s,selectValue:c,tabValues:l}=e;const d=[],{blockElementScrollPositionUntilNextRender:a}=(0,i.a_)(),o=e=>{const t=e.currentTarget,n=d.indexOf(t),r=l[n].value;r!==s&&(a(t),c(r))},h=e=>{let t=null;switch(e.key){case"Enter":o(e);break;case"ArrowRight":{const n=d.indexOf(e.currentTarget)+1;t=d[n]??d[0];break}case"ArrowLeft":{const n=d.indexOf(e.currentTarget)-1;t=d[n]??d[d.length-1];break}}t?.focus()};return(0,y.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,r.A)("tabs",{"tabs--block":n},t),children:l.map((e=>{let{value:t,label:n,attributes:i}=e;return(0,y.jsx)("li",{role:"tab",tabIndex:s===t?0:-1,"aria-selected":s===t,ref:e=>d.push(e),onKeyDown:h,onClick:o,...i,className:(0,r.A)("tabs__item",m.tabItem,i?.className,{"tabs__item--active":s===t}),children:n??t},t)}))})}function g(e){let{lazy:t,children:n,selectedValue:r}=e;const i=(Array.isArray(n)?n:[n]).filter(Boolean);if(t){const e=i.find((e=>e.props.value===r));return e?(0,s.cloneElement)(e,{className:"margin-top--md"}):null}return(0,y.jsx)("div",{className:"margin-top--md",children:i.map(((e,t)=>(0,s.cloneElement)(e,{key:t,hidden:e.props.value!==r})))})}function v(e){const t=b(e);return(0,y.jsxs)("div",{className:(0,r.A)("tabs-container",m.tabList),children:[(0,y.jsx)(f,{...e,...t}),(0,y.jsx)(g,{...e,...t})]})}function T(e){const t=(0,u.A)();return(0,y.jsx)(v,{...e,children:h(e.children)},String(t))}},3159:(e,t,n)=>{n.d(t,{R:()=>c,x:()=>l});var s=n(8318);const r={},i=s.createContext(r);function c(e){const t=s.useContext(i);return s.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function l(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:c(e.components),s.createElement(i.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/5e95c892.45d0ef91.js b/assets/js/5e95c892.45d0ef91.js deleted file mode 100644 index 2fb8f472..00000000 --- a/assets/js/5e95c892.45d0ef91.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkgreenfield_js_sdk_docs=self.webpackChunkgreenfield_js_sdk_docs||[]).push([[647],{1591:(e,s,r)=>{r.r(s),r.d(s,{default:()=>t});r(8318);var d=r(3372),c=r(5679),n=r(9023),u=r(2841),a=r(5601),l=r(9214);function t(e){return(0,l.jsx)(c.e3,{className:(0,d.A)(n.G.wrapper.docsPages),children:(0,l.jsx)(a.A,{children:(0,u.v)(e.route.routes)})})}}}]); \ No newline at end of file diff --git a/assets/js/5e95c892.d7e4bd90.js b/assets/js/5e95c892.d7e4bd90.js new file mode 100644 index 00000000..335c183b --- /dev/null +++ b/assets/js/5e95c892.d7e4bd90.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkgreenfield_js_sdk_docs=self.webpackChunkgreenfield_js_sdk_docs||[]).push([[647],{2366:(e,s,r)=>{r.r(s),r.d(s,{default:()=>t});r(8318);var d=r(3372),c=r(7173),n=r(9166),u=r(2841),a=r(9098),l=r(9214);function t(e){return(0,l.jsx)(c.e3,{className:(0,d.A)(n.G.wrapper.docsPages),children:(0,l.jsx)(a.A,{children:(0,u.v)(e.route.routes)})})}}}]); \ No newline at end of file diff --git a/assets/js/601.ae42d7a2.js b/assets/js/601.ae42d7a2.js new file mode 100644 index 00000000..fa637936 --- /dev/null +++ b/assets/js/601.ae42d7a2.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkgreenfield_js_sdk_docs=self.webpackChunkgreenfield_js_sdk_docs||[]).push([[601],{4320:(e,t,n)=>{n.d(t,{A:()=>d});n(8318);var s=n(3372),i=n(6093),o=n(146),r=n(9214);function d(e){let{className:t}=e;return(0,r.jsx)("main",{className:(0,s.A)("container margin-vert--xl",t),children:(0,r.jsx)("div",{className:"row",children:(0,r.jsxs)("div",{className:"col col--6 col--offset-3",children:[(0,r.jsx)(o.A,{as:"h1",className:"hero__title",children:(0,r.jsx)(i.A,{id:"theme.NotFound.title",description:"The title of the 404 page",children:"Page Not Found"})}),(0,r.jsx)("p",{children:(0,r.jsx)(i.A,{id:"theme.NotFound.p1",description:"The first paragraph of the 404 page",children:"We could not find what you were looking for."})}),(0,r.jsx)("p",{children:(0,r.jsx)(i.A,{id:"theme.NotFound.p2",description:"The 2nd paragraph of the 404 page",children:"Please contact the owner of the site that linked you to the original URL and let them know their link is broken."})})]})})})}},7982:(e,t,n)=>{n.r(t),n.d(t,{default:()=>a});n(8318);var s=n(6093),i=n(7173),o=n(9098),r=n(4320),d=n(9214);function a(){const e=(0,s.T)({id:"theme.NotFound.title",message:"Page Not Found"});return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(i.be,{title:e}),(0,d.jsx)(o.A,{children:(0,d.jsx)(r.A,{})})]})}}}]); \ No newline at end of file diff --git a/assets/js/6e6aa86b.45881ae2.js b/assets/js/6e6aa86b.45881ae2.js deleted file mode 100644 index d11ed6c1..00000000 --- a/assets/js/6e6aa86b.45881ae2.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkgreenfield_js_sdk_docs=self.webpackChunkgreenfield_js_sdk_docs||[]).push([[300],{9319:(e,n,i)=>{i.r(n),i.d(n,{assets:()=>a,contentTitle:()=>c,default:()=>u,frontMatter:()=>o,metadata:()=>d,toc:()=>l});var t=i(9214),r=i(3159),s=i(4375);const o={id:"api-overview",title:"Overview",sidebar_position:1},c=void 0,d={id:"api/api-overview",title:"Overview",description:"The SDK contains three APIs:",source:"@site/docs/api/overview.mdx",sourceDirName:"api",slug:"/api/api-overview",permalink:"/greenfield-js-sdk/api/api-overview",draft:!1,unlisted:!1,editUrl:"https://github.com/bnb-chain/greenfield-js-sdk/tree/main/doc-site/docs/api/overview.mdx",tags:[],version:"current",sidebarPosition:1,frontMatter:{id:"api-overview",title:"Overview",sidebar_position:1},sidebar:"GettingStartSidebar",previous:{title:"API",permalink:"/greenfield-js-sdk/category/api"},next:{title:"Account",permalink:"/greenfield-js-sdk/api/account"}},a={},l=[];function p(e){const n={a:"a",li:"li",p:"p",ul:"ul",...(0,r.R)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.p,{children:"The SDK contains three APIs:"}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsx)(s.A,{type:"Tx"}),"\n",(0,t.jsx)(n.p,{children:"send message to greenfield"}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsx)(s.A,{type:"Query"}),"\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.a,{href:"https://docs.bnbchain.org/greenfield-docs/docs/api/blockchain-rest",children:"query"})," info from greenfield."]}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsx)(s.A,{type:"Storage Provider"}),"\n",(0,t.jsx)(n.p,{children:(0,t.jsx)(n.a,{href:"https://docs.bnbchain.org/greenfield-docs/docs/api/storage-provider-rest",children:"more details"})}),"\n"]}),"\n"]})]})}function u(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(p,{...e})}):p(e)}},4375:(e,n,i)=>{i.d(n,{A:()=>r});i(8318);var t=i(9214);const r=e=>{const{type:n}=e;return(0,t.jsx)("span",{style:{backgroundColor:"#25c2a0",borderRadius:"5px",color:"#FFF",fontSize:14,padding:2},children:n})}},3159:(e,n,i)=>{i.d(n,{R:()=>o,x:()=>c});var t=i(8318);const r={},s=t.createContext(r);function o(e){const n=t.useContext(s);return t.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function c(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:o(e.components),t.createElement(s.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/6e6aa86b.d4c6db47.js b/assets/js/6e6aa86b.d4c6db47.js new file mode 100644 index 00000000..10805acd --- /dev/null +++ b/assets/js/6e6aa86b.d4c6db47.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkgreenfield_js_sdk_docs=self.webpackChunkgreenfield_js_sdk_docs||[]).push([[300],{9319:(e,n,i)=>{i.r(n),i.d(n,{assets:()=>c,contentTitle:()=>a,default:()=>u,frontMatter:()=>o,metadata:()=>d,toc:()=>l});var t=i(9214),r=i(3159),s=i(1180);const o={id:"api-overview",title:"Overview",sidebar_position:1},a=void 0,d={id:"api/api-overview",title:"Overview",description:"The SDK contains three APIs:",source:"@site/docs/api/overview.mdx",sourceDirName:"api",slug:"/api/api-overview",permalink:"/greenfield-js-sdk/api/api-overview",draft:!1,unlisted:!1,editUrl:"https://github.com/bnb-chain/greenfield-js-sdk/tree/main/doc-site/docs/api/overview.mdx",tags:[],version:"current",sidebarPosition:1,frontMatter:{id:"api-overview",title:"Overview",sidebar_position:1},sidebar:"GettingStartSidebar",previous:{title:"API",permalink:"/greenfield-js-sdk/category/api"},next:{title:"Account",permalink:"/greenfield-js-sdk/api/account"}},c={},l=[];function p(e){const n={a:"a",li:"li",p:"p",ul:"ul",...(0,r.R)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.p,{children:"The SDK contains three APIs:"}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsx)(s.A,{type:"Tx"}),"\n",(0,t.jsx)(n.p,{children:"send message to greenfield"}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsx)(s.A,{type:"Query"}),"\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.a,{href:"https://greenfield-chain.bnbchain.org/openapi#/Query/",children:"query"})," info from greenfield."]}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsx)(s.A,{type:"Storage Provider"}),"\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.a,{href:"https://github.com/bnb-chain/greenfield-storage-provider/tree/master/docs/modules",children:"more details"}),"."]}),"\n"]}),"\n"]})]})}function u(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(p,{...e})}):p(e)}},1180:(e,n,i)=>{i.d(n,{A:()=>r});i(8318);var t=i(9214);const r=e=>{const{type:n}=e;return(0,t.jsx)("span",{style:{backgroundColor:"#25c2a0",borderRadius:"5px",color:"#FFF",fontSize:14,padding:2},children:n})}},3159:(e,n,i)=>{i.d(n,{R:()=>o,x:()=>a});var t=i(8318);const r={},s=t.createContext(r);function o(e){const n=t.useContext(s);return t.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function a(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:o(e.components),t.createElement(s.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/6f233aca.75a1ee93.js b/assets/js/6f233aca.75a1ee93.js deleted file mode 100644 index d85d2173..00000000 --- a/assets/js/6f233aca.75a1ee93.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkgreenfield_js_sdk_docs=self.webpackChunkgreenfield_js_sdk_docs||[]).push([[982],{182:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>c,contentTitle:()=>o,default:()=>h,frontMatter:()=>l,metadata:()=>u,toc:()=>d});var r=n(9214),a=n(3159),s=n(5303),i=n(1744);const l={id:"sp-client",sidebar_position:3,title:"Storage Provider Client"},o=void 0,u={id:"client/sp-client",title:"Storage Provider Client",description:"The API related to storage providers is troublesome.",source:"@site/docs/client/sp-client.mdx",sourceDirName:"client",slug:"/client/sp-client",permalink:"/greenfield-js-sdk/client/sp-client",draft:!1,unlisted:!1,editUrl:"https://github.com/bnb-chain/greenfield-js-sdk/tree/main/doc-site/docs/client/sp-client.mdx",tags:[],version:"current",sidebarPosition:3,frontMatter:{id:"sp-client",sidebar_position:3,title:"Storage Provider Client"},sidebar:"GettingStartSidebar",previous:{title:"Query Client",permalink:"/greenfield-js-sdk/client/query-client"},next:{title:"API",permalink:"/greenfield-js-sdk/category/api"}},c={},d=[{value:"AuthType",id:"authtype",level:2},{value:"Sp Api Example",id:"sp-api-example",level:2}];function p(e){const t={a:"a",code:"code",h2:"h2",li:"li",p:"p",pre:"pre",ul:"ul",...(0,a.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(t.p,{children:"The API related to storage providers is troublesome."}),"\n",(0,r.jsx)(t.h2,{id:"authtype",children:"AuthType"}),"\n",(0,r.jsxs)(t.p,{children:["SDK support two\n",(0,r.jsx)(t.a,{href:"https://docs.bnbchain.org/greenfield-docs/docs/api/storage-provider-rest#authentication-type",children:"authentication type"}),":"]}),"\n",(0,r.jsxs)(t.ul,{children:["\n",(0,r.jsx)(t.li,{children:"ECDSA: It is usually used on Node.js(Because it need to use a private key)"}),"\n",(0,r.jsx)(t.li,{children:"EDDSA: It is usually used in a browser"}),"\n"]}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-jsx",metastring:'title="AuthType"',children:"/**\n * ECDSA Signature\n */\nexport type ECDSA = {\n type: 'ECDSA',\n privateKey: string,\n};\n/**\n * EDDSA Signature\n */\nexport type EDDSA = {\n type: 'EDDSA',\n seed: string,\n domain: string,\n address: string,\n};\nexport type AuthType = ECDSA | EDDSA;\n"})}),"\n",(0,r.jsx)(t.h2,{id:"sp-api-example",children:"Sp Api Example"}),"\n",(0,r.jsxs)(t.p,{children:["Take ",(0,r.jsx)(t.code,{children:"getBucketReadQuota"})," as a complete example:"]}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-js",metastring:'title="offchainAuth"',children:"const getAllSps = async () => {\n const sps = await getSps();\n\n return sps.map((sp) => {\n return {\n address: sp.operatorAddress,\n endpoint: sp.endpoint,\n name: sp.description?.moniker,\n };\n });\n};\n\n// generate seed:\nconst allSps = await getAllSps();\nconst offchainAuthRes = await client.offchainauth.genOffChainAuthKeyPairAndUpload(\n {\n sps: allSps,\n chainId: GREEN_CHAIN_ID,\n expirationMs: 5 * 24 * 60 * 60 * 1000,\n domain: window.location.origin,\n address: 'your address',\n },\n provider: 'wallet provider',\n);\n"})}),"\n",(0,r.jsxs)(s.A,{children:[(0,r.jsx)(i.A,{value:"Browser",label:"Browser",children:(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-jsx",metastring:'title="browser"',children:"// request sp api\nconst bucketQuota = await client.bucket.getBucketReadQuota(\n {\n bucketName,\n },\n // highlight-start\n {\n type: 'EDDSA',\n seed: offchainAuthRes.seedString,\n domain: window.location.origin,\n address: '0x...',\n },\n // highlight-end\n);\n"})})}),(0,r.jsx)(i.A,{value:"Nodejs",label:"Nodejs",children:(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-jsx",metastring:'title="Nodejs"',children:"// request sp api\nconst bucketQuota = await client.bucket.getBucketReadQuota(\n {\n bucketName,\n },\n // highlight-start\n {\n type: 'ECDSA',\n privateKey: '0x....',\n },\n // highlight-end\n);\n"})})})]})]})}function h(e={}){const{wrapper:t}={...(0,a.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(p,{...e})}):p(e)}},1744:(e,t,n)=>{n.d(t,{A:()=>i});n(8318);var r=n(3372);const a={tabItem:"tabItem_SosH"};var s=n(9214);function i(e){let{children:t,hidden:n,className:i}=e;return(0,s.jsx)("div",{role:"tabpanel",className:(0,r.A)(a.tabItem,i),hidden:n,children:t})}},5303:(e,t,n)=>{n.d(t,{A:()=>A});var r=n(8318),a=n(3372),s=n(6888),i=n(6325),l=n(7503),o=n(8997),u=n(2554),c=n(3074);function d(e){return r.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,r.isValidElement)(e)&&function(e){const{props:t}=e;return!!t&&"object"==typeof t&&"value"in t}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function p(e){const{values:t,children:n}=e;return(0,r.useMemo)((()=>{const e=t??function(e){return d(e).map((e=>{let{props:{value:t,label:n,attributes:r,default:a}}=e;return{value:t,label:n,attributes:r,default:a}}))}(n);return function(e){const t=(0,u.X)(e,((e,t)=>e.value===t.value));if(t.length>0)throw new Error(`Docusaurus error: Duplicate values "${t.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[t,n])}function h(e){let{value:t,tabValues:n}=e;return n.some((e=>e.value===t))}function f(e){let{queryString:t=!1,groupId:n}=e;const a=(0,i.W6)(),s=function(e){let{queryString:t=!1,groupId:n}=e;if("string"==typeof t)return t;if(!1===t)return null;if(!0===t&&!n)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return n??null}({queryString:t,groupId:n});return[(0,o.aZ)(s),(0,r.useCallback)((e=>{if(!s)return;const t=new URLSearchParams(a.location.search);t.set(s,e),a.replace({...a.location,search:t.toString()})}),[s,a])]}function m(e){const{defaultValue:t,queryString:n=!1,groupId:a}=e,s=p(e),[i,o]=(0,r.useState)((()=>function(e){let{defaultValue:t,tabValues:n}=e;if(0===n.length)throw new Error("Docusaurus error: the component requires at least one children component");if(t){if(!h({value:t,tabValues:n}))throw new Error(`Docusaurus error: The has a defaultValue "${t}" but none of its children has the corresponding value. Available values are: ${n.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return t}const r=n.find((e=>e.default))??n[0];if(!r)throw new Error("Unexpected error: 0 tabValues");return r.value}({defaultValue:t,tabValues:s}))),[u,d]=f({queryString:n,groupId:a}),[m,g]=function(e){let{groupId:t}=e;const n=function(e){return e?`docusaurus.tab.${e}`:null}(t),[a,s]=(0,c.Dv)(n);return[a,(0,r.useCallback)((e=>{n&&s.set(e)}),[n,s])]}({groupId:a}),b=(()=>{const e=u??m;return h({value:e,tabValues:s})?e:null})();(0,l.A)((()=>{b&&o(b)}),[b]);return{selectedValue:i,selectValue:(0,r.useCallback)((e=>{if(!h({value:e,tabValues:s}))throw new Error(`Can't select invalid tab value=${e}`);o(e),d(e),g(e)}),[d,g,s]),tabValues:s}}var g=n(269);const b={tabList:"tabList_u4OX",tabItem:"tabItem_nyVU"};var v=n(9214);function x(e){let{className:t,block:n,selectedValue:r,selectValue:i,tabValues:l}=e;const o=[],{blockElementScrollPositionUntilNextRender:u}=(0,s.a_)(),c=e=>{const t=e.currentTarget,n=o.indexOf(t),a=l[n].value;a!==r&&(u(t),i(a))},d=e=>{let t=null;switch(e.key){case"Enter":c(e);break;case"ArrowRight":{const n=o.indexOf(e.currentTarget)+1;t=o[n]??o[0];break}case"ArrowLeft":{const n=o.indexOf(e.currentTarget)-1;t=o[n]??o[o.length-1];break}}t?.focus()};return(0,v.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,a.A)("tabs",{"tabs--block":n},t),children:l.map((e=>{let{value:t,label:n,attributes:s}=e;return(0,v.jsx)("li",{role:"tab",tabIndex:r===t?0:-1,"aria-selected":r===t,ref:e=>o.push(e),onKeyDown:d,onClick:c,...s,className:(0,a.A)("tabs__item",b.tabItem,s?.className,{"tabs__item--active":r===t}),children:n??t},t)}))})}function y(e){let{lazy:t,children:n,selectedValue:a}=e;const s=(Array.isArray(n)?n:[n]).filter(Boolean);if(t){const e=s.find((e=>e.props.value===a));return e?(0,r.cloneElement)(e,{className:"margin-top--md"}):null}return(0,v.jsx)("div",{className:"margin-top--md",children:s.map(((e,t)=>(0,r.cloneElement)(e,{key:t,hidden:e.props.value!==a})))})}function j(e){const t=m(e);return(0,v.jsxs)("div",{className:(0,a.A)("tabs-container",b.tabList),children:[(0,v.jsx)(x,{...e,...t}),(0,v.jsx)(y,{...e,...t})]})}function A(e){const t=(0,g.A)();return(0,v.jsx)(j,{...e,children:d(e.children)},String(t))}},3159:(e,t,n)=>{n.d(t,{R:()=>i,x:()=>l});var r=n(8318);const a={},s=r.createContext(a);function i(e){const t=r.useContext(s);return r.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function l(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(a):e.components||a:i(e.components),r.createElement(s.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/6f233aca.8a2a4009.js b/assets/js/6f233aca.8a2a4009.js new file mode 100644 index 00000000..84a38fbe --- /dev/null +++ b/assets/js/6f233aca.8a2a4009.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkgreenfield_js_sdk_docs=self.webpackChunkgreenfield_js_sdk_docs||[]).push([[982],{182:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>c,contentTitle:()=>o,default:()=>h,frontMatter:()=>l,metadata:()=>u,toc:()=>d});var r=n(9214),a=n(3159),s=n(6159),i=n(7264);const l={id:"sp-client",sidebar_position:3,title:"Storage Provider Client"},o=void 0,u={id:"client/sp-client",title:"Storage Provider Client",description:"The API related to storage providers is troublesome.",source:"@site/docs/client/sp-client.mdx",sourceDirName:"client",slug:"/client/sp-client",permalink:"/greenfield-js-sdk/client/sp-client",draft:!1,unlisted:!1,editUrl:"https://github.com/bnb-chain/greenfield-js-sdk/tree/main/doc-site/docs/client/sp-client.mdx",tags:[],version:"current",sidebarPosition:3,frontMatter:{id:"sp-client",sidebar_position:3,title:"Storage Provider Client"},sidebar:"GettingStartSidebar",previous:{title:"Query Client",permalink:"/greenfield-js-sdk/client/query-client"},next:{title:"API",permalink:"/greenfield-js-sdk/category/api"}},c={},d=[{value:"AuthType",id:"authtype",level:2},{value:"Sp Api Example",id:"sp-api-example",level:2}];function p(e){const t={a:"a",code:"code",h2:"h2",li:"li",p:"p",pre:"pre",ul:"ul",...(0,a.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(t.p,{children:"The API related to storage providers is troublesome."}),"\n",(0,r.jsx)(t.h2,{id:"authtype",children:"AuthType"}),"\n",(0,r.jsxs)(t.p,{children:["SDK support two\n",(0,r.jsx)(t.a,{href:"https://github.com/bnb-chain/greenfield-storage-provider/tree/master/docs/storage-provider-rest-api#authentication-type",children:"authentication type"}),":"]}),"\n",(0,r.jsxs)(t.ul,{children:["\n",(0,r.jsx)(t.li,{children:"ECDSA: It is usually used on Node.js(Because it need to use a private key)"}),"\n",(0,r.jsx)(t.li,{children:"EDDSA: It is usually used in a browser"}),"\n"]}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-jsx",metastring:'title="AuthType"',children:"/**\n * ECDSA Signature\n */\nexport type ECDSA = {\n type: 'ECDSA',\n privateKey: string,\n};\n/**\n * EDDSA Signature\n */\nexport type EDDSA = {\n type: 'EDDSA',\n seed: string,\n domain: string,\n address: string,\n};\nexport type AuthType = ECDSA | EDDSA;\n"})}),"\n",(0,r.jsx)(t.h2,{id:"sp-api-example",children:"Sp Api Example"}),"\n",(0,r.jsxs)(t.p,{children:["Take ",(0,r.jsx)(t.code,{children:"getBucketReadQuota"})," as a complete example:"]}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-js",metastring:'title="offchainAuth"',children:"const getAllSps = async () => {\n const sps = await getSps();\n\n return sps.map((sp) => {\n return {\n address: sp.operatorAddress,\n endpoint: sp.endpoint,\n name: sp.description?.moniker,\n };\n });\n};\n\n// generate seed:\nconst allSps = await getAllSps();\nconst offchainAuthRes = await client.offchainauth.genOffChainAuthKeyPairAndUpload(\n {\n sps: allSps,\n chainId: GREEN_CHAIN_ID,\n expirationMs: 5 * 24 * 60 * 60 * 1000,\n domain: window.location.origin,\n address: 'your address',\n },\n provider: 'wallet provider',\n);\n"})}),"\n",(0,r.jsxs)(s.A,{children:[(0,r.jsx)(i.A,{value:"Browser",label:"Browser",children:(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-jsx",metastring:'title="browser"',children:"// request sp api\nconst bucketQuota = await client.bucket.getBucketReadQuota(\n {\n bucketName,\n },\n // highlight-start\n {\n type: 'EDDSA',\n seed: offchainAuthRes.seedString,\n domain: window.location.origin,\n address: '0x...',\n },\n // highlight-end\n);\n"})})}),(0,r.jsx)(i.A,{value:"Nodejs",label:"Nodejs",children:(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-jsx",metastring:'title="Nodejs"',children:"// request sp api\nconst bucketQuota = await client.bucket.getBucketReadQuota(\n {\n bucketName,\n },\n // highlight-start\n {\n type: 'ECDSA',\n privateKey: '0x....',\n },\n // highlight-end\n);\n"})})})]})]})}function h(e={}){const{wrapper:t}={...(0,a.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(p,{...e})}):p(e)}},7264:(e,t,n)=>{n.d(t,{A:()=>i});n(8318);var r=n(3372);const a={tabItem:"tabItem_SosH"};var s=n(9214);function i(e){let{children:t,hidden:n,className:i}=e;return(0,s.jsx)("div",{role:"tabpanel",className:(0,r.A)(a.tabItem,i),hidden:n,children:t})}},6159:(e,t,n)=>{n.d(t,{A:()=>A});var r=n(8318),a=n(3372),s=n(2157),i=n(6325),l=n(848),o=n(5014),u=n(3799),c=n(6765);function d(e){return r.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,r.isValidElement)(e)&&function(e){const{props:t}=e;return!!t&&"object"==typeof t&&"value"in t}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the