From 18a8c00cd7e88c4ab5a13142242e0b41997bc524 Mon Sep 17 00:00:00 2001 From: aaroncox Date: Mon, 31 Aug 2026 20:21:08 -0700 Subject: [PATCH 01/10] Replace the create-account dependency with a local AccountCreator --- .../account-creation-plugin-metamask/Makefile | 1 + .../package.json | 1 - .../src/account-creator.ts | 75 +++++++++++++++++++ .../src/index.ts | 18 ++--- .../test/setup.ts | 6 ++ .../test/tests/account-creator.ts | 57 ++++++++++++++ .../test/tests/common.ts | 22 ------ .../test/tests/mocks/ethereum.ts | 42 ----------- 8 files changed, 145 insertions(+), 77 deletions(-) create mode 100644 packages/account-creation-plugin-metamask/src/account-creator.ts create mode 100644 packages/account-creation-plugin-metamask/test/setup.ts create mode 100644 packages/account-creation-plugin-metamask/test/tests/account-creator.ts delete mode 100644 packages/account-creation-plugin-metamask/test/tests/common.ts delete mode 100644 packages/account-creation-plugin-metamask/test/tests/mocks/ethereum.ts diff --git a/packages/account-creation-plugin-metamask/Makefile b/packages/account-creation-plugin-metamask/Makefile index 3543f49d..daf9e431 100644 --- a/packages/account-creation-plugin-metamask/Makefile +++ b/packages/account-creation-plugin-metamask/Makefile @@ -1,3 +1,4 @@ MOCK_DIR := ./test/data +MOCHA_EXTRA := -r test/setup.ts include ../../common.mk diff --git a/packages/account-creation-plugin-metamask/package.json b/packages/account-creation-plugin-metamask/package.json index 9de91a0b..6e8f8b73 100644 --- a/packages/account-creation-plugin-metamask/package.json +++ b/packages/account-creation-plugin-metamask/package.json @@ -17,7 +17,6 @@ ], "scripts": {}, "dependencies": { - "@greymass/create-account": "^1.1.0", "@metamask/providers": "^17.0.0", "@wharfkit/session": "workspace:*" }, diff --git a/packages/account-creation-plugin-metamask/src/account-creator.ts b/packages/account-creation-plugin-metamask/src/account-creator.ts new file mode 100644 index 00000000..be71944f --- /dev/null +++ b/packages/account-creation-plugin-metamask/src/account-creator.ts @@ -0,0 +1,75 @@ +export interface AccountCreationOptions { + /** Fully built account creation service URL, query string included. */ + url: string +} + +export interface AccountCreationPayload { + /** Name of the account that was created. */ + sa: string + /** Permission the keys were assigned to, e.g. "active". */ + sp: string +} + +export class AccountCreator { + private popupWindow?: Window + private origin: string + private popupStatusInterval?: ReturnType + + constructor(public readonly options: AccountCreationOptions) { + this.origin = new URL(options.url).origin + } + + async createAccount(): Promise { + this.popupWindow = window.open( + this.options.url, + 'targetWindow', + `toolbar=no, + location=no, + status=no, + menubar=no, + scrollbars=yes, + resizable=yes, + width=400, + height=600` + )! + + return new Promise((resolve, reject) => { + const finish = (complete: () => void) => { + window.removeEventListener('message', listener) + this.closeDialog() + complete() + } + const listener = (event: MessageEvent) => { + if (event.origin !== this.origin) { + return + } + if (event.data?.error) { + finish(() => reject(new Error(event.data.error))) + } else if (event.data?.sa && event.data?.sp) { + finish(() => resolve(event.data)) + } + } + window.addEventListener('message', listener) + + this.popupStatusInterval = setInterval(() => { + if (this.popupWindow && this.popupWindow.closed) { + finish(() => reject(new Error('Popup window closed'))) + } + }, 500) + }) + } + + closeDialog() { + this.popupWindow?.close() + + this.cleanup() + } + + cleanup() { + if (this.popupStatusInterval) { + clearInterval(this.popupStatusInterval) + } + this.popupStatusInterval = undefined + this.popupWindow = undefined + } +} diff --git a/packages/account-creation-plugin-metamask/src/index.ts b/packages/account-creation-plugin-metamask/src/index.ts index 2f68957e..b76983c9 100644 --- a/packages/account-creation-plugin-metamask/src/index.ts +++ b/packages/account-creation-plugin-metamask/src/index.ts @@ -1,4 +1,3 @@ -import {AccountCreator} from '@greymass/create-account' import { AbstractAccountCreationPlugin, AccountCreationPlugin, @@ -10,6 +9,7 @@ import { } from '@wharfkit/session' import {AccountCreationPluginMetadata} from '@wharfkit/session' import {MetaMaskInpageProvider, RequestArguments} from '@metamask/providers' +import {AccountCreator} from './account-creator' import {checkIsFlask, getSnapsProvider, InvokeSnapParams, Snap} from './metamask' export type GetSnapsResponse = Record @@ -88,19 +88,13 @@ export class AccountCreationPluginMetamask qs.set('owner_key', String(ownerPublicKey)) qs.set('active_key', String(activePublicKey)) const accountCreator = new AccountCreator({ - supportedChains: [String(currentChain.id)], - fullCreationServiceUrl: `${this.accountCreationServiceUrl}?${qs.toString()}`, - scope: context.appName || 'Antelope App', + url: `${this.accountCreationServiceUrl}?${qs.toString()}`, }) - const accountCreationResponse = await accountCreator.createAccount() + const {sa} = await accountCreator.createAccount() - if ('sa' in accountCreationResponse && 'sp' in accountCreationResponse) { - return { - accountName: accountCreationResponse.sa, - chain: context.chain, - } - } else { - throw new Error(accountCreationResponse.error) + return { + accountName: sa, + chain: context.chain, } } diff --git a/packages/account-creation-plugin-metamask/test/setup.ts b/packages/account-creation-plugin-metamask/test/setup.ts new file mode 100644 index 00000000..d09c17de --- /dev/null +++ b/packages/account-creation-plugin-metamask/test/setup.ts @@ -0,0 +1,6 @@ +import {JSDOM} from 'jsdom' + +const dom = new JSDOM('', {url: 'http://localhost'}) + +global.window = dom.window as any +global.document = dom.window.document as any diff --git a/packages/account-creation-plugin-metamask/test/tests/account-creator.ts b/packages/account-creation-plugin-metamask/test/tests/account-creator.ts new file mode 100644 index 00000000..99fedc12 --- /dev/null +++ b/packages/account-creation-plugin-metamask/test/tests/account-creator.ts @@ -0,0 +1,57 @@ +import {assert} from 'chai' + +import {AccountCreator} from '../../src/account-creator' + +const serviceUrl = 'https://eos.account.unicove.com/buy?supported_chains=aca376f2' +const serviceOrigin = 'https://eos.account.unicove.com' + +function mockPopup() { + const popup = { + closed: false, + close() { + this.closed = true + }, + } + ;(window as any).open = () => popup + return popup +} + +function post(data: any, origin: string) { + window.dispatchEvent(new (window as any).MessageEvent('message', {data, origin})) +} + +suite('AccountCreator', function () { + test('resolves with the account reported by the service', async function () { + mockPopup() + const result = new AccountCreator({url: serviceUrl}).createAccount() + post({sa: 'wharfkit1111', sp: 'active'}, serviceOrigin) + assert.deepEqual(await result, {sa: 'wharfkit1111', sp: 'active'}) + }) + + test('ignores messages from another origin', async function () { + mockPopup() + const result = new AccountCreator({url: serviceUrl}).createAccount() + post({sa: 'attacker1111', sp: 'active'}, 'https://example.com') + const settled = await Promise.race([ + result, + new Promise((resolve) => setTimeout(() => resolve('pending'), 10)), + ]) + assert.equal(settled, 'pending') + post({sa: 'wharfkit1111', sp: 'active'}, serviceOrigin) + assert.equal((await result).sa, 'wharfkit1111') + }) + + test('rejects when the popup is closed first', async function () { + const popup = mockPopup() + const result = new AccountCreator({url: serviceUrl}).createAccount() + popup.closed = true + let error: Error | undefined + try { + await result + } catch (caught) { + error = caught as Error + } + assert.instanceOf(error, Error) + assert.equal(error?.message, 'Popup window closed') + }) +}) diff --git a/packages/account-creation-plugin-metamask/test/tests/common.ts b/packages/account-creation-plugin-metamask/test/tests/common.ts deleted file mode 100644 index 77a22512..00000000 --- a/packages/account-creation-plugin-metamask/test/tests/common.ts +++ /dev/null @@ -1,22 +0,0 @@ -import {Chains, SessionKit} from '@wharfkit/session' -import {mockSessionKitArgs} from '@wharfkit/mock-data' - -import {AccountCreationPluginMetamask} from '$lib' -import {setupEthereumMock} from './mocks/ethereum' - -suite('AccountCreationPluginMetamask', function () { - setup(function () { - setupEthereumMock() // Set up the Ethereum mock before each test - }) - test('createAccount', async function () { - const kit = new SessionKit(mockSessionKitArgs, { - accountCreationPlugins: [new AccountCreationPluginMetamask()], - }) - // This will throw an error because we are not mocking the - // browser environment or the Metamask provider in this test - // const result = await kit.createAccount({ - // chain: Chains.EOS, - // pluginId: 'account-creation-plugin-metamask', - // }) - }) -}) diff --git a/packages/account-creation-plugin-metamask/test/tests/mocks/ethereum.ts b/packages/account-creation-plugin-metamask/test/tests/mocks/ethereum.ts deleted file mode 100644 index a454e0a0..00000000 --- a/packages/account-creation-plugin-metamask/test/tests/mocks/ethereum.ts +++ /dev/null @@ -1,42 +0,0 @@ -/// - -import {MetaMaskInpageProvider} from '@metamask/providers' - -class MockMetaMaskInpageProvider implements Partial { - request(args: {method: string; params?: any}) { - switch (args.method) { - case 'wallet_getSnaps': - return Promise.resolve({}) - case 'wallet_requestSnaps': - return Promise.resolve({ - 'local:http://localhost:8080': { - id: 'local:http://localhost:8080', - version: '1.0.0', - }, - }) - case 'wallet_invokeSnap': - if (args.params.request.method === 'antelope_getPublicKey') { - return Promise.resolve( - 'PUB_K1_6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5BoDq63' - ) - } - if (args.params.request.method === 'antelope_signTransaction') { - return Promise.resolve( - 'SIG_K1_KfCdjsrTnx5cBpbA5cUdHZAsRYsnC9uKzuS1shFeqfMCfdZwX4PBm9pfHwGRT6ffz3eavhtkyNci5GoFozQAx8P8PBnDmj' - ) - } - return Promise.resolve(null) - case 'web3_clientVersion': - return Promise.resolve(['MetaMask/v10.8.1']) - default: - return Promise.resolve(null) - } - } -} - -const mockProvider = new MockMetaMaskInpageProvider() - -export function setupEthereumMock() { - global.window = global.window || {} - global.window.ethereum = mockProvider as any -} From 1b6130954e9703318a0dbd3de5535b7832acd333 Mon Sep 17 00:00:00 2001 From: aaroncox Date: Mon, 31 Aug 2026 20:22:11 -0700 Subject: [PATCH 02/10] Fix the service URL handling in the Anchor account creator --- .../account-creation-plugin-anchor/Makefile | 1 + .../src/account-creator.ts | 3 +- .../src/index.ts | 1 + .../test/setup.ts | 6 ++ .../test/tests/account-creator.ts | 61 +++++++++++++++++++ .../test/tests/common.ts | 42 ------------- 6 files changed, 71 insertions(+), 43 deletions(-) create mode 100644 packages/account-creation-plugin-anchor/test/setup.ts create mode 100644 packages/account-creation-plugin-anchor/test/tests/account-creator.ts delete mode 100644 packages/account-creation-plugin-anchor/test/tests/common.ts diff --git a/packages/account-creation-plugin-anchor/Makefile b/packages/account-creation-plugin-anchor/Makefile index 3543f49d..daf9e431 100644 --- a/packages/account-creation-plugin-anchor/Makefile +++ b/packages/account-creation-plugin-anchor/Makefile @@ -1,3 +1,4 @@ MOCK_DIR := ./test/data +MOCHA_EXTRA := -r test/setup.ts include ../../common.mk diff --git a/packages/account-creation-plugin-anchor/src/account-creator.ts b/packages/account-creation-plugin-anchor/src/account-creator.ts index fc533d5f..1bff77ef 100644 --- a/packages/account-creation-plugin-anchor/src/account-creator.ts +++ b/packages/account-creation-plugin-anchor/src/account-creator.ts @@ -53,8 +53,9 @@ export class AccountCreator { )! return new Promise((resolve, reject) => { + const origin = new URL(this.creationServiceUrl).origin const listener = (event: MessageEvent) => { - if (event.origin === this.creationServiceUrl) { + if (event.origin === origin) { window.removeEventListener('message', listener) this.closeDialog() diff --git a/packages/account-creation-plugin-anchor/src/index.ts b/packages/account-creation-plugin-anchor/src/index.ts index 1b75c824..c2848a82 100644 --- a/packages/account-creation-plugin-anchor/src/index.ts +++ b/packages/account-creation-plugin-anchor/src/index.ts @@ -68,6 +68,7 @@ export class AccountCreationPluginAnchor */ async create(context: CreateAccountContext): Promise { const accountCreator = new AccountCreator({ + creationServiceUrl: this.config.serviceUrl, supportedChains: context.chain ? [context.chain.id] : (context.chains || this.config.supportedChains || []).map((chain) => chain.id), diff --git a/packages/account-creation-plugin-anchor/test/setup.ts b/packages/account-creation-plugin-anchor/test/setup.ts new file mode 100644 index 00000000..d09c17de --- /dev/null +++ b/packages/account-creation-plugin-anchor/test/setup.ts @@ -0,0 +1,6 @@ +import {JSDOM} from 'jsdom' + +const dom = new JSDOM('', {url: 'http://localhost'}) + +global.window = dom.window as any +global.document = dom.window.document as any diff --git a/packages/account-creation-plugin-anchor/test/tests/account-creator.ts b/packages/account-creation-plugin-anchor/test/tests/account-creator.ts new file mode 100644 index 00000000..d493c924 --- /dev/null +++ b/packages/account-creation-plugin-anchor/test/tests/account-creator.ts @@ -0,0 +1,61 @@ +import {assert} from 'chai' + +import {AccountCreator} from '../../src/account-creator' + +const serviceUrl = 'https://create.anchor.link/nested' +const serviceOrigin = 'https://create.anchor.link' + +function mockPopup() { + const popup = { + closed: false, + close() { + this.closed = true + }, + } + ;(window as any).open = () => popup + return popup +} + +function post(data: any, origin: string) { + window.dispatchEvent(new (window as any).MessageEvent('message', {data, origin})) +} + +function creator() { + return new AccountCreator({scope: 'wallet', creationServiceUrl: serviceUrl}) +} + +suite('AccountCreator', function () { + test('resolves with the account reported by the service', async function () { + mockPopup() + const result = creator().createAccount() + post({sa: 'wharfkit1111', cid: 'aca376f2'}, serviceOrigin) + assert.equal((await result).sa, 'wharfkit1111') + }) + + test('ignores messages from another origin', async function () { + mockPopup() + const result = creator().createAccount() + post({sa: 'attacker1111'}, 'https://example.com') + const settled = await Promise.race([ + result, + new Promise((resolve) => setTimeout(() => resolve('pending'), 10)), + ]) + assert.equal(settled, 'pending') + post({sa: 'wharfkit1111'}, serviceOrigin) + assert.equal((await result).sa, 'wharfkit1111') + }) + + test('rejects when the popup is closed first', async function () { + const popup = mockPopup() + const result = creator().createAccount() + popup.closed = true + let error: Error | undefined + try { + await result + } catch (caught) { + error = caught as Error + } + assert.instanceOf(error, Error) + assert.equal(error?.message, 'Popup window closed') + }) +}) diff --git a/packages/account-creation-plugin-anchor/test/tests/common.ts b/packages/account-creation-plugin-anchor/test/tests/common.ts deleted file mode 100644 index b5895c58..00000000 --- a/packages/account-creation-plugin-anchor/test/tests/common.ts +++ /dev/null @@ -1,42 +0,0 @@ -import {assert} from 'chai' -import sinon from 'sinon' -import {Chains, SessionKit} from '@wharfkit/session' -import {mockSessionKitArgs, mockSessionKitOptions} from '@wharfkit/mock-data' - -import {AccountCreator} from '../../src/account-creator' -import {AccountCreationPluginAnchor} from '$lib' - -suite('AccountCreationPluginGreymass', function () { - let createAccountStub - - setup(function () { - // Before each test, replace the `createAccount` method with a stub - createAccountStub = sinon.stub(AccountCreator.prototype, 'createAccount') - }) - - teardown(function () { - // After each test, restore the original method - createAccountStub.restore() - }) - - // test('createAccount', async function () { - // // Make the stub resolve the desired values - // createAccountStub.resolves({ - // cid: Chains.EOS.id, - // sa: 'wharfkit1111', - // }) - - // const kit = new SessionKit(mockSessionKitArgs, { - // ...mockSessionKitOptions, - // accountCreationPlugins: [new AccountCreationPluginGreymass()], - // }) - - // const result = await kit.createAccount({ - // chain: Chains.EOS, - // accountName: 'wharfkit1111', - // }) - - // assert.equal(result.chain, Chains.EOS) - // assert.equal(result.accountName, 'wharfkit1111') - // }) -}) From a0217849a4712e3869a33f28102cdd9857bdf80f Mon Sep 17 00:00:00 2001 From: aaroncox Date: Mon, 31 Aug 2026 20:28:30 -0700 Subject: [PATCH 03/10] Remove the five plugin templates --- bun.lock | 72 --------------- .../.editorconfig | 12 --- .../.gitignore | 3 - .../account-creation-plugin-template/LICENSE | 27 ------ .../account-creation-plugin-template/Makefile | 3 - .../README.md | 22 ----- .../package.json | 32 ------- .../src/index.ts | 65 -------------- ...de93cf80e8098e1a0a4ec48cc86c1050772d7.json | 45 ---------- ...14e8a151304a30043198b7b9e9df34a14aaeb.json | 18 ---- .../test/tests/common.ts | 27 ------ .../test/tsconfig.json | 25 ------ .../tsconfig.json | 6 -- packages/login-plugin-template/.editorconfig | 12 --- packages/login-plugin-template/.gitignore | 4 - packages/login-plugin-template/LICENSE | 27 ------ packages/login-plugin-template/Makefile | 1 - packages/login-plugin-template/README.md | 20 ----- packages/login-plugin-template/package.json | 33 ------- packages/login-plugin-template/src/index.ts | 59 ------------ .../src/translations/en.json | 4 - .../src/translations/index.ts | 11 --- .../src/translations/ko.json | 4 - .../src/translations/zh-hans.json | 4 - .../src/translations/zh-hant.json | 4 - .../test/tests/common.ts | 15 ---- .../login-plugin-template/test/tsconfig.json | 25 ------ packages/login-plugin-template/tsconfig.json | 6 -- .../transact-plugin-template/.editorconfig | 12 --- packages/transact-plugin-template/.gitignore | 4 - packages/transact-plugin-template/LICENSE | 27 ------ packages/transact-plugin-template/Makefile | 3 - packages/transact-plugin-template/README.md | 20 ----- .../transact-plugin-template/package.json | 33 ------- .../transact-plugin-template/src/index.ts | 90 ------------------- .../src/translations/en.json | 5 -- .../src/translations/index.ts | 11 --- .../src/translations/ko.json | 5 -- .../src/translations/zh-hans.json | 5 -- .../src/translations/zh-hant.json | 5 -- ...de93cf80e8098e1a0a4ec48cc86c1050772d7.json | 45 ---------- ...1de03f2a7ee6c133465c8c6b2b286704a5d8f.json | 33 ------- ...14e8a151304a30043198b7b9e9df34a14aaeb.json | 18 ---- .../test/tests/common.ts | 49 ---------- .../test/tsconfig.json | 25 ------ .../transact-plugin-template/tsconfig.json | 6 -- packages/ui-plugin-template/.editorconfig | 12 --- packages/ui-plugin-template/.gitignore | 4 - packages/ui-plugin-template/LICENSE | 27 ------ packages/ui-plugin-template/Makefile | 3 - packages/ui-plugin-template/README.md | 20 ----- packages/ui-plugin-template/package.json | 32 ------- packages/ui-plugin-template/src/index.ts | 81 ----------------- ...1de03f2a7ee6c133465c8c6b2b286704a5d8f.json | 33 ------- ...14e8a151304a30043198b7b9e9df34a14aaeb.json | 18 ---- .../ui-plugin-template/test/tests/common.ts | 45 ---------- .../ui-plugin-template/test/tsconfig.json | 25 ------ packages/ui-plugin-template/tsconfig.json | 6 -- packages/wallet-plugin-template/.editorconfig | 12 --- packages/wallet-plugin-template/.gitignore | 2 - packages/wallet-plugin-template/LICENSE | 27 ------ packages/wallet-plugin-template/Makefile | 3 - packages/wallet-plugin-template/README.md | 20 ----- packages/wallet-plugin-template/package.json | 32 ------- packages/wallet-plugin-template/src/index.ts | 87 ------------------ ...1de03f2a7ee6c133465c8c6b2b286704a5d8f.json | 33 ------- ...14e8a151304a30043198b7b9e9df34a14aaeb.json | 18 ---- .../test/tests/common.ts | 51 ----------- .../wallet-plugin-template/test/tsconfig.json | 25 ------ packages/wallet-plugin-template/tsconfig.json | 6 -- 70 files changed, 1604 deletions(-) delete mode 100644 packages/account-creation-plugin-template/.editorconfig delete mode 100644 packages/account-creation-plugin-template/.gitignore delete mode 100644 packages/account-creation-plugin-template/LICENSE delete mode 100644 packages/account-creation-plugin-template/Makefile delete mode 100644 packages/account-creation-plugin-template/README.md delete mode 100644 packages/account-creation-plugin-template/package.json delete mode 100644 packages/account-creation-plugin-template/src/index.ts delete mode 100644 packages/account-creation-plugin-template/test/data/1a4de93cf80e8098e1a0a4ec48cc86c1050772d7.json delete mode 100644 packages/account-creation-plugin-template/test/data/ed314e8a151304a30043198b7b9e9df34a14aaeb.json delete mode 100644 packages/account-creation-plugin-template/test/tests/common.ts delete mode 100644 packages/account-creation-plugin-template/test/tsconfig.json delete mode 100644 packages/account-creation-plugin-template/tsconfig.json delete mode 100644 packages/login-plugin-template/.editorconfig delete mode 100644 packages/login-plugin-template/.gitignore delete mode 100644 packages/login-plugin-template/LICENSE delete mode 100644 packages/login-plugin-template/Makefile delete mode 100644 packages/login-plugin-template/README.md delete mode 100644 packages/login-plugin-template/package.json delete mode 100644 packages/login-plugin-template/src/index.ts delete mode 100644 packages/login-plugin-template/src/translations/en.json delete mode 100644 packages/login-plugin-template/src/translations/index.ts delete mode 100644 packages/login-plugin-template/src/translations/ko.json delete mode 100644 packages/login-plugin-template/src/translations/zh-hans.json delete mode 100644 packages/login-plugin-template/src/translations/zh-hant.json delete mode 100644 packages/login-plugin-template/test/tests/common.ts delete mode 100644 packages/login-plugin-template/test/tsconfig.json delete mode 100644 packages/login-plugin-template/tsconfig.json delete mode 100644 packages/transact-plugin-template/.editorconfig delete mode 100644 packages/transact-plugin-template/.gitignore delete mode 100644 packages/transact-plugin-template/LICENSE delete mode 100644 packages/transact-plugin-template/Makefile delete mode 100644 packages/transact-plugin-template/README.md delete mode 100644 packages/transact-plugin-template/package.json delete mode 100644 packages/transact-plugin-template/src/index.ts delete mode 100644 packages/transact-plugin-template/src/translations/en.json delete mode 100644 packages/transact-plugin-template/src/translations/index.ts delete mode 100644 packages/transact-plugin-template/src/translations/ko.json delete mode 100644 packages/transact-plugin-template/src/translations/zh-hans.json delete mode 100644 packages/transact-plugin-template/src/translations/zh-hant.json delete mode 100644 packages/transact-plugin-template/test/data/1a4de93cf80e8098e1a0a4ec48cc86c1050772d7.json delete mode 100644 packages/transact-plugin-template/test/data/a041de03f2a7ee6c133465c8c6b2b286704a5d8f.json delete mode 100644 packages/transact-plugin-template/test/data/ed314e8a151304a30043198b7b9e9df34a14aaeb.json delete mode 100644 packages/transact-plugin-template/test/tests/common.ts delete mode 100644 packages/transact-plugin-template/test/tsconfig.json delete mode 100644 packages/transact-plugin-template/tsconfig.json delete mode 100644 packages/ui-plugin-template/.editorconfig delete mode 100644 packages/ui-plugin-template/.gitignore delete mode 100644 packages/ui-plugin-template/LICENSE delete mode 100644 packages/ui-plugin-template/Makefile delete mode 100644 packages/ui-plugin-template/README.md delete mode 100644 packages/ui-plugin-template/package.json delete mode 100644 packages/ui-plugin-template/src/index.ts delete mode 100644 packages/ui-plugin-template/test/data/a041de03f2a7ee6c133465c8c6b2b286704a5d8f.json delete mode 100644 packages/ui-plugin-template/test/data/ed314e8a151304a30043198b7b9e9df34a14aaeb.json delete mode 100644 packages/ui-plugin-template/test/tests/common.ts delete mode 100644 packages/ui-plugin-template/test/tsconfig.json delete mode 100644 packages/ui-plugin-template/tsconfig.json delete mode 100644 packages/wallet-plugin-template/.editorconfig delete mode 100644 packages/wallet-plugin-template/.gitignore delete mode 100644 packages/wallet-plugin-template/LICENSE delete mode 100644 packages/wallet-plugin-template/Makefile delete mode 100644 packages/wallet-plugin-template/README.md delete mode 100644 packages/wallet-plugin-template/package.json delete mode 100644 packages/wallet-plugin-template/src/index.ts delete mode 100644 packages/wallet-plugin-template/test/data/a041de03f2a7ee6c133465c8c6b2b286704a5d8f.json delete mode 100644 packages/wallet-plugin-template/test/data/ed314e8a151304a30043198b7b9e9df34a14aaeb.json delete mode 100644 packages/wallet-plugin-template/test/tests/common.ts delete mode 100644 packages/wallet-plugin-template/test/tsconfig.json delete mode 100644 packages/wallet-plugin-template/tsconfig.json diff --git a/bun.lock b/bun.lock index 514ea4bf..b077c42a 100644 --- a/bun.lock +++ b/bun.lock @@ -84,7 +84,6 @@ "name": "@wharfkit/account-creation-plugin-metamask", "version": "4.0.0-rc4", "dependencies": { - "@greymass/create-account": "^1.1.0", "@metamask/providers": "^17.0.0", "@wharfkit/session": "workspace:*", }, @@ -93,17 +92,6 @@ "@wharfkit/session": "workspace:*", }, }, - "packages/account-creation-plugin-template": { - "name": "@wharfkit/account-creation-plugin-template", - "version": "4.0.0-rc4", - "dependencies": { - "@wharfkit/session": "workspace:*", - }, - "devDependencies": { - "@wharfkit/mock-data": "workspace:*", - "@wharfkit/session": "workspace:*", - }, - }, "packages/actionstream": { "name": "@wharfkit/actionstream", "version": "4.0.0-rc4", @@ -234,18 +222,6 @@ "@wharfkit/mock-data": "workspace:*", }, }, - "packages/login-plugin-template": { - "name": "@wharfkit/login-plugin-template", - "version": "4.0.0-rc4", - "dependencies": { - "@wharfkit/session": "workspace:*", - }, - "devDependencies": { - "@wharfkit/mock-data": "workspace:*", - "@wharfkit/session": "workspace:*", - "@wharfkit/wallet-plugin-privatekey": "workspace:*", - }, - }, "packages/mock-data": { "name": "@wharfkit/mock-data", "version": "4.0.0-rc4", @@ -512,29 +488,6 @@ "@wharfkit/wallet-plugin-privatekey": "workspace:*", }, }, - "packages/transact-plugin-template": { - "name": "@wharfkit/transact-plugin-template", - "version": "4.0.0-rc4", - "dependencies": { - "@wharfkit/session": "workspace:*", - }, - "devDependencies": { - "@wharfkit/mock-data": "workspace:*", - "@wharfkit/session": "workspace:*", - "@wharfkit/wallet-plugin-privatekey": "workspace:*", - }, - }, - "packages/ui-plugin-template": { - "name": "@wharfkit/ui-plugin-template", - "version": "4.0.0-rc4", - "dependencies": { - "@wharfkit/session": "workspace:*", - }, - "devDependencies": { - "@wharfkit/mock-data": "workspace:*", - "@wharfkit/session": "workspace:*", - }, - }, "packages/wallet-plugin-anchor": { "name": "@wharfkit/wallet-plugin-anchor", "version": "4.0.0-rc4", @@ -675,17 +628,6 @@ "@wharfkit/session": "workspace:*", }, }, - "packages/wallet-plugin-template": { - "name": "@wharfkit/wallet-plugin-template", - "version": "4.0.0-rc4", - "dependencies": { - "@wharfkit/session": "workspace:*", - }, - "devDependencies": { - "@wharfkit/mock-data": "workspace:*", - "@wharfkit/session": "workspace:*", - }, - }, "packages/wallet-plugin-tokenpocket": { "name": "@wharfkit/wallet-plugin-tokenpocket", "version": "4.0.0-rc4", @@ -980,12 +922,8 @@ "@greymass/buoy": ["@greymass/buoy@1.0.4", "", { "dependencies": { "eventemitter3": "^4.0.7", "tslib": "^2.1.0" } }, "sha512-/O9EsjWJw81TiJcvKqMKxjrJpEfHKh8WcUK07gFT+uS0+JUKfoVrYVQn1qNOAdYWU+AZrhZJop8xP/LYmKfGHg=="], - "@greymass/create-account": ["@greymass/create-account@1.1.0", "", { "dependencies": { "@greymass/return-path": "^0.0.1", "@wharfkit/antelope": "^1.0.13", "@wharfkit/signing-request": "^3.2.0", "tslib": "^2.1.0" } }, "sha512-6FT1Kwx7t5gL75PklNoMTH+CHCaT6/RZAMW48YvnNEdJyL8m5j5FTn8p5zzU9xaVIKzJSvjA1gkK1mjeXIxmIQ=="], - "@greymass/miniaes": ["@greymass/miniaes@1.0.0", "", { "dependencies": { "tslib": "^2.1.0" } }, "sha512-xKYTnAyyoq3gpJS11JvU4dkju28M8Zbp06CuP3aKR4DMH6B2z64LauGGGzKksKh5Qd770JA/dzhLbImnBlymbg=="], - "@greymass/return-path": ["@greymass/return-path@0.0.1", "", { "dependencies": { "tslib": "^2.1.0" } }, "sha512-PMPgSJYSHeaYXbURj4JfsEeReWkJqlTKFMn2iTPhvb+6ICR5GhVPDJKewqZPqpZumcD13M1c701YYWKHZlMsxw=="], - "@greymass/vert": ["@greymass/vert@3.0.0", "", { "dependencies": { "@ethereumjs/util": "^8.0.0-beta.1", "@wharfkit/antelope": "^1.1.1", "bn.js": "^5.2.0", "brorand": "^1.1.0", "chai": "^4.3.6", "colors": "^1.4.0", "cross-fetch": "^3.1.5", "elliptic": "^6.5.4", "hash.js": "^1.1.7", "js-sha3": "^0.8.0", "json-diff": "^0.9.0", "json-diff-ts": "^1.2.4", "lodash": "^4.17.21", "loglevel": "^1.8.0", "loglevel-plugin-prefix": "^0.8.4", "rustbn.js": "^0.2.0", "sorted-btree": "^1.6.0" } }, "sha512-ChSjkFwa0Jn+mzV10D5f51uX4dpzQY8O1m+rFpN+HIMPyUVTtzeF1f4geqnlk5Jj+qy1XUCgyMul2sMwGQdarw=="], "@humanfs/core": ["@humanfs/core@0.19.2", "", { "dependencies": { "@humanfs/types": "^0.15.0" } }, "sha512-UhXNm+CFMWcbChXywFwkmhqjs3PRCmcSa/hfBgLIb7oQ5HNb1wS0icWsGtSAUNgefHeI+eBrA8I1fxmbHsGdvA=="], @@ -1476,8 +1414,6 @@ "@wharfkit/account-creation-plugin-metamask": ["@wharfkit/account-creation-plugin-metamask@workspace:packages/account-creation-plugin-metamask"], - "@wharfkit/account-creation-plugin-template": ["@wharfkit/account-creation-plugin-template@workspace:packages/account-creation-plugin-template"], - "@wharfkit/actionstream": ["@wharfkit/actionstream@workspace:packages/actionstream"], "@wharfkit/antelope": ["@wharfkit/antelope@workspace:packages/antelope"], @@ -1496,8 +1432,6 @@ "@wharfkit/hyperion": ["@wharfkit/hyperion@workspace:packages/hyperion"], - "@wharfkit/login-plugin-template": ["@wharfkit/login-plugin-template@workspace:packages/login-plugin-template"], - "@wharfkit/mock-data": ["@wharfkit/mock-data@workspace:packages/mock-data"], "@wharfkit/msigs": ["@wharfkit/msigs@workspace:packages/msigs"], @@ -1536,10 +1470,6 @@ "@wharfkit/transact-plugin-resource-provider": ["@wharfkit/transact-plugin-resource-provider@workspace:packages/transact-plugin-resource-provider"], - "@wharfkit/transact-plugin-template": ["@wharfkit/transact-plugin-template@workspace:packages/transact-plugin-template"], - - "@wharfkit/ui-plugin-template": ["@wharfkit/ui-plugin-template@workspace:packages/ui-plugin-template"], - "@wharfkit/wallet-plugin-anchor": ["@wharfkit/wallet-plugin-anchor@workspace:packages/wallet-plugin-anchor"], "@wharfkit/wallet-plugin-cleos": ["@wharfkit/wallet-plugin-cleos@workspace:packages/wallet-plugin-cleos"], @@ -1562,8 +1492,6 @@ "@wharfkit/wallet-plugin-scatter": ["@wharfkit/wallet-plugin-scatter@workspace:packages/wallet-plugin-scatter"], - "@wharfkit/wallet-plugin-template": ["@wharfkit/wallet-plugin-template@workspace:packages/wallet-plugin-template"], - "@wharfkit/wallet-plugin-tokenpocket": ["@wharfkit/wallet-plugin-tokenpocket@workspace:packages/wallet-plugin-tokenpocket"], "@wharfkit/wallet-plugin-web-authenticator": ["@wharfkit/wallet-plugin-web-authenticator@workspace:packages/wallet-plugin-web-authenticator"], diff --git a/packages/account-creation-plugin-template/.editorconfig b/packages/account-creation-plugin-template/.editorconfig deleted file mode 100644 index 779f99a1..00000000 --- a/packages/account-creation-plugin-template/.editorconfig +++ /dev/null @@ -1,12 +0,0 @@ -root = true - -[*] -indent_style = space -indent_size = 4 -end_of_line = lf -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true - -[*.md] -trim_trailing_whitespace = false diff --git a/packages/account-creation-plugin-template/.gitignore b/packages/account-creation-plugin-template/.gitignore deleted file mode 100644 index 05834bb2..00000000 --- a/packages/account-creation-plugin-template/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -node_modules/ -lib/ -yarn-error.log diff --git a/packages/account-creation-plugin-template/LICENSE b/packages/account-creation-plugin-template/LICENSE deleted file mode 100644 index 482ed2da..00000000 --- a/packages/account-creation-plugin-template/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2023 Greymass Inc. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. diff --git a/packages/account-creation-plugin-template/Makefile b/packages/account-creation-plugin-template/Makefile deleted file mode 100644 index 3543f49d..00000000 --- a/packages/account-creation-plugin-template/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -MOCK_DIR := ./test/data - -include ../../common.mk diff --git a/packages/account-creation-plugin-template/README.md b/packages/account-creation-plugin-template/README.md deleted file mode 100644 index 5a2e6e30..00000000 --- a/packages/account-creation-plugin-template/README.md +++ /dev/null @@ -1,22 +0,0 @@ -# WARNING: This is a work in progress and not ready for use. - -# @wharfkit/account-creation-plugin-template - -A template to create a `account-creationPlugin` for use within the `@wharfkit/session` library. - -## Usage - -- [Use this as a template.](https://docs.github.com/en/repositories/creating-and-managing-repositories/creating-a-repository-from-a-template) -- Write your account-creation plugin's logic. -- Publish it on Github or npmjs.com -- Include it in your project and use it. - -## Developing - -You need [Make](https://www.gnu.org/software/make/), [node.js](https://nodejs.org/en/) and [yarn](https://classic.yarnpkg.com/en/docs/install) installed. - -Clone the repository and run `make` to checkout all dependencies and build the project. See the [Makefile](./Makefile) for other useful targets. Before submitting a pull request make sure to run `make lint`. - ---- - -Made with ☕️ & ❤️ by [Greymass](https://greymass.com), if you find this useful please consider [supporting us](https://greymass.com/support-us). diff --git a/packages/account-creation-plugin-template/package.json b/packages/account-creation-plugin-template/package.json deleted file mode 100644 index 93928b9a..00000000 --- a/packages/account-creation-plugin-template/package.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "name": "@wharfkit/account-creation-plugin-template", - "description": "A template to create account-creation plugins for use with @wharfkit/session.", - "version": "4.0.0-rc4", - "private": true, - "homepage": "https://github.com/wharfkit/account-creation-plugin-template", - "license": "BSD-3-Clause", - "engines": { - "node": ">=20.19.0" - }, - "main": "lib/account-creation-plugin-template.js", - "module": "lib/account-creation-plugin-template.m.js", - "types": "lib/account-creation-plugin-template.d.ts", - "sideEffects": false, - "files": [ - "lib/*", - "src/*" - ], - "scripts": {}, - "dependencies": { - "@wharfkit/session": "workspace:*" - }, - "devDependencies": { - "@wharfkit/mock-data": "workspace:*", - "@wharfkit/session": "workspace:*" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/wharfkit/js.git", - "directory": "packages/account-creation-plugin-template" - } -} diff --git a/packages/account-creation-plugin-template/src/index.ts b/packages/account-creation-plugin-template/src/index.ts deleted file mode 100644 index ccf9ab64..00000000 --- a/packages/account-creation-plugin-template/src/index.ts +++ /dev/null @@ -1,65 +0,0 @@ -import { - AbstractAccountCreationPlugin, - AccountCreationPlugin, - AccountCreationPluginConfig, - Chains, - CreateAccountContext, - CreateAccountResponse, -} from '@wharfkit/session' -import {AccountCreationPluginMetadata} from '@wharfkit/session' - -export class AccountCreationPluginTEMPLATE - extends AbstractAccountCreationPlugin - implements AccountCreationPlugin -{ - /** - * The logic configuration for the account-creation plugin. - */ - readonly config: AccountCreationPluginConfig = { - // Should the user interface display a chain selector? - requiresChainSelect: true, - - // Optionally specify if this plugin only works with specific blockchains. - // supportedChains: [Chains.Jungle4], - } - /** - * The metadata for the account-creation plugin to be displayed in the user interface. - */ - readonly metadata: AccountCreationPluginMetadata = AccountCreationPluginMetadata.from({ - name: 'Account Creation Plugin Template', - description: 'A template that can be used to build account creation plugins!', - logo: 'base_64_encoded_image', - homepage: 'https://someplace.com', - }) - /** - * A unique string identifier for this account-creation plugin. - * - * It's recommended this is all lower case, no spaces, and only URL-friendly special characters (dashes, underscores, etc) - */ - get id(): string { - return 'account-creation-plugin-template' - } - - /** - * The name of the account-creation plugin to be displayed in the user interface. - */ - get name(): string { - return 'Account Creation Plugin Template' - } - - /** - * Performs the account creationg logic required to create the account. - * - * @param options CreateAccountContext - * @returns Promise - */ - // TODO: Remove these eslint rule modifiers when you are implementing this method. - /* eslint-disable @typescript-eslint/no-unused-vars */ - async create(context: CreateAccountContext): Promise { - // Example response... - return { - chain: Chains.EOS, - accountName: 'wharfkit1111', - } - } -} diff --git a/packages/account-creation-plugin-template/test/data/1a4de93cf80e8098e1a0a4ec48cc86c1050772d7.json b/packages/account-creation-plugin-template/test/data/1a4de93cf80e8098e1a0a4ec48cc86c1050772d7.json deleted file mode 100644 index 4b01d2b9..00000000 --- a/packages/account-creation-plugin-template/test/data/1a4de93cf80e8098e1a0a4ec48cc86c1050772d7.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "request": { - "path": "https://jungle4.greymass.com/v1/chain/get_info", - "params": { - "method": "POST", - "headers": {} - } - }, - "headers": { - "access-control-allow-headers": "X-Requested-With,Accept,Content-Type,Origin", - "access-control-allow-methods": "GET, POST, OPTIONS", - "access-control-allow-origin": "*", - "connection": "close", - "content-length": "964", - "content-type": "application/json", - "date": "Sat, 31 Dec 2022 07:01:37 GMT", - "host": "jungle4.greymass.com", - "server": "nginx/1.18.0 (Ubuntu)", - "x-cached": "MISS" - }, - "status": 200, - "json": { - "server_version": "905c5cc9", - "chain_id": "73e4385a2708e6d7048834fbc1079f2fabb17b3c125b146af438971e90716c4d", - "head_block_num": 53515366, - "last_irreversible_block_num": 53515039, - "last_irreversible_block_id": "0330931f8caaac25828e42073605c1fbe07ebcbb3d330890a63420e0cd596885", - "head_block_id": "033094661eb1189e4d3aea3800a53821f6ac21b0a50f76ab76ed69febed7468e", - "head_block_time": "2022-12-31T07:01:37.000", - "head_block_producer": "jumpingfrogs", - "virtual_block_cpu_limit": 200000000, - "virtual_block_net_limit": 1048576000, - "block_cpu_limit": 200000, - "block_net_limit": 1048576, - "server_version_string": "v3.1.3", - "fork_db_head_block_num": 53515366, - "fork_db_head_block_id": "033094661eb1189e4d3aea3800a53821f6ac21b0a50f76ab76ed69febed7468e", - "server_full_version_string": "v3.1.3-905c5cc900b4e88aed4ab6912009127bf9f4f140", - "total_cpu_weight": "120460600273060", - "total_net_weight": "117529136309360", - "earliest_available_block_num": 53328984, - "last_irreversible_block_time": "2022-12-31T06:58:53.500" - }, - "text": "{\"server_version\":\"905c5cc9\",\"chain_id\":\"73e4385a2708e6d7048834fbc1079f2fabb17b3c125b146af438971e90716c4d\",\"head_block_num\":53515366,\"last_irreversible_block_num\":53515039,\"last_irreversible_block_id\":\"0330931f8caaac25828e42073605c1fbe07ebcbb3d330890a63420e0cd596885\",\"head_block_id\":\"033094661eb1189e4d3aea3800a53821f6ac21b0a50f76ab76ed69febed7468e\",\"head_block_time\":\"2022-12-31T07:01:37.000\",\"head_block_producer\":\"jumpingfrogs\",\"virtual_block_cpu_limit\":200000000,\"virtual_block_net_limit\":1048576000,\"block_cpu_limit\":200000,\"block_net_limit\":1048576,\"server_version_string\":\"v3.1.3\",\"fork_db_head_block_num\":53515366,\"fork_db_head_block_id\":\"033094661eb1189e4d3aea3800a53821f6ac21b0a50f76ab76ed69febed7468e\",\"server_full_version_string\":\"v3.1.3-905c5cc900b4e88aed4ab6912009127bf9f4f140\",\"total_cpu_weight\":\"120460600273060\",\"total_net_weight\":\"117529136309360\",\"earliest_available_block_num\":53328984,\"last_irreversible_block_time\":\"2022-12-31T06:58:53.500\"}" -} \ No newline at end of file diff --git a/packages/account-creation-plugin-template/test/data/ed314e8a151304a30043198b7b9e9df34a14aaeb.json b/packages/account-creation-plugin-template/test/data/ed314e8a151304a30043198b7b9e9df34a14aaeb.json deleted file mode 100644 index 4874c223..00000000 --- a/packages/account-creation-plugin-template/test/data/ed314e8a151304a30043198b7b9e9df34a14aaeb.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "request": { - "path": "https://jungle4.greymass.com/v1/chain/get_raw_abi", - "params": { - "method": "POST", - "body": "{\"account_name\":\"eosio.token\"}", - "headers": {} - } - }, - "status": 200, - "json": { - "account_name": "eosio.token", - "code_hash": "33109b3dd5d354cab5a425c1d4c404c4db056717215f1a8b7ba036a6692811df", - "abi_hash": "d84356074da34a976528321472d73ac919227b9b01d9de59d8ade6d96440455c", - "abi": "DmVvc2lvOjphYmkvMS4yAAgHYWNjb3VudAABB2JhbGFuY2UFYXNzZXQFY2xvc2UAAgVvd25lcgRuYW1lBnN5bWJvbAZzeW1ib2wGY3JlYXRlAAIGaXNzdWVyBG5hbWUObWF4aW11bV9zdXBwbHkFYXNzZXQOY3VycmVuY3lfc3RhdHMAAwZzdXBwbHkFYXNzZXQKbWF4X3N1cHBseQVhc3NldAZpc3N1ZXIEbmFtZQVpc3N1ZQADAnRvBG5hbWUIcXVhbnRpdHkFYXNzZXQEbWVtbwZzdHJpbmcEb3BlbgADBW93bmVyBG5hbWUGc3ltYm9sBnN5bWJvbAlyYW1fcGF5ZXIEbmFtZQZyZXRpcmUAAghxdWFudGl0eQVhc3NldARtZW1vBnN0cmluZwh0cmFuc2ZlcgAEBGZyb20EbmFtZQJ0bwRuYW1lCHF1YW50aXR5BWFzc2V0BG1lbW8Gc3RyaW5nBgAAAAAAhWlEBWNsb3NlAAAAAACobNRFBmNyZWF0ZQAAAAAAAKUxdgVpc3N1ZQAAAAAAADBVpQRvcGVuAAAAAACo67K6BnJldGlyZQAAAABXLTzNzQh0cmFuc2ZlcgACAAAAOE9NETIDaTY0AAAHYWNjb3VudAAAAAAAkE3GA2k2NAAADmN1cnJlbmN5X3N0YXRzAAAAAA===" - }, - "text": "{\"account_name\":\"eosio.token\",\"code_hash\":\"33109b3dd5d354cab5a425c1d4c404c4db056717215f1a8b7ba036a6692811df\",\"abi_hash\":\"d84356074da34a976528321472d73ac919227b9b01d9de59d8ade6d96440455c\",\"abi\":\"DmVvc2lvOjphYmkvMS4yAAgHYWNjb3VudAABB2JhbGFuY2UFYXNzZXQFY2xvc2UAAgVvd25lcgRuYW1lBnN5bWJvbAZzeW1ib2wGY3JlYXRlAAIGaXNzdWVyBG5hbWUObWF4aW11bV9zdXBwbHkFYXNzZXQOY3VycmVuY3lfc3RhdHMAAwZzdXBwbHkFYXNzZXQKbWF4X3N1cHBseQVhc3NldAZpc3N1ZXIEbmFtZQVpc3N1ZQADAnRvBG5hbWUIcXVhbnRpdHkFYXNzZXQEbWVtbwZzdHJpbmcEb3BlbgADBW93bmVyBG5hbWUGc3ltYm9sBnN5bWJvbAlyYW1fcGF5ZXIEbmFtZQZyZXRpcmUAAghxdWFudGl0eQVhc3NldARtZW1vBnN0cmluZwh0cmFuc2ZlcgAEBGZyb20EbmFtZQJ0bwRuYW1lCHF1YW50aXR5BWFzc2V0BG1lbW8Gc3RyaW5nBgAAAAAAhWlEBWNsb3NlAAAAAACobNRFBmNyZWF0ZQAAAAAAAKUxdgVpc3N1ZQAAAAAAADBVpQRvcGVuAAAAAACo67K6BnJldGlyZQAAAABXLTzNzQh0cmFuc2ZlcgACAAAAOE9NETIDaTY0AAAHYWNjb3VudAAAAAAAkE3GA2k2NAAADmN1cnJlbmN5X3N0YXRzAAAAAA===\"}" -} \ No newline at end of file diff --git a/packages/account-creation-plugin-template/test/tests/common.ts b/packages/account-creation-plugin-template/test/tests/common.ts deleted file mode 100644 index 9ae8fd00..00000000 --- a/packages/account-creation-plugin-template/test/tests/common.ts +++ /dev/null @@ -1,27 +0,0 @@ -import {assert} from 'chai' -import {Chains, PermissionLevel, SessionKit} from '@wharfkit/session' -import { - mockChainDefinition, - mockPermissionLevel, - mockSessionKitArgs, - mockSessionKitOptions, -} from '@wharfkit/mock-data' - -import {AccountCreationPluginTEMPLATE} from '$lib' - -suite('AccountCreationPluginTEMPLATE', function () { - test('createAccount', async function () { - // const kit = new SessionKit( - // { - // ...mockSessionKitArgs, - // accountCreationPlugins: [new AccountCreationPluginTEMPLATE()], - // }, - // mockSessionKitOptions - // ) - // const result = await kit.createAccount({ - // chain: mockChainDefinition.id, - // permissionLevel: mockPermissionLevel, - // }) - // Add your own assertions here... - }) -}) diff --git a/packages/account-creation-plugin-template/test/tsconfig.json b/packages/account-creation-plugin-template/test/tsconfig.json deleted file mode 100644 index 472a9a18..00000000 --- a/packages/account-creation-plugin-template/test/tsconfig.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "extends": [ - "../tsconfig.json", - "../../../tsconfig.test.json" - ], - "compilerOptions": { - "baseUrl": "..", - "paths": { - "$lib": [ - "src" - ], - "$test": [ - "test" - ], - "$test/*": [ - "test/*" - ] - } - }, - "include": [ - "*.ts", - "**/*.ts", - "../src/**/*.ts" - ] -} diff --git a/packages/account-creation-plugin-template/tsconfig.json b/packages/account-creation-plugin-template/tsconfig.json deleted file mode 100644 index 4e6c6ce1..00000000 --- a/packages/account-creation-plugin-template/tsconfig.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": "../../tsconfig.base.json", - "include": [ - "src/**/*" - ] -} diff --git a/packages/login-plugin-template/.editorconfig b/packages/login-plugin-template/.editorconfig deleted file mode 100644 index 779f99a1..00000000 --- a/packages/login-plugin-template/.editorconfig +++ /dev/null @@ -1,12 +0,0 @@ -root = true - -[*] -indent_style = space -indent_size = 4 -end_of_line = lf -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true - -[*.md] -trim_trailing_whitespace = false diff --git a/packages/login-plugin-template/.gitignore b/packages/login-plugin-template/.gitignore deleted file mode 100644 index 53bc8ae9..00000000 --- a/packages/login-plugin-template/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -node_modules/ -lib/ -build/ -test/browser.html* diff --git a/packages/login-plugin-template/LICENSE b/packages/login-plugin-template/LICENSE deleted file mode 100644 index 482ed2da..00000000 --- a/packages/login-plugin-template/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2023 Greymass Inc. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. diff --git a/packages/login-plugin-template/Makefile b/packages/login-plugin-template/Makefile deleted file mode 100644 index 2c760893..00000000 --- a/packages/login-plugin-template/Makefile +++ /dev/null @@ -1 +0,0 @@ -include ../../common.mk diff --git a/packages/login-plugin-template/README.md b/packages/login-plugin-template/README.md deleted file mode 100644 index b5255b85..00000000 --- a/packages/login-plugin-template/README.md +++ /dev/null @@ -1,20 +0,0 @@ -# @wharfkit/login-plugin-template - -A template to create a `LoginPlugin` for use during a `login` call within the `@wharfkit/session` library. - -## Usage - -- [Use this as a template.](https://docs.github.com/en/repositories/creating-and-managing-repositories/creating-a-repository-from-a-template) -- Write your plugin's logic. -- Publish it on Github or npmjs.com -- Include it in your project and use it. - -## Developing - -You need [Make](https://www.gnu.org/software/make/), [node.js](https://nodejs.org/en/) and [yarn](https://classic.yarnpkg.com/en/docs/install) installed. - -Clone the repository and run `make` to checkout all dependencies and build the project. See the [Makefile](./Makefile) for other useful targets. Before submitting a pull request make sure to run `make lint`. - ---- - -Made with ☕️ & ❤️ by [Greymass](https://greymass.com), if you find this useful please consider [supporting us](https://greymass.com/support-us). diff --git a/packages/login-plugin-template/package.json b/packages/login-plugin-template/package.json deleted file mode 100644 index ec991334..00000000 --- a/packages/login-plugin-template/package.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "name": "@wharfkit/login-plugin-template", - "description": "A template to create a `LoginPlugin` for use with @wharfkit/session.", - "version": "4.0.0-rc4", - "private": true, - "homepage": "https://github.com/wharfkit/login-plugin-template", - "license": "BSD-3-Clause", - "engines": { - "node": ">=20.19.0" - }, - "main": "lib/login-plugin-template.js", - "module": "lib/login-plugin-template.m.js", - "types": "lib/login-plugin-template.d.ts", - "sideEffects": false, - "files": [ - "lib/*", - "src/*" - ], - "scripts": {}, - "dependencies": { - "@wharfkit/session": "workspace:*" - }, - "devDependencies": { - "@wharfkit/mock-data": "workspace:*", - "@wharfkit/session": "workspace:*", - "@wharfkit/wallet-plugin-privatekey": "workspace:*" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/wharfkit/js.git", - "directory": "packages/login-plugin-template" - } -} diff --git a/packages/login-plugin-template/src/index.ts b/packages/login-plugin-template/src/index.ts deleted file mode 100644 index ca83a80e..00000000 --- a/packages/login-plugin-template/src/index.ts +++ /dev/null @@ -1,59 +0,0 @@ -import {AbstractLoginPlugin, LoginContext, LoginHookTypes} from '@wharfkit/session' - -/** Import JSON localization strings */ -import defaultTranslations from './translations' - -export class LoginPluginTemplate extends AbstractLoginPlugin { - /** A unique ID for this plugin */ - id = 'login-plugin-template' - - /** Optional - The translation strings to use for the plugin */ - translations = defaultTranslations - - /** - * Register the hooks required for this plugin to function - * - * @param context The LoginContext of the login process being performed - */ - register(context: LoginContext): void { - // Optional - Retrieve the translation function from the UI if it exists - let t - if (context.ui) { - t = context.ui.getTranslate() - } - - // Register any desired beforeSign hooks - context.addHook(LoginHookTypes.beforeLogin, async (context): Promise => { - // If this plugin is interacting with the UI, throw an error since this is an undefined function - if (context.ui) { - throw new Error( - // Translate the error message against the given key or use the default value as English - t('beforelogin', { - default: 'undefined beforeSign hook called from plugin template', - }) - ) - } else { - // eslint-disable-next-line no-console - console.log('undefined beforeSign hook called with', context) - } - return - }) - - // Register any desired afterSign hooks - context.addHook(LoginHookTypes.afterLogin, async (context): Promise => { - // If this plugin is interacting with the UI, throw an error since this is an undefined function - if (context.ui) { - throw new Error( - // Translate the error message against the given key or use the default value as English - t('afterlogin', { - default: 'undefined afterSign hook called from plugin template', - }) - ) - } else { - // eslint-disable-next-line no-console - console.log('undefined afterSign hook called with', context) - } - return - }) - } -} diff --git a/packages/login-plugin-template/src/translations/en.json b/packages/login-plugin-template/src/translations/en.json deleted file mode 100644 index f07c89cf..00000000 --- a/packages/login-plugin-template/src/translations/en.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "beforelogin": "undefined beforeSign hook called from plugin template", - "afterlogin": "undefined afterSign hook called from plugin template" -} diff --git a/packages/login-plugin-template/src/translations/index.ts b/packages/login-plugin-template/src/translations/index.ts deleted file mode 100644 index 73136018..00000000 --- a/packages/login-plugin-template/src/translations/index.ts +++ /dev/null @@ -1,11 +0,0 @@ -import en from './en.json' -import ko from './ko.json' -import zh_hans from './zh-hans.json' -import zh_hant from './zh-hant.json' - -export default { - en, - ko, - 'zh-Hans': zh_hans, - 'zh-Hant': zh_hant, -} diff --git a/packages/login-plugin-template/src/translations/ko.json b/packages/login-plugin-template/src/translations/ko.json deleted file mode 100644 index f07c89cf..00000000 --- a/packages/login-plugin-template/src/translations/ko.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "beforelogin": "undefined beforeSign hook called from plugin template", - "afterlogin": "undefined afterSign hook called from plugin template" -} diff --git a/packages/login-plugin-template/src/translations/zh-hans.json b/packages/login-plugin-template/src/translations/zh-hans.json deleted file mode 100644 index f07c89cf..00000000 --- a/packages/login-plugin-template/src/translations/zh-hans.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "beforelogin": "undefined beforeSign hook called from plugin template", - "afterlogin": "undefined afterSign hook called from plugin template" -} diff --git a/packages/login-plugin-template/src/translations/zh-hant.json b/packages/login-plugin-template/src/translations/zh-hant.json deleted file mode 100644 index f07c89cf..00000000 --- a/packages/login-plugin-template/src/translations/zh-hant.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "beforelogin": "undefined beforeSign hook called from plugin template", - "afterlogin": "undefined afterSign hook called from plugin template" -} diff --git a/packages/login-plugin-template/test/tests/common.ts b/packages/login-plugin-template/test/tests/common.ts deleted file mode 100644 index 342200fa..00000000 --- a/packages/login-plugin-template/test/tests/common.ts +++ /dev/null @@ -1,15 +0,0 @@ -import {LoginPluginTemplate} from '../../src/index' - -import {SessionKit} from '@wharfkit/session' -import {mockSessionKitArgs, mockSessionKitOptions} from '@wharfkit/mock-data' - -suite('example', function () { - // test('plugin usage', async function () { - // const kit = new SessionKit(mockSessionKitArgs, { - // ...mockSessionKitOptions, - // loginPlugins: [new LoginPluginTemplate()], - // }) - // const result = await kit.login() - // console.log(result) - // }) -}) diff --git a/packages/login-plugin-template/test/tsconfig.json b/packages/login-plugin-template/test/tsconfig.json deleted file mode 100644 index 472a9a18..00000000 --- a/packages/login-plugin-template/test/tsconfig.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "extends": [ - "../tsconfig.json", - "../../../tsconfig.test.json" - ], - "compilerOptions": { - "baseUrl": "..", - "paths": { - "$lib": [ - "src" - ], - "$test": [ - "test" - ], - "$test/*": [ - "test/*" - ] - } - }, - "include": [ - "*.ts", - "**/*.ts", - "../src/**/*.ts" - ] -} diff --git a/packages/login-plugin-template/tsconfig.json b/packages/login-plugin-template/tsconfig.json deleted file mode 100644 index 4e6c6ce1..00000000 --- a/packages/login-plugin-template/tsconfig.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": "../../tsconfig.base.json", - "include": [ - "src/**/*" - ] -} diff --git a/packages/transact-plugin-template/.editorconfig b/packages/transact-plugin-template/.editorconfig deleted file mode 100644 index 779f99a1..00000000 --- a/packages/transact-plugin-template/.editorconfig +++ /dev/null @@ -1,12 +0,0 @@ -root = true - -[*] -indent_style = space -indent_size = 4 -end_of_line = lf -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true - -[*.md] -trim_trailing_whitespace = false diff --git a/packages/transact-plugin-template/.gitignore b/packages/transact-plugin-template/.gitignore deleted file mode 100644 index 53bc8ae9..00000000 --- a/packages/transact-plugin-template/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -node_modules/ -lib/ -build/ -test/browser.html* diff --git a/packages/transact-plugin-template/LICENSE b/packages/transact-plugin-template/LICENSE deleted file mode 100644 index 05da976c..00000000 --- a/packages/transact-plugin-template/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2022 Greymass Inc. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. diff --git a/packages/transact-plugin-template/Makefile b/packages/transact-plugin-template/Makefile deleted file mode 100644 index 3543f49d..00000000 --- a/packages/transact-plugin-template/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -MOCK_DIR := ./test/data - -include ../../common.mk diff --git a/packages/transact-plugin-template/README.md b/packages/transact-plugin-template/README.md deleted file mode 100644 index 645d1753..00000000 --- a/packages/transact-plugin-template/README.md +++ /dev/null @@ -1,20 +0,0 @@ -# @wharfkit/transact-plugin-template - -A template to create a `transactPlugin` for use during a `transact` call within the `@wharfkit/session` library. - -## Usage - -- [Use this as a template.](https://docs.github.com/en/repositories/creating-and-managing-repositories/creating-a-repository-from-a-template) -- Write your plugin's logic. -- Publish it on Github or npmjs.com -- Include it in your project and use it. - -## Developing - -You need [Make](https://www.gnu.org/software/make/), [node.js](https://nodejs.org/en/) and [yarn](https://classic.yarnpkg.com/en/docs/install) installed. - -Clone the repository and run `make` to checkout all dependencies and build the project. See the [Makefile](./Makefile) for other useful targets. Before submitting a pull request make sure to run `make lint`. - ---- - -Made with ☕️ & ❤️ by [Greymass](https://greymass.com), if you find this useful please consider [supporting us](https://greymass.com/support-us). diff --git a/packages/transact-plugin-template/package.json b/packages/transact-plugin-template/package.json deleted file mode 100644 index 05378d36..00000000 --- a/packages/transact-plugin-template/package.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "name": "@wharfkit/transact-plugin-template", - "description": "A template to create plugins for use with @wharfkit/session transact method.", - "version": "4.0.0-rc4", - "private": true, - "homepage": "https://github.com/wharfkit/transact-plugin-template", - "license": "BSD-3-Clause", - "engines": { - "node": ">=20.19.0" - }, - "main": "lib/transact-plugin-template.js", - "module": "lib/transact-plugin-template.m.js", - "types": "lib/transact-plugin-template.d.ts", - "sideEffects": false, - "files": [ - "lib/*", - "src/*" - ], - "scripts": {}, - "dependencies": { - "@wharfkit/session": "workspace:*" - }, - "devDependencies": { - "@wharfkit/mock-data": "workspace:*", - "@wharfkit/session": "workspace:*", - "@wharfkit/wallet-plugin-privatekey": "workspace:*" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/wharfkit/js.git", - "directory": "packages/transact-plugin-template" - } -} diff --git a/packages/transact-plugin-template/src/index.ts b/packages/transact-plugin-template/src/index.ts deleted file mode 100644 index 1f076685..00000000 --- a/packages/transact-plugin-template/src/index.ts +++ /dev/null @@ -1,90 +0,0 @@ -import { - AbstractTransactPlugin, - TransactContext, - TransactHookResponseType, - TransactHookTypes, -} from '@wharfkit/session' - -/** Import JSON localization strings */ -import defaultTranslations from './translations' - -export class TransactPluginTemplate extends AbstractTransactPlugin { - /** A unique ID for this plugin */ - id = 'transact-plugin-template' - - /** Optional - The translation strings to use for the plugin */ - translations = defaultTranslations - - /** - * Register the hooks required for this plugin to function - * - * @param context The TransactContext of the transaction being performed - */ - register(context: TransactContext): void { - // Optional - Retrieve the translation function from the UI if it exists - let t - if (context.ui) { - t = context.ui.getTranslate() - } - - // Register any desired beforeSign hooks - context.addHook( - TransactHookTypes.beforeSign, - async (request, context): Promise => { - // If this plugin is interacting with the UI, throw an error since this is an undefined function - if (context.ui) { - throw new Error( - // Translate the error message against the given key or use the default value as English - t('beforesign', { - default: 'undefined beforeSign hook called from plugin template', - }) - ) - } else { - // eslint-disable-next-line no-console - console.log('undefined beforeSign hook called with', request, context) - } - return - } - ) - - // Register any desired afterSign hooks - context.addHook( - TransactHookTypes.afterSign, - async (request, context): Promise => { - // If this plugin is interacting with the UI, throw an error since this is an undefined function - if (context.ui) { - throw new Error( - // Translate the error message against the given key or use the default value as English - t('aftersign', { - default: 'undefined afterSign hook called from plugin template', - }) - ) - } else { - // eslint-disable-next-line no-console - console.log('undefined afterSign hook called with', request, context) - } - return - } - ) - - // Register any desired afterBroadcast hooks - context.addHook( - TransactHookTypes.afterBroadcast, - async (request, context): Promise => { - // If this plugin is interacting with the UI, throw an error since this is an undefined function - if (context.ui) { - throw new Error( - // Translate the error message against the given key or use the default value as English - t('afterbroadcast', { - default: 'undefined afterBroadcast hook called from plugin template', - }) - ) - } else { - // eslint-disable-next-line no-console - console.log('undefined afterBroadcast hook called with', request, context) - } - return - } - ) - } -} diff --git a/packages/transact-plugin-template/src/translations/en.json b/packages/transact-plugin-template/src/translations/en.json deleted file mode 100644 index 0122e384..00000000 --- a/packages/transact-plugin-template/src/translations/en.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "beforesign": "undefined beforeSign hook called from plugin template", - "aftersign": "undefined afterSign hook called from plugin template", - "afterbroadcast": "undefined afterBroadcast hook called from plugin template" -} diff --git a/packages/transact-plugin-template/src/translations/index.ts b/packages/transact-plugin-template/src/translations/index.ts deleted file mode 100644 index 73136018..00000000 --- a/packages/transact-plugin-template/src/translations/index.ts +++ /dev/null @@ -1,11 +0,0 @@ -import en from './en.json' -import ko from './ko.json' -import zh_hans from './zh-hans.json' -import zh_hant from './zh-hant.json' - -export default { - en, - ko, - 'zh-Hans': zh_hans, - 'zh-Hant': zh_hant, -} diff --git a/packages/transact-plugin-template/src/translations/ko.json b/packages/transact-plugin-template/src/translations/ko.json deleted file mode 100644 index 0122e384..00000000 --- a/packages/transact-plugin-template/src/translations/ko.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "beforesign": "undefined beforeSign hook called from plugin template", - "aftersign": "undefined afterSign hook called from plugin template", - "afterbroadcast": "undefined afterBroadcast hook called from plugin template" -} diff --git a/packages/transact-plugin-template/src/translations/zh-hans.json b/packages/transact-plugin-template/src/translations/zh-hans.json deleted file mode 100644 index 0122e384..00000000 --- a/packages/transact-plugin-template/src/translations/zh-hans.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "beforesign": "undefined beforeSign hook called from plugin template", - "aftersign": "undefined afterSign hook called from plugin template", - "afterbroadcast": "undefined afterBroadcast hook called from plugin template" -} diff --git a/packages/transact-plugin-template/src/translations/zh-hant.json b/packages/transact-plugin-template/src/translations/zh-hant.json deleted file mode 100644 index 0122e384..00000000 --- a/packages/transact-plugin-template/src/translations/zh-hant.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "beforesign": "undefined beforeSign hook called from plugin template", - "aftersign": "undefined afterSign hook called from plugin template", - "afterbroadcast": "undefined afterBroadcast hook called from plugin template" -} diff --git a/packages/transact-plugin-template/test/data/1a4de93cf80e8098e1a0a4ec48cc86c1050772d7.json b/packages/transact-plugin-template/test/data/1a4de93cf80e8098e1a0a4ec48cc86c1050772d7.json deleted file mode 100644 index 4b01d2b9..00000000 --- a/packages/transact-plugin-template/test/data/1a4de93cf80e8098e1a0a4ec48cc86c1050772d7.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "request": { - "path": "https://jungle4.greymass.com/v1/chain/get_info", - "params": { - "method": "POST", - "headers": {} - } - }, - "headers": { - "access-control-allow-headers": "X-Requested-With,Accept,Content-Type,Origin", - "access-control-allow-methods": "GET, POST, OPTIONS", - "access-control-allow-origin": "*", - "connection": "close", - "content-length": "964", - "content-type": "application/json", - "date": "Sat, 31 Dec 2022 07:01:37 GMT", - "host": "jungle4.greymass.com", - "server": "nginx/1.18.0 (Ubuntu)", - "x-cached": "MISS" - }, - "status": 200, - "json": { - "server_version": "905c5cc9", - "chain_id": "73e4385a2708e6d7048834fbc1079f2fabb17b3c125b146af438971e90716c4d", - "head_block_num": 53515366, - "last_irreversible_block_num": 53515039, - "last_irreversible_block_id": "0330931f8caaac25828e42073605c1fbe07ebcbb3d330890a63420e0cd596885", - "head_block_id": "033094661eb1189e4d3aea3800a53821f6ac21b0a50f76ab76ed69febed7468e", - "head_block_time": "2022-12-31T07:01:37.000", - "head_block_producer": "jumpingfrogs", - "virtual_block_cpu_limit": 200000000, - "virtual_block_net_limit": 1048576000, - "block_cpu_limit": 200000, - "block_net_limit": 1048576, - "server_version_string": "v3.1.3", - "fork_db_head_block_num": 53515366, - "fork_db_head_block_id": "033094661eb1189e4d3aea3800a53821f6ac21b0a50f76ab76ed69febed7468e", - "server_full_version_string": "v3.1.3-905c5cc900b4e88aed4ab6912009127bf9f4f140", - "total_cpu_weight": "120460600273060", - "total_net_weight": "117529136309360", - "earliest_available_block_num": 53328984, - "last_irreversible_block_time": "2022-12-31T06:58:53.500" - }, - "text": "{\"server_version\":\"905c5cc9\",\"chain_id\":\"73e4385a2708e6d7048834fbc1079f2fabb17b3c125b146af438971e90716c4d\",\"head_block_num\":53515366,\"last_irreversible_block_num\":53515039,\"last_irreversible_block_id\":\"0330931f8caaac25828e42073605c1fbe07ebcbb3d330890a63420e0cd596885\",\"head_block_id\":\"033094661eb1189e4d3aea3800a53821f6ac21b0a50f76ab76ed69febed7468e\",\"head_block_time\":\"2022-12-31T07:01:37.000\",\"head_block_producer\":\"jumpingfrogs\",\"virtual_block_cpu_limit\":200000000,\"virtual_block_net_limit\":1048576000,\"block_cpu_limit\":200000,\"block_net_limit\":1048576,\"server_version_string\":\"v3.1.3\",\"fork_db_head_block_num\":53515366,\"fork_db_head_block_id\":\"033094661eb1189e4d3aea3800a53821f6ac21b0a50f76ab76ed69febed7468e\",\"server_full_version_string\":\"v3.1.3-905c5cc900b4e88aed4ab6912009127bf9f4f140\",\"total_cpu_weight\":\"120460600273060\",\"total_net_weight\":\"117529136309360\",\"earliest_available_block_num\":53328984,\"last_irreversible_block_time\":\"2022-12-31T06:58:53.500\"}" -} \ No newline at end of file diff --git a/packages/transact-plugin-template/test/data/a041de03f2a7ee6c133465c8c6b2b286704a5d8f.json b/packages/transact-plugin-template/test/data/a041de03f2a7ee6c133465c8c6b2b286704a5d8f.json deleted file mode 100644 index bdd3fcdb..00000000 --- a/packages/transact-plugin-template/test/data/a041de03f2a7ee6c133465c8c6b2b286704a5d8f.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "request": { - "path": "https://jungle4.greymass.com/v1/chain/get_info", - "params": { - "method": "GET", - "headers": {} - } - }, - "status": 200, - "json": { - "server_version": "905c5cc9", - "chain_id": "73e4385a2708e6d7048834fbc1079f2fabb17b3c125b146af438971e90716c4d", - "head_block_num": 107760337, - "last_irreversible_block_num": 107760010, - "last_irreversible_block_id": "066c498a86f39c797299bab0d7e6b1b176105c83cf5746dab87f6001fbf9c292", - "head_block_id": "066c4ad138a5fe1d1710e90ef5dabeebb44a68e8e671dfa56cfa0f90a755996c", - "head_block_time": "2023-11-10T17:30:55.000", - "head_block_producer": "ivote4eosusa", - "virtual_block_cpu_limit": 200000000, - "virtual_block_net_limit": 1048576000, - "block_cpu_limit": 200000, - "block_net_limit": 1048576, - "server_version_string": "v3.1.3", - "fork_db_head_block_num": 107760337, - "fork_db_head_block_id": "066c4ad138a5fe1d1710e90ef5dabeebb44a68e8e671dfa56cfa0f90a755996c", - "server_full_version_string": "v3.1.3-905c5cc900b4e88aed4ab6912009127bf9f4f140", - "total_cpu_weight": "120613298869319", - "total_net_weight": "117529300091371", - "earliest_available_block_num": 107585477, - "last_irreversible_block_time": "2023-11-10T17:28:11.500" - }, - "text": "{\"server_version\":\"905c5cc9\",\"chain_id\":\"73e4385a2708e6d7048834fbc1079f2fabb17b3c125b146af438971e90716c4d\",\"head_block_num\":107760337,\"last_irreversible_block_num\":107760010,\"last_irreversible_block_id\":\"066c498a86f39c797299bab0d7e6b1b176105c83cf5746dab87f6001fbf9c292\",\"head_block_id\":\"066c4ad138a5fe1d1710e90ef5dabeebb44a68e8e671dfa56cfa0f90a755996c\",\"head_block_time\":\"2023-11-10T17:30:55.000\",\"head_block_producer\":\"ivote4eosusa\",\"virtual_block_cpu_limit\":200000000,\"virtual_block_net_limit\":1048576000,\"block_cpu_limit\":200000,\"block_net_limit\":1048576,\"server_version_string\":\"v3.1.3\",\"fork_db_head_block_num\":107760337,\"fork_db_head_block_id\":\"066c4ad138a5fe1d1710e90ef5dabeebb44a68e8e671dfa56cfa0f90a755996c\",\"server_full_version_string\":\"v3.1.3-905c5cc900b4e88aed4ab6912009127bf9f4f140\",\"total_cpu_weight\":\"120613298869319\",\"total_net_weight\":\"117529300091371\",\"earliest_available_block_num\":107585477,\"last_irreversible_block_time\":\"2023-11-10T17:28:11.500\"}" -} \ No newline at end of file diff --git a/packages/transact-plugin-template/test/data/ed314e8a151304a30043198b7b9e9df34a14aaeb.json b/packages/transact-plugin-template/test/data/ed314e8a151304a30043198b7b9e9df34a14aaeb.json deleted file mode 100644 index 4874c223..00000000 --- a/packages/transact-plugin-template/test/data/ed314e8a151304a30043198b7b9e9df34a14aaeb.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "request": { - "path": "https://jungle4.greymass.com/v1/chain/get_raw_abi", - "params": { - "method": "POST", - "body": "{\"account_name\":\"eosio.token\"}", - "headers": {} - } - }, - "status": 200, - "json": { - "account_name": "eosio.token", - "code_hash": "33109b3dd5d354cab5a425c1d4c404c4db056717215f1a8b7ba036a6692811df", - "abi_hash": "d84356074da34a976528321472d73ac919227b9b01d9de59d8ade6d96440455c", - "abi": "DmVvc2lvOjphYmkvMS4yAAgHYWNjb3VudAABB2JhbGFuY2UFYXNzZXQFY2xvc2UAAgVvd25lcgRuYW1lBnN5bWJvbAZzeW1ib2wGY3JlYXRlAAIGaXNzdWVyBG5hbWUObWF4aW11bV9zdXBwbHkFYXNzZXQOY3VycmVuY3lfc3RhdHMAAwZzdXBwbHkFYXNzZXQKbWF4X3N1cHBseQVhc3NldAZpc3N1ZXIEbmFtZQVpc3N1ZQADAnRvBG5hbWUIcXVhbnRpdHkFYXNzZXQEbWVtbwZzdHJpbmcEb3BlbgADBW93bmVyBG5hbWUGc3ltYm9sBnN5bWJvbAlyYW1fcGF5ZXIEbmFtZQZyZXRpcmUAAghxdWFudGl0eQVhc3NldARtZW1vBnN0cmluZwh0cmFuc2ZlcgAEBGZyb20EbmFtZQJ0bwRuYW1lCHF1YW50aXR5BWFzc2V0BG1lbW8Gc3RyaW5nBgAAAAAAhWlEBWNsb3NlAAAAAACobNRFBmNyZWF0ZQAAAAAAAKUxdgVpc3N1ZQAAAAAAADBVpQRvcGVuAAAAAACo67K6BnJldGlyZQAAAABXLTzNzQh0cmFuc2ZlcgACAAAAOE9NETIDaTY0AAAHYWNjb3VudAAAAAAAkE3GA2k2NAAADmN1cnJlbmN5X3N0YXRzAAAAAA===" - }, - "text": "{\"account_name\":\"eosio.token\",\"code_hash\":\"33109b3dd5d354cab5a425c1d4c404c4db056717215f1a8b7ba036a6692811df\",\"abi_hash\":\"d84356074da34a976528321472d73ac919227b9b01d9de59d8ade6d96440455c\",\"abi\":\"DmVvc2lvOjphYmkvMS4yAAgHYWNjb3VudAABB2JhbGFuY2UFYXNzZXQFY2xvc2UAAgVvd25lcgRuYW1lBnN5bWJvbAZzeW1ib2wGY3JlYXRlAAIGaXNzdWVyBG5hbWUObWF4aW11bV9zdXBwbHkFYXNzZXQOY3VycmVuY3lfc3RhdHMAAwZzdXBwbHkFYXNzZXQKbWF4X3N1cHBseQVhc3NldAZpc3N1ZXIEbmFtZQVpc3N1ZQADAnRvBG5hbWUIcXVhbnRpdHkFYXNzZXQEbWVtbwZzdHJpbmcEb3BlbgADBW93bmVyBG5hbWUGc3ltYm9sBnN5bWJvbAlyYW1fcGF5ZXIEbmFtZQZyZXRpcmUAAghxdWFudGl0eQVhc3NldARtZW1vBnN0cmluZwh0cmFuc2ZlcgAEBGZyb20EbmFtZQJ0bwRuYW1lCHF1YW50aXR5BWFzc2V0BG1lbW8Gc3RyaW5nBgAAAAAAhWlEBWNsb3NlAAAAAACobNRFBmNyZWF0ZQAAAAAAAKUxdgVpc3N1ZQAAAAAAADBVpQRvcGVuAAAAAACo67K6BnJldGlyZQAAAABXLTzNzQh0cmFuc2ZlcgACAAAAOE9NETIDaTY0AAAHYWNjb3VudAAAAAAAkE3GA2k2NAAADmN1cnJlbmN5X3N0YXRzAAAAAA===\"}" -} \ No newline at end of file diff --git a/packages/transact-plugin-template/test/tests/common.ts b/packages/transact-plugin-template/test/tests/common.ts deleted file mode 100644 index 500ecf8e..00000000 --- a/packages/transact-plugin-template/test/tests/common.ts +++ /dev/null @@ -1,49 +0,0 @@ -import {TransactPluginTemplate} from '../../src/index' - -import {Session, SessionArgs, SessionOptions} from '@wharfkit/session' -import {mockFetch} from '@wharfkit/mock-data' -import {WalletPluginPrivateKey} from '@wharfkit/wallet-plugin-privatekey' - -const wallet = new WalletPluginPrivateKey('5Jtoxgny5tT7NiNFp1MLogviuPJ9NniWjnU4wKzaX4t7pL4kJ8s') - -const mockSessionArgs: SessionArgs = { - chain: { - id: '73e4385a2708e6d7048834fbc1079f2fabb17b3c125b146af438971e90716c4d', - url: 'https://jungle4.greymass.com', - }, - permissionLevel: 'wharfkit1131@test', - walletPlugin: wallet, -} - -const mockSessionOptions: SessionOptions = { - fetch: mockFetch, - transactPlugins: [new TransactPluginTemplate()], -} - -suite('example', function () { - test('plugin usage', async function () { - const session = new Session(mockSessionArgs, mockSessionOptions) - const action = { - authorization: [ - { - actor: 'wharfkit1115', - permission: 'test', - }, - ], - account: 'eosio.token', - name: 'transfer', - data: { - from: 'wharfkit1115', - to: 'wharfkittest', - quantity: '0.0001 EOS', - memo: 'wharfkit plugin - resource provider test (maxFee: 0.0001)', - }, - } - await session.transact( - { - action, - }, - {broadcast: false} - ) - }) -}) diff --git a/packages/transact-plugin-template/test/tsconfig.json b/packages/transact-plugin-template/test/tsconfig.json deleted file mode 100644 index 472a9a18..00000000 --- a/packages/transact-plugin-template/test/tsconfig.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "extends": [ - "../tsconfig.json", - "../../../tsconfig.test.json" - ], - "compilerOptions": { - "baseUrl": "..", - "paths": { - "$lib": [ - "src" - ], - "$test": [ - "test" - ], - "$test/*": [ - "test/*" - ] - } - }, - "include": [ - "*.ts", - "**/*.ts", - "../src/**/*.ts" - ] -} diff --git a/packages/transact-plugin-template/tsconfig.json b/packages/transact-plugin-template/tsconfig.json deleted file mode 100644 index 4e6c6ce1..00000000 --- a/packages/transact-plugin-template/tsconfig.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": "../../tsconfig.base.json", - "include": [ - "src/**/*" - ] -} diff --git a/packages/ui-plugin-template/.editorconfig b/packages/ui-plugin-template/.editorconfig deleted file mode 100644 index 779f99a1..00000000 --- a/packages/ui-plugin-template/.editorconfig +++ /dev/null @@ -1,12 +0,0 @@ -root = true - -[*] -indent_style = space -indent_size = 4 -end_of_line = lf -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true - -[*.md] -trim_trailing_whitespace = false diff --git a/packages/ui-plugin-template/.gitignore b/packages/ui-plugin-template/.gitignore deleted file mode 100644 index 53bc8ae9..00000000 --- a/packages/ui-plugin-template/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -node_modules/ -lib/ -build/ -test/browser.html* diff --git a/packages/ui-plugin-template/LICENSE b/packages/ui-plugin-template/LICENSE deleted file mode 100644 index 482ed2da..00000000 --- a/packages/ui-plugin-template/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2023 Greymass Inc. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. diff --git a/packages/ui-plugin-template/Makefile b/packages/ui-plugin-template/Makefile deleted file mode 100644 index 3543f49d..00000000 --- a/packages/ui-plugin-template/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -MOCK_DIR := ./test/data - -include ../../common.mk diff --git a/packages/ui-plugin-template/README.md b/packages/ui-plugin-template/README.md deleted file mode 100644 index 25944d12..00000000 --- a/packages/ui-plugin-template/README.md +++ /dev/null @@ -1,20 +0,0 @@ -# @wharfkit/ui-plugin-template - -A template to create a `UserInterface` for use during the `login` and `transact` calls of the `@wharfkit/session` library. - -## Usage - -- [Use this as a template.](https://docs.github.com/en/repositories/creating-and-managing-repositories/creating-a-repository-from-a-template) -- Write your user interfaces display logic. -- Publish it on Github or npmjs.com -- Include it in your project and use it. - -## Developing - -You need [Make](https://www.gnu.org/software/make/), [node.js](https://nodejs.org/en/) and [yarn](https://classic.yarnpkg.com/en/docs/install) installed. - -Clone the repository and run `make` to checkout all dependencies and build the project. See the [Makefile](./Makefile) for other useful targets. Before submitting a pull request make sure to run `make lint`. - ---- - -Made with ☕️ & ❤️ by [Greymass](https://greymass.com), if you find this useful please consider [supporting us](https://greymass.com/support-us). diff --git a/packages/ui-plugin-template/package.json b/packages/ui-plugin-template/package.json deleted file mode 100644 index 457930f9..00000000 --- a/packages/ui-plugin-template/package.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "name": "@wharfkit/ui-plugin-template", - "description": "A template to create user interfaces for use with @wharfkit/session.", - "version": "4.0.0-rc4", - "private": true, - "homepage": "https://github.com/wharfkit/ui-plugin-template", - "license": "BSD-3-Clause", - "engines": { - "node": ">=20.19.0" - }, - "main": "lib/ui-plugin-template.js", - "module": "lib/ui-plugin-template.m.js", - "types": "lib/ui-plugin-template.d.ts", - "sideEffects": false, - "files": [ - "lib/*", - "src/*" - ], - "scripts": {}, - "dependencies": { - "@wharfkit/session": "workspace:*" - }, - "devDependencies": { - "@wharfkit/mock-data": "workspace:*", - "@wharfkit/session": "workspace:*" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/wharfkit/js.git", - "directory": "packages/ui-plugin-template" - } -} diff --git a/packages/ui-plugin-template/src/index.ts b/packages/ui-plugin-template/src/index.ts deleted file mode 100644 index d2172e6f..00000000 --- a/packages/ui-plugin-template/src/index.ts +++ /dev/null @@ -1,81 +0,0 @@ -import { - AbstractUserInterface, - cancelable, - Cancelable, - Checksum256, - LocaleDefinitions, - LoginContext, - LoginOptions, - PermissionLevel, - PromptArgs, - PromptResponse, - UserInterface, - UserInterfaceAccountCreationResponse, - UserInterfaceLoginResponse, -} from '@wharfkit/session' - -export class UserInterfaceTEMPLATE extends AbstractUserInterface implements UserInterface { - /* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-empty-function */ - - /** Collect the chain, permission level, and wallet plugin index a login call needs. */ - async login(context: LoginContext): Promise { - return { - chainId: context.chain?.id ?? Checksum256.from(context.chains[0].id), - permissionLevel: context.permissionLevel ?? PermissionLevel.from('teamgreymass@active'), - walletPluginIndex: 0, - } - } - - /** An error has occurred. Present it to the user. */ - async onError(error: Error): Promise {} - - /** An account creation call has started. Return the chain and plugin the user picked. */ - async onAccountCreate(): Promise { - return {} - } - - /** The account creation call has finished. Tear down any account creation UI. */ - async onAccountCreateComplete(): Promise {} - - /** A login call has started. Prepare any UI the login flow needs. */ - async onLogin(options?: LoginOptions): Promise {} - - /** The login call has finished. Tear down any login UI. */ - async onLoginComplete(): Promise {} - - /** A transact call has started. Prepare any UI the transact flow needs. */ - async onTransact(): Promise {} - - /** The transact call has finished. Tear down any transact UI. */ - async onTransactComplete(): Promise {} - - /** The transact call has reached the signing step. */ - async onSign(): Promise {} - - /** Signing has finished. */ - async onSignComplete(): Promise {} - - /** The transact call has reached the broadcast step. */ - async onBroadcast(): Promise {} - - /** Broadcasting has finished. */ - async onBroadcastComplete(): Promise {} - - /** Render the prompt in `args` and resolve with the user's choice; the second `cancelable` argument runs on abort. */ - prompt(args: PromptArgs): Cancelable { - return cancelable( - new Promise(() => { - // Render the PromptElements in `args`, then resolve or reject. - }), - (canceled) => { - throw canceled - } - ) - } - - /** A plugin has pushed a text-only status message. Surface it however suits the UI. */ - status(message: string): void {} - - /** Merge localization strings supplied by a plugin into the UI's own definitions. */ - addTranslations(definitions: LocaleDefinitions): void {} -} diff --git a/packages/ui-plugin-template/test/data/a041de03f2a7ee6c133465c8c6b2b286704a5d8f.json b/packages/ui-plugin-template/test/data/a041de03f2a7ee6c133465c8c6b2b286704a5d8f.json deleted file mode 100644 index bdd3fcdb..00000000 --- a/packages/ui-plugin-template/test/data/a041de03f2a7ee6c133465c8c6b2b286704a5d8f.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "request": { - "path": "https://jungle4.greymass.com/v1/chain/get_info", - "params": { - "method": "GET", - "headers": {} - } - }, - "status": 200, - "json": { - "server_version": "905c5cc9", - "chain_id": "73e4385a2708e6d7048834fbc1079f2fabb17b3c125b146af438971e90716c4d", - "head_block_num": 107760337, - "last_irreversible_block_num": 107760010, - "last_irreversible_block_id": "066c498a86f39c797299bab0d7e6b1b176105c83cf5746dab87f6001fbf9c292", - "head_block_id": "066c4ad138a5fe1d1710e90ef5dabeebb44a68e8e671dfa56cfa0f90a755996c", - "head_block_time": "2023-11-10T17:30:55.000", - "head_block_producer": "ivote4eosusa", - "virtual_block_cpu_limit": 200000000, - "virtual_block_net_limit": 1048576000, - "block_cpu_limit": 200000, - "block_net_limit": 1048576, - "server_version_string": "v3.1.3", - "fork_db_head_block_num": 107760337, - "fork_db_head_block_id": "066c4ad138a5fe1d1710e90ef5dabeebb44a68e8e671dfa56cfa0f90a755996c", - "server_full_version_string": "v3.1.3-905c5cc900b4e88aed4ab6912009127bf9f4f140", - "total_cpu_weight": "120613298869319", - "total_net_weight": "117529300091371", - "earliest_available_block_num": 107585477, - "last_irreversible_block_time": "2023-11-10T17:28:11.500" - }, - "text": "{\"server_version\":\"905c5cc9\",\"chain_id\":\"73e4385a2708e6d7048834fbc1079f2fabb17b3c125b146af438971e90716c4d\",\"head_block_num\":107760337,\"last_irreversible_block_num\":107760010,\"last_irreversible_block_id\":\"066c498a86f39c797299bab0d7e6b1b176105c83cf5746dab87f6001fbf9c292\",\"head_block_id\":\"066c4ad138a5fe1d1710e90ef5dabeebb44a68e8e671dfa56cfa0f90a755996c\",\"head_block_time\":\"2023-11-10T17:30:55.000\",\"head_block_producer\":\"ivote4eosusa\",\"virtual_block_cpu_limit\":200000000,\"virtual_block_net_limit\":1048576000,\"block_cpu_limit\":200000,\"block_net_limit\":1048576,\"server_version_string\":\"v3.1.3\",\"fork_db_head_block_num\":107760337,\"fork_db_head_block_id\":\"066c4ad138a5fe1d1710e90ef5dabeebb44a68e8e671dfa56cfa0f90a755996c\",\"server_full_version_string\":\"v3.1.3-905c5cc900b4e88aed4ab6912009127bf9f4f140\",\"total_cpu_weight\":\"120613298869319\",\"total_net_weight\":\"117529300091371\",\"earliest_available_block_num\":107585477,\"last_irreversible_block_time\":\"2023-11-10T17:28:11.500\"}" -} \ No newline at end of file diff --git a/packages/ui-plugin-template/test/data/ed314e8a151304a30043198b7b9e9df34a14aaeb.json b/packages/ui-plugin-template/test/data/ed314e8a151304a30043198b7b9e9df34a14aaeb.json deleted file mode 100644 index 4874c223..00000000 --- a/packages/ui-plugin-template/test/data/ed314e8a151304a30043198b7b9e9df34a14aaeb.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "request": { - "path": "https://jungle4.greymass.com/v1/chain/get_raw_abi", - "params": { - "method": "POST", - "body": "{\"account_name\":\"eosio.token\"}", - "headers": {} - } - }, - "status": 200, - "json": { - "account_name": "eosio.token", - "code_hash": "33109b3dd5d354cab5a425c1d4c404c4db056717215f1a8b7ba036a6692811df", - "abi_hash": "d84356074da34a976528321472d73ac919227b9b01d9de59d8ade6d96440455c", - "abi": "DmVvc2lvOjphYmkvMS4yAAgHYWNjb3VudAABB2JhbGFuY2UFYXNzZXQFY2xvc2UAAgVvd25lcgRuYW1lBnN5bWJvbAZzeW1ib2wGY3JlYXRlAAIGaXNzdWVyBG5hbWUObWF4aW11bV9zdXBwbHkFYXNzZXQOY3VycmVuY3lfc3RhdHMAAwZzdXBwbHkFYXNzZXQKbWF4X3N1cHBseQVhc3NldAZpc3N1ZXIEbmFtZQVpc3N1ZQADAnRvBG5hbWUIcXVhbnRpdHkFYXNzZXQEbWVtbwZzdHJpbmcEb3BlbgADBW93bmVyBG5hbWUGc3ltYm9sBnN5bWJvbAlyYW1fcGF5ZXIEbmFtZQZyZXRpcmUAAghxdWFudGl0eQVhc3NldARtZW1vBnN0cmluZwh0cmFuc2ZlcgAEBGZyb20EbmFtZQJ0bwRuYW1lCHF1YW50aXR5BWFzc2V0BG1lbW8Gc3RyaW5nBgAAAAAAhWlEBWNsb3NlAAAAAACobNRFBmNyZWF0ZQAAAAAAAKUxdgVpc3N1ZQAAAAAAADBVpQRvcGVuAAAAAACo67K6BnJldGlyZQAAAABXLTzNzQh0cmFuc2ZlcgACAAAAOE9NETIDaTY0AAAHYWNjb3VudAAAAAAAkE3GA2k2NAAADmN1cnJlbmN5X3N0YXRzAAAAAA===" - }, - "text": "{\"account_name\":\"eosio.token\",\"code_hash\":\"33109b3dd5d354cab5a425c1d4c404c4db056717215f1a8b7ba036a6692811df\",\"abi_hash\":\"d84356074da34a976528321472d73ac919227b9b01d9de59d8ade6d96440455c\",\"abi\":\"DmVvc2lvOjphYmkvMS4yAAgHYWNjb3VudAABB2JhbGFuY2UFYXNzZXQFY2xvc2UAAgVvd25lcgRuYW1lBnN5bWJvbAZzeW1ib2wGY3JlYXRlAAIGaXNzdWVyBG5hbWUObWF4aW11bV9zdXBwbHkFYXNzZXQOY3VycmVuY3lfc3RhdHMAAwZzdXBwbHkFYXNzZXQKbWF4X3N1cHBseQVhc3NldAZpc3N1ZXIEbmFtZQVpc3N1ZQADAnRvBG5hbWUIcXVhbnRpdHkFYXNzZXQEbWVtbwZzdHJpbmcEb3BlbgADBW93bmVyBG5hbWUGc3ltYm9sBnN5bWJvbAlyYW1fcGF5ZXIEbmFtZQZyZXRpcmUAAghxdWFudGl0eQVhc3NldARtZW1vBnN0cmluZwh0cmFuc2ZlcgAEBGZyb20EbmFtZQJ0bwRuYW1lCHF1YW50aXR5BWFzc2V0BG1lbW8Gc3RyaW5nBgAAAAAAhWlEBWNsb3NlAAAAAACobNRFBmNyZWF0ZQAAAAAAAKUxdgVpc3N1ZQAAAAAAADBVpQRvcGVuAAAAAACo67K6BnJldGlyZQAAAABXLTzNzQh0cmFuc2ZlcgACAAAAOE9NETIDaTY0AAAHYWNjb3VudAAAAAAAkE3GA2k2NAAADmN1cnJlbmN5X3N0YXRzAAAAAA===\"}" -} \ No newline at end of file diff --git a/packages/ui-plugin-template/test/tests/common.ts b/packages/ui-plugin-template/test/tests/common.ts deleted file mode 100644 index 286150f9..00000000 --- a/packages/ui-plugin-template/test/tests/common.ts +++ /dev/null @@ -1,45 +0,0 @@ -import {assert} from 'chai' -import {PermissionLevel, SessionKit} from '@wharfkit/session' -import { - mockChainDefinition, - mockPermissionLevel, - mockSessionKitArgs, - mockSessionKitOptions, -} from '@wharfkit/mock-data' - -import {UserInterfaceTEMPLATE} from '$lib' - -suite('user interface', function () { - test('login and sign', async function () { - const kit = new SessionKit( - { - ...mockSessionKitArgs, - ui: new UserInterfaceTEMPLATE(), - }, - mockSessionKitOptions - ) - const {session} = await kit.login({ - chain: mockChainDefinition.id, - permissionLevel: mockPermissionLevel, - }) - assert.isTrue(session.chain.equals(mockChainDefinition)) - assert.isTrue(session.actor.equals(PermissionLevel.from(mockPermissionLevel).actor)) - const result = await session.transact( - { - action: { - authorization: [PermissionLevel.from(mockPermissionLevel)], - account: 'eosio.token', - name: 'transfer', - data: { - from: PermissionLevel.from(mockPermissionLevel).actor, - to: 'wharfkittest', - quantity: '0.0001 EOS', - memo: 'wharfkit/session ui plugin template', - }, - }, - }, - {broadcast: false} - ) - assert.equal(result.signatures.length, 1) - }) -}) diff --git a/packages/ui-plugin-template/test/tsconfig.json b/packages/ui-plugin-template/test/tsconfig.json deleted file mode 100644 index 472a9a18..00000000 --- a/packages/ui-plugin-template/test/tsconfig.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "extends": [ - "../tsconfig.json", - "../../../tsconfig.test.json" - ], - "compilerOptions": { - "baseUrl": "..", - "paths": { - "$lib": [ - "src" - ], - "$test": [ - "test" - ], - "$test/*": [ - "test/*" - ] - } - }, - "include": [ - "*.ts", - "**/*.ts", - "../src/**/*.ts" - ] -} diff --git a/packages/ui-plugin-template/tsconfig.json b/packages/ui-plugin-template/tsconfig.json deleted file mode 100644 index 4e6c6ce1..00000000 --- a/packages/ui-plugin-template/tsconfig.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": "../../tsconfig.base.json", - "include": [ - "src/**/*" - ] -} diff --git a/packages/wallet-plugin-template/.editorconfig b/packages/wallet-plugin-template/.editorconfig deleted file mode 100644 index 779f99a1..00000000 --- a/packages/wallet-plugin-template/.editorconfig +++ /dev/null @@ -1,12 +0,0 @@ -root = true - -[*] -indent_style = space -indent_size = 4 -end_of_line = lf -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true - -[*.md] -trim_trailing_whitespace = false diff --git a/packages/wallet-plugin-template/.gitignore b/packages/wallet-plugin-template/.gitignore deleted file mode 100644 index 88edb628..00000000 --- a/packages/wallet-plugin-template/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -node_modules/ -lib/ diff --git a/packages/wallet-plugin-template/LICENSE b/packages/wallet-plugin-template/LICENSE deleted file mode 100644 index 482ed2da..00000000 --- a/packages/wallet-plugin-template/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2023 Greymass Inc. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. diff --git a/packages/wallet-plugin-template/Makefile b/packages/wallet-plugin-template/Makefile deleted file mode 100644 index 3543f49d..00000000 --- a/packages/wallet-plugin-template/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -MOCK_DIR := ./test/data - -include ../../common.mk diff --git a/packages/wallet-plugin-template/README.md b/packages/wallet-plugin-template/README.md deleted file mode 100644 index cd6d673c..00000000 --- a/packages/wallet-plugin-template/README.md +++ /dev/null @@ -1,20 +0,0 @@ -# @wharfkit/wallet-plugin-template - -A template to create a `WalletPlugin` for use within the `@wharfkit/session` library. - -## Usage - -- [Use this as a template.](https://docs.github.com/en/repositories/creating-and-managing-repositories/creating-a-repository-from-a-template) -- Write your wallet plugin's logic. -- Publish it on Github or npmjs.com -- Include it in your project and use it. - -## Developing - -You need [Make](https://www.gnu.org/software/make/), [node.js](https://nodejs.org/en/) and [yarn](https://classic.yarnpkg.com/en/docs/install) installed. - -Clone the repository and run `make` to checkout all dependencies and build the project. See the [Makefile](./Makefile) for other useful targets. Before submitting a pull request make sure to run `make lint`. - ---- - -Made with ☕️ & ❤️ by [Greymass](https://greymass.com), if you find this useful please consider [supporting us](https://greymass.com/support-us). diff --git a/packages/wallet-plugin-template/package.json b/packages/wallet-plugin-template/package.json deleted file mode 100644 index feb24154..00000000 --- a/packages/wallet-plugin-template/package.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "name": "@wharfkit/wallet-plugin-template", - "description": "A template to create wallet plugins for use with @wharfkit/session.", - "version": "4.0.0-rc4", - "private": true, - "homepage": "https://github.com/wharfkit/wallet-plugin-template", - "license": "BSD-3-Clause", - "engines": { - "node": ">=20.19.0" - }, - "main": "lib/wallet-plugin-template.js", - "module": "lib/wallet-plugin-template.m.js", - "types": "lib/wallet-plugin-template.d.ts", - "sideEffects": false, - "files": [ - "lib/*", - "src/*" - ], - "scripts": {}, - "dependencies": { - "@wharfkit/session": "workspace:*" - }, - "devDependencies": { - "@wharfkit/mock-data": "workspace:*", - "@wharfkit/session": "workspace:*" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/wharfkit/js.git", - "directory": "packages/wallet-plugin-template" - } -} diff --git a/packages/wallet-plugin-template/src/index.ts b/packages/wallet-plugin-template/src/index.ts deleted file mode 100644 index fbe961ea..00000000 --- a/packages/wallet-plugin-template/src/index.ts +++ /dev/null @@ -1,87 +0,0 @@ -import { - AbstractWalletPlugin, - Checksum256, - LoginContext, - PermissionLevel, - ResolvedSigningRequest, - Signature, - TransactContext, - WalletPlugin, - WalletPluginConfig, - WalletPluginLoginResponse, - WalletPluginMetadata, - WalletPluginSignResponse, -} from '@wharfkit/session' - -export class WalletPluginTEMPLATE extends AbstractWalletPlugin implements WalletPlugin { - /** - * The logic configuration for the wallet plugin. - */ - readonly config: WalletPluginConfig = { - // Should the user interface display a chain selector? - requiresChainSelect: true, - - // Should the user interface display a permission selector? - requiresPermissionSelect: false, - - // Optionally specify if this plugin only works with specific blockchains. - // supportedChains: ['73e4385a2708e6d7048834fbc1079f2fabb17b3c125b146af438971e90716c4d'] - } - /** - * The metadata for the wallet plugin to be displayed in the user interface. - */ - readonly metadata: WalletPluginMetadata = WalletPluginMetadata.from({ - name: 'Wallet Plugin Template', - description: 'A template that can be used to build wallet plugins!', - logo: 'base_64_encoded_image', - homepage: 'https://someplace.com', - download: 'https://someplace.com/download', - }) - /** - * A unique string identifier for this wallet plugin. - * - * It's recommended this is all lower case, no spaces, and only URL-friendly special characters (dashes, underscores, etc) - */ - get id(): string { - return 'wallet-plugin-template' - } - /** - * Performs the wallet logic required to login and return the chain and permission level to use. - * - * @param options WalletPluginLoginOptions - * @returns Promise - */ - // TODO: Remove these eslint rule modifiers when you are implementing this method. - /* eslint-disable @typescript-eslint/no-unused-vars */ - async login(context: LoginContext): Promise { - // Example response... - return { - chain: Checksum256.from( - '73e4385a2708e6d7048834fbc1079f2fabb17b3c125b146af438971e90716c4d' - ), - permissionLevel: PermissionLevel.from('wharfkit1111@test'), - } - } - /** - * Performs the wallet logic required to sign a transaction and return the signature. - * - * @param chain ChainDefinition - * @param resolved ResolvedSigningRequest - * @returns Promise - */ - // TODO: Remove these eslint rule modifiers when you are implementing this method. - /* eslint-disable @typescript-eslint/no-unused-vars */ - async sign( - resolved: ResolvedSigningRequest, - context: TransactContext - ): Promise { - // Example response... - return { - signatures: [ - Signature.from( - 'SIG_K1_KfqBXGdSRnVgZbAXyL9hEYbAvrZjcaxUCenD7Z3aX6yzf6MEyc4Cy3ywToD4j3SKkzSg7L1uvRUirEPHwAwrbg5c9z27Z3' - ), - ], - } - } -} diff --git a/packages/wallet-plugin-template/test/data/a041de03f2a7ee6c133465c8c6b2b286704a5d8f.json b/packages/wallet-plugin-template/test/data/a041de03f2a7ee6c133465c8c6b2b286704a5d8f.json deleted file mode 100644 index bdd3fcdb..00000000 --- a/packages/wallet-plugin-template/test/data/a041de03f2a7ee6c133465c8c6b2b286704a5d8f.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "request": { - "path": "https://jungle4.greymass.com/v1/chain/get_info", - "params": { - "method": "GET", - "headers": {} - } - }, - "status": 200, - "json": { - "server_version": "905c5cc9", - "chain_id": "73e4385a2708e6d7048834fbc1079f2fabb17b3c125b146af438971e90716c4d", - "head_block_num": 107760337, - "last_irreversible_block_num": 107760010, - "last_irreversible_block_id": "066c498a86f39c797299bab0d7e6b1b176105c83cf5746dab87f6001fbf9c292", - "head_block_id": "066c4ad138a5fe1d1710e90ef5dabeebb44a68e8e671dfa56cfa0f90a755996c", - "head_block_time": "2023-11-10T17:30:55.000", - "head_block_producer": "ivote4eosusa", - "virtual_block_cpu_limit": 200000000, - "virtual_block_net_limit": 1048576000, - "block_cpu_limit": 200000, - "block_net_limit": 1048576, - "server_version_string": "v3.1.3", - "fork_db_head_block_num": 107760337, - "fork_db_head_block_id": "066c4ad138a5fe1d1710e90ef5dabeebb44a68e8e671dfa56cfa0f90a755996c", - "server_full_version_string": "v3.1.3-905c5cc900b4e88aed4ab6912009127bf9f4f140", - "total_cpu_weight": "120613298869319", - "total_net_weight": "117529300091371", - "earliest_available_block_num": 107585477, - "last_irreversible_block_time": "2023-11-10T17:28:11.500" - }, - "text": "{\"server_version\":\"905c5cc9\",\"chain_id\":\"73e4385a2708e6d7048834fbc1079f2fabb17b3c125b146af438971e90716c4d\",\"head_block_num\":107760337,\"last_irreversible_block_num\":107760010,\"last_irreversible_block_id\":\"066c498a86f39c797299bab0d7e6b1b176105c83cf5746dab87f6001fbf9c292\",\"head_block_id\":\"066c4ad138a5fe1d1710e90ef5dabeebb44a68e8e671dfa56cfa0f90a755996c\",\"head_block_time\":\"2023-11-10T17:30:55.000\",\"head_block_producer\":\"ivote4eosusa\",\"virtual_block_cpu_limit\":200000000,\"virtual_block_net_limit\":1048576000,\"block_cpu_limit\":200000,\"block_net_limit\":1048576,\"server_version_string\":\"v3.1.3\",\"fork_db_head_block_num\":107760337,\"fork_db_head_block_id\":\"066c4ad138a5fe1d1710e90ef5dabeebb44a68e8e671dfa56cfa0f90a755996c\",\"server_full_version_string\":\"v3.1.3-905c5cc900b4e88aed4ab6912009127bf9f4f140\",\"total_cpu_weight\":\"120613298869319\",\"total_net_weight\":\"117529300091371\",\"earliest_available_block_num\":107585477,\"last_irreversible_block_time\":\"2023-11-10T17:28:11.500\"}" -} \ No newline at end of file diff --git a/packages/wallet-plugin-template/test/data/ed314e8a151304a30043198b7b9e9df34a14aaeb.json b/packages/wallet-plugin-template/test/data/ed314e8a151304a30043198b7b9e9df34a14aaeb.json deleted file mode 100644 index 4874c223..00000000 --- a/packages/wallet-plugin-template/test/data/ed314e8a151304a30043198b7b9e9df34a14aaeb.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "request": { - "path": "https://jungle4.greymass.com/v1/chain/get_raw_abi", - "params": { - "method": "POST", - "body": "{\"account_name\":\"eosio.token\"}", - "headers": {} - } - }, - "status": 200, - "json": { - "account_name": "eosio.token", - "code_hash": "33109b3dd5d354cab5a425c1d4c404c4db056717215f1a8b7ba036a6692811df", - "abi_hash": "d84356074da34a976528321472d73ac919227b9b01d9de59d8ade6d96440455c", - "abi": "DmVvc2lvOjphYmkvMS4yAAgHYWNjb3VudAABB2JhbGFuY2UFYXNzZXQFY2xvc2UAAgVvd25lcgRuYW1lBnN5bWJvbAZzeW1ib2wGY3JlYXRlAAIGaXNzdWVyBG5hbWUObWF4aW11bV9zdXBwbHkFYXNzZXQOY3VycmVuY3lfc3RhdHMAAwZzdXBwbHkFYXNzZXQKbWF4X3N1cHBseQVhc3NldAZpc3N1ZXIEbmFtZQVpc3N1ZQADAnRvBG5hbWUIcXVhbnRpdHkFYXNzZXQEbWVtbwZzdHJpbmcEb3BlbgADBW93bmVyBG5hbWUGc3ltYm9sBnN5bWJvbAlyYW1fcGF5ZXIEbmFtZQZyZXRpcmUAAghxdWFudGl0eQVhc3NldARtZW1vBnN0cmluZwh0cmFuc2ZlcgAEBGZyb20EbmFtZQJ0bwRuYW1lCHF1YW50aXR5BWFzc2V0BG1lbW8Gc3RyaW5nBgAAAAAAhWlEBWNsb3NlAAAAAACobNRFBmNyZWF0ZQAAAAAAAKUxdgVpc3N1ZQAAAAAAADBVpQRvcGVuAAAAAACo67K6BnJldGlyZQAAAABXLTzNzQh0cmFuc2ZlcgACAAAAOE9NETIDaTY0AAAHYWNjb3VudAAAAAAAkE3GA2k2NAAADmN1cnJlbmN5X3N0YXRzAAAAAA===" - }, - "text": "{\"account_name\":\"eosio.token\",\"code_hash\":\"33109b3dd5d354cab5a425c1d4c404c4db056717215f1a8b7ba036a6692811df\",\"abi_hash\":\"d84356074da34a976528321472d73ac919227b9b01d9de59d8ade6d96440455c\",\"abi\":\"DmVvc2lvOjphYmkvMS4yAAgHYWNjb3VudAABB2JhbGFuY2UFYXNzZXQFY2xvc2UAAgVvd25lcgRuYW1lBnN5bWJvbAZzeW1ib2wGY3JlYXRlAAIGaXNzdWVyBG5hbWUObWF4aW11bV9zdXBwbHkFYXNzZXQOY3VycmVuY3lfc3RhdHMAAwZzdXBwbHkFYXNzZXQKbWF4X3N1cHBseQVhc3NldAZpc3N1ZXIEbmFtZQVpc3N1ZQADAnRvBG5hbWUIcXVhbnRpdHkFYXNzZXQEbWVtbwZzdHJpbmcEb3BlbgADBW93bmVyBG5hbWUGc3ltYm9sBnN5bWJvbAlyYW1fcGF5ZXIEbmFtZQZyZXRpcmUAAghxdWFudGl0eQVhc3NldARtZW1vBnN0cmluZwh0cmFuc2ZlcgAEBGZyb20EbmFtZQJ0bwRuYW1lCHF1YW50aXR5BWFzc2V0BG1lbW8Gc3RyaW5nBgAAAAAAhWlEBWNsb3NlAAAAAACobNRFBmNyZWF0ZQAAAAAAAKUxdgVpc3N1ZQAAAAAAADBVpQRvcGVuAAAAAACo67K6BnJldGlyZQAAAABXLTzNzQh0cmFuc2ZlcgACAAAAOE9NETIDaTY0AAAHYWNjb3VudAAAAAAAkE3GA2k2NAAADmN1cnJlbmN5X3N0YXRzAAAAAA===\"}" -} \ No newline at end of file diff --git a/packages/wallet-plugin-template/test/tests/common.ts b/packages/wallet-plugin-template/test/tests/common.ts deleted file mode 100644 index ebfe55ea..00000000 --- a/packages/wallet-plugin-template/test/tests/common.ts +++ /dev/null @@ -1,51 +0,0 @@ -import {assert} from 'chai' -import {PermissionLevel, SessionKit} from '@wharfkit/session' -import { - mockChainDefinition, - mockPermissionLevel, - mockSessionKitArgs, - mockSessionKitOptions, -} from '@wharfkit/mock-data' - -import {WalletPluginTEMPLATE} from '$lib' - -suite('wallet plugin', function () { - test('login and sign', async function () { - const kit = new SessionKit( - { - ...mockSessionKitArgs, - walletPlugins: [new WalletPluginTEMPLATE()], - }, - mockSessionKitOptions - ) - const {session} = await kit.login({ - chain: mockChainDefinition.id, - permissionLevel: mockPermissionLevel, - }) - assert.isTrue(session.chain.equals(mockChainDefinition)) - assert.isTrue(session.actor.equals(PermissionLevel.from(mockPermissionLevel).actor)) - assert.isTrue( - session.permission.equals(PermissionLevel.from(mockPermissionLevel).permission) - ) - const result = await session.transact( - { - action: { - authorization: [PermissionLevel.from(mockPermissionLevel)], - account: 'eosio.token', - name: 'transfer', - data: { - from: PermissionLevel.from(mockPermissionLevel).actor, - to: 'wharfkittest', - quantity: '0.0001 EOS', - memo: 'wharfkit/session wallet plugin template', - }, - }, - }, - { - broadcast: false, - } - ) - assert.isTrue(result.signer.equals(mockPermissionLevel)) - assert.equal(result.signatures.length, 1) - }) -}) diff --git a/packages/wallet-plugin-template/test/tsconfig.json b/packages/wallet-plugin-template/test/tsconfig.json deleted file mode 100644 index 472a9a18..00000000 --- a/packages/wallet-plugin-template/test/tsconfig.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "extends": [ - "../tsconfig.json", - "../../../tsconfig.test.json" - ], - "compilerOptions": { - "baseUrl": "..", - "paths": { - "$lib": [ - "src" - ], - "$test": [ - "test" - ], - "$test/*": [ - "test/*" - ] - } - }, - "include": [ - "*.ts", - "**/*.ts", - "../src/**/*.ts" - ] -} diff --git a/packages/wallet-plugin-template/tsconfig.json b/packages/wallet-plugin-template/tsconfig.json deleted file mode 100644 index 4e6c6ce1..00000000 --- a/packages/wallet-plugin-template/tsconfig.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": "../../tsconfig.base.json", - "include": [ - "src/**/*" - ] -} From 5726f84d46eebbaebd063aaf6273a6773dc4370d Mon Sep 17 00:00:00 2001 From: aaroncox Date: Tue, 1 Sep 2026 00:10:09 -0700 Subject: [PATCH 04/10] Emit a single ESM file and publish sourcemaps --- packages/bundle/vite.config.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/bundle/vite.config.js b/packages/bundle/vite.config.js index abf8a417..019b11a8 100644 --- a/packages/bundle/vite.config.js +++ b/packages/bundle/vite.config.js @@ -4,6 +4,7 @@ import { resolve } from 'path'; export default defineConfig({ build: { + sourcemap: true, lib: { entry: resolve(__dirname, 'src/main.ts'), name: 'Wharf', @@ -14,10 +15,12 @@ export default defineConfig({ rollupOptions: { output: { globals: {}, + // Without this the ESM output is a 6 KB shell importing sibling chunks. + inlineDynamicImports: true, }, }, }, define: { - 'process.env': {}, + 'process.env': {}, }, -}); \ No newline at end of file +}); From 43f267b31737332727d42b8964ce780ce7026365 Mon Sep 17 00:00:00 2001 From: aaroncox Date: Tue, 1 Sep 2026 00:10:09 -0700 Subject: [PATCH 05/10] Pin the bundle's documented CDN URLs --- packages/bundle/README.md | 41 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 39 insertions(+), 2 deletions(-) diff --git a/packages/bundle/README.md b/packages/bundle/README.md index 94036249..8381b755 100644 --- a/packages/bundle/README.md +++ b/packages/bundle/README.md @@ -5,7 +5,7 @@ A prepackaged bundle of common Wharf libraries, built as a self-contained IIFE ( ## Usage ```html - + ``` -`public/bundle.html` and `public/esm.html` are runnable examples of both forms. `make` copies them next to the built files, so open them from `dist/` after a build. +The ESM file is the same artifact in module form, and it is one file with no sibling chunks, so copying it next to your HTML works: + +```html + +``` + +### URL forms + +Both URLs above name an exact version and the full file path. jsDelivr serves that form as the bytes npm holds, byte for byte, with `cache-control: immutable` for a year. The shorter forms (`@wharfkit/bundle`, `@wharfkit/bundle@latest`, `@wharfkit/bundle@4`) are minified by jsDelivr itself and cached for twelve hours at the edge, so they carry different bytes than the package and pick up patch releases without an edit. + +Use `https://cdn.jsdelivr.net/npm/@wharfkit/bundle@4/dist/wharf.bundle.js` if you want patch releases without editing the page. The trade is that the bytes are no longer the package's own and no longer eligible for Subresource Integrity. + +To add an `integrity` attribute, take the hash for the exact version from `https://data.jsdelivr.com/v1/packages/npm/@wharfkit/bundle@4.0.0?structure=flat`, and pair it with `crossorigin="anonymous"`, which SRI requires. An `integrity` attribute on a ` +``` + +Mixing versions across imports, or adding a package still on the `1.x` line, splits it again. esm.sh takes an explicit pin against that: `?deps=@wharfkit/antelope@4.0.0` on each top-level URL rewrites the antelope import to one concrete build and propagates into every transitive `@wharfkit/*` request, so it costs one query parameter per import rather than one entry per transitive package. jsDelivr's `+esm` route has no query-parameter equivalent, and its output carries jsDelivr's own warning against pairing it with Subresource Integrity. + +The bundle stays the recommended browser artifact. It is the only one that guarantees a single antelope without a resolver. + +## Examples + +`public/bundle.html` and `public/esm.html` are runnable examples of both forms, loading the built files next to them. `make` copies them into `dist/`, so open them from there after a build. The same pages ship in the package, at `https://cdn.jsdelivr.net/npm/@wharfkit/bundle@4.0.0/dist/bundle.html` and `.../dist/esm.html`. ## Types From d1b0c1bfb2d1d57ca3495a160232d14e25bd6b1e Mon Sep 17 00:00:00 2001 From: aaroncox Date: Tue, 1 Sep 2026 09:31:54 -0700 Subject: [PATCH 06/10] Bring src/lib under the lint gate --- .oxlintrc.json | 2 +- packages/web-renderer/src/lib/qrcode/index.ts | 58 +++++++++---------- packages/web-renderer/src/lib/utils.ts | 6 +- 3 files changed, 31 insertions(+), 35 deletions(-) diff --git a/.oxlintrc.json b/.oxlintrc.json index 1fc6bb29..fd7f7008 100644 --- a/.oxlintrc.json +++ b/.oxlintrc.json @@ -5,7 +5,7 @@ "correctness": "error" }, "ignorePatterns": [ - "**/lib/**", + "packages/*/lib/**", "**/node_modules/**", "**/coverage/**", "**/docs_build/**", diff --git a/packages/web-renderer/src/lib/qrcode/index.ts b/packages/web-renderer/src/lib/qrcode/index.ts index b44afae4..9a4c4593 100644 --- a/packages/web-renderer/src/lib/qrcode/index.ts +++ b/packages/web-renderer/src/lib/qrcode/index.ts @@ -13,44 +13,40 @@ interface Rect { * @author Johan Nordberg */ export default function generate(text: string, level: 'L' | 'M' | 'Q' | 'H' = 'L', version = -1) { - try { - const qr = new QRCode(version, ErrorCorrectLevel[level]) - const rects: Rect[] = [] + const qr = new QRCode(version, ErrorCorrectLevel[level]) + const rects: Rect[] = [] - qr.addData(text) - qr.make() + qr.addData(text) + qr.make() - const rows = qr.modules - const size = rows.length + const rows = qr.modules + const size = rows.length - for (const [y, row] of rows.entries()) { - let rect: Rect | undefined - for (const [x, on] of row.entries()) { - if (on) { - if (!rect) rect = {x, y, width: 0, height: 1} - rect.width++ - } else { - if (rect && rect.width > 0) { - rects.push(rect) - } - rect = undefined + for (const [y, row] of rows.entries()) { + let rect: Rect | undefined + for (const [x, on] of row.entries()) { + if (on) { + if (!rect) rect = {x, y, width: 0, height: 1} + rect.width++ + } else { + if (rect && rect.width > 0) { + rects.push(rect) } - } - if (rect && rect.width > 0) { - rects.push(rect) + rect = undefined } } - - const svg: string[] = [ - ``, - ] - for (const {x, y, width, height} of rects) { - svg.push(``) + if (rect && rect.width > 0) { + rects.push(rect) } - svg.push('') + } - return svg.join('') - } catch (e) { - console.log('Could not render QR code: ', e) + const svg: string[] = [ + ``, + ] + for (const {x, y, width, height} of rects) { + svg.push(``) } + svg.push('') + + return svg.join('') } diff --git a/packages/web-renderer/src/lib/utils.ts b/packages/web-renderer/src/lib/utils.ts index ce85a94d..a637e53e 100644 --- a/packages/web-renderer/src/lib/utils.ts +++ b/packages/web-renderer/src/lib/utils.ts @@ -25,15 +25,14 @@ export function getThemedLogo( if (!theme) { // if no theme is set, use the system preference for logo - window.matchMedia('(prefers-color-scheme: dark)').matches - ? (theme = 'dark') - : (theme = 'light') + theme = window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light' } if (!logo) { if ('getLogo' in metadata) { return metadata.getLogo()?.[theme] ?? metadata.getLogo()?.[oppositeTheme] } + // eslint-disable-next-line no-console console.warn(`${name} does not have a logo.`) return } @@ -41,6 +40,7 @@ export function getThemedLogo( const image = logo[theme] ?? logo[oppositeTheme] if (!isUrlImage(image.toString()) && !isBase64Image(image.toString())) { + // eslint-disable-next-line no-console console.warn(`${name} ${theme} logo is not a supported image format.`) return } From 527b906cd054c93cb27a75a087887577d065c5e2 Mon Sep 17 00:00:00 2001 From: aaroncox Date: Tue, 1 Sep 2026 16:36:54 -0700 Subject: [PATCH 07/10] Split dev and master --- .github/workflows/release.yml | 8 +++++++- scripts/release.ts | 35 ++++++++++++++++++++--------------- 2 files changed, 27 insertions(+), 16 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5f294e9f..b658dfd8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,6 +3,12 @@ name: Release on: push: branches: [master] + workflow_dispatch: + inputs: + force: + description: Publish even though the tag for master's version already exists + type: boolean + default: false permissions: id-token: write @@ -27,6 +33,6 @@ jobs: - run: | git config user.name "github-actions[bot]" git config user.email "41898282+github-actions[bot]@users.noreply.github.com" - - run: bun scripts/release.ts publish + - run: bun scripts/release.ts publish ${{ inputs.force && '--force' || '' }} env: GH_TOKEN: ${{ github.token }} diff --git a/scripts/release.ts b/scripts/release.ts index d61a53f8..eb356a57 100644 --- a/scripts/release.ts +++ b/scripts/release.ts @@ -241,15 +241,15 @@ function bump(arg: string, dryRun: boolean) { if (sh('git', ['status', '--porcelain']) !== '') fail('working tree is not clean') const branch = sh('git', ['rev-parse', '--abbrev-ref', 'HEAD']) - if (branch !== 'master') fail(`on branch ${branch}, releases start from master`) + if (branch !== 'dev') fail(`on branch ${branch}, releases start from dev`) const hasOrigin = trySh('git', ['remote', 'get-url', 'origin']) !== null if (hasOrigin) { - sh('git', ['fetch', 'origin', 'master']) - if (sh('git', ['rev-parse', 'HEAD']) !== sh('git', ['rev-parse', 'origin/master'])) { - fail('master is not equal to origin/master') + sh('git', ['fetch', 'origin', 'dev']) + if (sh('git', ['rev-parse', 'HEAD']) !== sh('git', ['rev-parse', 'origin/dev'])) { + fail('dev is not equal to origin/dev') } } else if (dryRun) { - log('no origin remote; skipping the origin/master guard for this dry run') + log('no origin remote; skipping the origin/dev guard for this dry run') } else { fail('no origin remote configured') } @@ -295,25 +295,25 @@ function bump(arg: string, dryRun: boolean) { return } - const releaseBranch = `release/${tag}` - sh('git', ['checkout', '-b', releaseBranch]) sh('git', ['add', '-A']) sh('git', ['commit', '-m', `Version ${target}`]) - sh('git', ['push', '-u', 'origin', releaseBranch]) + sh('git', ['push', 'origin', 'dev']) sh('gh', [ 'pr', 'create', '--base', 'master', + '--head', + 'dev', '--title', `Version ${target}`, '--body', - `Lockstep release ${target}. Publishes on merge via release.yml.`, + `Lockstep release ${target}. Promotes dev to master; publishes on merge via release.yml.`, ]) - log(`release PR opened for ${target}`) + log(`promotion PR opened for ${target}`) } -function publish() { +function publish(force: boolean) { const root = rootManifest() const version = root.version const tag = `v${version}` @@ -322,11 +322,16 @@ function publish() { return } - if ( + const tagged = trySh('git', ['rev-parse', '--verify', `refs/tags/${tag}`]) !== null || trySh('git', ['ls-remote', '--exit-code', '--tags', 'origin', `refs/tags/${tag}`]) !== null - ) { - log(`tag ${tag} already exists; nothing to publish`) + if (tagged) { + // every master push runs publish; an existing tag means this one carries no bump + if (!force) { + log(`tag ${tag} already exists; this push is not a release`) + return + } + log(`tag ${tag} already exists; --force given, resuming the publish`) } else { sh('git', ['tag', '-a', tag, '-m', `Version ${version}`]) sh('git', ['push', 'origin', tag]) @@ -392,7 +397,7 @@ function main() { break } case 'publish': - publish() + publish(flags.has('--force')) break case 'verify': verify({install: !flags.has('--no-install')}) From 8bd72e32c8f7cb69903c11b2890f6a63e5e567c6 Mon Sep 17 00:00:00 2001 From: aaroncox Date: Tue, 1 Sep 2026 16:48:34 -0700 Subject: [PATCH 08/10] Rewrite the bundle README CDN pins at bump time --- scripts/release.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/scripts/release.ts b/scripts/release.ts index eb356a57..b0001187 100644 --- a/scripts/release.ts +++ b/scripts/release.ts @@ -210,6 +210,22 @@ function resolveTarget(current: string, arg: string): string { fail(`unknown version argument "${arg}"`) } +// CDN pins must name an exact version, so a bump has to rewrite them +const PINNED_READMES = ['packages/bundle/README.md'] +const PIN = /(@wharfkit\/[a-z-]+@)\d+\.\d+\.\d+(?:-[\w.]+)?/g + +function writeReadmePins(version: string) { + for (const relative of PINNED_READMES) { + const path = join(ROOT, relative) + if (!existsSync(path)) fail(`${relative}: pinned readme is missing`) + const raw = readFileSync(path, 'utf8') + const updated = raw.replace(PIN, `$1${version}`) + if (updated === raw) continue + writeFileSync(path, updated) + log(`${relative}: pinned to ${version}`) + } +} + function writeVersion(manifestPath: string, version: string) { const raw = readFileSync(manifestPath, 'utf8') const updated = raw.replace(/"version":\s*"[^"]*"/, `"version": "${version}"`) @@ -286,6 +302,7 @@ function bump(arg: string, dryRun: boolean) { log(`bumping to ${target}`) writeVersion(join(ROOT, 'package.json'), target) for (const member of list) writeVersion(member.manifestPath, target) + writeReadmePins(target) execFileSync('bun', ['install', '--ignore-scripts'], {cwd: ROOT, stdio: 'inherit'}) packAndCheckPins(members()) From da123744586d4567df0de5d005f51663c8dc994f Mon Sep 17 00:00:00 2001 From: aaroncox Date: Tue, 1 Sep 2026 17:23:16 -0700 Subject: [PATCH 09/10] Version 4.0.0-rc5 --- bun.lock | 98 +++++++++---------- package.json | 2 +- packages/abicache/package.json | 2 +- .../package.json | 2 +- .../package.json | 2 +- .../package.json | 2 +- packages/account/package.json | 2 +- packages/actionstream/package.json | 2 +- packages/antelope/package.json | 2 +- packages/atomicassets/package.json | 2 +- packages/bundle/README.md | 14 +-- packages/bundle/package.json | 2 +- packages/cli/package.json | 2 +- packages/common/package.json | 2 +- packages/conformance/package.json | 2 +- packages/contract/package.json | 2 +- packages/hyperion/package.json | 2 +- packages/mock-data/package.json | 2 +- packages/msigs/package.json | 2 +- packages/protocol-esr/package.json | 2 +- packages/protocol-scatter/package.json | 2 +- packages/resources/package.json | 2 +- packages/roborovski/package.json | 2 +- packages/sealed-messages/package.json | 2 +- packages/session/package.json | 2 +- packages/signing-request/package.json | 2 +- packages/svelte-components/package.json | 2 +- packages/token/package.json | 2 +- .../transact-plugin-autocorrect/package.json | 2 +- .../transact-plugin-cosigner/package.json | 2 +- .../transact-plugin-explorerlink/package.json | 2 +- .../package.json | 2 +- .../package.json | 2 +- packages/transact-plugin-mock/package.json | 2 +- .../transact-plugin-msig-propose/package.json | 2 +- .../package.json | 2 +- packages/wallet-plugin-anchor/package.json | 2 +- packages/wallet-plugin-cleos/package.json | 2 +- .../wallet-plugin-cloudwallet/package.json | 2 +- .../wallet-plugin-gatewallet/package.json | 2 +- packages/wallet-plugin-imtoken/package.json | 2 +- packages/wallet-plugin-metamask/package.json | 2 +- packages/wallet-plugin-mimic/package.json | 2 +- packages/wallet-plugin-mock/package.json | 2 +- packages/wallet-plugin-paycash/package.json | 2 +- .../wallet-plugin-privatekey/package.json | 2 +- packages/wallet-plugin-scatter/package.json | 2 +- .../wallet-plugin-tokenpocket/package.json | 2 +- .../package.json | 2 +- packages/web-renderer/package.json | 2 +- packages/web-ui/package.json | 2 +- packages/webauthn/package.json | 2 +- 52 files changed, 106 insertions(+), 106 deletions(-) diff --git a/bun.lock b/bun.lock index b077c42a..dc73a436 100644 --- a/bun.lock +++ b/bun.lock @@ -32,7 +32,7 @@ }, "packages/abicache": { "name": "@wharfkit/abicache", - "version": "4.0.0-rc4", + "version": "4.0.0-rc5", "dependencies": { "@wharfkit/antelope": "workspace:*", "@wharfkit/signing-request": "workspace:*", @@ -44,7 +44,7 @@ }, "packages/account": { "name": "@wharfkit/account", - "version": "4.0.0-rc4", + "version": "4.0.0-rc5", "dependencies": { "@wharfkit/antelope": "workspace:*", "@wharfkit/common": "workspace:*", @@ -60,7 +60,7 @@ }, "packages/account-creation-plugin-anchor": { "name": "@wharfkit/account-creation-plugin-anchor", - "version": "4.0.0-rc4", + "version": "4.0.0-rc5", "dependencies": { "@wharfkit/session": "workspace:*", }, @@ -71,7 +71,7 @@ }, "packages/account-creation-plugin-jungle4": { "name": "@wharfkit/account-creation-plugin-jungle4", - "version": "4.0.0-rc4", + "version": "4.0.0-rc5", "dependencies": { "@wharfkit/session": "workspace:*", }, @@ -82,7 +82,7 @@ }, "packages/account-creation-plugin-metamask": { "name": "@wharfkit/account-creation-plugin-metamask", - "version": "4.0.0-rc4", + "version": "4.0.0-rc5", "dependencies": { "@metamask/providers": "^17.0.0", "@wharfkit/session": "workspace:*", @@ -94,7 +94,7 @@ }, "packages/actionstream": { "name": "@wharfkit/actionstream", - "version": "4.0.0-rc4", + "version": "4.0.0-rc5", "dependencies": { "@wharfkit/antelope": "workspace:*", }, @@ -105,7 +105,7 @@ }, "packages/antelope": { "name": "@wharfkit/antelope", - "version": "4.0.0-rc4", + "version": "4.0.0-rc5", "dependencies": { "@noble/curves": "^2.2.0", "@noble/hashes": "^2.2.0", @@ -115,7 +115,7 @@ }, "packages/atomicassets": { "name": "@wharfkit/atomicassets", - "version": "4.0.0-rc4", + "version": "4.0.0-rc5", "dependencies": { "@wharfkit/antelope": "workspace:*", "@wharfkit/common": "workspace:*", @@ -128,7 +128,7 @@ }, "packages/bundle": { "name": "@wharfkit/bundle", - "version": "4.0.0-rc4", + "version": "4.0.0-rc5", "devDependencies": { "@wharfkit/account": "workspace:*", "@wharfkit/antelope": "workspace:*", @@ -154,7 +154,7 @@ }, "packages/cli": { "name": "@wharfkit/cli", - "version": "4.0.0-rc4", + "version": "4.0.0-rc5", "bin": { "wharfkit": "./lib/cli.js", }, @@ -178,7 +178,7 @@ }, "packages/common": { "name": "@wharfkit/common", - "version": "4.0.0-rc4", + "version": "4.0.0-rc5", "dependencies": { "@wharfkit/antelope": "workspace:*", }, @@ -189,7 +189,7 @@ }, "packages/conformance": { "name": "@wharfkit/conformance", - "version": "4.0.0-rc4", + "version": "4.0.0-rc5", "devDependencies": { "@greymass/vert": "^3.0.0", "@types/bun": "^1.0.4", @@ -200,7 +200,7 @@ }, "packages/contract": { "name": "@wharfkit/contract", - "version": "4.0.0-rc4", + "version": "4.0.0-rc5", "dependencies": { "@wharfkit/abicache": "workspace:*", "@wharfkit/antelope": "workspace:*", @@ -214,7 +214,7 @@ }, "packages/hyperion": { "name": "@wharfkit/hyperion", - "version": "4.0.0-rc4", + "version": "4.0.0-rc5", "dependencies": { "@wharfkit/antelope": "workspace:*", }, @@ -224,7 +224,7 @@ }, "packages/mock-data": { "name": "@wharfkit/mock-data", - "version": "4.0.0-rc4", + "version": "4.0.0-rc5", "dependencies": { "@wharfkit/antelope": "workspace:*", "@wharfkit/session": "workspace:*", @@ -233,7 +233,7 @@ }, "packages/msigs": { "name": "@wharfkit/msigs", - "version": "4.0.0-rc4", + "version": "4.0.0-rc5", "dependencies": { "@wharfkit/antelope": "workspace:*", }, @@ -243,7 +243,7 @@ }, "packages/protocol-esr": { "name": "@wharfkit/protocol-esr", - "version": "4.0.0-rc4", + "version": "4.0.0-rc5", "dependencies": { "@greymass/buoy": "catalog:", "@wharfkit/sealed-messages": "workspace:*", @@ -262,7 +262,7 @@ }, "packages/protocol-scatter": { "name": "@wharfkit/protocol-scatter", - "version": "4.0.0-rc4", + "version": "4.0.0-rc5", "dependencies": { "@wharfkit/session": "workspace:*", "eosjs": "20.0.0", @@ -276,7 +276,7 @@ }, "packages/resources": { "name": "@wharfkit/resources", - "version": "4.0.0-rc4", + "version": "4.0.0-rc5", "dependencies": { "@wharfkit/antelope": "workspace:*", "bn.js": "catalog:", @@ -288,7 +288,7 @@ }, "packages/roborovski": { "name": "@wharfkit/roborovski", - "version": "4.0.0-rc4", + "version": "4.0.0-rc5", "dependencies": { "@wharfkit/antelope": "workspace:*", }, @@ -298,7 +298,7 @@ }, "packages/sealed-messages": { "name": "@wharfkit/sealed-messages", - "version": "4.0.0-rc4", + "version": "4.0.0-rc5", "dependencies": { "@greymass/miniaes": "^1.0.0", "@wharfkit/antelope": "workspace:*", @@ -309,7 +309,7 @@ }, "packages/session": { "name": "@wharfkit/session", - "version": "4.0.0-rc4", + "version": "4.0.0-rc5", "dependencies": { "@wharfkit/abicache": "workspace:*", "@wharfkit/antelope": "workspace:*", @@ -326,14 +326,14 @@ }, "packages/signing-request": { "name": "@wharfkit/signing-request", - "version": "4.0.0-rc4", + "version": "4.0.0-rc5", "dependencies": { "@wharfkit/antelope": "workspace:*", }, }, "packages/svelte-components": { "name": "@wharfkit/svelte-components", - "version": "4.0.0-rc4", + "version": "4.0.0-rc5", "dependencies": { "@lucide/svelte": "^0.516.0", "@melt-ui/svelte": "^0.86.6", @@ -380,7 +380,7 @@ }, "packages/token": { "name": "@wharfkit/token", - "version": "4.0.0-rc4", + "version": "4.0.0-rc5", "dependencies": { "@wharfkit/antelope": "workspace:*", "@wharfkit/contract": "workspace:*", @@ -391,7 +391,7 @@ }, "packages/transact-plugin-autocorrect": { "name": "@wharfkit/transact-plugin-autocorrect", - "version": "4.0.0-rc4", + "version": "4.0.0-rc5", "dependencies": { "@wharfkit/resources": "workspace:*", "@wharfkit/session": "workspace:*", @@ -404,7 +404,7 @@ }, "packages/transact-plugin-cosigner": { "name": "@wharfkit/transact-plugin-cosigner", - "version": "4.0.0-rc4", + "version": "4.0.0-rc5", "dependencies": { "@wharfkit/session": "workspace:*", }, @@ -416,7 +416,7 @@ }, "packages/transact-plugin-explorerlink": { "name": "@wharfkit/transact-plugin-explorerlink", - "version": "4.0.0-rc4", + "version": "4.0.0-rc5", "dependencies": { "@wharfkit/session": "workspace:*", }, @@ -428,7 +428,7 @@ }, "packages/transact-plugin-finality-callback": { "name": "@wharfkit/transact-plugin-finality-callback", - "version": "4.0.0-rc4", + "version": "4.0.0-rc5", "dependencies": { "@wharfkit/session": "workspace:*", }, @@ -439,7 +439,7 @@ }, "packages/transact-plugin-finality-checker": { "name": "@wharfkit/transact-plugin-finality-checker", - "version": "4.0.0-rc4", + "version": "4.0.0-rc5", "dependencies": { "@wharfkit/session": "workspace:*", }, @@ -451,7 +451,7 @@ }, "packages/transact-plugin-mock": { "name": "@wharfkit/transact-plugin-mock", - "version": "4.0.0-rc4", + "version": "4.0.0-rc5", "dependencies": { "@wharfkit/session": "workspace:*", }, @@ -463,7 +463,7 @@ }, "packages/transact-plugin-msig-propose": { "name": "@wharfkit/transact-plugin-msig-propose", - "version": "4.0.0-rc4", + "version": "4.0.0-rc5", "dependencies": { "@wharfkit/session": "workspace:*", }, @@ -475,7 +475,7 @@ }, "packages/transact-plugin-resource-provider": { "name": "@wharfkit/transact-plugin-resource-provider", - "version": "4.0.0-rc4", + "version": "4.0.0-rc5", "dependencies": { "@wharfkit/resources": "workspace:*", "@wharfkit/session": "workspace:*", @@ -490,7 +490,7 @@ }, "packages/wallet-plugin-anchor": { "name": "@wharfkit/wallet-plugin-anchor", - "version": "4.0.0-rc4", + "version": "4.0.0-rc5", "dependencies": { "@greymass/buoy": "catalog:", "@wharfkit/antelope": "workspace:*", @@ -511,7 +511,7 @@ }, "packages/wallet-plugin-cleos": { "name": "@wharfkit/wallet-plugin-cleos", - "version": "4.0.0-rc4", + "version": "4.0.0-rc5", "dependencies": { "@wharfkit/session": "workspace:*", }, @@ -522,7 +522,7 @@ }, "packages/wallet-plugin-cloudwallet": { "name": "@wharfkit/wallet-plugin-cloudwallet", - "version": "4.0.0-rc4", + "version": "4.0.0-rc5", "dependencies": { "@wharfkit/session": "workspace:*", }, @@ -533,7 +533,7 @@ }, "packages/wallet-plugin-gatewallet": { "name": "@wharfkit/wallet-plugin-gatewallet", - "version": "4.0.0-rc4", + "version": "4.0.0-rc5", "dependencies": { "@wharfkit/protocol-scatter": "workspace:*", "@wharfkit/session": "workspace:*", @@ -546,7 +546,7 @@ }, "packages/wallet-plugin-imtoken": { "name": "@wharfkit/wallet-plugin-imtoken", - "version": "4.0.0-rc4", + "version": "4.0.0-rc5", "dependencies": { "@wharfkit/protocol-scatter": "workspace:*", "@wharfkit/session": "workspace:*", @@ -559,7 +559,7 @@ }, "packages/wallet-plugin-metamask": { "name": "@wharfkit/wallet-plugin-metamask", - "version": "4.0.0-rc4", + "version": "4.0.0-rc5", "dependencies": { "@metamask/providers": "^17.0.0", "@wharfkit/session": "workspace:*", @@ -571,7 +571,7 @@ }, "packages/wallet-plugin-mimic": { "name": "@wharfkit/wallet-plugin-mimic", - "version": "4.0.0-rc4", + "version": "4.0.0-rc5", "dependencies": { "@wharfkit/session": "workspace:*", }, @@ -582,7 +582,7 @@ }, "packages/wallet-plugin-mock": { "name": "@wharfkit/wallet-plugin-mock", - "version": "4.0.0-rc4", + "version": "4.0.0-rc5", "dependencies": { "@wharfkit/session": "workspace:*", }, @@ -594,7 +594,7 @@ }, "packages/wallet-plugin-paycash": { "name": "@wharfkit/wallet-plugin-paycash", - "version": "4.0.0-rc4", + "version": "4.0.0-rc5", "dependencies": { "@wharfkit/protocol-esr": "workspace:*", "@wharfkit/session": "workspace:*", @@ -606,7 +606,7 @@ }, "packages/wallet-plugin-privatekey": { "name": "@wharfkit/wallet-plugin-privatekey", - "version": "4.0.0-rc4", + "version": "4.0.0-rc5", "dependencies": { "@wharfkit/session": "workspace:*", }, @@ -618,7 +618,7 @@ }, "packages/wallet-plugin-scatter": { "name": "@wharfkit/wallet-plugin-scatter", - "version": "4.0.0-rc4", + "version": "4.0.0-rc5", "dependencies": { "@wharfkit/protocol-scatter": "workspace:*", "@wharfkit/session": "workspace:*", @@ -630,7 +630,7 @@ }, "packages/wallet-plugin-tokenpocket": { "name": "@wharfkit/wallet-plugin-tokenpocket", - "version": "4.0.0-rc4", + "version": "4.0.0-rc5", "dependencies": { "@wharfkit/protocol-scatter": "workspace:*", "@wharfkit/session": "workspace:*", @@ -642,7 +642,7 @@ }, "packages/wallet-plugin-web-authenticator": { "name": "@wharfkit/wallet-plugin-web-authenticator", - "version": "4.0.0-rc4", + "version": "4.0.0-rc5", "dependencies": { "@greymass/buoy": "catalog:", "@wharfkit/antelope": "workspace:*", @@ -661,7 +661,7 @@ }, "packages/web-renderer": { "name": "@wharfkit/web-renderer", - "version": "4.0.0-rc4", + "version": "4.0.0-rc5", "dependencies": { "@wharfkit/session": "workspace:*", }, @@ -712,7 +712,7 @@ }, "packages/web-ui": { "name": "@wharfkit/web-ui", - "version": "4.0.0-rc4", + "version": "4.0.0-rc5", "dependencies": { "@wharfkit/common": "workspace:*", "@wharfkit/session": "workspace:*", @@ -744,7 +744,7 @@ }, "packages/webauthn": { "name": "@wharfkit/webauthn", - "version": "4.0.0-rc4", + "version": "4.0.0-rc5", "dependencies": { "@wharfkit/antelope": "workspace:*", "cborg": "^4.5.8", diff --git a/package.json b/package.json index d0cf2c55..0717fa73 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "wharfkit-js", "private": true, - "version": "4.0.0-rc4", + "version": "4.0.0-rc5", "workspaces": { "packages": [ "packages/*" diff --git a/packages/abicache/package.json b/packages/abicache/package.json index a50c59d7..b12d97b4 100644 --- a/packages/abicache/package.json +++ b/packages/abicache/package.json @@ -1,7 +1,7 @@ { "name": "@wharfkit/abicache", "description": "ABI Caching Mechanism for use in Session and Contract Kits", - "version": "4.0.0-rc4", + "version": "4.0.0-rc5", "homepage": "https://github.com/wharfkit/abicache", "license": "BSD-3-Clause", "engines": { diff --git a/packages/account-creation-plugin-anchor/package.json b/packages/account-creation-plugin-anchor/package.json index 7c11e030..07a752de 100644 --- a/packages/account-creation-plugin-anchor/package.json +++ b/packages/account-creation-plugin-anchor/package.json @@ -1,7 +1,7 @@ { "name": "@wharfkit/account-creation-plugin-anchor", "description": "An account creation plugin using the Greymass account creation service", - "version": "4.0.0-rc4", + "version": "4.0.0-rc5", "homepage": "https://github.com/wharfkit/account-creation-plugin-anchor", "license": "BSD-3-Clause", "engines": { diff --git a/packages/account-creation-plugin-jungle4/package.json b/packages/account-creation-plugin-jungle4/package.json index 75e34524..face7d7a 100644 --- a/packages/account-creation-plugin-jungle4/package.json +++ b/packages/account-creation-plugin-jungle4/package.json @@ -1,7 +1,7 @@ { "name": "@wharfkit/account-creation-plugin-jungle4", "description": "Plugin to create a Jungle4 Testnet acccount.", - "version": "4.0.0-rc4", + "version": "4.0.0-rc5", "homepage": "https://github.com/wharfkit/account-creation-plugin-jungle4", "license": "BSD-3-Clause", "engines": { diff --git a/packages/account-creation-plugin-metamask/package.json b/packages/account-creation-plugin-metamask/package.json index 6e8f8b73..efc2061a 100644 --- a/packages/account-creation-plugin-metamask/package.json +++ b/packages/account-creation-plugin-metamask/package.json @@ -1,7 +1,7 @@ { "name": "@wharfkit/account-creation-plugin-metamask", "description": "A MetaMask plugin to create EOS accounts using Metamask public keys.", - "version": "4.0.0-rc4", + "version": "4.0.0-rc5", "homepage": "https://github.com/wharfkit/wallet-plugin-metamask", "license": "BSD-3-Clause", "engines": { diff --git a/packages/account/package.json b/packages/account/package.json index 0cb09ccf..9d0269d2 100644 --- a/packages/account/package.json +++ b/packages/account/package.json @@ -1,7 +1,7 @@ { "name": "@wharfkit/account", "description": "Account kit for Wharf Kit", - "version": "4.0.0-rc4", + "version": "4.0.0-rc5", "homepage": "https://github.com/wharfkit/account", "license": "BSD-3-Clause", "engines": { diff --git a/packages/actionstream/package.json b/packages/actionstream/package.json index 5efa4d0b..cae6d80e 100644 --- a/packages/actionstream/package.json +++ b/packages/actionstream/package.json @@ -1,7 +1,7 @@ { "name": "@wharfkit/actionstream", "description": "Client library for subscribing to Roborovski action streams", - "version": "4.0.0-rc4", + "version": "4.0.0-rc5", "homepage": "https://github.com/wharfkit/actionstream", "license": "BSD-3-Clause", "engines": { diff --git a/packages/antelope/package.json b/packages/antelope/package.json index 6533e00a..b95d6860 100644 --- a/packages/antelope/package.json +++ b/packages/antelope/package.json @@ -1,7 +1,7 @@ { "name": "@wharfkit/antelope", "description": "Library for working with Antelope powered blockchains.", - "version": "4.0.0-rc4", + "version": "4.0.0-rc5", "homepage": "https://github.com/wharfkit/antelope", "license": "BSD-3-Clause", "engines": { diff --git a/packages/atomicassets/package.json b/packages/atomicassets/package.json index a46f00da..0d191955 100644 --- a/packages/atomicassets/package.json +++ b/packages/atomicassets/package.json @@ -1,7 +1,7 @@ { "name": "@wharfkit/atomicassets", "description": "AtomicAsset library for Wharf", - "version": "4.0.0-rc4", + "version": "4.0.0-rc5", "homepage": "https://github.com/wharfkit/atomicassets", "license": "BSD-3-Clause", "engines": { diff --git a/packages/bundle/README.md b/packages/bundle/README.md index 8381b755..b0ac0964 100644 --- a/packages/bundle/README.md +++ b/packages/bundle/README.md @@ -5,7 +5,7 @@ A prepackaged bundle of common Wharf libraries, built as a self-contained IIFE ( ## Usage ```html - + ``` @@ -30,7 +30,7 @@ Both URLs above name an exact version and the full file path. jsDelivr serves th Use `https://cdn.jsdelivr.net/npm/@wharfkit/bundle@4/dist/wharf.bundle.js` if you want patch releases without editing the page. The trade is that the bytes are no longer the package's own and no longer eligible for Subresource Integrity. -To add an `integrity` attribute, take the hash for the exact version from `https://data.jsdelivr.com/v1/packages/npm/@wharfkit/bundle@4.0.0?structure=flat`, and pair it with `crossorigin="anonymous"`, which SRI requires. An `integrity` attribute on a ` ``` -Mixing versions across imports, or adding a package still on the `1.x` line, splits it again. esm.sh takes an explicit pin against that: `?deps=@wharfkit/antelope@4.0.0` on each top-level URL rewrites the antelope import to one concrete build and propagates into every transitive `@wharfkit/*` request, so it costs one query parameter per import rather than one entry per transitive package. jsDelivr's `+esm` route has no query-parameter equivalent, and its output carries jsDelivr's own warning against pairing it with Subresource Integrity. +Mixing versions across imports, or adding a package still on the `1.x` line, splits it again. esm.sh takes an explicit pin against that: `?deps=@wharfkit/antelope@4.0.0-rc5` on each top-level URL rewrites the antelope import to one concrete build and propagates into every transitive `@wharfkit/*` request, so it costs one query parameter per import rather than one entry per transitive package. jsDelivr's `+esm` route has no query-parameter equivalent, and its output carries jsDelivr's own warning against pairing it with Subresource Integrity. The bundle stays the recommended browser artifact. It is the only one that guarantees a single antelope without a resolver. ## Examples -`public/bundle.html` and `public/esm.html` are runnable examples of both forms, loading the built files next to them. `make` copies them into `dist/`, so open them from there after a build. The same pages ship in the package, at `https://cdn.jsdelivr.net/npm/@wharfkit/bundle@4.0.0/dist/bundle.html` and `.../dist/esm.html`. +`public/bundle.html` and `public/esm.html` are runnable examples of both forms, loading the built files next to them. `make` copies them into `dist/`, so open them from there after a build. The same pages ship in the package, at `https://cdn.jsdelivr.net/npm/@wharfkit/bundle@4.0.0-rc5/dist/bundle.html` and `.../dist/esm.html`. ## Types diff --git a/packages/bundle/package.json b/packages/bundle/package.json index 7cdd3ae4..3f72ac5b 100644 --- a/packages/bundle/package.json +++ b/packages/bundle/package.json @@ -1,6 +1,6 @@ { "name": "@wharfkit/bundle", - "version": "4.0.0-rc4", + "version": "4.0.0-rc5", "description": "A prepackaged bundle of common Wharf libraries re-exported for IIFE or ESM", "license": "BSD-3-Clause", "type": "module", diff --git a/packages/cli/package.json b/packages/cli/package.json index 057ff0a2..275d7470 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@wharfkit/cli", - "version": "4.0.0-rc4", + "version": "4.0.0-rc5", "license": "BSD-3-Clause", "homepage": "https://github.com/wharfkit/cli#readme", "description": "Command line utilities for Wharf", diff --git a/packages/common/package.json b/packages/common/package.json index 5babd8f1..63a28cae 100644 --- a/packages/common/package.json +++ b/packages/common/package.json @@ -1,7 +1,7 @@ { "name": "@wharfkit/common", "description": "Common data and functions shared across WharfKit packages", - "version": "4.0.0-rc4", + "version": "4.0.0-rc5", "homepage": "https://github.com/wharfkit/common", "license": "BSD-3-Clause", "engines": { diff --git a/packages/conformance/package.json b/packages/conformance/package.json index 11ef0509..570d89e2 100644 --- a/packages/conformance/package.json +++ b/packages/conformance/package.json @@ -1,6 +1,6 @@ { "name": "@wharfkit/conformance", - "version": "4.0.0-rc4", + "version": "4.0.0-rc5", "type": "module", "license": "BSD-3-Clause", "engines": { diff --git a/packages/contract/package.json b/packages/contract/package.json index 0caa5318..f4157bcc 100644 --- a/packages/contract/package.json +++ b/packages/contract/package.json @@ -1,7 +1,7 @@ { "name": "@wharfkit/contract", "description": "ContractKit for Wharf", - "version": "4.0.0-rc4", + "version": "4.0.0-rc5", "homepage": "https://github.com/wharfkit/contract", "license": "BSD-3-Clause", "engines": { diff --git a/packages/hyperion/package.json b/packages/hyperion/package.json index e88ff930..543ede6e 100644 --- a/packages/hyperion/package.json +++ b/packages/hyperion/package.json @@ -1,7 +1,7 @@ { "name": "@wharfkit/hyperion", "description": "API Client to access Hyperion API endpoints", - "version": "4.0.0-rc4", + "version": "4.0.0-rc5", "homepage": "https://github.com/wharfkit/hyperion", "license": "BSD-3-Clause", "engines": { diff --git a/packages/mock-data/package.json b/packages/mock-data/package.json index 21330a6f..58ec6b87 100644 --- a/packages/mock-data/package.json +++ b/packages/mock-data/package.json @@ -1,7 +1,7 @@ { "name": "@wharfkit/mock-data", "description": "Sample data for usage in tests throughout @wharfkit", - "version": "4.0.0-rc4", + "version": "4.0.0-rc5", "homepage": "https://github.com/wharfkit/mock-data", "license": "BSD-3-Clause", "engines": { diff --git a/packages/msigs/package.json b/packages/msigs/package.json index d92a14e5..dbf75a09 100644 --- a/packages/msigs/package.json +++ b/packages/msigs/package.json @@ -1,7 +1,7 @@ { "name": "@wharfkit/msigs", "description": "API Client to access Roborovski msigs API endpoints", - "version": "4.0.0-rc4", + "version": "4.0.0-rc5", "homepage": "https://github.com/wharfkit/msigs", "license": "BSD-3-Clause", "engines": { diff --git a/packages/protocol-esr/package.json b/packages/protocol-esr/package.json index e91840b2..a1fa78f0 100644 --- a/packages/protocol-esr/package.json +++ b/packages/protocol-esr/package.json @@ -1,7 +1,7 @@ { "name": "@wharfkit/protocol-esr", "description": "Abstract methods useful to all ESR-based wallet plugins", - "version": "4.0.0-rc4", + "version": "4.0.0-rc5", "homepage": "https://github.com/wharfkit/protocol-esr", "license": "BSD-3-Clause", "engines": { diff --git a/packages/protocol-scatter/package.json b/packages/protocol-scatter/package.json index 2fe4071e..efce51f8 100644 --- a/packages/protocol-scatter/package.json +++ b/packages/protocol-scatter/package.json @@ -1,7 +1,7 @@ { "name": "@wharfkit/protocol-scatter", "description": "Abstract methods useful to all Scatter-based wallet plugins", - "version": "4.0.0-rc4", + "version": "4.0.0-rc5", "homepage": "https://github.com/wharfkit/protocol-scatter", "license": "BSD-3-Clause", "engines": { diff --git a/packages/resources/package.json b/packages/resources/package.json index 9ee075fc..27d3ebcc 100644 --- a/packages/resources/package.json +++ b/packages/resources/package.json @@ -1,7 +1,7 @@ { "name": "@wharfkit/resources", "description": "Library to assist in Antelope-blockchain resource calculations.", - "version": "4.0.0-rc4", + "version": "4.0.0-rc5", "homepage": "https://github.com/wharfkit/resources", "license": "BSD-3-Clause", "engines": { diff --git a/packages/roborovski/package.json b/packages/roborovski/package.json index e02f820d..27a24e7d 100644 --- a/packages/roborovski/package.json +++ b/packages/roborovski/package.json @@ -1,7 +1,7 @@ { "name": "@wharfkit/roborovski", "description": "API Client to access Roborovski API endpoints", - "version": "4.0.0-rc4", + "version": "4.0.0-rc5", "homepage": "https://github.com/wharfkit/roborovski", "license": "BSD-3-Clause", "engines": { diff --git a/packages/sealed-messages/package.json b/packages/sealed-messages/package.json index 47ec9f5e..99bcf904 100644 --- a/packages/sealed-messages/package.json +++ b/packages/sealed-messages/package.json @@ -1,7 +1,7 @@ { "name": "@wharfkit/sealed-messages", "description": "", - "version": "4.0.0-rc4", + "version": "4.0.0-rc5", "homepage": "https://github.com/wharfkit/sealed-messages", "license": "BSD-3-Clause", "engines": { diff --git a/packages/session/package.json b/packages/session/package.json index f9eaf253..4cc69687 100644 --- a/packages/session/package.json +++ b/packages/session/package.json @@ -1,7 +1,7 @@ { "name": "@wharfkit/session", "description": "Create account-based sessions, perform transactions, and allow users to login using Antelope-based blockchains.", - "version": "4.0.0-rc4", + "version": "4.0.0-rc5", "homepage": "https://github.com/wharfkit/session", "license": "BSD-3-Clause", "engines": { diff --git a/packages/signing-request/package.json b/packages/signing-request/package.json index b347a2c0..d24714c9 100644 --- a/packages/signing-request/package.json +++ b/packages/signing-request/package.json @@ -1,6 +1,6 @@ { "name": "@wharfkit/signing-request", - "version": "4.0.0-rc4", + "version": "4.0.0-rc5", "description": "Signing Request (ESR / EEP-7) encoder and decoder for Antelope blockchains", "homepage": "https://github.com/wharfkit/signing-request", "license": "BSD-3-Clause", diff --git a/packages/svelte-components/package.json b/packages/svelte-components/package.json index b241edc7..883995f9 100644 --- a/packages/svelte-components/package.json +++ b/packages/svelte-components/package.json @@ -1,6 +1,6 @@ { "name": "@wharfkit/svelte-components", - "version": "4.0.0-rc4", + "version": "4.0.0-rc5", "description": "Svelte 5 and Tailwind v4 component library for Antelope applications", "license": "BSD-3-Clause", "repository": { diff --git a/packages/token/package.json b/packages/token/package.json index 48c510ad..7f55cbcc 100644 --- a/packages/token/package.json +++ b/packages/token/package.json @@ -1,7 +1,7 @@ { "name": "@wharfkit/token", "description": "Library to work with Antelope-blockchain system tokens.", - "version": "4.0.0-rc4", + "version": "4.0.0-rc5", "homepage": "https://github.com/wharfkit/token", "license": "BSD-3-Clause", "engines": { diff --git a/packages/transact-plugin-autocorrect/package.json b/packages/transact-plugin-autocorrect/package.json index bbe9b93c..3a90d06a 100644 --- a/packages/transact-plugin-autocorrect/package.json +++ b/packages/transact-plugin-autocorrect/package.json @@ -1,7 +1,7 @@ { "name": "@wharfkit/transact-plugin-autocorrect", "description": "A plugin to correct common issues users experience while performing transactions.", - "version": "4.0.0-rc4", + "version": "4.0.0-rc5", "homepage": "https://github.com/wharfkit/transact-plugin-autocorrect", "license": "BSD-3-Clause", "engines": { diff --git a/packages/transact-plugin-cosigner/package.json b/packages/transact-plugin-cosigner/package.json index 6e657422..d08efd55 100644 --- a/packages/transact-plugin-cosigner/package.json +++ b/packages/transact-plugin-cosigner/package.json @@ -1,7 +1,7 @@ { "name": "@wharfkit/transact-plugin-cosigner", "description": "Automatically cosign transactions to assume resource costs using a noop action.", - "version": "4.0.0-rc4", + "version": "4.0.0-rc5", "homepage": "https://github.com/wharfkit/transact-plugin-cosigner", "license": "BSD-3-Clause", "engines": { diff --git a/packages/transact-plugin-explorerlink/package.json b/packages/transact-plugin-explorerlink/package.json index 4a08b4df..352d71c4 100644 --- a/packages/transact-plugin-explorerlink/package.json +++ b/packages/transact-plugin-explorerlink/package.json @@ -1,7 +1,7 @@ { "name": "@wharfkit/transact-plugin-explorerlink", "description": "A transact plugin to display a link to a block explorer after a transaction is broadcast.", - "version": "4.0.0-rc4", + "version": "4.0.0-rc5", "homepage": "https://github.com/wharfkit/transact-plugin-explorerlink", "license": "BSD-3-Clause", "engines": { diff --git a/packages/transact-plugin-finality-callback/package.json b/packages/transact-plugin-finality-callback/package.json index c967f84c..a4655132 100644 --- a/packages/transact-plugin-finality-callback/package.json +++ b/packages/transact-plugin-finality-callback/package.json @@ -1,7 +1,7 @@ { "name": "@wharfkit/transact-plugin-finality-callback", "description": "A template to create plugins for use with @wharfkit/session transact method.", - "version": "4.0.0-rc4", + "version": "4.0.0-rc5", "homepage": "https://github.com/wharfkit/transact-plugin-finality-callback", "license": "BSD-3-Clause", "engines": { diff --git a/packages/transact-plugin-finality-checker/package.json b/packages/transact-plugin-finality-checker/package.json index ca0c8109..1119599f 100644 --- a/packages/transact-plugin-finality-checker/package.json +++ b/packages/transact-plugin-finality-checker/package.json @@ -1,7 +1,7 @@ { "name": "@wharfkit/transact-plugin-finality-checker", "description": "A template to create plugins for use with @wharfkit/session transact method.", - "version": "4.0.0-rc4", + "version": "4.0.0-rc5", "homepage": "https://github.com/wharfkit/transact-plugin-finality-checker", "license": "BSD-3-Clause", "engines": { diff --git a/packages/transact-plugin-mock/package.json b/packages/transact-plugin-mock/package.json index 6cd4c59c..810ce325 100644 --- a/packages/transact-plugin-mock/package.json +++ b/packages/transact-plugin-mock/package.json @@ -1,7 +1,7 @@ { "name": "@wharfkit/transact-plugin-mock", "description": "A mock TransactPlugin to simulate specific events.", - "version": "4.0.0-rc4", + "version": "4.0.0-rc5", "homepage": "https://github.com/wharfkit/transact-plugin-mock", "license": "BSD-3-Clause", "engines": { diff --git a/packages/transact-plugin-msig-propose/package.json b/packages/transact-plugin-msig-propose/package.json index 1564ee2e..a6645e95 100644 --- a/packages/transact-plugin-msig-propose/package.json +++ b/packages/transact-plugin-msig-propose/package.json @@ -1,7 +1,7 @@ { "name": "@wharfkit/transact-plugin-msig-propose", "description": "A template to create plugins for use with @wharfkit/session transact method.", - "version": "4.0.0-rc4", + "version": "4.0.0-rc5", "private": true, "homepage": "https://github.com/wharfkit/transact-plugin-msig-propose", "license": "BSD-3-Clause", diff --git a/packages/transact-plugin-resource-provider/package.json b/packages/transact-plugin-resource-provider/package.json index 57eb6778..98db7bef 100644 --- a/packages/transact-plugin-resource-provider/package.json +++ b/packages/transact-plugin-resource-provider/package.json @@ -1,7 +1,7 @@ { "name": "@wharfkit/transact-plugin-resource-provider", "description": "Plugin to automatically provide network resources for transactions using the Resource Provider implementation standard.", - "version": "4.0.0-rc4", + "version": "4.0.0-rc5", "homepage": "https://github.com/wharfkit/transact-plugin-resource-provider", "license": "BSD-3-Clause", "engines": { diff --git a/packages/wallet-plugin-anchor/package.json b/packages/wallet-plugin-anchor/package.json index 3088314a..26741c21 100644 --- a/packages/wallet-plugin-anchor/package.json +++ b/packages/wallet-plugin-anchor/package.json @@ -1,7 +1,7 @@ { "name": "@wharfkit/wallet-plugin-anchor", "description": "An Anchor plugin for use with @wharfkit/session.", - "version": "4.0.0-rc4", + "version": "4.0.0-rc5", "homepage": "https://github.com/wharfkit/wallet-plugin-anchor", "license": "BSD-3-Clause", "engines": { diff --git a/packages/wallet-plugin-cleos/package.json b/packages/wallet-plugin-cleos/package.json index 80286483..6c34d6c0 100644 --- a/packages/wallet-plugin-cleos/package.json +++ b/packages/wallet-plugin-cleos/package.json @@ -1,7 +1,7 @@ { "name": "@wharfkit/wallet-plugin-cleos", "description": "A template to create wallet plugins for use with @wharfkit/session.", - "version": "4.0.0-rc4", + "version": "4.0.0-rc5", "homepage": "https://github.com/wharfkit/wallet-plugin-cleos", "license": "BSD-3-Clause", "engines": { diff --git a/packages/wallet-plugin-cloudwallet/package.json b/packages/wallet-plugin-cloudwallet/package.json index ffe5035b..418213b2 100644 --- a/packages/wallet-plugin-cloudwallet/package.json +++ b/packages/wallet-plugin-cloudwallet/package.json @@ -1,7 +1,7 @@ { "name": "@wharfkit/wallet-plugin-cloudwallet", "description": "A WalletPlugin for My Cloud Wallet for use within the @wharfkit/session.", - "version": "4.0.0-rc4", + "version": "4.0.0-rc5", "homepage": "https://github.com/wharfkit/wallet-plugin-cloudwallet", "license": "BSD-3-Clause", "engines": { diff --git a/packages/wallet-plugin-gatewallet/package.json b/packages/wallet-plugin-gatewallet/package.json index 7a777e4e..d46d2e48 100644 --- a/packages/wallet-plugin-gatewallet/package.json +++ b/packages/wallet-plugin-gatewallet/package.json @@ -1,7 +1,7 @@ { "name": "@wharfkit/wallet-plugin-gatewallet", "description": "A template to create wallet plugins for use with @wharfkit/session.", - "version": "4.0.0-rc4", + "version": "4.0.0-rc5", "homepage": "https://github.com/wharfkit/wallet-plugin-template", "license": "BSD-3-Clause", "engines": { diff --git a/packages/wallet-plugin-imtoken/package.json b/packages/wallet-plugin-imtoken/package.json index 3a84a1e6..087d033f 100644 --- a/packages/wallet-plugin-imtoken/package.json +++ b/packages/wallet-plugin-imtoken/package.json @@ -1,7 +1,7 @@ { "name": "@wharfkit/wallet-plugin-imtoken", "description": "A template to create wallet plugins for use with @wharfkit/session.", - "version": "4.0.0-rc4", + "version": "4.0.0-rc5", "homepage": "https://github.com/wharfkit/wallet-plugin-imtoken", "license": "BSD-3-Clause", "engines": { diff --git a/packages/wallet-plugin-metamask/package.json b/packages/wallet-plugin-metamask/package.json index 41237a52..28c43522 100644 --- a/packages/wallet-plugin-metamask/package.json +++ b/packages/wallet-plugin-metamask/package.json @@ -1,7 +1,7 @@ { "name": "@wharfkit/wallet-plugin-metamask", "description": "A MetaMask plugin for use with @wharfkit/session.", - "version": "4.0.0-rc4", + "version": "4.0.0-rc5", "homepage": "https://github.com/wharfkit/wallet-plugin-metamask", "license": "BSD-3-Clause", "engines": { diff --git a/packages/wallet-plugin-mimic/package.json b/packages/wallet-plugin-mimic/package.json index 3cc499b0..601dc6ce 100644 --- a/packages/wallet-plugin-mimic/package.json +++ b/packages/wallet-plugin-mimic/package.json @@ -1,7 +1,7 @@ { "name": "@wharfkit/wallet-plugin-mimic", "description": "A template to create wallet plugins for use with @wharfkit/session.", - "version": "4.0.0-rc4", + "version": "4.0.0-rc5", "private": true, "homepage": "https://github.com/wharfkit/wallet-plugin-mimic", "license": "BSD-3-Clause", diff --git a/packages/wallet-plugin-mock/package.json b/packages/wallet-plugin-mock/package.json index f03fefe8..090a7ed3 100644 --- a/packages/wallet-plugin-mock/package.json +++ b/packages/wallet-plugin-mock/package.json @@ -1,7 +1,7 @@ { "name": "@wharfkit/wallet-plugin-mock", "description": "A mock wallet for developers to use while building web applications.", - "version": "4.0.0-rc4", + "version": "4.0.0-rc5", "homepage": "https://github.com/wharfkit/wallet-plugin-mock", "license": "BSD-3-Clause", "engines": { diff --git a/packages/wallet-plugin-paycash/package.json b/packages/wallet-plugin-paycash/package.json index 88033d14..bf20ef0c 100644 --- a/packages/wallet-plugin-paycash/package.json +++ b/packages/wallet-plugin-paycash/package.json @@ -1,7 +1,7 @@ { "name": "@wharfkit/wallet-plugin-paycash", "description": "A Wharf wallet plugin for the PayCash wallet", - "version": "4.0.0-rc4", + "version": "4.0.0-rc5", "homepage": "https://github.com/wharfkit/wallet-plugin-paycash", "license": "BSD-3-Clause", "engines": { diff --git a/packages/wallet-plugin-privatekey/package.json b/packages/wallet-plugin-privatekey/package.json index 83757a6f..af014c03 100644 --- a/packages/wallet-plugin-privatekey/package.json +++ b/packages/wallet-plugin-privatekey/package.json @@ -1,7 +1,7 @@ { "name": "@wharfkit/wallet-plugin-privatekey", "description": "A template to create wallet plugins for use with @wharfkit/session.", - "version": "4.0.0-rc4", + "version": "4.0.0-rc5", "homepage": "https://github.com/wharfkit/wallet-plugin-privatekey", "license": "BSD-3-Clause", "engines": { diff --git a/packages/wallet-plugin-scatter/package.json b/packages/wallet-plugin-scatter/package.json index 4ec88b5f..29926996 100644 --- a/packages/wallet-plugin-scatter/package.json +++ b/packages/wallet-plugin-scatter/package.json @@ -1,7 +1,7 @@ { "name": "@wharfkit/wallet-plugin-scatter", "description": "A WalletPlugin for the Scatter wallet for use within the @wharfkit/session.", - "version": "4.0.0-rc4", + "version": "4.0.0-rc5", "homepage": "https://github.com/wharfkit/wallet-plugin-scatter", "license": "BSD-3-Clause", "engines": { diff --git a/packages/wallet-plugin-tokenpocket/package.json b/packages/wallet-plugin-tokenpocket/package.json index db3ccf1a..b2eb41dc 100644 --- a/packages/wallet-plugin-tokenpocket/package.json +++ b/packages/wallet-plugin-tokenpocket/package.json @@ -1,7 +1,7 @@ { "name": "@wharfkit/wallet-plugin-tokenpocket", "description": "A WalletPlugin for the TokenPocket wallet for use within the @wharfkit/session.", - "version": "4.0.0-rc4", + "version": "4.0.0-rc5", "homepage": "https://github.com/wharfkit/wallet-plugin-tokenpocket", "license": "BSD-3-Clause", "engines": { diff --git a/packages/wallet-plugin-web-authenticator/package.json b/packages/wallet-plugin-web-authenticator/package.json index d1ec02e9..d96793f1 100644 --- a/packages/wallet-plugin-web-authenticator/package.json +++ b/packages/wallet-plugin-web-authenticator/package.json @@ -1,7 +1,7 @@ { "name": "@wharfkit/wallet-plugin-web-authenticator", "description": "A Web Authenticator wallet plugin for use with @wharfkit/session.", - "version": "4.0.0-rc4", + "version": "4.0.0-rc5", "homepage": "https://github.com/wharfkit/wallet-plugin-web-authenticator", "license": "BSD-3-Clause", "engines": { diff --git a/packages/web-renderer/package.json b/packages/web-renderer/package.json index f46cfaf5..b94dbb3e 100644 --- a/packages/web-renderer/package.json +++ b/packages/web-renderer/package.json @@ -1,6 +1,6 @@ { "name": "@wharfkit/web-renderer", - "version": "4.0.0-rc4", + "version": "4.0.0-rc5", "description": "", "license": "BSD-3-Clause", "engines": { diff --git a/packages/web-ui/package.json b/packages/web-ui/package.json index 5c54ed0c..ca124355 100644 --- a/packages/web-ui/package.json +++ b/packages/web-ui/package.json @@ -1,6 +1,6 @@ { "name": "@wharfkit/web-ui", - "version": "4.0.0-rc4", + "version": "4.0.0-rc5", "description": "Modern embedded UI renderer for WharfKit SessionKit", "type": "module", "license": "BSD-3-Clause", diff --git a/packages/webauthn/package.json b/packages/webauthn/package.json index d4cf1809..b1fa0777 100644 --- a/packages/webauthn/package.json +++ b/packages/webauthn/package.json @@ -1,7 +1,7 @@ { "name": "@wharfkit/webauthn", "description": "WebAuthn helpers for antelope core", - "version": "4.0.0-rc4", + "version": "4.0.0-rc5", "homepage": "https://github.com/greymass/eosio-webauthn", "license": "BSD-3-Clause", "engines": { From 5d983e3f3321ba9291f5b58960e4edf33cedbe5b Mon Sep 17 00:00:00 2001 From: aaroncox Date: Tue, 1 Sep 2026 19:29:30 -0700 Subject: [PATCH 10/10] Patch scatter-ts to detect node by window, not navigator --- bun.lock | 3 +++ package.json | 3 +++ patches/scatter-ts@0.1.9.patch | 26 ++++++++++++++++++++++++++ 3 files changed, 32 insertions(+) create mode 100644 patches/scatter-ts@0.1.9.patch diff --git a/bun.lock b/bun.lock index dc73a436..79d1b821 100644 --- a/bun.lock +++ b/bun.lock @@ -755,6 +755,9 @@ }, }, }, + "patchedDependencies": { + "scatter-ts@0.1.9": "patches/scatter-ts@0.1.9.patch", + }, "overrides": { "@wharfkit/antelope": "workspace:*", "@wharfkit/signing-request": "workspace:*", diff --git a/package.json b/package.json index 0717fa73..cd8d2385 100644 --- a/package.json +++ b/package.json @@ -43,5 +43,8 @@ "overrides": { "@wharfkit/antelope": "workspace:*", "@wharfkit/signing-request": "workspace:*" + }, + "patchedDependencies": { + "scatter-ts@0.1.9": "patches/scatter-ts@0.1.9.patch" } } diff --git a/patches/scatter-ts@0.1.9.patch b/patches/scatter-ts@0.1.9.patch new file mode 100644 index 00000000..3fc66637 --- /dev/null +++ b/patches/scatter-ts@0.1.9.patch @@ -0,0 +1,26 @@ +diff --git a/packages/core/src/util/Device.js b/packages/core/src/util/Device.js +index b20039200a5f7fdc92ca445e63c99620e36de4d0..d6a6f1b57acf45c8ed06fe34ceb9b5ed625e691e 100644 +--- a/packages/core/src/util/Device.js ++++ b/packages/core/src/util/Device.js +@@ -2,7 +2,7 @@ import DeviceUUID from './device-uuid'; + + let device; + +-if ( typeof navigator === 'undefined') { ++if ( typeof navigator === 'undefined' || typeof window === 'undefined') { + device = 'nodejs_env' + } else { + const du = new DeviceUUID().parse(); +diff --git a/scatter.js b/scatter.js +index 8997c7dace3d0c453915da4453614679a8a152c1..ee9f31e4a9274b1cc171b00f544d54eea6b88ed4 100644 +--- a/scatter.js ++++ b/scatter.js +@@ -1370,7 +1370,7 @@ var DeviceUUID = function (options) { + + let device; + +-if ( typeof navigator === 'undefined') { ++if ( typeof navigator === 'undefined' || typeof window === 'undefined') { + device = 'nodejs_env'; + } else { + const du = new DeviceUUID().parse();