@ownables/platform-node 0.3.0 → 0.5.1

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.
Files changed (40) hide show
  1. package/README.md +30 -0
  2. package/dist/core/src/index.d.ts +2 -0
  3. package/dist/core/src/index.d.ts.map +1 -1
  4. package/dist/core/src/index.js +2 -0
  5. package/dist/core/src/index.js.map +1 -1
  6. package/dist/core/src/interfaces/core.d.ts +5 -1
  7. package/dist/core/src/interfaces/core.d.ts.map +1 -1
  8. package/dist/core/src/ownableErrorMessage.d.ts +2 -0
  9. package/dist/core/src/ownableErrorMessage.d.ts.map +1 -0
  10. package/dist/core/src/ownableErrorMessage.js +20 -0
  11. package/dist/core/src/ownableErrorMessage.js.map +1 -0
  12. package/dist/core/src/services/EventChain.service.d.ts +2 -0
  13. package/dist/core/src/services/EventChain.service.d.ts.map +1 -1
  14. package/dist/core/src/services/EventChain.service.js +2 -1
  15. package/dist/core/src/services/EventChain.service.js.map +1 -1
  16. package/dist/core/src/services/Ownable.service.d.ts +7 -3
  17. package/dist/core/src/services/Ownable.service.d.ts.map +1 -1
  18. package/dist/core/src/services/Ownable.service.js +28 -18
  19. package/dist/core/src/services/Ownable.service.js.map +1 -1
  20. package/dist/core/src/services/Polling.service.js +1 -1
  21. package/dist/core/src/services/Polling.service.js.map +1 -1
  22. package/dist/core/src/services/WorkerRPC.service.d.ts +37 -0
  23. package/dist/core/src/services/WorkerRPC.service.d.ts.map +1 -0
  24. package/dist/core/src/services/WorkerRPC.service.js +219 -0
  25. package/dist/core/src/services/WorkerRPC.service.js.map +1 -0
  26. package/dist/core/src/services/workerSource.d.ts +2 -0
  27. package/dist/core/src/services/workerSource.d.ts.map +1 -0
  28. package/dist/core/src/services/workerSource.js +72 -0
  29. package/dist/core/src/services/workerSource.js.map +1 -0
  30. package/dist/core/src/types/EventChainStore.d.ts +1 -0
  31. package/dist/core/src/types/EventChainStore.d.ts.map +1 -1
  32. package/dist/core/src/types/OwnableRuntime.d.ts +3 -1
  33. package/dist/core/src/types/OwnableRuntime.d.ts.map +1 -1
  34. package/dist/core/src/types/TypedPackage.d.ts +3 -0
  35. package/dist/core/src/types/TypedPackage.d.ts.map +1 -1
  36. package/dist/platform-node/src/services/NodeSandboxOwnableRPC.service.d.ts +15 -12
  37. package/dist/platform-node/src/services/NodeSandboxOwnableRPC.service.d.ts.map +1 -1
  38. package/dist/platform-node/src/services/NodeSandboxOwnableRPC.service.js +114 -131
  39. package/dist/platform-node/src/services/NodeSandboxOwnableRPC.service.js.map +1 -1
  40. package/package.json +3 -2
