@wallet-ui/react-native-kit 3.1.0-canary-20260127222831
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/LICENSE +20 -0
- package/README.md +17 -0
- package/dist/index.browser.cjs +384 -0
- package/dist/index.browser.cjs.map +1 -0
- package/dist/index.browser.mjs +353 -0
- package/dist/index.browser.mjs.map +1 -0
- package/dist/index.native.mjs +353 -0
- package/dist/index.native.mjs.map +1 -0
- package/dist/index.node.cjs +384 -0
- package/dist/index.node.cjs.map +1 -0
- package/dist/index.node.mjs +353 -0
- package/dist/index.node.mjs.map +1 -0
- package/dist/types/async-storage-cache.d.ts +10 -0
- package/dist/types/async-storage-cache.d.ts.map +1 -0
- package/dist/types/authorization-store.d.ts +24 -0
- package/dist/types/authorization-store.d.ts.map +1 -0
- package/dist/types/cache.d.ts +29 -0
- package/dist/types/cache.d.ts.map +1 -0
- package/dist/types/client.d.ts +6 -0
- package/dist/types/client.d.ts.map +1 -0
- package/dist/types/create-default-client.d.ts +6 -0
- package/dist/types/create-default-client.d.ts.map +1 -0
- package/dist/types/ellipsify.d.ts +2 -0
- package/dist/types/ellipsify.d.ts.map +1 -0
- package/dist/types/get-account-from-authorized-account.d.ts +4 -0
- package/dist/types/get-account-from-authorized-account.d.ts.map +1 -0
- package/dist/types/get-address-from-base64.d.ts +4 -0
- package/dist/types/get-address-from-base64.d.ts.map +1 -0
- package/dist/types/get-authorization-from-authorization-result.d.ts +4 -0
- package/dist/types/get-authorization-from-authorization-result.d.ts.map +1 -0
- package/dist/types/index.d.ts +12 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/mobile-wallet-provider.d.ts +23 -0
- package/dist/types/mobile-wallet-provider.d.ts.map +1 -0
- package/dist/types/use-authorization-store.d.ts +20 -0
- package/dist/types/use-authorization-store.d.ts.map +1 -0
- package/dist/types/use-authorization.d.ts +52 -0
- package/dist/types/use-authorization.d.ts.map +1 -0
- package/dist/types/use-mobile-wallet.d.ts +31 -0
- package/dist/types/use-mobile-wallet.d.ts.map +1 -0
- package/package.json +96 -0
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { Address } from '@solana/kit';
|
|
2
|
+
import { AppIdentity, AuthorizeAPI, AuthToken, Base64EncodedAddress, Chain, DeauthorizeAPI, SignInPayload } from '@solana-mobile/mobile-wallet-adapter-protocol';
|
|
3
|
+
import { WalletIcon } from '@wallet-standard/core';
|
|
4
|
+
import { AuthorizationStore } from './authorization-store';
|
|
5
|
+
import { Cache } from './cache';
|
|
6
|
+
export type Account = Readonly<{
|
|
7
|
+
address: Address;
|
|
8
|
+
addressBase64: Base64EncodedAddress;
|
|
9
|
+
icon?: WalletIcon;
|
|
10
|
+
label?: string;
|
|
11
|
+
}>;
|
|
12
|
+
export type WalletAuthorization = Readonly<{
|
|
13
|
+
accounts: Account[];
|
|
14
|
+
authToken: AuthToken;
|
|
15
|
+
selectedAccount: Account;
|
|
16
|
+
}>;
|
|
17
|
+
export type WalletAuthorizationCache = Cache<WalletAuthorization | undefined>;
|
|
18
|
+
export type WalletAuthorizationProps = Readonly<{
|
|
19
|
+
cache?: WalletAuthorizationCache;
|
|
20
|
+
chain: Chain;
|
|
21
|
+
identity: AppIdentity;
|
|
22
|
+
store: AuthorizationStore;
|
|
23
|
+
}>;
|
|
24
|
+
export declare function useAuthorization({ chain, identity, store }: WalletAuthorizationProps): {
|
|
25
|
+
accounts: Readonly<{
|
|
26
|
+
address: Address;
|
|
27
|
+
addressBase64: Base64EncodedAddress;
|
|
28
|
+
icon?: WalletIcon;
|
|
29
|
+
label?: string;
|
|
30
|
+
}>[] | null;
|
|
31
|
+
authorizeSession: (wallet: AuthorizeAPI) => Promise<Readonly<{
|
|
32
|
+
address: Address;
|
|
33
|
+
addressBase64: Base64EncodedAddress;
|
|
34
|
+
icon?: WalletIcon;
|
|
35
|
+
label?: string;
|
|
36
|
+
}>>;
|
|
37
|
+
authorizeSessionWithSignIn: (wallet: AuthorizeAPI, signInPayload: SignInPayload) => Promise<Readonly<{
|
|
38
|
+
address: Address;
|
|
39
|
+
addressBase64: Base64EncodedAddress;
|
|
40
|
+
icon?: WalletIcon;
|
|
41
|
+
label?: string;
|
|
42
|
+
}>>;
|
|
43
|
+
deauthorizeSession: (wallet: DeauthorizeAPI) => Promise<void>;
|
|
44
|
+
deauthorizeSessions: () => Promise<void>;
|
|
45
|
+
selectedAccount: Readonly<{
|
|
46
|
+
address: Address;
|
|
47
|
+
addressBase64: Base64EncodedAddress;
|
|
48
|
+
icon?: WalletIcon;
|
|
49
|
+
label?: string;
|
|
50
|
+
}> | undefined;
|
|
51
|
+
};
|
|
52
|
+
//# sourceMappingURL=use-authorization.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-authorization.d.ts","sourceRoot":"","sources":["../../src/use-authorization.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EACH,WAAW,EAEX,YAAY,EACZ,SAAS,EACT,oBAAoB,EACpB,KAAK,EACL,cAAc,EACd,aAAa,EAGhB,MAAM,+CAA+C,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAGnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAIhC,MAAM,MAAM,OAAO,GAAG,QAAQ,CAAC;IAC3B,OAAO,EAAE,OAAO,CAAC;IACjB,aAAa,EAAE,oBAAoB,CAAC;IACpC,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC,CAAC;AAEH,MAAM,MAAM,mBAAmB,GAAG,QAAQ,CAAC;IACvC,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,SAAS,EAAE,SAAS,CAAC;IACrB,eAAe,EAAE,OAAO,CAAC;CAC5B,CAAC,CAAC;AACH,MAAM,MAAM,wBAAwB,GAAG,KAAK,CAAC,mBAAmB,GAAG,SAAS,CAAC,CAAC;AAC9E,MAAM,MAAM,wBAAwB,GAAG,QAAQ,CAAC;IAC5C,KAAK,CAAC,EAAE,wBAAwB,CAAC;IACjC,KAAK,EAAE,KAAK,CAAC;IACb,QAAQ,EAAE,WAAW,CAAC;IACtB,KAAK,EAAE,kBAAkB,CAAC;CAC7B,CAAC,CAAC;AACH,wBAAgB,gBAAgB,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,wBAAwB;;iBAlBxE,OAAO;uBACD,oBAAoB;eAC5B,UAAU;gBACT,MAAM;;+BA8BK,YAAY;iBAjCtB,OAAO;uBACD,oBAAoB;eAC5B,UAAU;gBACT,MAAM;;yCAwDK,YAAY,iBAAiB,aAAa;iBA3DpD,OAAO;uBACD,oBAAoB;eAC5B,UAAU;gBACT,MAAM;;iCAoFK,cAAc;;;iBAvFxB,OAAO;uBACD,oBAAoB;eAC5B,UAAU;gBACT,MAAM;;EAoHjB"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Address, SignatureBytes, Transaction, TransactionSendingSigner } from '@solana/kit';
|
|
2
|
+
import { AuthorizeAPI, SignInPayload } from '@solana-mobile/mobile-wallet-adapter-protocol';
|
|
3
|
+
import { Account } from './use-authorization';
|
|
4
|
+
export declare function useMobileWallet(): {
|
|
5
|
+
account: Readonly<{
|
|
6
|
+
address: Address;
|
|
7
|
+
addressBase64: import("@solana-mobile/mobile-wallet-adapter-protocol").Base64EncodedAddress;
|
|
8
|
+
icon?: import("@wallet-standard/core").WalletIcon;
|
|
9
|
+
label?: string;
|
|
10
|
+
}> | undefined;
|
|
11
|
+
accounts: Readonly<{
|
|
12
|
+
address: Address;
|
|
13
|
+
addressBase64: import("@solana-mobile/mobile-wallet-adapter-protocol").Base64EncodedAddress;
|
|
14
|
+
icon?: import("@wallet-standard/core").WalletIcon;
|
|
15
|
+
label?: string;
|
|
16
|
+
}>[] | null;
|
|
17
|
+
connect: () => Promise<Account>;
|
|
18
|
+
connectAnd: (cb: (wallet: AuthorizeAPI) => Promise<Account | void>) => Promise<Account | void>;
|
|
19
|
+
deauthorizeSession: (wallet: import("@solana-mobile/mobile-wallet-adapter-protocol").DeauthorizeAPI) => Promise<void>;
|
|
20
|
+
disconnect: () => Promise<void>;
|
|
21
|
+
getTransactionSigner: (address: Address, minContextSlot: bigint) => TransactionSendingSigner;
|
|
22
|
+
signAndSendTransaction: (transaction: Transaction | Transaction[], minContextSlot: bigint) => Promise<SignatureBytes[]>;
|
|
23
|
+
signIn: (signInPayload: SignInPayload) => Promise<Account>;
|
|
24
|
+
signMessage: (message: Uint8Array) => Promise<Uint8Array>;
|
|
25
|
+
client: import("./client").Client;
|
|
26
|
+
store: import("./authorization-store").AuthorizationStore;
|
|
27
|
+
cache?: import("./use-authorization").WalletAuthorizationCache;
|
|
28
|
+
chain: import("@solana-mobile/mobile-wallet-adapter-protocol").Chain;
|
|
29
|
+
identity: import("@solana-mobile/mobile-wallet-adapter-protocol").AppIdentity;
|
|
30
|
+
};
|
|
31
|
+
//# sourceMappingURL=use-mobile-wallet.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-mobile-wallet.d.ts","sourceRoot":"","sources":["../../src/use-mobile-wallet.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AAC7F,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,+CAA+C,CAAC;AAK5F,OAAO,EAAE,OAAO,EAAoB,MAAM,qBAAqB,CAAC;AAEhE,wBAAgB,eAAe;;;;;;;;;;;;;mBAYb,OAAO,CAAC,OAAO,CAAC;qBAKf,CAAC,MAAM,EAAE,YAAY,KAAK,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC,KAAG,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC;;sBAYjD,OAAO,CAAC,IAAI,CAAC;oCA4BxC,OAAO,kBAAkB,MAAM,KAAG,wBAAwB;0CAzBhD,WAAW,GAAG,WAAW,EAAE,kBAAkB,MAAM,KAAG,OAAO,CAAC,cAAc,EAAE,CAAC;4BAR7E,aAAa,KAAG,OAAO,CAAC,OAAO,CAAC;2BAoBtC,UAAU,KAAG,OAAO,CAAC,UAAU,CAAC;;;;;;EAoDvD"}
|
package/package.json
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@wallet-ui/react-native-kit",
|
|
3
|
+
"version": "3.1.0-canary-20260127222831",
|
|
4
|
+
"description": "React components for Wallet UI",
|
|
5
|
+
"exports": {
|
|
6
|
+
".": {
|
|
7
|
+
"edge-light": {
|
|
8
|
+
"import": "./dist/index.node.mjs",
|
|
9
|
+
"require": "./dist/index.node.cjs"
|
|
10
|
+
},
|
|
11
|
+
"workerd": {
|
|
12
|
+
"import": "./dist/index.node.mjs",
|
|
13
|
+
"require": "./dist/index.node.cjs"
|
|
14
|
+
},
|
|
15
|
+
"browser": {
|
|
16
|
+
"import": "./dist/index.browser.mjs",
|
|
17
|
+
"require": "./dist/index.browser.cjs"
|
|
18
|
+
},
|
|
19
|
+
"node": {
|
|
20
|
+
"import": "./dist/index.node.mjs",
|
|
21
|
+
"require": "./dist/index.node.cjs"
|
|
22
|
+
},
|
|
23
|
+
"react-native": "./dist/index.native.mjs",
|
|
24
|
+
"types": "./dist/types/index.d.ts"
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"browser": {
|
|
28
|
+
"./dist/index.node.cjs": "./dist/index.browser.cjs",
|
|
29
|
+
"./dist/index.node.mjs": "./dist/index.browser.mjs"
|
|
30
|
+
},
|
|
31
|
+
"main": "./dist/index.node.cjs",
|
|
32
|
+
"module": "./dist/index.node.mjs",
|
|
33
|
+
"react-native": "./dist/index.native.mjs",
|
|
34
|
+
"types": "./dist/types/index.d.ts",
|
|
35
|
+
"type": "commonjs",
|
|
36
|
+
"files": [
|
|
37
|
+
"./dist/"
|
|
38
|
+
],
|
|
39
|
+
"sideEffects": false,
|
|
40
|
+
"keywords": [
|
|
41
|
+
"blockchain",
|
|
42
|
+
"solana",
|
|
43
|
+
"web3"
|
|
44
|
+
],
|
|
45
|
+
"author": "beeman <beeman@beeman.nl>",
|
|
46
|
+
"homepage": "https://wallet-ui.dev",
|
|
47
|
+
"license": "MIT",
|
|
48
|
+
"repository": {
|
|
49
|
+
"type": "git",
|
|
50
|
+
"url": "https://github.com/wallet-ui/wallet-ui"
|
|
51
|
+
},
|
|
52
|
+
"bugs": {
|
|
53
|
+
"url": "https://github.com/wallet-ui/wallet-ui/issues"
|
|
54
|
+
},
|
|
55
|
+
"browserslist": [
|
|
56
|
+
"supports bigint and not dead",
|
|
57
|
+
"maintained node versions"
|
|
58
|
+
],
|
|
59
|
+
"dependencies": {
|
|
60
|
+
"@nanostores/react": "^1.0.0",
|
|
61
|
+
"@react-native-async-storage/async-storage": "^2.2.0",
|
|
62
|
+
"@solana-mobile/mobile-wallet-adapter-protocol": "^2.2.5",
|
|
63
|
+
"@solana-mobile/mobile-wallet-adapter-protocol-kit": "^0.2.2",
|
|
64
|
+
"@solana-program/memo": "^0.10.0",
|
|
65
|
+
"@solana/kit": "^5.1.0",
|
|
66
|
+
"@solana/react": "3.0.3",
|
|
67
|
+
"@solana/wallet-standard-features": "1.3.0",
|
|
68
|
+
"@wallet-standard/core": "1.1.1",
|
|
69
|
+
"@wallet-standard/react": "1.0.1",
|
|
70
|
+
"js-base64": "^3.7.8",
|
|
71
|
+
"nanostores": "^1.1.0",
|
|
72
|
+
"@wallet-ui/core": "3.1.0-canary-20260127222831"
|
|
73
|
+
},
|
|
74
|
+
"peerDependencies": {
|
|
75
|
+
"react": ">=18"
|
|
76
|
+
},
|
|
77
|
+
"engines": {
|
|
78
|
+
"node": ">=20.18.0"
|
|
79
|
+
},
|
|
80
|
+
"scripts": {
|
|
81
|
+
"compile:js": "tsup --config build-scripts/tsup.config.package.ts",
|
|
82
|
+
"compile:typedefs": "tsc -p ./tsconfig.declarations.json",
|
|
83
|
+
"dev": "jest -c ../../node_modules/@wallet-ui/test-config/jest-dev.config.js --rootDir . --watch",
|
|
84
|
+
"publish-impl": "npm view $npm_package_name@$npm_package_version > /dev/null 2>&1 || (pnpm publish --tag ${PUBLISH_TAG:-canary} --access public --no-git-checks && (([ \"$PUBLISH_TAG\" != \"canary\" ] && pnpm dist-tag add $npm_package_name@$npm_package_version latest) || true))",
|
|
85
|
+
"publish-packages": "pnpm prepublishOnly && pnpm publish-impl",
|
|
86
|
+
"style:fix": "pnpm eslint --fix src && pnpm prettier --log-level warn --ignore-unknown --write ./*",
|
|
87
|
+
"test:lint": "TERM_OVERRIDE=\"${TURBO_HASH:+dumb}\" TERM=${TERM_OVERRIDE:-$TERM} jest -c ../../node_modules/@wallet-ui/test-config/jest-lint.config.js --rootDir . --silent",
|
|
88
|
+
"test:prettier": "TERM_OVERRIDE=\"${TURBO_HASH:+dumb}\" TERM=${TERM_OVERRIDE:-$TERM} jest -c ../../node_modules/@wallet-ui/test-config/jest-prettier.config.js --rootDir . --silent",
|
|
89
|
+
"test:treeshakability:browser": "true # agadoo dist/index.browser.mjs",
|
|
90
|
+
"test:treeshakability:native": "true # agadoo dist/index.native.mjs",
|
|
91
|
+
"test:treeshakability:node": "true # agadoo dist/index.node.mjs",
|
|
92
|
+
"test:typecheck": "tsc --noEmit",
|
|
93
|
+
"test:unit:browser": "TERM_OVERRIDE=\"${TURBO_HASH:+dumb}\" TERM=${TERM_OVERRIDE:-$TERM} jest -c ../../node_modules/@wallet-ui/test-config/jest-unit.config.browser.js --rootDir . --silent",
|
|
94
|
+
"test:unit:node": "TERM_OVERRIDE=\"${TURBO_HASH:+dumb}\" TERM=${TERM_OVERRIDE:-$TERM} jest -c ../../node_modules/@wallet-ui/test-config/jest-unit.config.node.js --rootDir . --silent"
|
|
95
|
+
}
|
|
96
|
+
}
|