Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async getBigMapKeyByID(id: string, keyToEncode: string, schema: Schema): Promise {
const { key, type } = schema.EncodeBigMapKey(keyToEncode);
const { packed } = await this.context.rpc.packData({ data: key, type });
const encodedExpr = encodeExpr(packed);
const bigMapValue = await this.context.rpc.getBigMapExpr(id.toString(), encodedExpr);
return schema.ExecuteOnBigMapValue(bigMapValue, smartContractAbstractionSemantic(this)) as T;
}
async getBigMapKeyByID(id: string, keyToEncode: string, schema: Schema): Promise {
const { key, type } = schema.EncodeBigMapKey(keyToEncode);
const { packed } = await this.context.rpc.packData({ data: key, type });
const encodedExpr = encodeExpr(packed);
const bigMapValue = await this.context.rpc.getBigMapExpr(id.toString(), encodedExpr);
return schema.ExecuteOnBigMapValue(bigMapValue, smartContractAbstractionSemantic(this)) as T;
}