Connect2IC / connect2ic

https://connect2ic.github.io/docs/
MIT License
92 stars 19 forks source link

Providers documentation for astrox seems to be outdated. #23

Open alejandrade opened 2 years ago

alejandrade commented 2 years ago

This is the following documentation https://connect2ic.github.io/docs/docs/Core/Providers

import { AstroX } from "@connect2ic/core/providers/astrox"

const provider = new AstroX({
  // boolean
  dev: true,
  // whitelisted canisters
  whitelist: [],
  // The url for the providers frontend
  providerUrl: "https://zwbmf-zyaaa-aaaai-acjaq-cai.raw.ic0.app",
  // The canister id of the ledger canister
  ledgerCanisterId: "ryjl3-tyaaa-aaaaa-aaaba-cai",
  // The host of the ledger canister
  ledgerHost: "https://boundary.ic0.app/",
  // The host used for canisters
  host: window.location.origin,
})

the provider URL is dead and returns this error.

Replica Error (5): "IC0508: Canister zwbmf-zyaaa-aaaai-acjaq-cai is stopped and therefore does not have a CallContextManager"

When i remove the provider url the default seems to work, but when i try to make requests, it fails to verify the signature.

Server returned an error:
  Code: 403 (Forbidden)
  Body: Failed to authenticate request 0x3a22b29f9c6ad794740a81beff6f3bf893de6cfaa588bf7f541e12b721253f6e due to: Invalid delegation: Invalid canister signature: IcCanisterSignature signature could not be verified: public key 0a0000000000e00b060101cea47938c11011408c8a5b4e7dbfbf49d2212f9d5b123257bec9d28a51a0318e, signature d9d9f7a26b63657274696669636174655905c8d9d9f7a3647472656583018301830183024863616e69737465728301820458209f19326617b9a984405e0feb949b49b667f2f39e6d7d8be6aa6491f1a603f1e48301830183018204582090535d23e961a83e01bc1f766807dd5b481df7a8d658b2b9573401ec7f35a46a830183018301820458201bc32267084cf07bb88bf0aa9f24946caaf817453eca139135dce9f0f2d330268301830182045820351e145ea7fd01ff509ada3e2fcba17a36757450883eb0fd7dda70be660cd235830183018204582099d196115e4689324a811476a13aef980c699d776253d2e31bfcecc90387db4883024a0000000000e00b06010183018301830183024e6365727469666965645f6461746182035820e6ee3f2e2d1a26bc2907f5aeeff685e303cf594582f9e60638e577d996796db88204582083c56bf14dde3d28de66c692b5fc9d97e9dd985b6ad72b0fe6f84e8a8df3dcb282045820ba16d71d1ffc6ced501ea01444bf122ea461c01f72f5a8749d3e09014aca64ce82045820ad2a482a34e6b9c1457e3a3c656364b9aba42d42d62547f6a3cc33463cae2870820458208300301e71ba6f18bd4cd9c425677426f683258ff3caa43acb707cc34293164a82045820ec2d15139ac27790633d167f40aac37852b4edbb95b374743656ee375c9d02b48204582065d2a0b57fda1bc60b6b881a658c9025a4bf72fcbb4f70f26575684481b45c3982045820f88e7877bf26b61d2b9f40fe4ea38d96cc6614b61106e4fdbced10912ead2e148204582015245cff3f57e48f67947641f29f8ae81458e469f0452752900087b42017652582045820145fe8ea4a14e4e2994a319af20a0bcc35fb20ddb4f309ead04bef4f9d8ebc63820458208d090b85f3acb7da0274ded5b7b3b3dd4393920ecd4b28c98970e0b412da7c7182045820f36b29a47d79ac6a27f3e59eee89b8a0c2a8a9196a232761948997d40bc615268301820458200b2f12cf83a8a339691c0d39be38432cee1a64da8e3898bb69afdb6970823c5e83024474696d65820349f2aad7c49ed5e09217697369676e617475726558308d5dabcaec62b3d0ebcb7c9dbd5cb78b6168f47d99910376367556e542eb713c6115809293397ac091f7d33029bffecd6a64656c65676174696f6ea2697375626e65745f6964581d2ecc29447b0eef6c241dcfdf7dab077093ccd6a1266be0fe9c9b1276026b6365727469666963617465590257d9d9f7a26474726565830182045820382d9bf61c7f6b3a275dd320718a5b4386212c0f7c93326839a06558967f164683018302467375626e657483018301830182045820267fe55111b56e3c3975532ea3373f7b72e9f82072fe8e607ed34486478a5b398301830183018302581d2ecc29447b0eef6c241dcfdf7dab077093ccd6a1266be0fe9c9b127602830183024f63616e69737465725f72616e6765738203581bd9d9f781824a0000000000e0000001014a0000000000efffff010183024a7075626c69635f6b657982035885308182301d060d2b0601040182dc7c0503010201060c2b0601040182dc7c0503020103610091541cdc7b65c4828286c911602d9438de5649d698b60fc06aec73589395d0bca71746524ed2ff17b2c8da9fbc897f0f07a40b204871b6fe96d45ef10b51d1f1d530d0679a5db82de96929805fa17c737994ebcc2312d2a25bd94747ecf8f34b8204582036977d2eb5781a30f392aa49b68a99e752e3f180e7d6c65dc1155bac272096038204582070ffc8b074ec3f16c63c4ef67bfffa086f81abd71c92ca2bfb58a0fb5f6f9a18820458205aecc1f623eab105db4aa8e75d0f21527c862a4270734f62380a9acdb439bcbd820458204a1d76c08e642e3db6982e6653be8c736f275a24ac221083430b2d5b441ce754820458202d856bba7b6c80171ce8e5d121bb7e4450b3565a644d9135e9fe5884281c1fb983024474696d658203499a839c8b9e83889217697369676e61747572655830a220a865e51917b06da4d7541857b82ee63a9b6143b0b6e3e49e70e947279e986faa7ab6df3bf18d5320c762fc922dae6474726565830182045820d95dda092d572612004d667c45b8af823f31077ba10e1e65c9e63131e4c3f1e0830243736967830258200ef75b660b759da77e3eff9aeadbb06cdc37869cc7830674825b7ef16cc0acdb83025820d02ffd411971e111893b0b4692ced8f843b29a52e572359b697c5d56756daa06820340, error: certificate verification failed: failed to verify threshold signature: certificate_tree_hash=CryptoHash(0xdbe4ff2943ae695c94eb2581031f4dfdc581d2cdd29816e25da76590595b008d), sig=Blob{48 bytes;a220a865e51917b06da4d7541857b82ee63a9b6143b0b6e3e49e70e947279e986faa7ab6df3bf18d5320c762fc922dae}, pk=ThresholdSigPublicKey { internal: ThresBls12_381(0x83c13a56121ca889d316a9a5e68a1ff78752783eba63c0b6999856b868f6fac5e36feeb22438e9dfc8bb3fed007a48890d79e2f96fc57dc47ede27c88e83cee320ed2ef1f344bb3ef2a2abbb688e9f503f8c6d25175b5c2d635ba4f14c6947a2) }, error=ThresBls12_381 signature could not be verified: public key 83c13a56121ca889d316a9a5e68a1ff78752783eba63c0b6999856b868f6fac5e36feeb22438e9dfc8bb3fed007a48890d79e2f96fc57dc47ede27c88e83cee320ed2ef1f344bb3ef2a2abbb688e9f503f8c6d25175b5c2d635ba4f14c6947a2, signature a220a865e51917b06da4d7541857b82ee63a9b6143b0b6e3e49e70e947279e986faa7ab6df3bf18d5320c762fc922dae, error: Invalid combined threshold signature

    at HttpAgent.call (index.js:187:1)
    at async caller (actor.js:174:43)
    at async onFormSubmit (tax-proposal.tsx:40:1)

my code


new AstroX({
                        whitelist: whiteListedCanister,
                        host: icpHost,
                        // The canister id of the ledger canister
                        ledgerCanisterId: "ryjl3-tyaaa-aaaaa-aaaba-cai",
                        // The host of the ledger canister
                        ledgerHost: "https://boundary.ic0.app/",
                      });

For reference I'm using plug and stoic providers without any issues.