@cartridge/controller 0.7.7 → 0.7.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/.turbo/turbo-build$colon$deps.log +23 -23
  2. package/.turbo/turbo-build.log +31 -31
  3. package/dist/controller.cjs +472 -3
  4. package/dist/controller.cjs.map +1 -1
  5. package/dist/controller.d.cts +1 -1
  6. package/dist/controller.d.ts +1 -1
  7. package/dist/controller.js +472 -3
  8. package/dist/controller.js.map +1 -1
  9. package/dist/index.cjs +1908 -1214
  10. package/dist/index.cjs.map +1 -1
  11. package/dist/index.d.cts +46 -3
  12. package/dist/index.d.ts +46 -3
  13. package/dist/index.js +1905 -1215
  14. package/dist/index.js.map +1 -1
  15. package/dist/node/index.cjs +1 -1
  16. package/dist/node/index.cjs.map +1 -1
  17. package/dist/node/index.d.cts +2 -2
  18. package/dist/node/index.d.ts +2 -2
  19. package/dist/node/index.js +1 -1
  20. package/dist/node/index.js.map +1 -1
  21. package/dist/{provider-CTDncg8U.d.cts → provider-BeCgS86X.d.cts} +64 -1
  22. package/dist/{provider-CTDncg8U.d.ts → provider-BeCgS86X.d.ts} +64 -1
  23. package/dist/session/index.cjs +1 -1
  24. package/dist/session/index.cjs.map +1 -1
  25. package/dist/session/index.d.cts +2 -2
  26. package/dist/session/index.d.ts +2 -2
  27. package/dist/session/index.js +1 -1
  28. package/dist/session/index.js.map +1 -1
  29. package/package.json +8 -5
  30. package/src/iframe/base.ts +1 -1
  31. package/src/iframe/keychain.ts +11 -0
  32. package/src/index.ts +1 -0
  33. package/src/types.ts +24 -0
  34. package/src/wallets/argent/index.ts +122 -0
  35. package/src/wallets/bridge.ts +165 -0
  36. package/src/wallets/index.ts +5 -0
  37. package/src/wallets/metamask/index.ts +210 -0
  38. package/src/wallets/phantom/index.ts +124 -0
  39. package/src/wallets/types.ts +32 -0
package/dist/index.d.cts CHANGED
@@ -1,14 +1,15 @@
1
1
  export { default } from './controller.cjs';
2
2
  import { P as ParsedSessionPolicies } from './policies-DD1aPjQ4.cjs';
3
3
  export { N as NotReadyToConnect } from './policies-DD1aPjQ4.cjs';
4
- export { i as Chain, C as ConnectError, b as ConnectReply, e as ControllerAccounts, a as ControllerError, g as ControllerOptions, D as DeployReply, E as ExecuteReply, h as IFrameOptions, I as IFrames, K as Keychain, k as KeychainOptions, L as LookupRequest, d as LookupResponse, c as LookupResult, M as Modal, P as ProbeReply, f as Profile, m as ProfileContextTypeVariant, l as ProfileOptions, j as ProviderOptions, R as ResponseCodes, S as Session, T as Tokens } from './provider-CTDncg8U.cjs';
4
+ import { W as WalletAdapter, E as ExternalWalletType, a as ExternalPlatform, b as ExternalWallet, c as ExternalWalletResponse } from './provider-BeCgS86X.cjs';
5
+ export { m as Chain, C as ConnectError, e as ConnectReply, i as ControllerAccounts, d as ControllerError, k as ControllerOptions, D as DeployReply, f as ExecuteReply, l as IFrameOptions, I as IFrames, K as Keychain, o as KeychainOptions, L as LookupRequest, h as LookupResponse, g as LookupResult, M as Modal, P as ProbeReply, j as Profile, q as ProfileContextTypeVariant, p as ProfileOptions, n as ProviderOptions, R as ResponseCodes, S as Session, T as Tokens, r as WalletBridge } from './provider-BeCgS86X.cjs';
5
6
  export { lookupAddresses, lookupUsernames } from './lookup.cjs';
6
7
  import * as starknet from 'starknet';
7
8
  import { Call } from 'starknet';
8
9
  import wasm from '@cartridge/account-wasm/controller';
