@cartridge/controller 0.7.14-alpha.3 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build$colon$deps.log +51 -49
- package/.turbo/turbo-build.log +47 -45
- package/dist/__tests__/setup.d.ts +0 -0
- package/dist/account.d.ts +2 -3
- package/dist/controller.d.ts +7 -5
- package/dist/iframe/base.d.ts +1 -0
- package/dist/iframe/keychain.d.ts +4 -2
- package/dist/iframe/profile.d.ts +1 -1
- package/dist/index.js +885 -4955
- package/dist/index.js.map +1 -1
- package/dist/node/index.cjs +3 -3
- package/dist/node/index.cjs.map +1 -1
- package/dist/node/index.d.cts +2 -2
- package/dist/node/index.d.ts +2 -2
- package/dist/node/index.js +3 -3
- package/dist/node/index.js.map +1 -1
- package/dist/{provider-sFJ4sl5V.js → provider-B9Ikz5hr.js} +98 -75
- package/dist/provider-B9Ikz5hr.js.map +1 -0
- package/dist/provider.d.ts +1 -1
- package/dist/session/account.d.ts +2 -2
- package/dist/session.js +10 -10
- package/dist/session.js.map +1 -1
- package/dist/stats.html +1 -1
- package/dist/types.d.ts +6 -5
- package/dist/utils.d.ts +3 -3
- package/dist/wallets/bridge.d.ts +2 -2
- package/dist/wallets/index.d.ts +0 -2
- package/dist/wallets/metamask/index.d.ts +2 -2
- package/dist/wallets/rabby/index.d.ts +1 -1
- package/dist/wallets/types.d.ts +2 -2
- package/jest.config.ts +2 -0
- package/package.json +8 -8
- package/src/__tests__/controllerDefaults.test.ts +80 -0
- package/src/__tests__/parseChainId.test.ts +0 -6
- package/src/__tests__/setup.ts +29 -0
- package/src/account.ts +5 -8
- package/src/controller.ts +98 -22
- package/src/iframe/base.ts +19 -1
- package/src/iframe/keychain.ts +14 -2
- package/src/iframe/profile.ts +0 -11
- package/src/node/account.ts +3 -3
- package/src/provider.ts +9 -9
- package/src/session/account.ts +3 -4
- package/src/types.ts +7 -5
- package/src/utils.ts +49 -13
- package/src/wallets/bridge.ts +8 -19
- package/src/wallets/index.ts +0 -2
- package/src/wallets/metamask/index.ts +18 -13
- package/src/wallets/rabby/index.ts +14 -10
- package/src/wallets/types.ts +5 -2
- package/tsconfig.json +3 -2
- package/.turbo/turbo-format$colon$check.log +0 -7
- package/.turbo/turbo-format.log +0 -42
- package/dist/provider-sFJ4sl5V.js.map +0 -1
- package/dist/wallets/turnkey/index.d.ts +0 -20
- package/dist/wallets/wallet-connect/index.d.ts +0 -19
- package/src/wallets/turnkey/index.ts +0 -195
- package/src/wallets/wallet-connect/index.ts +0 -206
|
@@ -1,49 +1,51 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
>
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
>
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
>
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
[
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
[2mdist/[22m[
|
|
22
|
-
[
|
|
23
|
-
[39m
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
[34mCLI[39m
|
|
32
|
-
[34mCLI[39m Using
|
|
33
|
-
[34mCLI[39m
|
|
34
|
-
[34mCLI[39m
|
|
35
|
-
[
|
|
36
|
-
[
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
[
|
|
43
|
-
[32mCJS[39m [1mdist/node/index.cjs
|
|
44
|
-
[32mCJS[39m
|
|
45
|
-
[
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
1
|
+
|
|
2
|
+
> @cartridge/controller@0.9.0 build:deps /home/runner/work/controller/controller/packages/controller
|
|
3
|
+
> pnpm build
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
> @cartridge/controller@0.9.0 build /home/runner/work/controller/controller/packages/controller
|
|
7
|
+
> pnpm build:browser && pnpm build:node
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
> @cartridge/controller@0.9.0 build:browser /home/runner/work/controller/controller/packages/controller
|
|
11
|
+
> vite build
|
|
12
|
+
|
|
13
|
+
[36mvite v6.3.4 [32mbuilding for production...[36m[39m
|
|
14
|
+
transforming...
|
|
15
|
+
[32m✓[39m 218 modules transformed.
|
|
16
|
+
rendering chunks...
|
|
17
|
+
[vite-plugin-top-level-await] Non-existing module "../../../node_modules/.pnpm/@cartridge+controller-wasm@0.2.1/node_modules/@cartridge/controller-wasm/pkg-session/session_wasm_bg.wasm" imported by "session.js", ignoring.
|
|
18
|
+
|
|
19
|
+
[vite:dts] Start generate declaration files...
|
|
20
|
+
computing gzip size...
|
|
21
|
+
[2mdist/[22m[36msession.js [39m[1m[2m11.17 kB[22m[1m[22m[2m │ gzip: 3.48 kB[22m[2m │ map: 60.40 kB[22m
|
|
22
|
+
[2mdist/[22m[36mprovider-B9Ikz5hr.js [39m[1m[2m13.52 kB[22m[1m[22m[2m │ gzip: 5.52 kB[22m[2m │ map: 32.77 kB[22m
|
|
23
|
+
[2mdist/[22m[36mindex.js [39m[1m[2m79.14 kB[22m[1m[22m[2m │ gzip: 20.64 kB[22m[2m │ map: 222.56 kB[22m
|
|
24
|
+
[vite:dts] Declaration files built in 4568ms.
|
|
25
|
+
|
|
26
|
+
[32m✓ built in 5.95s[39m
|
|
27
|
+
|
|
28
|
+
> @cartridge/controller@0.9.0 build:node /home/runner/work/controller/controller/packages/controller
|
|
29
|
+
> tsup --config tsup.node.config.ts
|
|
30
|
+
|
|
31
|
+
[34mCLI[39m Building entry: src/node/index.ts
|
|
32
|
+
[34mCLI[39m Using tsconfig: tsconfig.json
|
|
33
|
+
[34mCLI[39m tsup v8.4.0
|
|
34
|
+
[34mCLI[39m Using tsup config: /home/runner/work/controller/controller/packages/controller/tsup.node.config.ts
|
|
35
|
+
[34mCLI[39m Target: esnext
|
|
36
|
+
[34mCLI[39m Cleaning output folder
|
|
37
|
+
[34mESM[39m Build start
|
|
38
|
+
[34mCJS[39m Build start
|
|
39
|
+
"constants", "getChecksumAddress" and "shortString" are imported from external module "starknet" but never used in "dist/node/index.cjs".
|
|
40
|
+
Entry module "dist/node/index.cjs" is using named and default exports together. Consumers of your bundle will have to use `chunk.default` to access the default export, which may not be what you want. Use `output.exports: "named"` to disable this warning.
|
|
41
|
+
"constants", "getChecksumAddress" and "shortString" are imported from external module "starknet" but never used in "dist/node/index.js".
|
|
42
|
+
[32mCJS[39m [1mdist/node/index.cjs [22m[32m21.89 KB[39m
|
|
43
|
+
[32mCJS[39m [1mdist/node/index.cjs.map [22m[32m50.44 KB[39m
|
|
44
|
+
[32mCJS[39m ⚡️ Build success in 388ms
|
|
45
|
+
[32mESM[39m [1mdist/node/index.js [22m[32m21.13 KB[39m
|
|
46
|
+
[32mESM[39m [1mdist/node/index.js.map [22m[32m50.23 KB[39m
|
|
47
|
+
[32mESM[39m ⚡️ Build success in 389ms
|
|
48
|
+
[34mDTS[39m Build start
|
|
49
|
+
[32mDTS[39m ⚡️ Build success in 4125ms
|
|
50
|
+
[32mDTS[39m [1mdist/node/index.d.ts [22m[32m5.26 KB[39m
|
|
51
|
+
[32mDTS[39m [1mdist/node/index.d.cts [22m[32m5.26 KB[39m
|
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,45 +1,47 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
>
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
>
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
[
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
[2mdist/[22m[
|
|
18
|
-
[
|
|
19
|
-
[39m
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
[34mCLI[39m
|
|
28
|
-
[34mCLI[39m Using
|
|
29
|
-
[34mCLI[39m
|
|
30
|
-
[34mCLI[39m
|
|
31
|
-
[
|
|
32
|
-
[
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
"constants", "getChecksumAddress"
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
[
|
|
39
|
-
[32mESM[39m [1mdist/node/index.js [22m[32m21.
|
|
40
|
-
[32mESM[39m [1mdist/node/index.js.map [22m[
|
|
41
|
-
[32mESM[39m ⚡️ Build success in
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
1
|
+
|
|
2
|
+
> @cartridge/controller@0.9.0 build /home/runner/work/controller/controller/packages/controller
|
|
3
|
+
> pnpm build:browser && pnpm build:node
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
> @cartridge/controller@0.9.0 build:browser /home/runner/work/controller/controller/packages/controller
|
|
7
|
+
> vite build
|
|
8
|
+
|
|
9
|
+
[36mvite v6.3.4 [32mbuilding for production...[36m[39m
|
|
10
|
+
transforming...
|
|
11
|
+
[32m✓[39m 218 modules transformed.
|
|
12
|
+
rendering chunks...
|
|
13
|
+
[vite-plugin-top-level-await] Non-existing module "../../../node_modules/.pnpm/@cartridge+controller-wasm@0.2.1/node_modules/@cartridge/controller-wasm/pkg-session/session_wasm_bg.wasm" imported by "session.js", ignoring.
|
|
14
|
+
|
|
15
|
+
[vite:dts] Start generate declaration files...
|
|
16
|
+
computing gzip size...
|
|
17
|
+
[2mdist/[22m[36msession.js [39m[1m[2m11.17 kB[22m[1m[22m[2m │ gzip: 3.48 kB[22m[2m │ map: 60.40 kB[22m
|
|
18
|
+
[2mdist/[22m[36mprovider-B9Ikz5hr.js [39m[1m[2m13.52 kB[22m[1m[22m[2m │ gzip: 5.52 kB[22m[2m │ map: 32.77 kB[22m
|
|
19
|
+
[2mdist/[22m[36mindex.js [39m[1m[2m79.14 kB[22m[1m[22m[2m │ gzip: 20.64 kB[22m[2m │ map: 222.56 kB[22m
|
|
20
|
+
[vite:dts] Declaration files built in 4366ms.
|
|
21
|
+
|
|
22
|
+
[32m✓ built in 5.93s[39m
|
|
23
|
+
|
|
24
|
+
> @cartridge/controller@0.9.0 build:node /home/runner/work/controller/controller/packages/controller
|
|
25
|
+
> tsup --config tsup.node.config.ts
|
|
26
|
+
|
|
27
|
+
[34mCLI[39m Building entry: src/node/index.ts
|
|
28
|
+
[34mCLI[39m Using tsconfig: tsconfig.json
|
|
29
|
+
[34mCLI[39m tsup v8.4.0
|
|
30
|
+
[34mCLI[39m Using tsup config: /home/runner/work/controller/controller/packages/controller/tsup.node.config.ts
|
|
31
|
+
[34mCLI[39m Target: esnext
|
|
32
|
+
[34mCLI[39m Cleaning output folder
|
|
33
|
+
[34mESM[39m Build start
|
|
34
|
+
[34mCJS[39m Build start
|
|
35
|
+
"constants", "getChecksumAddress" and "shortString" are imported from external module "starknet" but never used in "dist/node/index.js".
|
|
36
|
+
"constants", "getChecksumAddress" and "shortString" are imported from external module "starknet" but never used in "dist/node/index.cjs".
|
|
37
|
+
Entry module "dist/node/index.cjs" is using named and default exports together. Consumers of your bundle will have to use `chunk.default` to access the default export, which may not be what you want. Use `output.exports: "named"` to disable this warning.
|
|
38
|
+
[34mDTS[39m Build start
|
|
39
|
+
[32mESM[39m [1mdist/node/index.js [22m[32m21.13 KB[39m
|
|
40
|
+
[32mESM[39m [1mdist/node/index.js.map [22m[32m50.23 KB[39m
|
|
41
|
+
[32mESM[39m ⚡️ Build success in 343ms
|
|
42
|
+
[32mCJS[39m [1mdist/node/index.cjs [22m[32m21.89 KB[39m
|
|
43
|
+
[32mCJS[39m [1mdist/node/index.cjs.map [22m[32m50.44 KB[39m
|
|
44
|
+
[32mCJS[39m ⚡️ Build success in 344ms
|
|
45
|
+
[32mDTS[39m ⚡️ Build success in 4247ms
|
|
46
|
+
[32mDTS[39m [1mdist/node/index.d.ts [22m[32m5.26 KB[39m
|
|
47
|
+
[32mDTS[39m [1mdist/node/index.d.cts [22m[32m5.26 KB[39m
|
|
File without changes
|
package/dist/account.d.ts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { InvokeFunctionResponse, TypedData, WalletAccount, Call, AllowArray } from 'starknet';
|
|
2
|
-
import { SPEC } from '@starknet-io/types-js';
|
|
3
2
|
import { Keychain, KeychainOptions, Modal } from './types';
|
|
4
3
|
import { AsyncMethodReturns } from '@cartridge/penpal';
|
|
5
4
|
import { default as BaseProvider } from './provider';
|
|
5
|
+
import { SIGNATURE } from '@starknet-io/types-js';
|
|
6
6
|
declare class ControllerAccount extends WalletAccount {
|
|
7
|
-
address: string;
|
|
8
7
|
private keychain;
|
|
9
8
|
private modal;
|
|
10
9
|
private options?;
|
|
@@ -30,6 +29,6 @@ declare class ControllerAccount extends WalletAccount {
|
|
|
30
29
|
* @returns the signature of the JSON object
|
|
31
30
|
* @throws {Error} if the JSON object is not a valid JSON
|
|
32
31
|
*/
|
|
33
|
-
signMessage(typedData: TypedData): Promise<
|
|
32
|
+
signMessage(typedData: TypedData): Promise<SIGNATURE>;
|
|
34
33
|
}
|
|
35
34
|
export default ControllerAccount;
|
package/dist/controller.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { ControllerOptions, ProfileContextTypeVariant } from './types';
|
|
2
|
-
import { default as BaseProvider } from './provider';
|
|
3
|
-
import { WalletAccount } from 'starknet';
|
|
4
1
|
import { Policy } from '@cartridge/presets';
|
|
5
2
|
import { AddStarknetChainParameters } from '@starknet-io/types-js';
|
|
3
|
+
import { WalletAccount } from 'starknet';
|
|
4
|
+
import { default as BaseProvider } from './provider';
|
|
5
|
+
import { ControllerOptions, ProfileContextTypeVariant } from './types';
|
|
6
6
|
export default class ControllerProvider extends BaseProvider {
|
|
7
7
|
private keychain?;
|
|
8
8
|
private profile?;
|
|
@@ -10,7 +10,9 @@ export default class ControllerProvider extends BaseProvider {
|
|
|
10
10
|
private iframes;
|
|
11
11
|
private selectedChain;
|
|
12
12
|
private chains;
|
|
13
|
-
|
|
13
|
+
isReady(): boolean;
|
|
14
|
+
constructor(options?: ControllerOptions);
|
|
15
|
+
logout(): Promise<void>;
|
|
14
16
|
probe(): Promise<WalletAccount | undefined>;
|
|
15
17
|
connect(): Promise<WalletAccount | undefined>;
|
|
16
18
|
switchStarknetChain(chainId: string): Promise<boolean>;
|
|
@@ -30,6 +32,6 @@ export default class ControllerProvider extends BaseProvider {
|
|
|
30
32
|
transactionHash: string;
|
|
31
33
|
} | undefined>;
|
|
32
34
|
delegateAccount(): Promise<string | null>;
|
|
33
|
-
private
|
|
35
|
+
private initializeChains;
|
|
34
36
|
private waitForKeychain;
|
|
35
37
|
}
|
package/dist/iframe/base.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ export declare class IFrame<CallSender extends {}> implements Modal {
|
|
|
9
9
|
private iframe?;
|
|
10
10
|
private container?;
|
|
11
11
|
private onClose?;
|
|
12
|
+
private child?;
|
|
12
13
|
constructor({ id, url, preset, onClose, onConnect, methods, }: Pick<ControllerOptions, "preset"> & {
|
|
13
14
|
id: string;
|
|
14
15
|
url: URL;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { Keychain, KeychainOptions } from '../types';
|
|
2
2
|
import { WalletBridge } from '../wallets/bridge';
|
|
3
3
|
import { IFrame, IFrameOptions } from './base';
|
|
4
|
-
type KeychainIframeOptions = IFrameOptions<Keychain> & KeychainOptions
|
|
4
|
+
type KeychainIframeOptions = IFrameOptions<Keychain> & KeychainOptions & {
|
|
5
|
+
version?: string;
|
|
6
|
+
};
|
|
5
7
|
export declare class KeychainIFrame extends IFrame<Keychain> {
|
|
6
8
|
private walletBridge;
|
|
7
|
-
constructor({ url, policies, ...iframeOptions }: KeychainIframeOptions);
|
|
9
|
+
constructor({ url, policies, version, ...iframeOptions }: KeychainIframeOptions);
|
|
8
10
|
getWalletBridge(): WalletBridge;
|
|
9
11
|
}
|
|
10
12
|
export {};
|
package/dist/iframe/profile.d.ts
CHANGED
|
@@ -8,5 +8,5 @@ export type ProfileIFrameOptions = IFrameOptions<Profile> & ProfileOptions & {
|
|
|
8
8
|
namespace?: string;
|
|
9
9
|
};
|
|
10
10
|
export declare class ProfileIFrame extends IFrame<Profile> {
|
|
11
|
-
constructor({ profileUrl, rpcUrl, version, username, slot, namespace, tokens,
|
|
11
|
+
constructor({ profileUrl, rpcUrl, version, username, slot, namespace, tokens, ...iframeOptions }: ProfileIFrameOptions);
|
|
12
12
|
}
|