@zuhaibnoor/zigchain-sdk 1.1.0 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/circuit/ChainCircuitApi.d.ts.map +1 -1
- package/dist/circuit/ChainCircuitApi.js.map +1 -1
- package/dist/dex/ChainDexApi.d.ts.map +1 -1
- package/dist/dex/ChainDexApi.js.map +1 -1
- package/dist/distribution/ChainDistributionApi.d.ts.map +1 -1
- package/dist/distribution/ChainDistributionApi.js +0 -1
- package/dist/distribution/ChainDistributionApi.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/staking/ChainStakingApi.d.ts +1 -5
- package/dist/staking/ChainStakingApi.d.ts.map +1 -1
- package/dist/staking/ChainStakingApi.js +9 -7
- package/dist/staking/ChainStakingApi.js.map +1 -1
- package/dist/upgrade/ChainUpgradeApi.d.ts.map +1 -1
- package/dist/validator-set/ChainValidator.d.ts +8 -0
- package/dist/validator-set/ChainValidator.d.ts.map +1 -0
- package/dist/validator-set/ChainValidator.js +15 -0
- package/dist/validator-set/ChainValidator.js.map +1 -0
- package/docs/block.md +325 -38
- package/docs/circuit.md +164 -35
- package/docs/dex.md +313 -63
- package/docs/distribution.md +664 -93
- package/docs/evidence.md +117 -122
- package/docs/factory.md +308 -62
- package/docs/gov.md +268 -70
- package/docs/ibc/ibcChannel.md +736 -249
- package/docs/ibc/ibcClient.md +608 -139
- package/docs/ibc-transfer.md +349 -90
- package/docs/interchain-accounts.md +151 -48
- package/docs/mint.md +173 -36
- package/docs/runtime.md +81 -42
- package/docs/slashing.md +209 -61
- package/docs/staking.md +534 -411
- package/docs/tokenwrapper.md +221 -64
- package/docs/txs.md +447 -0
- package/docs/upgrade.md +281 -58
- package/docs/validator-set.md +177 -0
- package/package.json +1 -1
- package/docs/comet-validator-set.md +0 -70
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# ZigChain SDK
|
|
2
2
|
|
|
3
|
-
This SDK provides a simple, developer-friendly way to interact with **ZigChain
|
|
3
|
+
This SDK provides a simple, developer-friendly way to interact with **ZigChain**. It is designed to closely follow ZigChain CLI query commands while keeping the API clean, predictable, and easy to use.
|
|
4
4
|
|
|
5
5
|
The SDK is modular — each blockchain module (auth, bank, staking, gov, etc.) has its own API class and documentation file.
|
|
6
6
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChainCircuitApi.d.ts","sourceRoot":"","sources":["../../src/circuit/ChainCircuitApi.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,KAAK,EAAE,sBAAsB,EAChC,uBAAuB,EAAE,MAAM,YAAY,CAAC;AAEhD,qBAAa,eAAe;IAEzB,OAAO,CAAC,MAAM,CAAa;IAC3B,OAAO,CAAC,SAAS,CAAY;gBACjB,SAAS,EAAE,gBAAgB;IAKtC;;KAEC;IACK,qBAAqB,CAAC,OAAO,EAAC,MAAM;IAM1C;;KAEC;IACK,wBAAwB;
|
|
1
|
+
{"version":3,"file":"ChainCircuitApi.d.ts","sourceRoot":"","sources":["../../src/circuit/ChainCircuitApi.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,KAAK,EAAE,sBAAsB,EAChC,uBAAuB,EAAE,MAAM,YAAY,CAAC;AAEhD,qBAAa,eAAe;IAEzB,OAAO,CAAC,MAAM,CAAa;IAC3B,OAAO,CAAC,SAAS,CAAY;gBACjB,SAAS,EAAE,gBAAgB;IAKtC;;KAEC;IACK,qBAAqB,CAAC,OAAO,EAAC,MAAM;IAM1C;;KAEC;IACK,wBAAwB;CAOjC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChainCircuitApi.js","sourceRoot":"","sources":["../../src/circuit/ChainCircuitApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAK/C,MAAM,OAAO,eAAe;IAEjB,MAAM,CAAa;IACnB,SAAS,CAAY;IAC7B,YAAY,SAA2B;QAClC,IAAI,CAAC,MAAM,GAAG,IAAI,UAAU,CAAC,SAAS,CAAC,GAAG,CAAC,CAAA;QAC3C,IAAI,CAAC,SAAS,GAAG,IAAI,UAAU,CAAC,SAAS,CAAC,GAAG,CAAC,CAAA;IAClD,CAAC;IAED;;KAEC;IACD,KAAK,CAAC,qBAAqB,CAAC,OAAc;QACtC,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAClB,+BAA+B,OAAO,EAAE,CAC3C,CAAA;IACL,CAAC;IAED;;KAEC;IACD,KAAK,CAAC,wBAAwB;QAC1B,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CACtB,6BAA6B,CAC5B,CAAA;IACP,CAAC;
|
|
1
|
+
{"version":3,"file":"ChainCircuitApi.js","sourceRoot":"","sources":["../../src/circuit/ChainCircuitApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAK/C,MAAM,OAAO,eAAe;IAEjB,MAAM,CAAa;IACnB,SAAS,CAAY;IAC7B,YAAY,SAA2B;QAClC,IAAI,CAAC,MAAM,GAAG,IAAI,UAAU,CAAC,SAAS,CAAC,GAAG,CAAC,CAAA;QAC3C,IAAI,CAAC,SAAS,GAAG,IAAI,UAAU,CAAC,SAAS,CAAC,GAAG,CAAC,CAAA;IAClD,CAAC;IAED;;KAEC;IACD,KAAK,CAAC,qBAAqB,CAAC,OAAc;QACtC,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAClB,+BAA+B,OAAO,EAAE,CAC3C,CAAA;IACL,CAAC;IAED;;KAEC;IACD,KAAK,CAAC,wBAAwB;QAC1B,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CACtB,6BAA6B,CAC5B,CAAA;IACP,CAAC;CAGF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChainDexApi.d.ts","sourceRoot":"","sources":["../../src/dex/ChainDexApi.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AAChE,OAAO,KACH,EAAE,eAAe,EACjB,uBAAuB,EACvB,eAAe,EACf,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAEzC,qBAAa,WAAW;IACtB,OAAO,CAAC,MAAM,CAAY;gBAEd,SAAS,EAAE,gBAAgB;IAIvC;;OAEG;IACG,SAAS,CAAC,MAAM,EAAE,MAAM;IAM9B;;OAEG;IAEI,iBAAiB,CAAC,MAAM,EAAE,MAAM;IAMvC;;OAEG;IAEG,aAAa,CAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;IAMlD;;MAEE;IACG,WAAW;
|
|
1
|
+
{"version":3,"file":"ChainDexApi.d.ts","sourceRoot":"","sources":["../../src/dex/ChainDexApi.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AAChE,OAAO,KACH,EAAE,eAAe,EACjB,uBAAuB,EACvB,eAAe,EACf,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAEzC,qBAAa,WAAW;IACtB,OAAO,CAAC,MAAM,CAAY;gBAEd,SAAS,EAAE,gBAAgB;IAIvC;;OAEG;IACG,SAAS,CAAC,MAAM,EAAE,MAAM;IAM9B;;OAEG;IAEI,iBAAiB,CAAC,MAAM,EAAE,MAAM;IAMvC;;OAEG;IAEG,aAAa,CAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;IAMlD;;MAEE;IACG,WAAW;CAOlB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChainDexApi.js","sourceRoot":"","sources":["../../src/dex/ChainDexApi.ts"],"names":[],"mappings":"AA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AAiB,CAAC,MAAc;QACrC,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CACpB,+BAA+B,MAAM,EAAE,CACxC,CAAA;IACH,CAAC;IAED;;OAEG;IAEH,KAAK,CAAC,aAAa,CAAE,MAAc,EAAE,MAAc;QACjD,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAClB,2BAA2B,MAAM,IAAI,MAAM,EAAE,CAChD,CAAA;IACH,CAAC;IAEA;;MAEE;IACH,KAAK,CAAC,WAAW;QACf,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CACpB,sBAAsB,CACvB,CAAA;IACH,CAAC;CAGF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChainDistributionApi.d.ts","sourceRoot":"","sources":["../../src/distribution/ChainDistributionApi.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ChainDistributionApi.d.ts","sourceRoot":"","sources":["../../src/distribution/ChainDistributionApi.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AAChE,OAAO,KAAK,EACV,2BAA2B,EAC3B,qBAAqB,EACrB,mBAAmB,EACnB,gCAAgC,EAChC,0BAA0B,EAC1B,wBAAwB,EACxB,mCAAmC,EACnC,wBAAwB,EACxB,iCAAiC,EACjC,mCAAmC,EACpC,MAAM,YAAY,CAAA;AAEnB,qBAAa,oBAAoB;IAC/B,OAAO,CAAC,MAAM,CAAY;gBAEd,SAAS,EAAE,gBAAgB;IAIvC;;OAEG;IACG,wBAAwB,CAAC,SAAS,EAAE,MAAM;IAQhD;;OAEG;IACG,kBAAkB;IAQxB;;OAEG;IACG,wBAAwB,CAAC,SAAS,EAAE,MAAM;IAQhD;;OAEG;IACG,6BAA6B,CAAC,SAAS,EAAE,MAAM;IAQrD;;OAEG;IACG,WAAW;IASjB;;OAEG;IACG,qBAAqB,CAAC,SAAS,EAAE,MAAM;IAM7C;;OAEG;IACG,gCAAgC,CACpC,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM;IAOnB;;OAEG;IACG,qBAAqB,CAAC,SAAS,EAAE,MAAM;IAM7C;;OAEG;IACG,8BAA8B,CAAC,SAAS,EAAE,MAAM;IAMtD;;OAEG;IACG,gCAAgC,CAAC,SAAS,EAAE,MAAM;CAMzD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChainDistributionApi.js","sourceRoot":"","sources":["../../src/distribution/ChainDistributionApi.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"ChainDistributionApi.js","sourceRoot":"","sources":["../../src/distribution/ChainDistributionApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAe9C,MAAM,OAAO,oBAAoB;IACvB,MAAM,CAAY;IAE1B,YAAY,SAA2B;QACrC,IAAI,CAAC,MAAM,GAAG,IAAI,UAAU,CAAC,SAAS,CAAC,GAAG,CAAC,CAAA;IAC7C,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,wBAAwB,CAAC,SAAiB;QAC9C,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAChC,2CAA2C,SAAS,aAAa,CAClE,CAAA;QAED,OAAO,IAAI,CAAA;IACb,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,kBAAkB;QACtB,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAChC,6CAA6C,CAC9C,CAAA;QAED,OAAO,IAAI,CAAA;IACb,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,wBAAwB,CAAC,SAAiB;QAC9C,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAChC,2CAA2C,SAAS,aAAa,CAClE,CAAA;QAED,OAAO,IAAI,CAAA;IACb,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,6BAA6B,CAAC,SAAiB;QACnD,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAChC,2CAA2C,SAAS,mBAAmB,CACxE,CAAA;QAED,OAAO,IAAI,CAAA;IACb,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,WAAW;QACf,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAChC,qCAAqC,CACtC,CAAA;QAED,OAAO,IAAI,CAAA;IACb,CAAC;IAEH,4BAA4B;IAC1B;;OAEG;IACH,KAAK,CAAC,qBAAqB,CAAC,SAAiB;QAC3C,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CACpB,2CAA2C,SAAS,UAAU,CAC/D,CAAA;IACH,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,gCAAgC,CACpC,SAAiB,EACjB,SAAiB;QAEjB,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CACpB,2CAA2C,SAAS,YAAY,SAAS,EAAE,CAC5E,CAAA;IACH,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,qBAAqB,CAAC,SAAiB;QAC3C,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CACpB,2CAA2C,SAAS,UAAU,CAC/D,CAAA;IACH,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,8BAA8B,CAAC,SAAiB;QACpD,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CACpB,2CAA2C,SAAS,EAAE,CACvD,CAAA;IACH,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,gCAAgC,CAAC,SAAiB;QACtD,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CACpB,2CAA2C,SAAS,sBAAsB,CAC3E,CAAA;IACH,CAAC;CAEF"}
|
package/dist/index.d.ts
CHANGED
|
@@ -44,7 +44,7 @@ export * from './ibc-transfer/ChainIbcTransferApi.js';
|
|
|
44
44
|
export * from './ibc-transfer/types.js';
|
|
45
45
|
export * from './interchain-accounts/ChainInterChainAccApi.js';
|
|
46
46
|
export * from './interchain-accounts/types.js';
|
|
47
|
-
export * from './validator-set/
|
|
47
|
+
export * from './validator-set/ChainValidator.js';
|
|
48
48
|
export * from './validator-set/types.js';
|
|
49
49
|
export * from './txs/ChainTxsApi.js';
|
|
50
50
|
export * from './txs/types.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,kCAAkC,CAAA;AAChD,cAAc,sBAAsB,CAAA;AAEpC,cAAc,yBAAyB,CAAA;AACvC,cAAc,qBAAqB,CAAA;AAEnC,cAAc,wBAAwB,CAAA;AACtC,cAAc,iBAAiB,CAAA;AAE/B,cAAc,0BAA0B,CAAA;AACxC,cAAc,kBAAkB,CAAA;AAEhC,cAAc,yCAAyC,CAAA;AACvD,cAAc,0BAA0B,CAAA;AAExC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,oBAAoB,CAAA;AAElC,cAAc,sBAAsB,CAAA;AACpC,cAAc,gBAAgB,CAAA;AAE9B,cAAc,wBAAwB,CAAA;AACtC,cAAc,iBAAiB,CAAA;AAE/B,cAAc,0BAA0B,CAAA;AACxC,cAAc,kBAAkB,CAAA;AAEhC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,oBAAoB,CAAA;AAElC,cAAc,sBAAsB,CAAA;AACpC,cAAc,gBAAgB,CAAA;AAE9B,cAAc,wBAAwB,CAAA;AACtC,cAAc,iBAAiB,CAAA;AAE/B,cAAc,gCAAgC,CAAA;AAC9C,cAAc,qBAAqB,CAAA;AAEnC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,oBAAoB,CAAA;AAElC,cAAc,wCAAwC,CAAA;AACtD,cAAc,yBAAyB,CAAA;AAEvC,cAAc,gCAAgC,CAAA;AAC9C,cAAc,qBAAqB,CAAA;AAEnC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,oBAAoB,CAAA;AAElC,cAAc,wCAAwC,CAAA;AACtD,cAAc,yBAAyB,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AEnC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,oBAAoB,CAAA;AAElC,cAAc,wCAAwC,CAAA;AACtD,cAAc,yBAAyB,CAAA;AAEvC,cAAc,wCAAwC,CAAA;AACtD,cAAc,2BAA2B,CAAA;AAEzC,cAAc,sCAAsC,CAAA;AACpD,cAAc,0BAA0B,CAAA;AAExC,cAAc,8CAA8C,CAAA;AAC5D,cAAc,8BAA8B,CAAA;AAE5C,cAAc,uCAAuC,CAAA;AACrD,cAAc,yBAAyB,CAAA;AAEvC,cAAc,gDAAgD,CAAA;AAC9D,cAAc,gCAAgC,CAAA;AAE9C,cAAc,mCAAmC,CAAA;AACjD,cAAc,0BAA0B,CAAA;AAExC,cAAc,sBAAsB,CAAA;AACpC,cAAc,gBAAgB,CAAA;AAE9B,cAAc,8BAA8B,CAAA;AAC5C,cAAc,oBAAoB,CAAA;AAElC,cAAc,wBAAwB,CAAA;AACtC,cAAc,iBAAiB,CAAA;AAE/B,wBAAgB,aAAa,WAE5B"}
|
package/dist/index.js
CHANGED
|
@@ -44,7 +44,7 @@ export * from './ibc-transfer/ChainIbcTransferApi.js';
|
|
|
44
44
|
export * from './ibc-transfer/types.js';
|
|
45
45
|
export * from './interchain-accounts/ChainInterChainAccApi.js';
|
|
46
46
|
export * from './interchain-accounts/types.js';
|
|
47
|
-
export * from './validator-set/
|
|
47
|
+
export * from './validator-set/ChainValidator.js';
|
|
48
48
|
export * from './validator-set/types.js';
|
|
49
49
|
export * from './txs/ChainTxsApi.js';
|
|
50
50
|
export * from './txs/types.js';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,kCAAkC,CAAA;AAChD,cAAc,sBAAsB,CAAA;AAEpC,cAAc,yBAAyB,CAAA;AACvC,cAAc,qBAAqB,CAAA;AAEnC,cAAc,wBAAwB,CAAA;AACtC,cAAc,iBAAiB,CAAA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CAAA;AAExC,cAAc,sBAAsB,CAAA;AACpC,cAAc,gBAAgB,CAAA;AAE9B,cAAc,8BAA8B,CAAA;AAC5C,cAAc,oBAAoB,CAAA;AAElC,cAAc,wBAAwB,CAAA;AACtC,cAAc,iBAAiB,CAAA;AAE/B,MAAM,UAAU,aAAa;IAC3B,OAAO,oBAAoB,CAAC;AAC9B,CAAC;AAID,OAAO,CAAC,GAAG,CAAC,aAAa,EAAE,CAAC,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { NetworkEndpoints } from '../networks/endpoints.js';
|
|
2
|
-
import type { DelegationResponse, DelegationsResponse, DelegationsToResponse, DelegatorValidatorResponse, DelegatorValidatorsResponse,
|
|
2
|
+
import type { DelegationResponse, DelegationsResponse, DelegationsToResponse, DelegatorValidatorResponse, DelegatorValidatorsResponse, StakingParamsResponse, StakingPoolResponse, RedelegationResponse, UnbondingDelegationResponse, UnbondingDelegationsResponse, UnbondingFromValidatorResponse, ValidatorResponse, ValidatorsResponse } from './types.js';
|
|
3
3
|
export declare class ChainStakingApi {
|
|
4
4
|
private client;
|
|
5
5
|
constructor(endpoints: NetworkEndpoints);
|
|
@@ -24,10 +24,6 @@ export declare class ChainStakingApi {
|
|
|
24
24
|
* Query all validators info for given delegator address
|
|
25
25
|
*/
|
|
26
26
|
fetchDelegatorValidators(delegatorAddress: string): Promise<DelegatorValidatorsResponse>;
|
|
27
|
-
/**
|
|
28
|
-
* zigchaind query staking historical-info
|
|
29
|
-
*/
|
|
30
|
-
fetchHistoricalInfo(height: number | string): Promise<HistoricalInfoResponse>;
|
|
31
27
|
/**
|
|
32
28
|
* zigchaind query staking params
|
|
33
29
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChainStakingApi.d.ts","sourceRoot":"","sources":["../../src/staking/ChainStakingApi.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AAChE,OAAO,KAA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;CAQtB"}
|
|
@@ -38,13 +38,15 @@ export class ChainStakingApi {
|
|
|
38
38
|
const data = await this.client.get(`/cosmos/staking/v1beta1/delegators/${delegatorAddress}/validators`);
|
|
39
39
|
return data;
|
|
40
40
|
}
|
|
41
|
-
/**
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
async fetchHistoricalInfo(height) {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
41
|
+
// /**
|
|
42
|
+
// * zigchaind query staking historical-info
|
|
43
|
+
// */
|
|
44
|
+
// async fetchHistoricalInfo(height: number | string) {
|
|
45
|
+
// const data = await this.client.get<HistoricalInfoResponse>(
|
|
46
|
+
// `/cosmos/staking/v1beta1/historical_info/${height}`
|
|
47
|
+
// )
|
|
48
|
+
// return data
|
|
49
|
+
// }
|
|
48
50
|
/**
|
|
49
51
|
* zigchaind query staking params
|
|
50
52
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChainStakingApi.js","sourceRoot":"","sources":["../../src/staking/ChainStakingApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAoB9C,MAAM,OAAO,eAAe;IAClB,MAAM,CAAY;IAE1B,YAAY,SAA2B;QACrC,IAAI,CAAC,MAAM,GAAG,IAAI,UAAU,CAAC,SAAS,CAAC,GAAG,CAAC,CAAA;IAC7C,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,eAAe,CACnB,gBAAwB,EACxB,gBAAwB;QAExB,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAChC,sCAAsC,gBAAgB,eAAe,gBAAgB,EAAE,CACxF,CAAA;QAED,OAAO,IAAI,CAAA;IACb,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,gBAAgB,CAAC,gBAAwB;QAC7C,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAChC,uCAAuC,gBAAgB,EAAE,CAC1D,C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EACvB,MAAM,YAAY,CAAA;AAEnB,qBAAa,eAAe;IAC1B,OAAO,CAAC,MAAM,CAAY;gBAEd,SAAS,EAAE,gBAAgB;IAIvC;;;OAGG;IACG,gBAAgB
|
|
1
|
+
{"version":3,"file":"ChainUpgradeApi.d.ts","sourceRoot":"","sources":["../../src/upgrade/ChainUpgradeApi.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AAChE,OAAO,KAAK,EACV,mBAAmB,EAEnB,wBAAwB,EACxB,sBAAsB,EACvB,MAAM,YAAY,CAAA;AAEnB,qBAAa,eAAe;IAC1B,OAAO,CAAC,MAAM,CAAY;gBAEd,SAAS,EAAE,gBAAgB;IAIvC;;;OAGG;IACG,gBAAgB;IAOtB;;;OAGG;IACG,cAAc;IAMpB;;;OAGG;IACG,mBAAmB;CAK1B"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { NetworkEndpoints } from '../networks/endpoints.js';
|
|
2
|
+
import type { CometValidatorSetResponse } from './types.js';
|
|
3
|
+
export declare class ChainValidatorSetApi {
|
|
4
|
+
private client;
|
|
5
|
+
constructor(endpoints: NetworkEndpoints);
|
|
6
|
+
fetchValidatorSet(height?: number | string): Promise<CometValidatorSetResponse>;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=ChainValidator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChainValidator.d.ts","sourceRoot":"","sources":["../../src/validator-set/ChainValidator.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AAChE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAA;AAE3D,qBAAa,oBAAoB;IAC/B,OAAO,CAAC,MAAM,CAAY;gBAEd,SAAS,EAAE,gBAAgB;IAKjC,iBAAiB,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM;CAOjD"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { HttpClient } from '../client/http.js';
|
|
2
|
+
export class ChainValidatorSetApi {
|
|
3
|
+
client;
|
|
4
|
+
constructor(endpoints) {
|
|
5
|
+
this.client = new HttpClient(endpoints.lcd);
|
|
6
|
+
}
|
|
7
|
+
// Query CometBFT validator set at specific height
|
|
8
|
+
async fetchValidatorSet(height) {
|
|
9
|
+
const path = height
|
|
10
|
+
? `/cosmos/base/tendermint/v1beta1/validatorsets/${height}`
|
|
11
|
+
: `/cosmos/base/tendermint/v1beta1/validatorsets/latest`;
|
|
12
|
+
return this.client.get(path);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=ChainValidator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChainValidator.js","sourceRoot":"","sources":["../../src/validator-set/ChainValidator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAI9C,MAAM,OAAO,oBAAoB;IACvB,MAAM,CAAY;IAE1B,YAAY,SAA2B;QACrC,IAAI,CAAC,MAAM,GAAG,IAAI,UAAU,CAAC,SAAS,CAAC,GAAG,CAAC,CAAA;IAC7C,CAAC;IAED,kDAAkD;IAClD,KAAK,CAAC,iBAAiB,CAAC,MAAwB;QAC9C,MAAM,IAAI,GAAG,MAAM;YACjB,CAAC,CAAC,iDAAiD,MAAM,EAAE;YAC3D,CAAC,CAAC,sDAAsD,CAAA;QAE1D,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAA4B,IAAI,CAAC,CAAA;IACzD,CAAC;CACF"}
|
package/docs/block.md
CHANGED
|
@@ -1,7 +1,87 @@
|
|
|
1
|
-
# Block
|
|
1
|
+
# Block
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
## What does this class do?
|
|
4
|
+
|
|
5
|
+
The **Block** provides access to **raw block data** on ZigChain.
|
|
6
|
+
|
|
7
|
+
Every block contains the transactions included in it, the header metadata that links it to the rest of the chain, the validator signatures that committed it, and evidence of any misbehaviour. This class lets you retrieve any of that data by height or fetch the current chain tip.
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Important Terminology
|
|
12
|
+
|
|
13
|
+
### Block
|
|
14
|
+
|
|
15
|
+
A **block** is a sealed, immutable unit of the blockchain. Each block contains an ordered list of transactions, a header with metadata, validator commit signatures, and a link back to the previous block.
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
### Block Height
|
|
20
|
+
|
|
21
|
+
The sequential position of a block in the chain, starting from `1`. Every new block increments the height by one.
|
|
22
|
+
|
|
23
|
+
```
|
|
24
|
+
height = 2990050
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
### Block Header
|
|
30
|
+
|
|
31
|
+
Metadata that describes a block and cryptographically links it to the chain. Contains chain ID, timestamps, hashes, and the proposer address.
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
### Block Hash
|
|
36
|
+
|
|
37
|
+
A cryptographic hash uniquely identifying a block. Represented as a Base64-encoded string in responses.
|
|
38
|
+
|
|
39
|
+
```
|
|
40
|
+
hash = 'r08gjOcW8lS6yGkwecQttOBbLiKP9gjBXOx6GO75B1I='
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
### Proposer
|
|
46
|
+
|
|
47
|
+
The validator that was selected to propose (create) a given block. Identified by their consensus address.
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
### Transactions (`txs`)
|
|
52
|
+
|
|
53
|
+
Raw Base64-encoded transaction data included in the block.
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
### Last Commit
|
|
58
|
+
|
|
59
|
+
The set of validator signatures that committed the **previous block**. Each signature entry identifies the validator and confirms they voted for that block.
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
### `block` vs `sdk_block`
|
|
64
|
+
|
|
65
|
+
The response contains two representations of the same block:
|
|
66
|
+
|
|
67
|
+
| Field | Description |
|
|
68
|
+
| ----------- | --------------------------------------------------------------------------- |
|
|
69
|
+
| `block` | Raw Tendermint/CometBFT block — proposer address is raw bytes (Base64) |
|
|
70
|
+
| `sdk_block` | Cosmos SDK-enhanced block — proposer address is a bech32 `zigvalcons` address |
|
|
71
|
+
|
|
72
|
+
For most use cases, `sdk_block` is easier to work with because addresses are human-readable.
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
### Block ID Flag
|
|
77
|
+
|
|
78
|
+
Each validator signature in `last_commit.signatures` includes a `block_id_flag` indicating how that validator voted:
|
|
79
|
+
|
|
80
|
+
| Flag | Meaning |
|
|
81
|
+
| ----------------------- | -------------------------------------------- |
|
|
82
|
+
| `BLOCK_ID_FLAG_COMMIT` | Validator signed and committed this block |
|
|
83
|
+
| `BLOCK_ID_FLAG_ABSENT` | Validator did not participate |
|
|
84
|
+
| `BLOCK_ID_FLAG_NIL` | Validator voted nil (no block) |
|
|
5
85
|
|
|
6
86
|
---
|
|
7
87
|
|
|
@@ -20,78 +100,285 @@ const blockApi = new ChainBlockApi(endpoints)
|
|
|
20
100
|
|
|
21
101
|
---
|
|
22
102
|
|
|
23
|
-
|
|
103
|
+
# 1️⃣ getBlockByHeight
|
|
104
|
+
|
|
105
|
+
## Method
|
|
24
106
|
|
|
25
|
-
|
|
26
|
-
|
|
107
|
+
```ts
|
|
108
|
+
async getBlockByHeight(height: number, atHeight?: number)
|
|
109
|
+
```
|
|
27
110
|
|
|
28
|
-
|
|
111
|
+
## CLI Equivalent
|
|
29
112
|
|
|
30
113
|
```bash
|
|
31
|
-
zigchaind query block
|
|
32
|
-
zigchaind query block --height <H>
|
|
114
|
+
zigchaind query block --type=height <height>
|
|
115
|
+
zigchaind query block --type=height <height> --height <H>
|
|
33
116
|
```
|
|
34
117
|
|
|
35
|
-
|
|
118
|
+
---
|
|
119
|
+
|
|
120
|
+
## Description
|
|
121
|
+
|
|
122
|
+
Fetches the **full block data for a specific block height**.
|
|
123
|
+
|
|
124
|
+
Returns the block header, all raw transactions included in the block, validator commit signatures, and evidence. The response includes both the raw Tendermint representation (`block`) and the Cosmos SDK-enhanced representation (`sdk_block`) with human-readable addresses.
|
|
125
|
+
|
|
126
|
+
The optional `atHeight` parameter allows querying this block as seen from a specific historical chain state — useful for advanced historical state comparisons.
|
|
127
|
+
|
|
128
|
+
---
|
|
129
|
+
|
|
130
|
+
## Parameters
|
|
131
|
+
|
|
132
|
+
| Name | Type | Required | Description |
|
|
133
|
+
| -------- | ------ | -------- | ------------------------------------------------------------------------------------ |
|
|
134
|
+
| height | number | ✅ Yes | The block height to fetch |
|
|
135
|
+
| atHeight | number | ❌ No | Query the block from this historical chain state. Omit for latest state. |
|
|
136
|
+
|
|
137
|
+
> ⚠️ Using `atHeight` may fail if the node has pruned state at that height.
|
|
138
|
+
|
|
139
|
+
---
|
|
140
|
+
|
|
141
|
+
## Usage Example
|
|
142
|
+
|
|
143
|
+
**Fetch a specific block:**
|
|
36
144
|
|
|
37
145
|
```ts
|
|
38
|
-
|
|
146
|
+
const block = await blockApi.getBlockByHeight(2990050)
|
|
147
|
+
console.dir(block, { depth: null })
|
|
39
148
|
```
|
|
40
149
|
|
|
41
|
-
**
|
|
150
|
+
**Fetch a block as seen from a historical chain state:**
|
|
42
151
|
|
|
43
152
|
```ts
|
|
44
|
-
const
|
|
45
|
-
console.
|
|
153
|
+
const block = await blockApi.getBlockByHeight(2990050, 3000000)
|
|
154
|
+
console.dir(block, { depth: null })
|
|
46
155
|
```
|
|
47
156
|
|
|
48
|
-
|
|
157
|
+
## Example Response
|
|
49
158
|
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
|
|
159
|
+
```json
|
|
160
|
+
{
|
|
161
|
+
"block_id": {
|
|
162
|
+
"hash": "r08gjOcW8lS6yGkwecQttOBbLiKP9gjBXOx6GO75B1I=",
|
|
163
|
+
"part_set_header": {
|
|
164
|
+
"total": 1,
|
|
165
|
+
"hash": "Bg/0BUwDfIUGfmmzD4aPGEoB9UdkY4JIRnWe8P8t+Hc="
|
|
166
|
+
}
|
|
167
|
+
},
|
|
168
|
+
"block": {
|
|
169
|
+
"header": {
|
|
170
|
+
"version": { "block": "11", "app": "0" },
|
|
171
|
+
"chain_id": "zig-test-2",
|
|
172
|
+
"height": "2990050",
|
|
173
|
+
"time": "2025-11-08T22:46:27.230010252Z",
|
|
174
|
+
"proposer_address": "j1fOFWcZJdBrtOxW6WFT42/v65k="
|
|
175
|
+
},
|
|
176
|
+
"data": {
|
|
177
|
+
"txs": [
|
|
178
|
+
"CvADCtYDCiQvY29zbXdhc20ud2FzbS52MS5Nc2dFeGVjdXRlQ29udHJhY3QS..."
|
|
179
|
+
]
|
|
180
|
+
},
|
|
181
|
+
"evidence": { "evidence": [] },
|
|
182
|
+
"last_commit": {
|
|
183
|
+
"height": "2990049",
|
|
184
|
+
"round": 0,
|
|
185
|
+
"signatures": [
|
|
186
|
+
{
|
|
187
|
+
"block_id_flag": "BLOCK_ID_FLAG_COMMIT",
|
|
188
|
+
"validator_address": "pfDCXVd4xiHCDhc16B4iUyulD7M=",
|
|
189
|
+
"timestamp": "2025-11-08T22:46:27.230010252Z",
|
|
190
|
+
"signature": "R9qDAUn+aLgeZ0l5fAc2..."
|
|
191
|
+
}
|
|
192
|
+
]
|
|
193
|
+
}
|
|
194
|
+
},
|
|
195
|
+
"sdk_block": {
|
|
196
|
+
"header": {
|
|
197
|
+
"chain_id": "zig-test-2",
|
|
198
|
+
"height": "2990050",
|
|
199
|
+
"time": "2025-11-08T22:46:27.230010252Z",
|
|
200
|
+
"proposer_address": "zigvalcons13atuu9t8ryjaq6a5a3twjc2nudh7l6uemvgmes"
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
}
|
|
53
204
|
```
|
|
54
205
|
|
|
206
|
+
## Response Field Explanation
|
|
207
|
+
|
|
208
|
+
### `block_id`
|
|
209
|
+
|
|
210
|
+
| Field | Description |
|
|
211
|
+
| ------------------------ | ---------------------------------------------------- |
|
|
212
|
+
| hash | Base64-encoded hash uniquely identifying this block |
|
|
213
|
+
| part_set_header.total | Number of block parts (always `1` for normal blocks) |
|
|
214
|
+
| part_set_header.hash | Hash of the block part set |
|
|
215
|
+
|
|
216
|
+
### `block.header` / `sdk_block.header`
|
|
217
|
+
|
|
218
|
+
| Field | Description |
|
|
219
|
+
| -------------------- | --------------------------------------------------------------------- |
|
|
220
|
+
| version.block | CometBFT protocol version |
|
|
221
|
+
| chain_id | Network identifier (e.g. `zig-test-2`) |
|
|
222
|
+
| height | This block's height |
|
|
223
|
+
| time | Timestamp when the block was committed |
|
|
224
|
+
| last_block_id.hash | Hash of the previous block — links the chain together |
|
|
225
|
+
| last_commit_hash | Hash of the previous block's commit signatures |
|
|
226
|
+
| data_hash | Hash of the transactions in this block |
|
|
227
|
+
| validators_hash | Hash of the current validator set |
|
|
228
|
+
| next_validators_hash | Hash of the next block's validator set |
|
|
229
|
+
| app_hash | Application state hash after all transactions were applied |
|
|
230
|
+
| last_results_hash | Hash of the previous block's transaction results |
|
|
231
|
+
| evidence_hash | Hash of any misbehaviour evidence included in this block |
|
|
232
|
+
| proposer_address | In `block`: raw Base64. In `sdk_block`: bech32 `zigvalcons` address |
|
|
233
|
+
|
|
234
|
+
### `block.data`
|
|
235
|
+
|
|
236
|
+
| Field | Description |
|
|
237
|
+
| ----- | -------------------------------------------------------------------- |
|
|
238
|
+
| txs | Array of raw Base64-encoded transactions included in this block |
|
|
239
|
+
|
|
240
|
+
> An empty `txs` array means the block contained no transactions (an empty block).
|
|
241
|
+
|
|
242
|
+
### `block.last_commit`
|
|
243
|
+
|
|
244
|
+
| Field | Description |
|
|
245
|
+
| ---------- | -------------------------------------------------------- |
|
|
246
|
+
| height | Height of the block this commit finalised (current - 1) |
|
|
247
|
+
| round | Consensus round in which this block was committed |
|
|
248
|
+
| block_id | Hash reference to the previous block |
|
|
249
|
+
| signatures | Array of validator commit signatures |
|
|
250
|
+
|
|
251
|
+
Each signature entry:
|
|
252
|
+
|
|
253
|
+
| Field | Description |
|
|
254
|
+
| ----------------- | ------------------------------------------------------- |
|
|
255
|
+
| block_id_flag | Validator's vote type (`COMMIT`, `ABSENT`, or `NIL`) |
|
|
256
|
+
| validator_address | Base64-encoded validator consensus address |
|
|
257
|
+
| timestamp | When the validator signed |
|
|
258
|
+
| signature | Base64-encoded cryptographic signature |
|
|
259
|
+
|
|
260
|
+
## When to Use
|
|
261
|
+
|
|
262
|
+
* Fetching full block contents for a known height
|
|
263
|
+
* Verifying which transactions were included in a block
|
|
264
|
+
* Checking which validators signed a specific block
|
|
265
|
+
* Building block explorer block detail pages
|
|
266
|
+
* Auditing chain state at a specific point in time
|
|
267
|
+
|
|
55
268
|
---
|
|
56
269
|
|
|
57
|
-
|
|
270
|
+
# 2️⃣ getLatestBlock
|
|
271
|
+
|
|
272
|
+
## Method
|
|
58
273
|
|
|
59
|
-
|
|
60
|
-
|
|
274
|
+
```ts
|
|
275
|
+
async getLatestBlock(atHeight?: number)
|
|
276
|
+
```
|
|
61
277
|
|
|
62
|
-
|
|
278
|
+
## CLI Equivalent
|
|
63
279
|
|
|
64
280
|
```bash
|
|
65
|
-
zigchaind query block
|
|
66
|
-
zigchaind query block --
|
|
281
|
+
zigchaind query block
|
|
282
|
+
zigchaind query block --height <H>
|
|
67
283
|
```
|
|
68
284
|
|
|
69
|
-
|
|
285
|
+
---
|
|
286
|
+
|
|
287
|
+
## Description
|
|
288
|
+
|
|
289
|
+
Fetches the **most recently committed block** on the chain.
|
|
290
|
+
|
|
291
|
+
This is the equivalent of checking the current chain tip — it tells you the latest block height, when it was produced, how many transactions it contained, and which validator proposed it.
|
|
292
|
+
|
|
293
|
+
The optional `atHeight` parameter is an advanced option that queries the latest block as seen from a specific historical chain state.
|
|
294
|
+
|
|
295
|
+
---
|
|
296
|
+
|
|
297
|
+
## Parameters
|
|
298
|
+
|
|
299
|
+
| Name | Type | Required | Description |
|
|
300
|
+
| -------- | ------ | -------- | ---------------------------------------------------------------------------- |
|
|
301
|
+
| atHeight | number | ❌ No | Query from this historical chain state. Omit to query current latest block. |
|
|
302
|
+
|
|
303
|
+
---
|
|
304
|
+
|
|
305
|
+
## Usage Example
|
|
306
|
+
|
|
307
|
+
**Fetch the current latest block:**
|
|
70
308
|
|
|
71
309
|
```ts
|
|
72
|
-
|
|
310
|
+
const latestBlock = await blockApi.getLatestBlock()
|
|
311
|
+
console.dir(latestBlock, { depth: null })
|
|
73
312
|
```
|
|
74
313
|
|
|
75
|
-
**
|
|
314
|
+
**Fetch the latest block as seen from a historical state:**
|
|
76
315
|
|
|
77
316
|
```ts
|
|
78
|
-
const
|
|
79
|
-
console.
|
|
317
|
+
const latestAtHeight = await blockApi.getLatestBlock(3000000)
|
|
318
|
+
console.dir(latestAtHeight, { depth: null })
|
|
80
319
|
```
|
|
81
320
|
|
|
82
|
-
|
|
321
|
+
## Example Response
|
|
83
322
|
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
|
|
323
|
+
```json
|
|
324
|
+
{
|
|
325
|
+
"block_id": {
|
|
326
|
+
"hash": "mDilLWqtCONHxux337yRYE8VgZN84E/2I4OQ2av0ysA=",
|
|
327
|
+
"part_set_header": { "total": 1, "hash": "X3COeE3KT8GuDahnnLUXJdabG++b68n+ELxm3OJ1P1g=" }
|
|
328
|
+
},
|
|
329
|
+
"block": {
|
|
330
|
+
"header": {
|
|
331
|
+
"chain_id": "zig-test-2",
|
|
332
|
+
"height": "4600308",
|
|
333
|
+
"time": "2026-02-21T05:56:32.495366040Z",
|
|
334
|
+
"proposer_address": "kf+/IYvD2VICszA7kymoXAyX+y4="
|
|
335
|
+
},
|
|
336
|
+
"data": { "txs": [] },
|
|
337
|
+
"evidence": { "evidence": [] },
|
|
338
|
+
"last_commit": {
|
|
339
|
+
"height": "4600307",
|
|
340
|
+
"round": 0,
|
|
341
|
+
"signatures": [
|
|
342
|
+
{
|
|
343
|
+
"block_id_flag": "BLOCK_ID_FLAG_COMMIT",
|
|
344
|
+
"validator_address": "pfDCXVd4xiHCDhc16B4iUyulD7M=",
|
|
345
|
+
"timestamp": "2026-02-21T05:56:32.495335987Z",
|
|
346
|
+
"signature": "YXHcv+uwO2/qPktnHfSWjCnQ6CU4..."
|
|
347
|
+
}
|
|
348
|
+
]
|
|
349
|
+
}
|
|
350
|
+
},
|
|
351
|
+
"sdk_block": {
|
|
352
|
+
"header": {
|
|
353
|
+
"chain_id": "zig-test-2",
|
|
354
|
+
"height": "4600308",
|
|
355
|
+
"time": "2026-02-21T05:56:32.495366040Z",
|
|
356
|
+
"proposer_address": "zigvalcons1j8lm7gvtc0v4yq4nxqaex2dgtsxf07ewjvh3rh"
|
|
357
|
+
},
|
|
358
|
+
"data": { "txs": [] }
|
|
359
|
+
}
|
|
360
|
+
}
|
|
87
361
|
```
|
|
88
362
|
|
|
89
|
-
|
|
363
|
+
The response structure is identical to `getBlockByHeight` — refer to that section for the full field-by-field breakdown.
|
|
364
|
+
|
|
365
|
+
### Quick Reads from the Latest Block
|
|
366
|
+
|
|
367
|
+
Here are the most commonly needed values and where to find them:
|
|
368
|
+
|
|
369
|
+
| Information needed | Field path |
|
|
370
|
+
| --------------------------- | --------------------------------------- |
|
|
371
|
+
| Current block height | `sdk_block.header.height` |
|
|
372
|
+
| Block timestamp | `sdk_block.header.time` |
|
|
373
|
+
| Proposing validator address | `sdk_block.header.proposer_address` |
|
|
374
|
+
| Number of transactions | `sdk_block.data.txs.length` |
|
|
375
|
+
| Chain ID | `sdk_block.header.chain_id` |
|
|
90
376
|
|
|
91
|
-
##
|
|
377
|
+
## When to Use
|
|
92
378
|
|
|
93
|
-
*
|
|
94
|
-
*
|
|
95
|
-
*
|
|
379
|
+
* Getting the current block height and chain tip
|
|
380
|
+
* Checking whether the chain is live and producing blocks
|
|
381
|
+
* Syncing an indexer to the latest state
|
|
382
|
+
* Displaying live block information in dashboards or explorers
|
|
96
383
|
|
|
97
384
|
---
|