Comments (7)
Could #5791 be responsible for this error?
Expected Option<*> definition for accountId in ContractEnvironment
I started getting this today with this new version but it works in old one so it seems like a breaking change?
from api.
It's failing on line marked bellow (old version of code) when parsing this abi.
Code:
const contract = new PinkContractPromise(
this.api,
this.registry,
contractAbi,
contractAddress,
contractKey,
);
const keyring = new Keyring({ type: 'sr25519' });
const account = keyring.addFromUri('//Alice');
const certificate = await signCertificate({ api: this.api, pair: account });
onst response = await contract.query.encryptContent(
account.address,
{
cert: certificate,
},
content,
);
return response.output.toJSON()['ok'].ok;
from api.
I'm using @phala/sdk. They've said they dont support ink v5 so maybe that's why it didn't work.
EDIT: I've completely removed phala but TX signing is still failing.
from api.
@tad3j Feels unlikely to me but not impossible. Could you share some code and steps to reproduce this? In which context is this happening?
from api.
@tad3j I was able to instantiate a ContractPromise
instance without a problem with the latest pjs version.
Here is my code:
import { ApiPromise, WsProvider } from "@polkadot/api";
import { ContractPromise } from "@polkadot/api-contract";
import abi from "./abi.json";
const wsProvider = new WsProvider(`wss://rococo-contracts-rpc.polkadot.io`);
const api = await ApiPromise.create({
provider: wsProvider,
});
const address = "5EnufwqqxnkWT6hc1LgjYWQGUsqQCtcr5192K2HuQJtRJgCi";
try {
const contract = new ContractPromise(api, abi, address);
console.log({ environment: contract.abi.environment });
} catch (error) {
console.error("Initializing contract error", error);
}
process.exit(0);
You could run it by i.e npx tsx abi.ts
Not sure what the PinkContractPromise
is about in your code. Maybe you are using some sort of wrapper library?
from api.
Strange, maybe it's issue with Phala SDK...will check.
Locking to "@polkadot/types": "10.11.3",
(version we used before) fixes the issue.
from api.
@tad3j can you share which sdk you are using? Sounds reasonable that it might cause issues with sdks building ontop of pjs. They have probably not yet upgraded their sdk and this could cause hiccups.
from api.
Related Issues (20)
- `Unable to decode storage society.candidates` when there's a vouch in the candidates list HOT 4
- Memory Leak in `query.entriesPaged`
- [Parachain] Trying to add an already reserved node 12D3KooWJb4BDK6gRLH27mYnd22igZQi6W3xraAJsvSanaccPNVx as reserved on SetId(0). HOT 6
- Rework documentation on types-support, and typegen HOT 3
- Arithmetic operations on balance.free throwing an error HOT 3
- `api.derive.accounts.identity` called with SuperIdentity doesn't return SubIdentities HOT 1
- Unable to update polkadot and kusama via `yarn build:interfaces` for v1002000 HOT 1
- `ApiPromise.create` doesn't resolve with the `ScProvier` HOT 3
- update issue templates
- [Tracking upstream] Remove `erasStakersClipped` from `api.derive.staking._erasExposure` when applicable HOT 3
- [Tracking upstream] Addition of TransactionExtension
- Support `minimumPeriod` of `0` HOT 6
- @polkadot/[email protected] references non-existing versions HOT 4
- Add decoration of runtimeApis HOT 1
- AssetId always converted to Multilocation or errors with numbers other than 0 HOT 8
- Coretime Endpoint doesn't work HOT 8
- Fix transferable balance in `api.derive.balances.all` with new formula HOT 2
- TypeError: Cannot read properties of undefined (reading 'env') HOT 1
- stakerRewards bug | Payouts HOT 19
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from api.