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