Skip to content

.js_ref needed in some places to make things work #40

@dan-distributive

Description

@dan-distributive

Example: this doesn't work:

id = wallet.get("id")
dcp.identity.set(id)

But this does!

id = wallet.get("id").js_ref
dcp.identity.set(id)

There are a few other places where that's the case too:
dcp.compute.marketValue() # doesn't work
vs.
dcp.compute.marketValue().js_ref. # works

Is there a clean or even a hacky way to modify bifrost2 to either generally or selectively fix these (or other) calls?

Min repro:

import dcp
dcp.init()

ks = dcp.wallet.get("id")
dcp.identity.set(ks)

Uncaught TypeError: Address must be composed of only hex digits; [object Object] is invalid
dcpEth$$Address@/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/dcp/js/node_modules/dcp-client/dist/dcp-client-bundle.js:1:1206757
62272/wallet$$Keystore/<@/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/dcp/js/node_modules/dcp-client/dist/dcp-client-bundle.js:1:1220709
wallet$$Keystore@/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/dcp/js/node_modules/dcp-client/dist/dcp-client-bundle.js:1:1223804
wallet$$IdKeystore@/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/dcp/js/node_modules/dcp-client/dist/dcp-client-bundle.js:1:1224728
identity$$set@/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/dcp/js/node_modules/dcp-client/dist/dcp-client-bundle.js:1:1127597
Uncaught Error: Python TypeError: 'NoneType' object is not callable

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions