@witnium/witniumchain 0.28.2 → 0.29.0
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 +2 -2
- package/dist/index.d.mts +5181 -1452
- package/dist/index.d.ts +5181 -1452
- package/dist/index.js +9 -14
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +9 -14
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -757,11 +757,12 @@ var WitniumchainClient = class {
|
|
|
757
757
|
// Routing: every method here passes `service: 'chain'` to `req()`. Calls
|
|
758
758
|
// throw at call time if `chainBaseUrl` wasn't configured.
|
|
759
759
|
//
|
|
760
|
-
// Auth:
|
|
761
|
-
// chain-api (anyone can check a witness), so they send
|
|
762
|
-
//
|
|
763
|
-
//
|
|
764
|
-
//
|
|
760
|
+
// Auth: a single witness, its transactions and the contract existence
|
|
761
|
+
// check are public on chain-api (anyone can check a witness), so they send
|
|
762
|
+
// no credential. An org's witness listing and contract info are the
|
|
763
|
+
// registry owner's (BearerJWT): the accounts-issued token already carries
|
|
764
|
+
// the chain-api audience, so the same `accessToken` works unchanged
|
|
765
|
+
// against both services. So do the dashboard reads.
|
|
765
766
|
//
|
|
766
767
|
// What's NOT here: chain-api v5 WRITES (propose/sign/finalize/revoke). Those
|
|
767
768
|
// are proxied by accounts (proposeWitnessV5, etc.) so credits get reserved
|
|
@@ -769,11 +770,12 @@ var WitniumchainClient = class {
|
|
|
769
770
|
// routing rules; calling chain-api writes directly would burn credits
|
|
770
771
|
// without billing them.
|
|
771
772
|
// ════════════════════════════════════════════════════════════════════════
|
|
773
|
+
/** The registry owner's: the token's org must own `contractAddress`. */
|
|
772
774
|
getContractInfo(contractAddress) {
|
|
773
775
|
return this.req(
|
|
774
776
|
"GET",
|
|
775
777
|
`/v5/contracts/${encodeURIComponent(contractAddress)}/info`,
|
|
776
|
-
{ auth: "
|
|
778
|
+
{ auth: "BearerJWT", service: "chain" }
|
|
777
779
|
);
|
|
778
780
|
}
|
|
779
781
|
getContractVerification(contractAddress) {
|
|
@@ -787,7 +789,7 @@ var WitniumchainClient = class {
|
|
|
787
789
|
return this.req(
|
|
788
790
|
"GET",
|
|
789
791
|
`/v5/contracts/${encodeURIComponent(contractAddress)}/witnesses`,
|
|
790
|
-
{ auth: "
|
|
792
|
+
{ auth: "BearerJWT", service: "chain", query: params }
|
|
791
793
|
);
|
|
792
794
|
}
|
|
793
795
|
getWitnessV5(contractAddress, witnessId) {
|
|
@@ -811,13 +813,6 @@ var WitniumchainClient = class {
|
|
|
811
813
|
{ auth: "Public", service: "chain" }
|
|
812
814
|
);
|
|
813
815
|
}
|
|
814
|
-
getWalletBalance(address) {
|
|
815
|
-
return this.req(
|
|
816
|
-
"GET",
|
|
817
|
-
`/v5/wallets/${encodeURIComponent(address)}/balance`,
|
|
818
|
-
{ auth: "Public", service: "chain" }
|
|
819
|
-
);
|
|
820
|
-
}
|
|
821
816
|
getDashboardContract() {
|
|
822
817
|
return this.req("GET", "/v5/dashboard/contract", {
|
|
823
818
|
auth: "BearerJWT",
|