9
10
  import { Policies, SessionPolicies } from '@cartridge/presets';
10
11
  export * from '@cartridge/presets';
11
- import { ChainId } from '@starknet-io/types-js';
12
+ import { ChainId, TypedData } from '@starknet-io/types-js';
12
13
  import '@cartridge/penpal';
13
14
 
14
15
  declare function normalizeCalls(calls: Call | Call[]): {
@@ -22,4 +23,46 @@ declare function toArray<T>(val: T | T[]): T[];
22
23
  declare function humanizeString(str: string): string;
23
24
  declare function parseChainId(url: URL): Promise<ChainId>;
24
25
 
25
- export { humanizeString, normalizeCalls, parseChainId, toArray, toSessionPolicies, toWasmPolicies };
26
+ declare class MetaMaskWallet implements WalletAdapter {
27
+ readonly type: ExternalWalletType;
28
+ readonly platform: ExternalPlatform;
29
+ private MMSDK;
30
+ private account;
31
+ constructor();
32
+ isAvailable(): boolean;
33
+ getInfo(): ExternalWallet;
34
+ connect(): Promise<ExternalWalletResponse<any>>;
35
+ signTransaction(transaction: any): Promise<ExternalWalletResponse<any>>;
36
+ signMessage(message: string): Promise<ExternalWalletResponse<any>>;
37
+ signTypedData(data: any): Promise<ExternalWalletResponse<any>>;
38
+ switchChain(chainId: string): Promise<boolean>;
39
+ getBalance(tokenAddress?: string): Promise<ExternalWalletResponse<any>>;
40
+ }
41
+
42
+ declare class PhantomWallet implements WalletAdapter {
43
+ readonly type: ExternalWalletType;
44
+ readonly platform: ExternalPlatform;
45
+ private account;
46
+ isAvailable(): boolean;
47
+ getInfo(): ExternalWallet;
48
+ connect(): Promise<ExternalWalletResponse<any>>;
49
+ signTransaction(transaction: any): Promise<ExternalWalletResponse<any>>;
50
+ signMessage(message: string): Promise<ExternalWalletResponse<any>>;
51
+ switchChain(_chainId: string): Promise<boolean>;
52
+ getBalance(_tokenAddress?: string): Promise<ExternalWalletResponse<any>>;
53
+ }
54
+
55
+ declare class ArgentWallet implements WalletAdapter {
56
+ readonly type: ExternalWalletType;
57
+ readonly platform: ExternalPlatform;
58
+ private wallet;
59
+ private account;
60
+ isAvailable(): boolean;
61
+ getInfo(): ExternalWallet;
62
+ connect(): Promise<ExternalWalletResponse<any>>;
63
+ signTypedData(data: TypedData): Promise<ExternalWalletResponse<any>>;
64
+ switchChain(_chainId: string): Promise<boolean>;
65
+ getBalance(_tokenAddress?: string): Promise<ExternalWalletResponse<any>>;
66
+ }
67
+
68
+ export { ArgentWallet, ExternalPlatform, ExternalWallet, ExternalWalletResponse, ExternalWalletType, MetaMaskWallet, PhantomWallet, WalletAdapter, humanizeString, normalizeCalls, parseChainId, toArray, toSessionPolicies, toWasmPolicies };
package/dist/index.d.ts CHANGED
@@ -1,14 +1,15 @@
1
1
  export { default } from './controller.js';
2
2
  import { P as ParsedSessionPolicies } from './policies-DD1aPjQ4.js';
3
3
  export { N as NotReadyToConnect } from './policies-DD1aPjQ4.js';
4
- export { i as Chain, C as ConnectError, b as ConnectReply, e as ControllerAccounts, a as ControllerError, g as ControllerOptions, D as DeployReply, E as ExecuteReply, h as IFrameOptions, I as IFrames, K as Keychain, k as KeychainOptions, L as LookupRequest, d as LookupResponse, c as LookupResult, M as Modal, P as ProbeReply, f as Profile, m as ProfileContextTypeVariant, l as ProfileOptions, j as ProviderOptions, R as ResponseCodes, S as Session, T as Tokens } from './provider-CTDncg8U.js';
4
+ import { W as WalletAdapter, E as ExternalWalletType, a as ExternalPlatform, b as ExternalWallet, c as ExternalWalletResponse } from './provider-BeCgS86X.js';
5
+ export { m as Chain, C as ConnectError, e as ConnectReply, i as ControllerAccounts, d as ControllerError, k as ControllerOptions, D as DeployReply, f as ExecuteReply, l as IFrameOptions, I as IFrames, K as Keychain, o as KeychainOptions, L as LookupRequest, h as LookupResponse, g as LookupResult, M as Modal, P as ProbeReply, j as Profile, q as ProfileContextTypeVariant, p as ProfileOptions, n as ProviderOptions, R as ResponseCodes, S as Session, T as Tokens, r as WalletBridge } from './provider-BeCgS86X.js';
5
6
  export { lookupAddresses, lookupUsernames } from './lookup.js';
6
7
  import * as starknet from 'starknet';
7
8
  import { Call } from 'starknet';
8
9
  import wasm from '@cartridge/account-wasm/controller';
9
10
  import { Policies, SessionPolicies } from '@cartridge/presets';
10
11
  export * from '@cartridge/presets';
11
- import { ChainId } from '@starknet-io/types-js';
12
+ import { ChainId, TypedData } from '@starknet-io/types-js';
12
13
  import '@cartridge/penpal';
13
14
 
14
15
  declare function normalizeCalls(calls: Call | Call[]): {
@@ -22,4 +23,46 @@ declare function toArray<T>(val: T | T[]): T[];
22
23
  declare function humanizeString(str: string): string;
23
24
  declare function parseChainId(url: URL): Promise<ChainId>;
24
25
 
25
- export { humanizeString, normalizeCalls, parseChainId, toArray, toSessionPolicies, toWasmPolicies };
26
+ declare class MetaMaskWallet implements WalletAdapter {
27
+ readonly type: ExternalWalletType;
28
+ readonly platform: ExternalPlatform;
29
+ private MMSDK;
30
+ private account;
31
+ constructor();
32
+ isAvailable(): boolean;
33
+ getInfo(): ExternalWallet;
34
+ connect(): Promise<ExternalWalletResponse<any>>;
35
+ signTransaction(transaction: any): Promise<ExternalWalletResponse<any>>;
36
+ signMessage(message: string): Promise<ExternalWalletResponse<any>>;
37
+ signTypedData(data: any): Promise<ExternalWalletResponse<any>>;
38
+ switchChain(chainId: string): Promise<boolean>;
39
+ getBalance(tokenAddress?: string): Promise<ExternalWalletResponse<any>>;
40
+ }
41
+
42
+ declare class PhantomWallet implements WalletAdapter {
43
+ readonly type: ExternalWalletType;
44
+ readonly platform: ExternalPlatform;
45
+ private account;
46
+ isAvailable(): boolean;
47
+ getInfo(): ExternalWallet;
48
+ connect(): Promise<ExternalWalletResponse<any>>;
49
+ signTransaction(transaction: any): Promise<ExternalWalletResponse<any>>;
50
+ signMessage(message: string): Promise<ExternalWalletResponse<any>>;
51
+ switchChain(_chainId: string): Promise<boolean>;
52
+ getBalance(_tokenAddress?: string): Promise<ExternalWalletResponse<any>>;
53
+ }
54
+
55
+ declare class ArgentWallet implements WalletAdapter {
56
+ readonly type: ExternalWalletType;
57
+ readonly platform: ExternalPlatform;
58
+ private wallet;
59
+ private account;
60
+ isAvailable(): boolean;
61
+ getInfo(): ExternalWallet;
62
+ connect(): Promise<ExternalWalletResponse<any>>;
63
+ signTypedData(data: TypedData): Promise<ExternalWalletResponse<any>>;
64
+ switchChain(_chainId: string): Promise<boolean>;
65
+ getBalance(_tokenAddress?: string): Promise<ExternalWalletResponse<any>>;
66
+ }
67
+
68
+ export { ArgentWallet, ExternalPlatform, ExternalWallet, ExternalWalletResponse, ExternalWalletType, MetaMaskWallet, PhantomWallet, WalletAdapter, humanizeString, normalizeCalls, parseChainId, toArray, toSessionPolicies, toWasmPolicies };