phygital-token-sdk 0.19.0 → 0.22.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/README.md +7 -7
- package/dist/generated/accounts/index.d.ts +1 -1
- package/dist/generated/accounts/index.d.ts.map +1 -1
- package/dist/generated/accounts/index.js +1 -1
- package/dist/generated/accounts/index.js.map +1 -1
- package/dist/generated/accounts/phygitalToken.d.ts +34 -0
- package/dist/generated/accounts/phygitalToken.d.ts.map +1 -0
- package/dist/generated/accounts/phygitalToken.js +60 -0
- package/dist/generated/accounts/phygitalToken.js.map +1 -0
- package/dist/generated/errors/phygitalToken.d.ts +10 -11
- package/dist/generated/errors/phygitalToken.d.ts.map +1 -1
- package/dist/generated/errors/phygitalToken.js +12 -14
- package/dist/generated/errors/phygitalToken.js.map +1 -1
- package/dist/generated/instructions/index.d.ts +3 -2
- package/dist/generated/instructions/index.d.ts.map +1 -1
- package/dist/generated/instructions/index.js +3 -2
- package/dist/generated/instructions/index.js.map +1 -1
- package/dist/generated/instructions/initialize.d.ts +11 -11
- package/dist/generated/instructions/initialize.d.ts.map +1 -1
- package/dist/generated/instructions/initialize.js +6 -6
- package/dist/generated/instructions/initialize.js.map +1 -1
- package/dist/generated/instructions/removeOwnership.d.ts +7 -7
- package/dist/generated/instructions/removeOwnership.js +3 -3
- package/dist/generated/instructions/setLockState.d.ts +7 -7
- package/dist/generated/instructions/setLockState.js +3 -3
- package/dist/generated/instructions/setMint.d.ts +37 -0
- package/dist/generated/instructions/setMint.d.ts.map +1 -0
- package/dist/generated/instructions/setMint.js +66 -0
- package/dist/generated/instructions/setMint.js.map +1 -0
- package/dist/generated/instructions/transferOwnership.d.ts +47 -0
- package/dist/generated/instructions/transferOwnership.d.ts.map +1 -0
- package/dist/generated/instructions/transferOwnership.js +83 -0
- package/dist/generated/instructions/transferOwnership.js.map +1 -0
- package/dist/generated/instructions/verify.d.ts +47 -0
- package/dist/generated/instructions/verify.d.ts.map +1 -0
- package/dist/generated/instructions/verify.js +88 -0
- package/dist/generated/instructions/verify.js.map +1 -0
- package/dist/generated/programs/phygitalToken.d.ts +19 -15
- package/dist/generated/programs/phygitalToken.d.ts.map +1 -1
- package/dist/generated/programs/phygitalToken.js +42 -28
- package/dist/generated/programs/phygitalToken.js.map +1 -1
- package/dist/generated/types/index.d.ts +1 -1
- package/dist/generated/types/index.d.ts.map +1 -1
- package/dist/generated/types/index.js +1 -1
- package/dist/generated/types/index.js.map +1 -1
- package/dist/generated/types/phygitalTokenType.d.ts +10 -0
- package/dist/generated/types/phygitalTokenType.d.ts.map +1 -0
- package/dist/generated/types/phygitalTokenType.js +16 -0
- package/dist/generated/types/phygitalTokenType.js.map +1 -0
- package/dist/index.d.ts +7 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -5
- package/dist/index.js.map +1 -1
- package/dist/instructions/initialize.d.ts +3 -3
- package/dist/instructions/initialize.d.ts.map +1 -1
- package/dist/instructions/initialize.js +5 -5
- package/dist/instructions/setMint.d.ts +8 -0
- package/dist/instructions/setMint.d.ts.map +1 -0
- package/dist/instructions/setMint.js +10 -0
- package/dist/instructions/setMint.js.map +1 -0
- package/dist/instructions/squadsInitialize.d.ts +6 -6
- package/dist/instructions/squadsInitialize.d.ts.map +1 -1
- package/dist/instructions/squadsInitialize.js +14 -23
- package/dist/instructions/squadsInitialize.js.map +1 -1
- package/dist/instructions/squadsSetMint.d.ts +21 -0
- package/dist/instructions/squadsSetMint.d.ts.map +1 -0
- package/dist/instructions/squadsSetMint.js +127 -0
- package/dist/instructions/squadsSetMint.js.map +1 -0
- package/dist/instructions/transfer.d.ts +4 -4
- package/dist/instructions/transfer.d.ts.map +1 -1
- package/dist/instructions/transfer.js +6 -6
- package/dist/instructions/transfer.js.map +1 -1
- package/dist/instructions/verify.d.ts +23 -0
- package/dist/instructions/verify.d.ts.map +1 -0
- package/dist/instructions/verify.js +50 -0
- package/dist/instructions/verify.js.map +1 -0
- package/dist/utils/consts.d.ts +1 -1
- package/dist/utils/consts.d.ts.map +1 -1
- package/dist/utils/consts.js +1 -1
- package/dist/utils/consts.js.map +1 -1
- package/dist/utils/metadata.d.ts +3 -3
- package/dist/utils/metadata.d.ts.map +1 -1
- package/dist/utils/metadata.js +11 -12
- package/dist/utils/metadata.js.map +1 -1
- package/dist/utils/passkey/secp256r1.d.ts +3 -3
- package/dist/utils/passkey/secp256r1.d.ts.map +1 -1
- package/dist/utils/passkey/secp256r1.js +4 -4
- package/dist/utils/passkey/secp256r1.js.map +1 -1
- package/dist/utils/pdas/index.d.ts +1 -1
- package/dist/utils/pdas/index.d.ts.map +1 -1
- package/dist/utils/pdas/index.js +1 -1
- package/dist/utils/pdas/index.js.map +1 -1
- package/dist/utils/pdas/token.d.ts +4 -0
- package/dist/utils/pdas/token.d.ts.map +1 -0
- package/dist/utils/pdas/token.js +14 -0
- package/dist/utils/pdas/token.js.map +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# phygital-token-sdk
|
|
2
2
|
|
|
3
|
-
TypeScript client for the Phygital Token Solana program. Authenticate a phygital
|
|
3
|
+
TypeScript client for the Phygital Token Solana program. Authenticate a phygital token with a live NFC tap using challenge–response.
|
|
4
4
|
|
|
5
5
|
## Install
|
|
6
6
|
|
|
@@ -10,7 +10,7 @@ pnpm add phygital-token-sdk @solana/kit
|
|
|
10
10
|
|
|
11
11
|
## Authenticate with NFC device
|
|
12
12
|
|
|
13
|
-
The custom authenticator uses the compressed secp256r1 **public key** as the WebAuthn `credential.id` and `user.id`. After a tap, `response.id` is that public key — and the on-chain
|
|
13
|
+
The custom authenticator uses the compressed secp256r1 **public key** as the WebAuthn `credential.id` and `user.id`. After a tap, `response.id` is that public key — and the on-chain token PDA is seeded by that same public key. A separate chip `identifier` is stored on the token for binding.
|
|
14
14
|
|
|
15
15
|
```ts
|
|
16
16
|
import { createSolanaRpc } from "@solana/kit";
|
|
@@ -18,8 +18,8 @@ import {
|
|
|
18
18
|
startAuthentication,
|
|
19
19
|
verifyResponse,
|
|
20
20
|
parseSecp256r1Pubkey,
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
findTokenPda,
|
|
22
|
+
fetchPhygitalToken,
|
|
23
23
|
} from "phygital-token-sdk";
|
|
24
24
|
|
|
25
25
|
const rpc = createSolanaRpc("https://api.mainnet-beta.solana.com");
|
|
@@ -35,11 +35,11 @@ const { isVerified, secp256r1PublicKey } = verifyResponse({
|
|
|
35
35
|
});
|
|
36
36
|
|
|
37
37
|
if (isVerified) {
|
|
38
|
-
const
|
|
38
|
+
const token = await fetchPhygitalToken(
|
|
39
39
|
rpc,
|
|
40
|
-
await
|
|
40
|
+
await findTokenPda(parseSecp256r1Pubkey(secp256r1PublicKey)),
|
|
41
41
|
);
|
|
42
|
-
// Continue with
|
|
42
|
+
// Continue with token.data.owner
|
|
43
43
|
}
|
|
44
44
|
```
|
|
45
45
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from "./
|
|
1
|
+
export * from "./phygitalToken.js";
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/generated/accounts/index.ts"],"names":[],"mappings":"AAQA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/generated/accounts/index.ts"],"names":[],"mappings":"AAQA,cAAc,oBAAoB,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from "./
|
|
1
|
+
export * from "./phygitalToken.js";
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/generated/accounts/index.ts"],"names":[],"mappings":"AAQA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/generated/accounts/index.ts"],"names":[],"mappings":"AAQA,cAAc,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { fetchEncodedAccount, fetchEncodedAccounts, type Account, type Address, type EncodedAccount, type FetchAccountConfig, type FetchAccountsConfig, type FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder, type MaybeAccount, type MaybeEncodedAccount, type ReadonlyUint8Array } from "@solana/kit";
|
|
2
|
+
import { type PhygitalTokenType, type PhygitalTokenTypeArgs, type Secp256r1Pubkey, type Secp256r1PubkeyArgs } from "../types/index.js";
|
|
3
|
+
export declare const PHYGITAL_TOKEN_DISCRIMINATOR: ReadonlyUint8Array;
|
|
4
|
+
export declare function getPhygitalTokenDiscriminatorBytes(): ReadonlyUint8Array;
|
|
5
|
+
export type PhygitalToken = {
|
|
6
|
+
discriminator: ReadonlyUint8Array;
|
|
7
|
+
tokenType: PhygitalTokenType;
|
|
8
|
+
owner: Address;
|
|
9
|
+
lastSignCount: number;
|
|
10
|
+
isLocked: boolean;
|
|
11
|
+
publicKey: Secp256r1Pubkey;
|
|
12
|
+
identifier: Secp256r1Pubkey;
|
|
13
|
+
mint: Address;
|
|
14
|
+
};
|
|
15
|
+
export type PhygitalTokenArgs = {
|
|
16
|
+
tokenType: PhygitalTokenTypeArgs;
|
|
17
|
+
owner: Address;
|
|
18
|
+
lastSignCount: number;
|
|
19
|
+
isLocked: boolean;
|
|
20
|
+
publicKey: Secp256r1PubkeyArgs;
|
|
21
|
+
identifier: Secp256r1PubkeyArgs;
|
|
22
|
+
mint: Address;
|
|
23
|
+
};
|
|
24
|
+
export declare function getPhygitalTokenEncoder(): FixedSizeEncoder<PhygitalTokenArgs>;
|
|
25
|
+
export declare function getPhygitalTokenDecoder(): FixedSizeDecoder<PhygitalToken>;
|
|
26
|
+
export declare function getPhygitalTokenCodec(): FixedSizeCodec<PhygitalTokenArgs, PhygitalToken>;
|
|
27
|
+
export declare function decodePhygitalToken<TAddress extends string = string>(encodedAccount: EncodedAccount<TAddress>): Account<PhygitalToken, TAddress>;
|
|
28
|
+
export declare function decodePhygitalToken<TAddress extends string = string>(encodedAccount: MaybeEncodedAccount<TAddress>): MaybeAccount<PhygitalToken, TAddress>;
|
|
29
|
+
export declare function fetchPhygitalToken<TAddress extends string = string>(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address<TAddress>, config?: FetchAccountConfig): Promise<Account<PhygitalToken, TAddress>>;
|
|
30
|
+
export declare function fetchMaybePhygitalToken<TAddress extends string = string>(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address<TAddress>, config?: FetchAccountConfig): Promise<MaybeAccount<PhygitalToken, TAddress>>;
|
|
31
|
+
export declare function fetchAllPhygitalToken(rpc: Parameters<typeof fetchEncodedAccounts>[0], addresses: Array<Address>, config?: FetchAccountsConfig): Promise<Account<PhygitalToken>[]>;
|
|
32
|
+
export declare function fetchAllMaybePhygitalToken(rpc: Parameters<typeof fetchEncodedAccounts>[0], addresses: Array<Address>, config?: FetchAccountsConfig): Promise<MaybeAccount<PhygitalToken>[]>;
|
|
33
|
+
export declare function getPhygitalTokenSize(): number;
|
|
34
|
+
//# sourceMappingURL=phygitalToken.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"phygitalToken.d.ts","sourceRoot":"","sources":["../../../src/generated/accounts/phygitalToken.ts"],"names":[],"mappings":"AAQA,OAAO,EAKL,mBAAmB,EACnB,oBAAoB,EAcpB,KAAK,OAAO,EACZ,KAAK,OAAO,EACZ,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,YAAY,EACjB,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACxB,MAAM,aAAa,CAAC;AACrB,OAAO,EAKL,KAAK,iBAAiB,EACtB,KAAK,qBAAqB,EAC1B,KAAK,eAAe,EACpB,KAAK,mBAAmB,EACzB,MAAM,mBAAmB,CAAC;AAE3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U,CAAC,OAAO,mBAAmB,CAAC,CAAC,CAAC,CAAC,EAC9C,OAAO,EAAE,OAAO,CAAC,QAAQ,CAAC,EAC1B,MAAM,CAAC,EAAE,kBAAkB,GAC1B,OAAO,CAAC,OAAO,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAC,CAI3C;AAED,wBAAsB,uBAAuB,CAAC,QAAQ,SAAS,MAAM,GAAG,MAAM,EAC5E,GAAG,EAAE,UAAU,CAAC,OAAO,mBAAmB,CAAC,CAAC,CAAC,CAAC,EAC9C,OAAO,EAAE,OAAO,CAAC,QAAQ,CAAC,EAC1B,MAAM,CAAC,EAAE,kBAAkB,GAC1B,OAAO,CAAC,YAAY,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAC,CAGhD;AAED,wBAAsB,qBAAqB,CACzC,GAAG,EAAE,UAAU,CAAC,OAAO,oBAAoB,CAAC,CAAC,CAAC,CAAC,EAC/C,SAAS,EAAE,KAAK,CAAC,OAAO,CAAC,EACzB,MAAM,CAAC,EAAE,mBAAmB,GAC3B,OAAO,CAAC,OAAO,CAAC,aAAa,CAAC,EAAE,CAAC,CAQnC;AAED,wBAAsB,0BAA0B,CAC9C,GAAG,EAAE,UAAU,CAAC,OAAO,oBAAoB,CAAC,CAAC,CAAC,CAAC,EAC/C,SAAS,EAAE,KAAK,CAAC,OAAO,CAAC,EACzB,MAAM,CAAC,EAAE,mBAAmB,GAC3B,OAAO,CAAC,YAAY,CAAC,aAAa,CAAC,EAAE,CAAC,CAGxC;AAED,wBAAgB,oBAAoB,IAAI,MAAM,CAE7C"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { assertAccountExists, assertAccountsExist, combineCodec, decodeAccount, fetchEncodedAccount, fetchEncodedAccounts, fixDecoderSize, fixEncoderSize, getAddressDecoder, getAddressEncoder, getBooleanDecoder, getBooleanEncoder, getBytesDecoder, getBytesEncoder, getStructDecoder, getStructEncoder, getU32Decoder, getU32Encoder, transformEncoder, } from "@solana/kit";
|
|
2
|
+
import { getPhygitalTokenTypeDecoder, getPhygitalTokenTypeEncoder, getSecp256r1PubkeyDecoder, getSecp256r1PubkeyEncoder, } from "../types/index.js";
|
|
3
|
+
export const PHYGITAL_TOKEN_DISCRIMINATOR = new Uint8Array([
|
|
4
|
+
123, 198, 67, 145, 58, 49, 38, 72,
|
|
5
|
+
]);
|
|
6
|
+
export function getPhygitalTokenDiscriminatorBytes() {
|
|
7
|
+
return fixEncoderSize(getBytesEncoder(), 8).encode(PHYGITAL_TOKEN_DISCRIMINATOR);
|
|
8
|
+
}
|
|
9
|
+
export function getPhygitalTokenEncoder() {
|
|
10
|
+
return transformEncoder(getStructEncoder([
|
|
11
|
+
["discriminator", fixEncoderSize(getBytesEncoder(), 8)],
|
|
12
|
+
["tokenType", getPhygitalTokenTypeEncoder()],
|
|
13
|
+
["owner", getAddressEncoder()],
|
|
14
|
+
["lastSignCount", getU32Encoder()],
|
|
15
|
+
["isLocked", getBooleanEncoder()],
|
|
16
|
+
["publicKey", getSecp256r1PubkeyEncoder()],
|
|
17
|
+
["identifier", getSecp256r1PubkeyEncoder()],
|
|
18
|
+
["mint", getAddressEncoder()],
|
|
19
|
+
]), (value) => ({ ...value, discriminator: PHYGITAL_TOKEN_DISCRIMINATOR }));
|
|
20
|
+
}
|
|
21
|
+
export function getPhygitalTokenDecoder() {
|
|
22
|
+
return getStructDecoder([
|
|
23
|
+
["discriminator", fixDecoderSize(getBytesDecoder(), 8)],
|
|
24
|
+
["tokenType", getPhygitalTokenTypeDecoder()],
|
|
25
|
+
["owner", getAddressDecoder()],
|
|
26
|
+
["lastSignCount", getU32Decoder()],
|
|
27
|
+
["isLocked", getBooleanDecoder()],
|
|
28
|
+
["publicKey", getSecp256r1PubkeyDecoder()],
|
|
29
|
+
["identifier", getSecp256r1PubkeyDecoder()],
|
|
30
|
+
["mint", getAddressDecoder()],
|
|
31
|
+
]);
|
|
32
|
+
}
|
|
33
|
+
export function getPhygitalTokenCodec() {
|
|
34
|
+
return combineCodec(getPhygitalTokenEncoder(), getPhygitalTokenDecoder());
|
|
35
|
+
}
|
|
36
|
+
export function decodePhygitalToken(encodedAccount) {
|
|
37
|
+
return decodeAccount(encodedAccount, getPhygitalTokenDecoder());
|
|
38
|
+
}
|
|
39
|
+
export async function fetchPhygitalToken(rpc, address, config) {
|
|
40
|
+
const maybeAccount = await fetchMaybePhygitalToken(rpc, address, config);
|
|
41
|
+
assertAccountExists(maybeAccount);
|
|
42
|
+
return maybeAccount;
|
|
43
|
+
}
|
|
44
|
+
export async function fetchMaybePhygitalToken(rpc, address, config) {
|
|
45
|
+
const maybeAccount = await fetchEncodedAccount(rpc, address, config);
|
|
46
|
+
return decodePhygitalToken(maybeAccount);
|
|
47
|
+
}
|
|
48
|
+
export async function fetchAllPhygitalToken(rpc, addresses, config) {
|
|
49
|
+
const maybeAccounts = await fetchAllMaybePhygitalToken(rpc, addresses, config);
|
|
50
|
+
assertAccountsExist(maybeAccounts);
|
|
51
|
+
return maybeAccounts;
|
|
52
|
+
}
|
|
53
|
+
export async function fetchAllMaybePhygitalToken(rpc, addresses, config) {
|
|
54
|
+
const maybeAccounts = await fetchEncodedAccounts(rpc, addresses, config);
|
|
55
|
+
return maybeAccounts.map((maybeAccount) => decodePhygitalToken(maybeAccount));
|
|
56
|
+
}
|
|
57
|
+
export function getPhygitalTokenSize() {
|
|
58
|
+
return 144;
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=phygitalToken.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"phygitalToken.js","sourceRoot":"","sources":["../../../src/generated/accounts/phygitalToken.ts"],"names":[],"mappings":"AAQA,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,YAAY,EACZ,aAAa,EACb,mBAAmB,EACnB,oBAAoB,EACpB,cAAc,EACd,cAAc,EACd,iBAAiB,EACjB,iBAAiB,EACjB,iBAAiB,EACjB,iBAAiB,EACjB,eAAe,EACf,eAAe,EACf,gBAAgB,EAChB,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;AAED,MAAM,CAAC,KAAK,UAAU,0BAA0B,CAC9C,GAA+C,EAC/C,SAAyB,EACzB,MAA4B;IAE5B,MAAM,aAAa,GAAG,MAAM,oBAAoB,CAAC,GAAG,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;IACzE,OAAO,aAAa,CAAC,GAAG,CAAC,CAAC,YAAY,EAAE,EAAE,CAAC,mBAAmB,CAAC,YAAY,CAAC,CAAC,CAAC;AAChF,CAAC;AAED,MAAM,UAAU,oBAAoB;IAClC,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -10,17 +10,16 @@ export declare const PHYGITAL_TOKEN_ERROR__STALE_SIGN_COUNT = 6007;
|
|
|
10
10
|
export declare const PHYGITAL_TOKEN_ERROR__CLIENT_DATA_HASH_MISMATCH = 6008;
|
|
11
11
|
export declare const PHYGITAL_TOKEN_ERROR__MISSING_INSTRUCTIONS_SYSVAR = 6009;
|
|
12
12
|
export declare const PHYGITAL_TOKEN_ERROR__INVALID_SYSVAR_DATA_FORMAT = 6010;
|
|
13
|
-
export declare const
|
|
14
|
-
export declare const
|
|
15
|
-
export declare const
|
|
16
|
-
export declare const
|
|
17
|
-
export declare const
|
|
18
|
-
export declare const
|
|
19
|
-
export declare const
|
|
20
|
-
export declare const
|
|
21
|
-
export declare const
|
|
22
|
-
export
|
|
23
|
-
export type PhygitalTokenError = typeof PHYGITAL_TOKEN_ERROR__ASSET_IS_CURRENTLY_LOCKED | typeof PHYGITAL_TOKEN_ERROR__ASSET_IS_NOT_LOCKABLE | typeof PHYGITAL_TOKEN_ERROR__CHALLENGE_HASH_MISMATCH | typeof PHYGITAL_TOKEN_ERROR__CLIENT_DATA_HASH_MISMATCH | typeof PHYGITAL_TOKEN_ERROR__INVALID_AUTHENTICATOR_DATA | typeof PHYGITAL_TOKEN_ERROR__INVALID_RECIPIENT | typeof PHYGITAL_TOKEN_ERROR__INVALID_SECP256R1_INSTRUCTION | typeof PHYGITAL_TOKEN_ERROR__INVALID_SECP256R1_PUBLIC_KEY | typeof PHYGITAL_TOKEN_ERROR__INVALID_SIGNATURE_OFFSETS | typeof PHYGITAL_TOKEN_ERROR__INVALID_SLOT_HASH | typeof PHYGITAL_TOKEN_ERROR__INVALID_SYSVAR_DATA_FORMAT | typeof PHYGITAL_TOKEN_ERROR__MISSING_INSTRUCTIONS_SYSVAR | typeof PHYGITAL_TOKEN_ERROR__ORIGIN_MISMATCH | typeof PHYGITAL_TOKEN_ERROR__OWNER_MISMATCH | typeof PHYGITAL_TOKEN_ERROR__RP_ID_MISMATCH | typeof PHYGITAL_TOKEN_ERROR__SECP256R1_PUBKEY_MISMATCH | typeof PHYGITAL_TOKEN_ERROR__SIGNATURE_INDEX_OUT_OF_BOUNDS | typeof PHYGITAL_TOKEN_ERROR__STALE_SIGN_COUNT | typeof PHYGITAL_TOKEN_ERROR__UNABLE_TO_PARSE_CLIENT_DATA | typeof PHYGITAL_TOKEN_ERROR__UNAUTHORIZED_AUTHORITY | typeof PHYGITAL_TOKEN_ERROR__USER_PRESENCE_NOT_VERIFIED;
|
|
13
|
+
export declare const PHYGITAL_TOKEN_ERROR__TOKEN_IS_CURRENTLY_LOCKED = 6011;
|
|
14
|
+
export declare const PHYGITAL_TOKEN_ERROR__TOKEN_IS_NOT_LOCKABLE = 6012;
|
|
15
|
+
export declare const PHYGITAL_TOKEN_ERROR__UNABLE_TO_PARSE_CLIENT_DATA = 6013;
|
|
16
|
+
export declare const PHYGITAL_TOKEN_ERROR__CHALLENGE_HASH_MISMATCH = 6014;
|
|
17
|
+
export declare const PHYGITAL_TOKEN_ERROR__INVALID_AUTHENTICATOR_DATA = 6015;
|
|
18
|
+
export declare const PHYGITAL_TOKEN_ERROR__USER_PRESENCE_NOT_VERIFIED = 6016;
|
|
19
|
+
export declare const PHYGITAL_TOKEN_ERROR__RP_ID_MISMATCH = 6017;
|
|
20
|
+
export declare const PHYGITAL_TOKEN_ERROR__ORIGIN_MISMATCH = 6018;
|
|
21
|
+
export declare const PHYGITAL_TOKEN_ERROR__UNAUTHORIZED_AUTHORITY = 6019;
|
|
22
|
+
export type PhygitalTokenError = typeof PHYGITAL_TOKEN_ERROR__CHALLENGE_HASH_MISMATCH | typeof PHYGITAL_TOKEN_ERROR__CLIENT_DATA_HASH_MISMATCH | typeof PHYGITAL_TOKEN_ERROR__INVALID_AUTHENTICATOR_DATA | typeof PHYGITAL_TOKEN_ERROR__INVALID_SECP256R1_INSTRUCTION | typeof PHYGITAL_TOKEN_ERROR__INVALID_SECP256R1_PUBLIC_KEY | typeof PHYGITAL_TOKEN_ERROR__INVALID_SIGNATURE_OFFSETS | typeof PHYGITAL_TOKEN_ERROR__INVALID_SLOT_HASH | typeof PHYGITAL_TOKEN_ERROR__INVALID_SYSVAR_DATA_FORMAT | typeof PHYGITAL_TOKEN_ERROR__MISSING_INSTRUCTIONS_SYSVAR | typeof PHYGITAL_TOKEN_ERROR__ORIGIN_MISMATCH | typeof PHYGITAL_TOKEN_ERROR__OWNER_MISMATCH | typeof PHYGITAL_TOKEN_ERROR__RP_ID_MISMATCH | typeof PHYGITAL_TOKEN_ERROR__SECP256R1_PUBKEY_MISMATCH | typeof PHYGITAL_TOKEN_ERROR__SIGNATURE_INDEX_OUT_OF_BOUNDS | typeof PHYGITAL_TOKEN_ERROR__STALE_SIGN_COUNT | typeof PHYGITAL_TOKEN_ERROR__TOKEN_IS_CURRENTLY_LOCKED | typeof PHYGITAL_TOKEN_ERROR__TOKEN_IS_NOT_LOCKABLE | typeof PHYGITAL_TOKEN_ERROR__UNABLE_TO_PARSE_CLIENT_DATA | typeof PHYGITAL_TOKEN_ERROR__UNAUTHORIZED_AUTHORITY | typeof PHYGITAL_TOKEN_ERROR__USER_PRESENCE_NOT_VERIFIED;
|
|
24
23
|
export declare function getPhygitalTokenErrorMessage(code: PhygitalTokenError): string;
|
|
25
24
|
export declare function isPhygitalTokenError<TProgramErrorCode extends PhygitalTokenError>(error: unknown, transactionMessage: {
|
|
26
25
|
instructions: Record<number, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"phygitalToken.d.ts","sourceRoot":"","sources":["../../../src/generated/errors/phygitalToken.ts"],"names":[],"mappings":"AAQA,OAAO,EAEL,KAAK,OAAO,EACZ,KAAK,uCAAuC,EAC5C,KAAK,WAAW,EACjB,MAAM,aAAa,CAAC;AAIrB,eAAO,MAAM,mDAAmD,OAAS,CAAC;AAE1E,eAAO,MAAM,mDAAmD,OAAS,CAAC;AAE1E,eAAO,MAAM,+CAA+C,OAAS,CAAC;AAEtE,eAAO,MAAM,kDAAkD,OAAS,CAAC;AAEzE,eAAO,MAAM,+CAA+C,OAAS,CAAC;AAEtE,eAAO,MAAM,oCAAoC,OAAS,CAAC;AAE3D,eAAO,MAAM,uCAAuC,OAAS,CAAC;AAE9D,eAAO,MAAM,sCAAsC,OAAS,CAAC;AAE7D,eAAO,MAAM,+CAA+C,OAAS,CAAC;AAEtE,eAAO,MAAM,iDAAiD,OAAS,CAAC;AAExE,eAAO,MAAM,gDAAgD,OAAS,CAAC;AAEvE,eAAO,MAAM
|
|
1
|
+
{"version":3,"file":"phygitalToken.d.ts","sourceRoot":"","sources":["../../../src/generated/errors/phygitalToken.ts"],"names":[],"mappings":"AAQA,OAAO,EAEL,KAAK,OAAO,EACZ,KAAK,uCAAuC,EAC5C,KAAK,WAAW,EACjB,MAAM,aAAa,CAAC;AAIrB,eAAO,MAAM,mDAAmD,OAAS,CAAC;AAE1E,eAAO,MAAM,mDAAmD,OAAS,CAAC;AAE1E,eAAO,MAAM,+CAA+C,OAAS,CAAC;AAEtE,eAAO,MAAM,kDAAkD,OAAS,CAAC;AAEzE,eAAO,MAAM,+CAA+C,OAAS,CAAC;AAEtE,eAAO,MAAM,oCAAoC,OAAS,CAAC;AAE3D,eAAO,MAAM,uCAAuC,OAAS,CAAC;AAE9D,eAAO,MAAM,sCAAsC,OAAS,CAAC;AAE7D,eAAO,MAAM,+CAA+C,OAAS,CAAC;AAEtE,eAAO,MAAM,iDAAiD,O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O,EAAE,QAAQ,CAAC;QAAE,IAAI,EAAE,iBAAiB,CAAA;KAAE,CAAC,CAAA;CAAE,CAAC,CAO7D"}
|
|
@@ -11,25 +11,21 @@ export const PHYGITAL_TOKEN_ERROR__STALE_SIGN_COUNT = 0x1777;
|
|
|
11
11
|
export const PHYGITAL_TOKEN_ERROR__CLIENT_DATA_HASH_MISMATCH = 0x1778;
|
|
12
12
|
export const PHYGITAL_TOKEN_ERROR__MISSING_INSTRUCTIONS_SYSVAR = 0x1779;
|
|
13
13
|
export const PHYGITAL_TOKEN_ERROR__INVALID_SYSVAR_DATA_FORMAT = 0x177a;
|
|
14
|
-
export const
|
|
15
|
-
export const
|
|
16
|
-
export const
|
|
17
|
-
export const
|
|
18
|
-
export const
|
|
19
|
-
export const
|
|
20
|
-
export const
|
|
21
|
-
export const
|
|
22
|
-
export const
|
|
23
|
-
export const PHYGITAL_TOKEN_ERROR__UNAUTHORIZED_AUTHORITY = 0x1784;
|
|
14
|
+
export const PHYGITAL_TOKEN_ERROR__TOKEN_IS_CURRENTLY_LOCKED = 0x177b;
|
|
15
|
+
export const PHYGITAL_TOKEN_ERROR__TOKEN_IS_NOT_LOCKABLE = 0x177c;
|
|
16
|
+
export const PHYGITAL_TOKEN_ERROR__UNABLE_TO_PARSE_CLIENT_DATA = 0x177d;
|
|
17
|
+
export const PHYGITAL_TOKEN_ERROR__CHALLENGE_HASH_MISMATCH = 0x177e;
|
|
18
|
+
export const PHYGITAL_TOKEN_ERROR__INVALID_AUTHENTICATOR_DATA = 0x177f;
|
|
19
|
+
export const PHYGITAL_TOKEN_ERROR__USER_PRESENCE_NOT_VERIFIED = 0x1780;
|
|
20
|
+
export const PHYGITAL_TOKEN_ERROR__RP_ID_MISMATCH = 0x1781;
|
|
21
|
+
export const PHYGITAL_TOKEN_ERROR__ORIGIN_MISMATCH = 0x1782;
|
|
22
|
+
export const PHYGITAL_TOKEN_ERROR__UNAUTHORIZED_AUTHORITY = 0x1783;
|
|
24
23
|
let phygitalTokenErrorMessages;
|
|
25
24
|
if (process.env["NODE_ENV"] !== "production") {
|
|
26
25
|
phygitalTokenErrorMessages = {
|
|
27
|
-
[PHYGITAL_TOKEN_ERROR__ASSET_IS_CURRENTLY_LOCKED]: `The owner needs to unlock the asset to enable transfer.`,
|
|
28
|
-
[PHYGITAL_TOKEN_ERROR__ASSET_IS_NOT_LOCKABLE]: `This asset is not lockable.`,
|
|
29
26
|
[PHYGITAL_TOKEN_ERROR__CHALLENGE_HASH_MISMATCH]: `Challenge hash mismatch.`,
|
|
30
27
|
[PHYGITAL_TOKEN_ERROR__CLIENT_DATA_HASH_MISMATCH]: `Client data hash mismatch`,
|
|
31
28
|
[PHYGITAL_TOKEN_ERROR__INVALID_AUTHENTICATOR_DATA]: `Authenticator data is too short to contain WebAuthn flags.`,
|
|
32
|
-
[PHYGITAL_TOKEN_ERROR__INVALID_RECIPIENT]: `Recipient cannot be the default (zero) pubkey`,
|
|
33
29
|
[PHYGITAL_TOKEN_ERROR__INVALID_SECP256R1_INSTRUCTION]: `No prior secp256r1 verification instruction in this transaction matches the provided client data`,
|
|
34
30
|
[PHYGITAL_TOKEN_ERROR__INVALID_SECP256R1_PUBLIC_KEY]: `Invalid secp256r1 public key`,
|
|
35
31
|
[PHYGITAL_TOKEN_ERROR__INVALID_SIGNATURE_OFFSETS]: `Failed to deserialize secp256r1 signature offsets from the instruction data`,
|
|
@@ -42,8 +38,10 @@ if (process.env["NODE_ENV"] !== "production") {
|
|
|
42
38
|
[PHYGITAL_TOKEN_ERROR__SECP256R1_PUBKEY_MISMATCH]: `secp256r1 pubkey does not match token record`,
|
|
43
39
|
[PHYGITAL_TOKEN_ERROR__SIGNATURE_INDEX_OUT_OF_BOUNDS]: `The signature index provided is out of bounds for the secp256r1 instruction`,
|
|
44
40
|
[PHYGITAL_TOKEN_ERROR__STALE_SIGN_COUNT]: `WebAuthn signCount must be greater than the last accepted signCount`,
|
|
41
|
+
[PHYGITAL_TOKEN_ERROR__TOKEN_IS_CURRENTLY_LOCKED]: `The owner needs to unlock the token to enable transfer.`,
|
|
42
|
+
[PHYGITAL_TOKEN_ERROR__TOKEN_IS_NOT_LOCKABLE]: `This token is not lockable.`,
|
|
45
43
|
[PHYGITAL_TOKEN_ERROR__UNABLE_TO_PARSE_CLIENT_DATA]: `Unable to parse client data JSON.`,
|
|
46
|
-
[PHYGITAL_TOKEN_ERROR__UNAUTHORIZED_AUTHORITY]: `Only the designated
|
|
44
|
+
[PHYGITAL_TOKEN_ERROR__UNAUTHORIZED_AUTHORITY]: `Only the designated authority can perform this action.`,
|
|
47
45
|
[PHYGITAL_TOKEN_ERROR__USER_PRESENCE_NOT_VERIFIED]: `WebAuthn user presence flag (UP) was not set by the authenticator.`,
|
|
48
46
|
};
|
|
49
47
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"phygitalToken.js","sourceRoot":"","sources":["../../../src/generated/errors/phygitalToken.ts"],"names":[],"mappings":"AAQA,OAAO,EACL,cAAc,GAIf,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,8BAA8B,EAAE,MAAM,sBAAsB,CAAC;AAGtE,MAAM,CAAC,MAAM,mDAAmD,GAAG,MAAM,CAAC;AAE1E,MAAM,CAAC,MAAM,mDAAmD,GAAG,MAAM,CAAC;AAE1E,MAAM,CAAC,MAAM,+CAA+C,GAAG,MAAM,CAAC;AAEtE,MAAM,CAAC,MAAM,kDAAkD,GAAG,MAAM,CAAC;AAEzE,MAAM,CAAC,MAAM,+CAA+C,GAAG,MAAM,CAAC;AAEtE,MAAM,CAAC,MAAM,oCAAoC,GAAG,MAAM,CAAC;AAE3D,MAAM,CAAC,MAAM,uCAAuC,GAAG,MAAM,CAAC;AAE9D,MAAM,CAAC,MAAM,sCAAsC,GAAG,MAAM,CAAC;AAE7D,MAAM,CAAC,MAAM,+CAA+C,GAAG,MAAM,CAAC;AAEtE,MAAM,CAAC,MAAM,iDAAiD,GAAG,MAAM,CAAC;AAExE,MAAM,CAAC,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C;AAED,MAAM,UAAU,oBAAoB,CAGlC,KAAc,EACd,kBAEC,EACD,IAAwB;IAGxB,OAAO,cAAc,CACnB,KAAK,EACL,kBAAkB,EAClB,8BAA8B,EAC9B,IAAI,CACL,CAAC;AACJ,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
export * from "./executeTransfer.js";
|
|
2
1
|
export * from "./initialize.js";
|
|
3
2
|
export * from "./removeOwnership.js";
|
|
4
3
|
export * from "./setLockState.js";
|
|
5
|
-
export * from "./
|
|
4
|
+
export * from "./setMint.js";
|
|
5
|
+
export * from "./transferOwnership.js";
|
|
6
|
+
export * from "./verify.js";
|
|
6
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/generated/instructions/index.ts"],"names":[],"mappings":"AAQA,cAAc,sBAAsB,CAAC;AACrC,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/generated/instructions/index.ts"],"names":[],"mappings":"AAQA,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,wBAAwB,CAAC;AACvC,cAAc,aAAa,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
export * from "./executeTransfer.js";
|
|
2
1
|
export * from "./initialize.js";
|
|
3
2
|
export * from "./removeOwnership.js";
|
|
4
3
|
export * from "./setLockState.js";
|
|
5
|
-
export * from "./
|
|
4
|
+
export * from "./setMint.js";
|
|
5
|
+
export * from "./transferOwnership.js";
|
|
6
|
+
export * from "./verify.js";
|
|
6
7
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/generated/instructions/index.ts"],"names":[],"mappings":"AAQA,cAAc,sBAAsB,CAAC;AACrC,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/generated/instructions/index.ts"],"names":[],"mappings":"AAQA,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,wBAAwB,CAAC;AACvC,cAAc,aAAa,CAAC"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { type AccountMeta, type AccountSignerMeta, type Address, type FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder, type Instruction, type InstructionWithAccounts, type InstructionWithData, type ReadonlyAccount, type ReadonlyUint8Array, type TransactionSigner, type WritableAccount, type WritableSignerAccount } from "@solana/kit";
|
|
2
2
|
import { PHYGITAL_TOKEN_PROGRAM_ADDRESS } from "../programs/index.js";
|
|
3
|
-
import { type
|
|
3
|
+
import { type PhygitalTokenType, type PhygitalTokenTypeArgs, type Secp256r1Pubkey, type Secp256r1PubkeyArgs } from "../types/index.js";
|
|
4
4
|
export declare const INITIALIZE_DISCRIMINATOR: ReadonlyUint8Array;
|
|
5
5
|
export declare function getInitializeDiscriminatorBytes(): ReadonlyUint8Array;
|
|
6
|
-
export type InitializeInstruction<TProgram extends string = typeof PHYGITAL_TOKEN_PROGRAM_ADDRESS, TAccountAuthority extends string | AccountMeta<string> = "G6kBnedts6uAivtY72ToaFHBs1UVbT9udiXmQZgMEjoF",
|
|
6
|
+
export type InitializeInstruction<TProgram extends string = typeof PHYGITAL_TOKEN_PROGRAM_ADDRESS, TAccountAuthority extends string | AccountMeta<string> = "G6kBnedts6uAivtY72ToaFHBs1UVbT9udiXmQZgMEjoF", TAccountToken extends string | AccountMeta<string> = string, TAccountSystemProgram extends string | AccountMeta<string> = "11111111111111111111111111111111", TRemainingAccounts extends readonly AccountMeta<string>[] = []> = Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array> & InstructionWithAccounts<[
|
|
7
7
|
TAccountAuthority extends string ? WritableSignerAccount<TAccountAuthority> & AccountSignerMeta<TAccountAuthority> : TAccountAuthority,
|
|
8
|
-
|
|
8
|
+
TAccountToken extends string ? WritableAccount<TAccountToken> : TAccountToken,
|
|
9
9
|
TAccountSystemProgram extends string ? ReadonlyAccount<TAccountSystemProgram> : TAccountSystemProgram,
|
|
10
10
|
...TRemainingAccounts
|
|
11
11
|
]>;
|
|
@@ -13,32 +13,32 @@ export type InitializeInstructionData = {
|
|
|
13
13
|
discriminator: ReadonlyUint8Array;
|
|
14
14
|
identifier: Secp256r1Pubkey;
|
|
15
15
|
secp256r1Pubkey: Secp256r1Pubkey;
|
|
16
|
-
|
|
16
|
+
tokenType: PhygitalTokenType;
|
|
17
17
|
};
|
|
18
18
|
export type InitializeInstructionDataArgs = {
|
|
19
19
|
identifier: Secp256r1PubkeyArgs;
|
|
20
20
|
secp256r1Pubkey: Secp256r1PubkeyArgs;
|
|
21
|
-
|
|
21
|
+
tokenType: PhygitalTokenTypeArgs;
|
|
22
22
|
};
|
|
23
23
|
export declare function getInitializeInstructionDataEncoder(): FixedSizeEncoder<InitializeInstructionDataArgs>;
|
|
24
24
|
export declare function getInitializeInstructionDataDecoder(): FixedSizeDecoder<InitializeInstructionData>;
|
|
25
25
|
export declare function getInitializeInstructionDataCodec(): FixedSizeCodec<InitializeInstructionDataArgs, InitializeInstructionData>;
|
|
26
|
-
export type InitializeInput<TAccountAuthority extends string = string,
|
|
26
|
+
export type InitializeInput<TAccountAuthority extends string = string, TAccountToken extends string = string, TAccountSystemProgram extends string = string> = {
|
|
27
27
|
authority?: TransactionSigner<TAccountAuthority>;
|
|
28
|
-
|
|
28
|
+
token: Address<TAccountToken>;
|
|
29
29
|
systemProgram?: Address<TAccountSystemProgram>;
|
|
30
30
|
identifier: InitializeInstructionDataArgs["identifier"];
|
|
31
31
|
secp256r1Pubkey: InitializeInstructionDataArgs["secp256r1Pubkey"];
|
|
32
|
-
|
|
32
|
+
tokenType: InitializeInstructionDataArgs["tokenType"];
|
|
33
33
|
};
|
|
34
|
-
export declare function getInitializeInstruction<TAccountAuthority extends string,
|
|
34
|
+
export declare function getInitializeInstruction<TAccountAuthority extends string, TAccountToken extends string, TAccountSystemProgram extends string, TProgramAddress extends Address = typeof PHYGITAL_TOKEN_PROGRAM_ADDRESS>(input: InitializeInput<TAccountAuthority, TAccountToken, TAccountSystemProgram>, config?: {
|
|
35
35
|
programAddress?: TProgramAddress;
|
|
36
|
-
}): InitializeInstruction<TProgramAddress, TAccountAuthority,
|
|
36
|
+
}): InitializeInstruction<TProgramAddress, TAccountAuthority, TAccountToken, TAccountSystemProgram>;
|
|
37
37
|
export type ParsedInitializeInstruction<TProgram extends string = typeof PHYGITAL_TOKEN_PROGRAM_ADDRESS, TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[]> = {
|
|
38
38
|
programAddress: Address<TProgram>;
|
|
39
39
|
accounts: {
|
|
40
40
|
authority: TAccountMetas[0];
|
|
41
|
-
|
|
41
|
+
token: TAccountMetas[1];
|
|
42
42
|
systemProgram: TAccountMetas[2];
|
|
43
43
|
};
|
|
44
44
|
data: InitializeInstructionData;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initialize.d.ts","sourceRoot":"","sources":["../../../src/generated/instructions/initialize.ts"],"names":[],"mappings":"AAQA,OAAO,EAWL,KAAK,WAAW,EAChB,KAAK,iBAAiB,EACtB,KAAK,OAAO,EACZ,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,WAAW,EAChB,KAAK,uBAAuB,EAC5B,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACpB,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACpB,KAAK,qBAAqB,EAC3B,MAAM,aAAa,CAAC;AAKrB,OAAO,EAAE,8BAA8B,EAAE,MAAM,sBAAsB,CAAC;AACtE,OAAO,EAKL,KAAK,
|
|
1
|
+
{"version":3,"file":"initialize.d.ts","sourceRoot":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AAO,GAAG,OAAO,8BAA8B,EAEvE,KAAK,EAAE,eAAe,CACpB,iBAAiB,EACjB,aAAa,EACb,qBAAqB,CACtB,EACD,MAAM,CAAC,EAAE;IAAE,cAAc,CAAC,EAAE,eAAe,CAAA;CAAE,GAC5C,qBAAqB,CACtB,eAAe,EACf,iBAAiB,EACjB,aAAa,EACb,qBAAqB,CACtB,CA8CA;AAED,MAAM,MAAM,2BAA2B,CACrC,QAAQ,SAAS,MAAM,GAAG,OAAO,8BAA8B,EAC/D,aAAa,SAAS,SAAS,WAAW,EAAE,GAAG,SAAS,WAAW,EAAE,IACnE;IACF,cAAc,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC;IAClC,QAAQ,EAAE;QACR,SAAS,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;QAC5B,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;QACxB,aAAa,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;KACjC,CAAC;IACF,IAAI,EAAE,yBAAyB,CAAC;CACjC,CAAC;AAEF,wBAAgB,0BAA0B,CACxC,QAAQ,SAAS,MAAM,EACvB,aAAa,SAAS,SAAS,WAAW,EAAE,EAE5C,WAAW,EAAE,WAAW,CAAC,QAAQ,CAAC,GAChC,uBAAuB,CAAC,aAAa,CAAC,GACtC,mBAAmB,CAAC,kBAAkB,CAAC,GACxC,2BAA2B,CAAC,QAAQ,EAAE,aAAa,CAAC,CAyBtD"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { combineCodec, fixDecoderSize, fixEncoderSize, getBytesDecoder, getBytesEncoder, getStructDecoder, getStructEncoder, SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS, SolanaError, transformEncoder, } from "@solana/kit";
|
|
2
2
|
import { getAccountMetaFactory, } from "@solana/kit/program-client-core";
|
|
3
3
|
import { PHYGITAL_TOKEN_PROGRAM_ADDRESS } from "../programs/index.js";
|
|
4
|
-
import {
|
|
4
|
+
import { getPhygitalTokenTypeDecoder, getPhygitalTokenTypeEncoder, getSecp256r1PubkeyDecoder, getSecp256r1PubkeyEncoder, } from "../types/index.js";
|
|
5
5
|
export const INITIALIZE_DISCRIMINATOR = new Uint8Array([
|
|
6
6
|
175, 175, 109, 31, 13, 152, 155, 237,
|
|
7
7
|
]);
|
|
@@ -13,7 +13,7 @@ export function getInitializeInstructionDataEncoder() {
|
|
|
13
13
|
["discriminator", fixEncoderSize(getBytesEncoder(), 8)],
|
|
14
14
|
["identifier", getSecp256r1PubkeyEncoder()],
|
|
15
15
|
["secp256r1Pubkey", getSecp256r1PubkeyEncoder()],
|
|
16
|
-
["
|
|
16
|
+
["tokenType", getPhygitalTokenTypeEncoder()],
|
|
17
17
|
]), (value) => ({ ...value, discriminator: INITIALIZE_DISCRIMINATOR }));
|
|
18
18
|
}
|
|
19
19
|
export function getInitializeInstructionDataDecoder() {
|
|
@@ -21,7 +21,7 @@ export function getInitializeInstructionDataDecoder() {
|
|
|
21
21
|
["discriminator", fixDecoderSize(getBytesDecoder(), 8)],
|
|
22
22
|
["identifier", getSecp256r1PubkeyDecoder()],
|
|
23
23
|
["secp256r1Pubkey", getSecp256r1PubkeyDecoder()],
|
|
24
|
-
["
|
|
24
|
+
["tokenType", getPhygitalTokenTypeDecoder()],
|
|
25
25
|
]);
|
|
26
26
|
}
|
|
27
27
|
export function getInitializeInstructionDataCodec() {
|
|
@@ -31,7 +31,7 @@ export function getInitializeInstruction(input, config) {
|
|
|
31
31
|
const programAddress = config?.programAddress ?? PHYGITAL_TOKEN_PROGRAM_ADDRESS;
|
|
32
32
|
const originalAccounts = {
|
|
33
33
|
authority: { value: input.authority ?? null, isWritable: true },
|
|
34
|
-
|
|
34
|
+
token: { value: input.token ?? null, isWritable: true },
|
|
35
35
|
systemProgram: { value: input.systemProgram ?? null, isWritable: false },
|
|
36
36
|
};
|
|
37
37
|
const accounts = originalAccounts;
|
|
@@ -48,7 +48,7 @@ export function getInitializeInstruction(input, config) {
|
|
|
48
48
|
return Object.freeze({
|
|
49
49
|
accounts: [
|
|
50
50
|
getAccountMeta("authority", accounts.authority),
|
|
51
|
-
getAccountMeta("
|
|
51
|
+
getAccountMeta("token", accounts.token),
|
|
52
52
|
getAccountMeta("systemProgram", accounts.systemProgram),
|
|
53
53
|
],
|
|
54
54
|
data: getInitializeInstructionDataEncoder().encode(args),
|
|
@@ -72,7 +72,7 @@ export function parseInitializeInstruction(instruction) {
|
|
|
72
72
|
programAddress: instruction.programAddress,
|
|
73
73
|
accounts: {
|
|
74
74
|
authority: getNextAccount(),
|
|
75
|
-
|
|
75
|
+
token: getNextAccount(),
|
|
76
76
|
systemProgram: getNextAccount(),
|
|
77
77
|
},
|
|
78
78
|
data: getInitializeInstructionDataDecoder().decode(instruction.data),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initialize.js","sourceRoot":"","sources":["../../../src/generated/instructions/initialize.ts"],"names":[],"mappings":"AAQA,OAAO,EACL,YAAY,EACZ,cAAc,EACd,cAAc,EACd,eAAe,EACf,eAAe,EACf,gBAAgB,EAChB,gBAAgB,EAChB,yDAAyD,EACzD,WAAW,EACX,gBAAgB,GAejB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,qBAAqB,GAEtB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,8BAA8B,EAAE,MAAM,sBAAsB,CAAC;AACtE,OAAO,EACL,
|
|
1
|
+
{"version":3,"file":"initialize.js","sourceRoot":"","sources":["../../../src/generated/instructions/initialize.ts"],"names":[],"mappings":"AAQA,OAAO,EACL,YAAY,EACZ,cAAc,EACd,cAAc,EACd,eAAe,EACf,eAAe,EACf,gBAAgB,EAChB,gBAAgB,EAChB,yDAAyD,EACzD,WAAW,EACX,gBAAgB,GAejB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,qBAAqB,GAEtB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,8BAA8B,EAAE,MAAM,sBAAsB,CAAC;AACtE,OAAO,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AAW,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACpC,MAAM,IAAI,WAAW,CACnB,yDAAyD,EACzD;YACE,kBAAkB,EAAE,WAAW,CAAC,QAAQ,CAAC,MAAM;YAC/C,oBAAoB,EAAE,CAAC;SACxB,CACF,CAAC;IACJ,CAAC;IACD,IAAI,YAAY,GAAG,CAAC,CAAC;IACrB,MAAM,cAAc,GAAG,GAAG,EAAE;QAC1B,MAAM,WAAW,GAAI,WAAW,CAAC,QAA0B,CAAC,YAAY,CAAE,CAAC;QAC3E,YAAY,IAAI,CAAC,CAAC;QAClB,OAAO,WAAW,CAAC;IACrB,CAAC,CAAC;IACF,OAAO;QACL,cAAc,EAAE,WAAW,CAAC,cAAc;QAC1C,QAAQ,EAAE;YACR,SAAS,EAAE,cAAc,EAAE;YAC3B,KAAK,EAAE,cAAc,EAAE;YACvB,aAAa,EAAE,cAAc,EAAE;SAChC;QACD,IAAI,EAAE,mCAAmC,EAAE,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC;KACrE,CAAC;AACJ,CAAC"}
|
|
@@ -2,9 +2,9 @@ import { type AccountMeta, type AccountSignerMeta, type Address, type FixedSizeC
|
|
|
2
2
|
import { PHYGITAL_TOKEN_PROGRAM_ADDRESS } from "../programs/index.js";
|
|
3
3
|
export declare const REMOVE_OWNERSHIP_DISCRIMINATOR: ReadonlyUint8Array;
|
|
4
4
|
export declare function getRemoveOwnershipDiscriminatorBytes(): ReadonlyUint8Array;
|
|
5
|
-
export type RemoveOwnershipInstruction<TProgram extends string = typeof PHYGITAL_TOKEN_PROGRAM_ADDRESS, TAccountOwner extends string | AccountMeta<string> = string,
|
|
5
|
+
export type RemoveOwnershipInstruction<TProgram extends string = typeof PHYGITAL_TOKEN_PROGRAM_ADDRESS, TAccountOwner extends string | AccountMeta<string> = string, TAccountToken extends string | AccountMeta<string> = string, TRemainingAccounts extends readonly AccountMeta<string>[] = []> = Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array> & InstructionWithAccounts<[
|
|
6
6
|
TAccountOwner extends string ? ReadonlySignerAccount<TAccountOwner> & AccountSignerMeta<TAccountOwner> : TAccountOwner,
|
|
7
|
-
|
|
7
|
+
TAccountToken extends string ? WritableAccount<TAccountToken> : TAccountToken,
|
|
8
8
|
...TRemainingAccounts
|
|
9
9
|
]>;
|
|
10
10
|
export type RemoveOwnershipInstructionData = {
|
|
@@ -14,18 +14,18 @@ export type RemoveOwnershipInstructionDataArgs = {};
|
|
|
14
14
|
export declare function getRemoveOwnershipInstructionDataEncoder(): FixedSizeEncoder<RemoveOwnershipInstructionDataArgs>;
|
|
15
15
|
export declare function getRemoveOwnershipInstructionDataDecoder(): FixedSizeDecoder<RemoveOwnershipInstructionData>;
|
|
16
16
|
export declare function getRemoveOwnershipInstructionDataCodec(): FixedSizeCodec<RemoveOwnershipInstructionDataArgs, RemoveOwnershipInstructionData>;
|
|
17
|
-
export type RemoveOwnershipInput<TAccountOwner extends string = string,
|
|
17
|
+
export type RemoveOwnershipInput<TAccountOwner extends string = string, TAccountToken extends string = string> = {
|
|
18
18
|
owner: TransactionSigner<TAccountOwner>;
|
|
19
|
-
|
|
19
|
+
token: Address<TAccountToken>;
|
|
20
20
|
};
|
|
21
|
-
export declare function getRemoveOwnershipInstruction<TAccountOwner extends string,
|
|
21
|
+
export declare function getRemoveOwnershipInstruction<TAccountOwner extends string, TAccountToken extends string, TProgramAddress extends Address = typeof PHYGITAL_TOKEN_PROGRAM_ADDRESS>(input: RemoveOwnershipInput<TAccountOwner, TAccountToken>, config?: {
|
|
22
22
|
programAddress?: TProgramAddress;
|
|
23
|
-
}): RemoveOwnershipInstruction<TProgramAddress, TAccountOwner,
|
|
23
|
+
}): RemoveOwnershipInstruction<TProgramAddress, TAccountOwner, TAccountToken>;
|
|
24
24
|
export type ParsedRemoveOwnershipInstruction<TProgram extends string = typeof PHYGITAL_TOKEN_PROGRAM_ADDRESS, TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[]> = {
|
|
25
25
|
programAddress: Address<TProgram>;
|
|
26
26
|
accounts: {
|
|
27
27
|
owner: TAccountMetas[0];
|
|
28
|
-
|
|
28
|
+
token: TAccountMetas[1];
|
|
29
29
|
};
|
|
30
30
|
data: RemoveOwnershipInstructionData;
|
|
31
31
|
};
|
|
@@ -20,14 +20,14 @@ export function getRemoveOwnershipInstruction(input, config) {
|
|
|
20
20
|
const programAddress = config?.programAddress ?? PHYGITAL_TOKEN_PROGRAM_ADDRESS;
|
|
21
21
|
const originalAccounts = {
|
|
22
22
|
owner: { value: input.owner ?? null, isWritable: false },
|
|
23
|
-
|
|
23
|
+
token: { value: input.token ?? null, isWritable: true },
|
|
24
24
|
};
|
|
25
25
|
const accounts = originalAccounts;
|
|
26
26
|
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
27
27
|
return Object.freeze({
|
|
28
28
|
accounts: [
|
|
29
29
|
getAccountMeta("owner", accounts.owner),
|
|
30
|
-
getAccountMeta("
|
|
30
|
+
getAccountMeta("token", accounts.token),
|
|
31
31
|
],
|
|
32
32
|
data: getRemoveOwnershipInstructionDataEncoder().encode({}),
|
|
33
33
|
programAddress,
|
|
@@ -48,7 +48,7 @@ export function parseRemoveOwnershipInstruction(instruction) {
|
|
|
48
48
|
};
|
|
49
49
|
return {
|
|
50
50
|
programAddress: instruction.programAddress,
|
|
51
|
-
accounts: { owner: getNextAccount(),
|
|
51
|
+
accounts: { owner: getNextAccount(), token: getNextAccount() },
|
|
52
52
|
data: getRemoveOwnershipInstructionDataDecoder().decode(instruction.data),
|
|
53
53
|
};
|
|
54
54
|
}
|
|
@@ -2,9 +2,9 @@ import { type AccountMeta, type AccountSignerMeta, type Address, type FixedSizeC
|
|
|
2
2
|
import { PHYGITAL_TOKEN_PROGRAM_ADDRESS } from "../programs/index.js";
|
|
3
3
|
export declare const SET_LOCK_STATE_DISCRIMINATOR: ReadonlyUint8Array;
|
|
4
4
|
export declare function getSetLockStateDiscriminatorBytes(): ReadonlyUint8Array;
|
|
5
|
-
export type SetLockStateInstruction<TProgram extends string = typeof PHYGITAL_TOKEN_PROGRAM_ADDRESS, TAccountOwner extends string | AccountMeta<string> = string,
|
|
5
|
+
export type SetLockStateInstruction<TProgram extends string = typeof PHYGITAL_TOKEN_PROGRAM_ADDRESS, TAccountOwner extends string | AccountMeta<string> = string, TAccountToken extends string | AccountMeta<string> = string, TRemainingAccounts extends readonly AccountMeta<string>[] = []> = Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array> & InstructionWithAccounts<[
|
|
6
6
|
TAccountOwner extends string ? ReadonlySignerAccount<TAccountOwner> & AccountSignerMeta<TAccountOwner> : TAccountOwner,
|
|
7
|
-
|
|
7
|
+
TAccountToken extends string ? WritableAccount<TAccountToken> : TAccountToken,
|
|
8
8
|
...TRemainingAccounts
|
|
9
9
|
]>;
|
|
10
10
|
export type SetLockStateInstructionData = {
|
|
@@ -17,19 +17,19 @@ export type SetLockStateInstructionDataArgs = {
|
|
|
17
17
|
export declare function getSetLockStateInstructionDataEncoder(): FixedSizeEncoder<SetLockStateInstructionDataArgs>;
|
|
18
18
|
export declare function getSetLockStateInstructionDataDecoder(): FixedSizeDecoder<SetLockStateInstructionData>;
|
|
19
19
|
export declare function getSetLockStateInstructionDataCodec(): FixedSizeCodec<SetLockStateInstructionDataArgs, SetLockStateInstructionData>;
|
|
20
|
-
export type SetLockStateInput<TAccountOwner extends string = string,
|
|
20
|
+
export type SetLockStateInput<TAccountOwner extends string = string, TAccountToken extends string = string> = {
|
|
21
21
|
owner: TransactionSigner<TAccountOwner>;
|
|
22
|
-
|
|
22
|
+
token: Address<TAccountToken>;
|
|
23
23
|
isLocked: SetLockStateInstructionDataArgs["isLocked"];
|
|
24
24
|
};
|
|
25
|
-
export declare function getSetLockStateInstruction<TAccountOwner extends string,
|
|
25
|
+
export declare function getSetLockStateInstruction<TAccountOwner extends string, TAccountToken extends string, TProgramAddress extends Address = typeof PHYGITAL_TOKEN_PROGRAM_ADDRESS>(input: SetLockStateInput<TAccountOwner, TAccountToken>, config?: {
|
|
26
26
|
programAddress?: TProgramAddress;
|
|
27
|
-
}): SetLockStateInstruction<TProgramAddress, TAccountOwner,
|
|
27
|
+
}): SetLockStateInstruction<TProgramAddress, TAccountOwner, TAccountToken>;
|
|
28
28
|
export type ParsedSetLockStateInstruction<TProgram extends string = typeof PHYGITAL_TOKEN_PROGRAM_ADDRESS, TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[]> = {
|
|
29
29
|
programAddress: Address<TProgram>;
|
|
30
30
|
accounts: {
|
|
31
31
|
owner: TAccountMetas[0];
|
|
32
|
-
|
|
32
|
+
token: TAccountMetas[1];
|
|
33
33
|
};
|
|
34
34
|
data: SetLockStateInstructionData;
|
|
35
35
|
};
|
|
@@ -26,7 +26,7 @@ export function getSetLockStateInstruction(input, config) {
|
|
|
26
26
|
const programAddress = config?.programAddress ?? PHYGITAL_TOKEN_PROGRAM_ADDRESS;
|
|
27
27
|
const originalAccounts = {
|
|
28
28
|
owner: { value: input.owner ?? null, isWritable: false },
|
|
29
|
-
|
|
29
|
+
token: { value: input.token ?? null, isWritable: true },
|
|
30
30
|
};
|
|
31
31
|
const accounts = originalAccounts;
|
|
32
32
|
const args = { ...input };
|
|
@@ -34,7 +34,7 @@ export function getSetLockStateInstruction(input, config) {
|
|
|
34
34
|
return Object.freeze({
|
|
35
35
|
accounts: [
|
|
36
36
|
getAccountMeta("owner", accounts.owner),
|
|
37
|
-
getAccountMeta("
|
|
37
|
+
getAccountMeta("token", accounts.token),
|
|
38
38
|
],
|
|
39
39
|
data: getSetLockStateInstructionDataEncoder().encode(args),
|
|
40
40
|
programAddress,
|
|
@@ -55,7 +55,7 @@ export function parseSetLockStateInstruction(instruction) {
|
|
|
55
55
|
};
|
|
56
56
|
return {
|
|
57
57
|
programAddress: instruction.programAddress,
|
|
58
|
-
accounts: { owner: getNextAccount(),
|
|
58
|
+
accounts: { owner: getNextAccount(), token: getNextAccount() },
|
|
59
59
|
data: getSetLockStateInstructionDataDecoder().decode(instruction.data),
|
|
60
60
|
};
|
|
61
61
|
}
|