@@ -1,165 +1,148 @@
1
- import vm from 'node:vm';
2
- import { transformSync } from '@babel/core';
3
- // @ts-expect-error - package has no shipped types
4
- import removeImportExport from 'babel-plugin-remove-import-export';
5
- import transformImportMetaUrl from '../babel/transformImportMetaUrl';
6
- function attributesToDict(attributes) {
7
- return Object.fromEntries(attributes.map(({ key, value }) => [key, value]));
8
- }
9
- function eventsToDict(events) {
10
- return events.map(({ type, attributes }) => ({
11
- type,
12
- attributes: attributesToDict(attributes),
13
- }));
14
- }
15
- function decodeBase64Json(encoded) {
16
- const json = Buffer.from(encoded, 'base64').toString('utf8');
17
- return JSON.parse(json);
18
- }
1
+ import { decode, encode } from 'cbor-x';
19
2
  export default class NodeSandboxOwnableRPC {
20
3
  ownableId = '';
21
- sandbox;
22
- stateDump = [];
23
- filename;
24
- constructor(options = {}) {
25
- this.filename = options.filename ?? '/ownable.js';
26
- }
27
- ensureSandbox() {
28
- if (!this.sandbox) {
4
+ exportsRef = null;
5
+ memory = null;
6
+ widgetWindow = null;
7
+ _queue = Promise.resolve();
8
+ constructor(id = '') {
9
+ this.ownableId = id;
10
+ }
11
+ unpackPtrLen(packed) {
12
+ const value = typeof packed === 'bigint' ? packed : BigInt(packed);
13
+ const ptr = Number(value & 0xffffffffn);
14
+ const len = Number((value >> 32n) & 0xffffffffn);
15
+ return { ptr, len };
16
+ }
17
+ ensureInitialized() {
18
+ if (!this.exportsRef || !this.memory) {
29
19
  throw new Error('Ownable runtime not initialized');
30
20
  }
31
- return this.sandbox;
21
+ return this.exportsRef;
32
22
  }
33
- runInSandbox(call, context) {
34
- const sandbox = this.ensureSandbox();
35
- for (const [key, value] of Object.entries(context)) {
36
- sandbox[key] = value;
23
+ async initialize(_js, wasm) {
24
+ const instance = (await WebAssembly.instantiate(wasm, {}));
25
+ const exportsRef = instance.exports;
26
+ if (!exportsRef.memory ||
27
+ typeof exportsRef.ownable_alloc !== 'function' ||
28
+ typeof exportsRef.ownable_free !== 'function' ||
29
+ typeof exportsRef.ownable_instantiate !== 'function' ||
30
+ typeof exportsRef.ownable_execute !== 'function' ||
31
+ typeof exportsRef.ownable_query !== 'function' ||
32
+ typeof exportsRef.ownable_external_event !== 'function') {
33
+ throw new Error('Invalid ownable runtime exports');
37
34
  }
35
+ this.exportsRef = exportsRef;
36
+ this.memory = exportsRef.memory;
37
+ }
38
+ setWidgetWindow(win) {
39
+ this.widgetWindow = win;
40
+ }
41
+ terminate() {
42
+ this.exportsRef = null;
43
+ this.memory = null;
44
+ this.widgetWindow = null;
45
+ }
46
+ invoke(type, inputBytes) {
47
+ const exportsRef = this.ensureInitialized();
48
+ const memory = this.memory;
49
+ const len = inputBytes.length >>> 0;
50
+ const inPtr = exportsRef.ownable_alloc(len);
51
+ if (len > 0)
52
+ new Uint8Array(memory.buffer, inPtr, len).set(inputBytes);
53
+ let packed;
38
54
  try {
39
- vm.runInContext(`result = ${call}`, sandbox);
40
- return sandbox.result;
55
+ switch (type) {
56
+ case 'instantiate':
57
+ packed = exportsRef.ownable_instantiate(inPtr, len);
58
+ break;
59
+ case 'execute':
60
+ packed = exportsRef.ownable_execute(inPtr, len);
61
+ break;
62
+ case 'query':
63
+ packed = exportsRef.ownable_query(inPtr, len);
64
+ break;
65
+ case 'external_event':
66
+ packed = exportsRef.ownable_external_event(inPtr, len);
67
+ break;
68
+ default:
69
+ throw new Error(`unknown message type ${type}`);
70
+ }
41
71
  }
42
72
  finally {
43
- for (const key of Object.keys(context)) {
44
- delete sandbox[key];
45
- }
46
- delete sandbox.result;
73
+ exportsRef.ownable_free(inPtr, len);
47
74
  }
75
+ const { ptr: outPtr, len: outLen } = this.unpackPtrLen(packed);
76
+ const output = outLen > 0
77
+ ? new Uint8Array(new Uint8Array(memory.buffer, outPtr, outLen))
78
+ : new Uint8Array();
79
+ if (outLen > 0)
80
+ exportsRef.ownable_free(outPtr, outLen);
81
+ return output;
48
82
  }
49
- normalizeModule(js) {
50
- const output = transformSync(js, {
51
- filename: this.filename,
52
- babelrc: false,
53
- configFile: false,
54
- plugins: [removeImportExport, transformImportMetaUrl],
55
- });
56
- if (!output?.code) {
57
- throw new Error('Unable to transform ownable module source');
83
+ decodeEnvelope(output) {
84
+ const envelope = decode(output);
85
+ if (!envelope.success) {
86
+ throw new Error(`Ownable ABI call failed: ${envelope.error_code || 'UNKNOWN'} ${envelope.error_message || ''}`.trim());
58
87
  }
59
- return output.code;
60
- }
61
- syncState(result) {
62
- const memJson = result.get('mem');
63
- const mem = typeof memJson === 'string' ? JSON.parse(memJson) : { state_dump: this.stateDump };
64
- this.stateDump = mem.state_dump;
65
- return this.stateDump;
66
- }
67
- parseStateResult(result) {
68
- const responseJson = result.has('state') ? result.get('state') : result.get('result');
69
- if (typeof responseJson !== 'string') {
70
- throw new Error('Invalid ownable runtime response');
71
- }
72
- return JSON.parse(responseJson);
88
+ const payload = envelope.payload ?? new Uint8Array();
89
+ return decode(payload);
73
90
  }
74
- async init(id, js, wasm) {
75
- this.ownableId = id;
76
- this.stateDump = [];
77
- const sandboxObject = {
78
- TextEncoder,
79
- TextDecoder,
80
- WebAssembly,
81
- Buffer,
82
- console,
83
- setTimeout,
84
- clearTimeout,
85
- URL,
86
- __filename: this.filename,
87
- mem: { state_dump: [] },
91
+ workerCall(type, request, state) {
92
+ const call = async () => {
93
+ const input = encode(request);
94
+ const output = this.invoke(type, input);
95
+ const decoded = this.decodeEnvelope(output);
96
+ return {
97
+ response: decoded.result,
98
+ state: decoded.mem?.state_dump ?? state ?? [],
99
+ };
88
100
  };
89
- this.sandbox = vm.createContext(sandboxObject);
90
- const normalized = this.normalizeModule(js);
91
- vm.runInContext(normalized, this.sandbox);
92
- const initFn = this.runInSandbox('(typeof __wbg_init !== "undefined" ? __wbg_init : (typeof init !== "undefined" ? init : undefined))', {});
93
- if (typeof initFn !== 'function') {
94
- throw new Error('Unable to locate wasm init function in ownable module');
95
- }
96
- return await initFn(wasm);
101
+ const next = this._queue.then(call, call);
102
+ this._queue = next.catch(() => { });
103
+ return next;
104
+ }
105
+ attributesToDict(attributes) {
106
+ return Object.fromEntries(attributes.map((a) => [a.key, a.value]));
97
107
  }
98
108
  async instantiate(msg, info) {
99
- const payload = { ...msg };
100
- if (!('nft' in payload))
101
- payload.nft = undefined;
102
- if (!('ownable_type' in payload))
103
- payload.ownable_type = undefined;
104
- if (typeof payload.network_id === 'string') {
105
- payload.network_id = payload.network_id.charCodeAt(0);
106
- }
107
- const result = (await this.runInSandbox('instantiate_contract(msg, info)', {
108
- msg: payload,
109
- info,
110
- }));
111
- const response = this.parseStateResult(result);
112
- const state = this.syncState(result);
109
+ const { response, state } = await this.workerCall('instantiate', { msg, info });
110
+ const parsed = decode(response);
113
111
  return {
114
- attributes: attributesToDict(response.attributes),
112
+ attributes: this.attributesToDict(parsed.attributes),
115
113
  state,
116
114
  };
117
115
  }
118
- async execute(msg, info, state) {
119
- const result = (await this.runInSandbox('execute_contract(msg, info, mem)', {
120
- msg,
121
- info,
122
- mem: { state_dump: state },
123
- }));
124
- const response = this.parseStateResult(result);
125
- const nextState = this.syncState(result);
116
+ toExecuteResult(response, state) {
126
117
  return {
127
- attributes: attributesToDict(response.attributes),
128
- events: eventsToDict(response.events || []),
129
- data: response.data,
130
- state: nextState,
118
+ attributes: this.attributesToDict(response.attributes),
119
+ events: (response.events || []).map((e) => ({
120
+ type: e.type,
121
+ attributes: this.attributesToDict(e.attributes),
122
+ })),
123
+ data: response.data ?? '',
124
+ state,
131
125
  };
132
126
  }
127
+ async execute(msg, info, state) {
128
+ const { response, state: newState } = await this.workerCall('execute', { msg, info, mem: { state_dump: state } }, state);
129
+ return this.toExecuteResult(decode(response), newState);
130
+ }
133
131
  async externalEvent(msg, info, state) {
134
- const result = (await this.runInSandbox('register_external_event(msg.msg, info, ownable_id, mem)', {
135
- msg,
132
+ const { response, state: newState } = await this.workerCall('external_event', {
133
+ msg: msg.msg,
136
134
  info,
137
135
  ownable_id: this.ownableId,
138
136
  mem: { state_dump: state },
139
- }));
140
- const response = this.parseStateResult(result);
141
- const nextState = this.syncState(result);
142
- return {
143
- attributes: attributesToDict(response.attributes),
144
- events: eventsToDict(response.events || []),
145
- data: response.data,
146
- state: nextState,
147
- };
148
- }
149
- async queryRaw(msg, state) {
150
- const result = (await this.runInSandbox('query_contract_state(msg, mem)', {
151
- msg,
152
- mem: { state_dump: state },
153
- }));
154
- const parsed = this.parseStateResult(result);
155
- return parsed;
137
+ }, state);
138
+ return this.toExecuteResult(decode(response), newState);
156
139
  }
157
140
  async query(msg, state) {
158
- const encoded = await this.queryRaw(msg, state);
159
- return decodeBase64Json(encoded);
141
+ const { response } = await this.workerCall('query', { msg, mem: { state_dump: state } }, state);
142
+ return JSON.parse(Buffer.from(response).toString('utf8'));
160
143
  }
161
144
  async refresh(_state) {
162
- // Node runtime has no iframe/widget to refresh.
145
+ // Node runtime has no widget window refresh target.
163
146
  }
164
147
  }
165
148
  //# sourceMappingURL=NodeSandboxOwnableRPC.service.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"NodeSandboxOwnableRPC.service.js","sourceRoot":"","sources":["../../../../src/services/NodeSandboxOwnableRPC.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,kDAAkD;AAClD,OAAO,kBAAkB,MAAM,mCAAmC,CAAC;AAGnE,OAAO,sBAAsB,MAAM,iCAAiC,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AAG;YACZ,IAAI;YACJ,UAAU,EAAE,IAAI,CAAC,SAAS;YAC1B,GAAG,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE;SAC3B,EACD,KAAK,CACN,CAAC;QACF,OAAO,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,QAAQ,CAAgB,EAAE,QAAQ,CAAC,CAAC;IACzE,CAAC;IAED,KAAK,CAAC,KAAK,CAAC,GAAc,EAAE,KAAgB;QAC1C,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE,EAAE,EAAE,KAAK,CAAC,CAAC;QAChG,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC;IAC5D,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,MAAiB;QAC7B,oDAAoD;IACtD,CAAC;CACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ownables/platform-node",
3
- "version": "0.3.0",
3
+ "version": "0.5.1",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -9,9 +9,10 @@
9
9
  ],
10
10
  "dependencies": {
11
11
  "@babel/core": "^7.28.4",
12
- "@ownables/core": "0.3.0",
12
+ "@ownables/core": "0.5.1",
13
13
  "any-bucket": "^0.1.6",
14
14
  "babel-plugin-remove-import-export": "^1.1.1",
15
+ "cbor-x": "^1.6.0",
15
16
  "jszip": "^3.10.1"
16
17
  },
17
18
  "scripts": {