phygital-token-sdk 0.19.0 → 0.20.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 +1 -1
- package/dist/generated/instructions/index.d.ts +1 -1
- package/dist/generated/instructions/index.d.ts.map +1 -1
- package/dist/generated/instructions/index.js +1 -1
- package/dist/generated/instructions/index.js.map +1 -1
- 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/programs/phygitalToken.d.ts +8 -8
- package/dist/generated/programs/phygitalToken.d.ts.map +1 -1
- package/dist/generated/programs/phygitalToken.js +16 -16
- package/dist/generated/programs/phygitalToken.js.map +1 -1
- package/dist/instructions/transfer.d.ts +2 -2
- package/dist/instructions/transfer.d.ts.map +1 -1
- package/dist/instructions/transfer.js +3 -3
- package/dist/instructions/transfer.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/generated/instructions/index.ts"],"names":[],"mappings":"AAQA,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,wBAAwB,CAAC;AACvC,cAAc,kBAAkB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/generated/instructions/index.ts"],"names":[],"mappings":"AAQA,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,wBAAwB,CAAC;AACvC,cAAc,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { type AccountMeta, type AccountSignerMeta, type Address, type Codec, type Decoder, type Encoder, type Instruction, type InstructionWithAccounts, type InstructionWithData, type ReadonlyAccount, type ReadonlySignerAccount, type ReadonlyUint8Array, type TransactionSigner, type WritableAccount } from "@solana/kit";
|
|
2
|
+
import { PHYGITAL_TOKEN_PROGRAM_ADDRESS } from "../programs/index.js";
|
|
3
|
+
import { type Secp256r1VerifyArgs, type Secp256r1VerifyArgsArgs } from "../types/index.js";
|
|
4
|
+
export declare const TRANSFER_OWNERSHIP_DISCRIMINATOR: ReadonlyUint8Array;
|
|
5
|
+
export declare function getTransferOwnershipDiscriminatorBytes(): ReadonlyUint8Array;
|
|
6
|
+
export type TransferOwnershipInstruction<TProgram extends string = typeof PHYGITAL_TOKEN_PROGRAM_ADDRESS, TAccountRecipient extends string | AccountMeta<string> = string, TAccountAsset extends string | AccountMeta<string> = string, TAccountSlotHashes extends string | AccountMeta<string> = "SysvarS1otHashes111111111111111111111111111", TAccountInstructionsSysvar extends string | AccountMeta<string> = "Sysvar1nstructions1111111111111111111111111", TRemainingAccounts extends readonly AccountMeta<string>[] = []> = Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array> & InstructionWithAccounts<[
|
|
7
|
+
TAccountRecipient extends string ? ReadonlySignerAccount<TAccountRecipient> & AccountSignerMeta<TAccountRecipient> : TAccountRecipient,
|
|
8
|
+
TAccountAsset extends string ? WritableAccount<TAccountAsset> : TAccountAsset,
|
|
9
|
+
TAccountSlotHashes extends string ? ReadonlyAccount<TAccountSlotHashes> : TAccountSlotHashes,
|
|
10
|
+
TAccountInstructionsSysvar extends string ? ReadonlyAccount<TAccountInstructionsSysvar> : TAccountInstructionsSysvar,
|
|
11
|
+
...TRemainingAccounts
|
|
12
|
+
]>;
|
|
13
|
+
export type TransferOwnershipInstructionData = {
|
|
14
|
+
discriminator: ReadonlyUint8Array;
|
|
15
|
+
secp256r1VerifyArgs: Secp256r1VerifyArgs;
|
|
16
|
+
slotNumber: bigint;
|
|
17
|
+
};
|
|
18
|
+
export type TransferOwnershipInstructionDataArgs = {
|
|
19
|
+
secp256r1VerifyArgs: Secp256r1VerifyArgsArgs;
|
|
20
|
+
slotNumber: number | bigint;
|
|
21
|
+
};
|
|
22
|
+
export declare function getTransferOwnershipInstructionDataEncoder(): Encoder<TransferOwnershipInstructionDataArgs>;
|
|
23
|
+
export declare function getTransferOwnershipInstructionDataDecoder(): Decoder<TransferOwnershipInstructionData>;
|
|
24
|
+
export declare function getTransferOwnershipInstructionDataCodec(): Codec<TransferOwnershipInstructionDataArgs, TransferOwnershipInstructionData>;
|
|
25
|
+
export type TransferOwnershipInput<TAccountRecipient extends string = string, TAccountAsset extends string = string, TAccountSlotHashes extends string = string, TAccountInstructionsSysvar extends string = string> = {
|
|
26
|
+
recipient: TransactionSigner<TAccountRecipient>;
|
|
27
|
+
asset: Address<TAccountAsset>;
|
|
28
|
+
slotHashes?: Address<TAccountSlotHashes>;
|
|
29
|
+
instructionsSysvar?: Address<TAccountInstructionsSysvar>;
|
|
30
|
+
secp256r1VerifyArgs: TransferOwnershipInstructionDataArgs["secp256r1VerifyArgs"];
|
|
31
|
+
slotNumber: TransferOwnershipInstructionDataArgs["slotNumber"];
|
|
32
|
+
};
|
|
33
|
+
export declare function getTransferOwnershipInstruction<TAccountRecipient extends string, TAccountAsset extends string, TAccountSlotHashes extends string, TAccountInstructionsSysvar extends string, TProgramAddress extends Address = typeof PHYGITAL_TOKEN_PROGRAM_ADDRESS>(input: TransferOwnershipInput<TAccountRecipient, TAccountAsset, TAccountSlotHashes, TAccountInstructionsSysvar>, config?: {
|
|
34
|
+
programAddress?: TProgramAddress;
|
|
35
|
+
}): TransferOwnershipInstruction<TProgramAddress, TAccountRecipient, TAccountAsset, TAccountSlotHashes, TAccountInstructionsSysvar>;
|
|
36
|
+
export type ParsedTransferOwnershipInstruction<TProgram extends string = typeof PHYGITAL_TOKEN_PROGRAM_ADDRESS, TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[]> = {
|
|
37
|
+
programAddress: Address<TProgram>;
|
|
38
|
+
accounts: {
|
|
39
|
+
recipient: TAccountMetas[0];
|
|
40
|
+
asset: TAccountMetas[1];
|
|
41
|
+
slotHashes: TAccountMetas[2];
|
|
42
|
+
instructionsSysvar: TAccountMetas[3];
|
|
43
|
+
};
|
|
44
|
+
data: TransferOwnershipInstructionData;
|
|
45
|
+
};
|
|
46
|
+
export declare function parseTransferOwnershipInstruction<TProgram extends string, TAccountMetas extends readonly AccountMeta[]>(instruction: Instruction<TProgram> & InstructionWithAccounts<TAccountMetas> & InstructionWithData<ReadonlyUint8Array>): ParsedTransferOwnershipInstruction<TProgram, TAccountMetas>;
|
|
47
|
+
//# sourceMappingURL=transferOwnership.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transferOwnership.d.ts","sourceRoot":"","sources":["../../../src/generated/instructions/transferOwnership.ts"],"names":[],"mappings":"AAQA,OAAO,EAaL,KAAK,WAAW,EAChB,KAAK,iBAAiB,EACtB,KAAK,OAAO,EACZ,KAAK,KAAK,EACV,KAAK,OAAO,EACZ,KAAK,OAAO,EACZ,KAAK,WAAW,EAChB,KAAK,uBAAuB,EAC5B,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACpB,KAAK,qBAAqB,EAC1B,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACrB,MAAM,aAAa,CAAC;AAKrB,OAAO,EAAE,8BAA8B,EAAE,MAAM,sBAAsB,CAAC;AACtE,OAAO,EAGL,KAAK,mBAAmB,EACxB,KAAK,uBAAuB,EAC7B,MAAM,mBAAmB,CAAC;AAE3B,eAAO,MAAM,gCAAgC,EAAE,kBACK,CAAC;AAErD,wBAAgB,sCAAsC,IAAI,kBAAkB,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QAAQ,CAAC,CAAC;IAClC,QAAQ,EAAE;QACR,SAAS,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;QAC5B,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;QACxB,UAAU,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;QAC7B,kBAAkB,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;KACtC,CAAC;IACF,IAAI,EAAE,gCAAgC,CAAC;CACxC,CAAC;AAEF,wBAAgB,iCAAiC,CAC/C,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,kCAAkC,CAAC,QAAQ,EAAE,aAAa,CAAC,CA0B7D"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { combineCodec, fixDecoderSize, fixEncoderSize, getBytesDecoder, getBytesEncoder, getStructDecoder, getStructEncoder, getU64Decoder, getU64Encoder, SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS, SolanaError, transformEncoder, } from "@solana/kit";
|
|
2
|
+
import { getAccountMetaFactory, } from "@solana/kit/program-client-core";
|
|
3
|
+
import { PHYGITAL_TOKEN_PROGRAM_ADDRESS } from "../programs/index.js";
|
|
4
|
+
import { getSecp256r1VerifyArgsDecoder, getSecp256r1VerifyArgsEncoder, } from "../types/index.js";
|
|
5
|
+
export const TRANSFER_OWNERSHIP_DISCRIMINATOR = new Uint8Array([65, 177, 215, 73, 53, 45, 99, 47]);
|
|
6
|
+
export function getTransferOwnershipDiscriminatorBytes() {
|
|
7
|
+
return fixEncoderSize(getBytesEncoder(), 8).encode(TRANSFER_OWNERSHIP_DISCRIMINATOR);
|
|
8
|
+
}
|
|
9
|
+
export function getTransferOwnershipInstructionDataEncoder() {
|
|
10
|
+
return transformEncoder(getStructEncoder([
|
|
11
|
+
["discriminator", fixEncoderSize(getBytesEncoder(), 8)],
|
|
12
|
+
["secp256r1VerifyArgs", getSecp256r1VerifyArgsEncoder()],
|
|
13
|
+
["slotNumber", getU64Encoder()],
|
|
14
|
+
]), (value) => ({ ...value, discriminator: TRANSFER_OWNERSHIP_DISCRIMINATOR }));
|
|
15
|
+
}
|
|
16
|
+
export function getTransferOwnershipInstructionDataDecoder() {
|
|
17
|
+
return getStructDecoder([
|
|
18
|
+
["discriminator", fixDecoderSize(getBytesDecoder(), 8)],
|
|
19
|
+
["secp256r1VerifyArgs", getSecp256r1VerifyArgsDecoder()],
|
|
20
|
+
["slotNumber", getU64Decoder()],
|
|
21
|
+
]);
|
|
22
|
+
}
|
|
23
|
+
export function getTransferOwnershipInstructionDataCodec() {
|
|
24
|
+
return combineCodec(getTransferOwnershipInstructionDataEncoder(), getTransferOwnershipInstructionDataDecoder());
|
|
25
|
+
}
|
|
26
|
+
export function getTransferOwnershipInstruction(input, config) {
|
|
27
|
+
const programAddress = config?.programAddress ?? PHYGITAL_TOKEN_PROGRAM_ADDRESS;
|
|
28
|
+
const originalAccounts = {
|
|
29
|
+
recipient: { value: input.recipient ?? null, isWritable: false },
|
|
30
|
+
asset: { value: input.asset ?? null, isWritable: true },
|
|
31
|
+
slotHashes: { value: input.slotHashes ?? null, isWritable: false },
|
|
32
|
+
instructionsSysvar: {
|
|
33
|
+
value: input.instructionsSysvar ?? null,
|
|
34
|
+
isWritable: false,
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
const accounts = originalAccounts;
|
|
38
|
+
const args = { ...input };
|
|
39
|
+
if (!accounts.slotHashes.value) {
|
|
40
|
+
accounts.slotHashes.value =
|
|
41
|
+
"SysvarS1otHashes111111111111111111111111111";
|
|
42
|
+
}
|
|
43
|
+
if (!accounts.instructionsSysvar.value) {
|
|
44
|
+
accounts.instructionsSysvar.value =
|
|
45
|
+
"Sysvar1nstructions1111111111111111111111111";
|
|
46
|
+
}
|
|
47
|
+
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
48
|
+
return Object.freeze({
|
|
49
|
+
accounts: [
|
|
50
|
+
getAccountMeta("recipient", accounts.recipient),
|
|
51
|
+
getAccountMeta("asset", accounts.asset),
|
|
52
|
+
getAccountMeta("slotHashes", accounts.slotHashes),
|
|
53
|
+
getAccountMeta("instructionsSysvar", accounts.instructionsSysvar),
|
|
54
|
+
],
|
|
55
|
+
data: getTransferOwnershipInstructionDataEncoder().encode(args),
|
|
56
|
+
programAddress,
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
export function parseTransferOwnershipInstruction(instruction) {
|
|
60
|
+
if (instruction.accounts.length < 4) {
|
|
61
|
+
throw new SolanaError(SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS, {
|
|
62
|
+
actualAccountMetas: instruction.accounts.length,
|
|
63
|
+
expectedAccountMetas: 4,
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
let accountIndex = 0;
|
|
67
|
+
const getNextAccount = () => {
|
|
68
|
+
const accountMeta = instruction.accounts[accountIndex];
|
|
69
|
+
accountIndex += 1;
|
|
70
|
+
return accountMeta;
|
|
71
|
+
};
|
|
72
|
+
return {
|
|
73
|
+
programAddress: instruction.programAddress,
|
|
74
|
+
accounts: {
|
|
75
|
+
recipient: getNextAccount(),
|
|
76
|
+
asset: getNextAccount(),
|
|
77
|
+
slotHashes: getNextAccount(),
|
|
78
|
+
instructionsSysvar: getNextAccount(),
|
|
79
|
+
},
|
|
80
|
+
data: getTransferOwnershipInstructionDataDecoder().decode(instruction.data),
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
//# sourceMappingURL=transferOwnership.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transferOwnership.js","sourceRoot":"","sources":["../../../src/generated/instructions/transferOwnership.ts"],"names":[],"mappings":"AAQA,OAAO,EACL,YAAY,EACZ,cAAc,EACd,cAAc,E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K,CAAC;YACvC,cAAc,CAAC,YAAY,EAAE,QAAQ,CAAC,UAAU,CAAC;YACjD,cAAc,CAAC,oBAAoB,EAAE,QAAQ,CAAC,kBAAkB,CAAC;SAClE;QACD,IAAI,EAAE,0CAA0C,EAAE,CAAC,MAAM,CACvD,IAA4C,CAC7C;QACD,cAAc;KAOf,CAAC,CAAC;AACL,CAAC;AAgBD,MAAM,UAAU,iCAAiC,CAI/C,WAEyC;IAEzC,IAAI,WAAW,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,UAAU,EAAE,cAAc,EAAE;YAC5B,kBAAkB,EAAE,cAAc,EAAE;SACrC;QACD,IAAI,EAAE,0CAA0C,EAAE,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC;KAC5E,CAAC;AACJ,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type Address, type ClientWithRpc, type ClientWithTransactionPlanning, type ClientWithTransactionSending, type ExtendedClient, type GetAccountInfoApi, type GetMultipleAccountsApi, type Instruction, type InstructionWithData, type ReadonlyUint8Array } from "@solana/kit";
|
|
2
2
|
import { type SelfFetchFunctions, type SelfPlanAndSendFunctions } from "@solana/kit/program-client-core";
|
|
3
3
|
import { getAssetCodec, type Asset, type AssetArgs } from "../accounts/index.js";
|
|
4
|
-
import {
|
|
4
|
+
import { getInitializeInstruction, getRemoveOwnershipInstruction, getSetLockStateInstruction, getTransferOwnershipInstruction, getVerifyAssetInstruction, type InitializeInput, type ParsedInitializeInstruction, type ParsedRemoveOwnershipInstruction, type ParsedSetLockStateInstruction, type ParsedTransferOwnershipInstruction, type ParsedVerifyAssetInstruction, type RemoveOwnershipInput, type SetLockStateInput, type TransferOwnershipInput, type VerifyAssetInput } from "../instructions/index.js";
|
|
5
5
|
export declare const PHYGITAL_TOKEN_PROGRAM_ADDRESS: Address<"DuPpckdjjgVAnYok2aTMAt264ZPBXqq3JSazJjCUzTJQ">;
|
|
6
6
|
export declare enum PhygitalTokenAccount {
|
|
7
7
|
Asset = 0
|
|
@@ -10,24 +10,24 @@ export declare function identifyPhygitalTokenAccount(account: {
|
|
|
10
10
|
data: ReadonlyUint8Array;
|
|
11
11
|
} | ReadonlyUint8Array): PhygitalTokenAccount;
|
|
12
12
|
export declare enum PhygitalTokenInstruction {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
Initialize = 0,
|
|
14
|
+
RemoveOwnership = 1,
|
|
15
|
+
SetLockState = 2,
|
|
16
|
+
TransferOwnership = 3,
|
|
17
17
|
VerifyAsset = 4
|
|
18
18
|
}
|
|
19
19
|
export declare function identifyPhygitalTokenInstruction(instruction: {
|
|
20
20
|
data: ReadonlyUint8Array;
|
|
21
21
|
} | ReadonlyUint8Array): PhygitalTokenInstruction;
|
|
22
22
|
export type ParsedPhygitalTokenInstruction<TProgram extends string = "DuPpckdjjgVAnYok2aTMAt264ZPBXqq3JSazJjCUzTJQ"> = ({
|
|
23
|
-
instructionType: PhygitalTokenInstruction.ExecuteTransfer;
|
|
24
|
-
} & ParsedExecuteTransferInstruction<TProgram>) | ({
|
|
25
23
|
instructionType: PhygitalTokenInstruction.Initialize;
|
|
26
24
|
} & ParsedInitializeInstruction<TProgram>) | ({
|
|
27
25
|
instructionType: PhygitalTokenInstruction.RemoveOwnership;
|
|
28
26
|
} & ParsedRemoveOwnershipInstruction<TProgram>) | ({
|
|
29
27
|
instructionType: PhygitalTokenInstruction.SetLockState;
|
|
30
28
|
} & ParsedSetLockStateInstruction<TProgram>) | ({
|
|
29
|
+
instructionType: PhygitalTokenInstruction.TransferOwnership;
|
|
30
|
+
} & ParsedTransferOwnershipInstruction<TProgram>) | ({
|
|
31
31
|
instructionType: PhygitalTokenInstruction.VerifyAsset;
|
|
32
32
|
} & ParsedVerifyAssetInstruction<TProgram>);
|
|
33
33
|
export declare function parsePhygitalTokenInstruction<TProgram extends string>(instruction: Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array>): ParsedPhygitalTokenInstruction<TProgram>;
|
|
@@ -42,10 +42,10 @@ export type PhygitalTokenPluginAccounts = {
|
|
|
42
42
|
asset: ReturnType<typeof getAssetCodec> & SelfFetchFunctions<AssetArgs, Asset>;
|
|
43
43
|
};
|
|
44
44
|
export type PhygitalTokenPluginInstructions = {
|
|
45
|
-
executeTransfer: (input: ExecuteTransferInput) => ReturnType<typeof getExecuteTransferInstruction> & SelfPlanAndSendFunctions;
|
|
46
45
|
initialize: (input: InitializeInput) => ReturnType<typeof getInitializeInstruction> & SelfPlanAndSendFunctions;
|
|
47
46
|
removeOwnership: (input: RemoveOwnershipInput) => ReturnType<typeof getRemoveOwnershipInstruction> & SelfPlanAndSendFunctions;
|
|
48
47
|
setLockState: (input: SetLockStateInput) => ReturnType<typeof getSetLockStateInstruction> & SelfPlanAndSendFunctions;
|
|
48
|
+
transferOwnership: (input: TransferOwnershipInput) => ReturnType<typeof getTransferOwnershipInstruction> & SelfPlanAndSendFunctions;
|
|
49
49
|
verifyAsset: (input: VerifyAssetInput) => ReturnType<typeof getVerifyAssetInstruction> & SelfPlanAndSendFunctions;
|
|
50
50
|
};
|
|
51
51
|
export type PhygitalTokenPluginRequirements = ClientWithRpc<GetAccountInfoApi & GetMultipleAccountsApi> & ClientWithTransactionPlanning & ClientWithTransactionSending;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"phygitalToken.d.ts","sourceRoot":"","sources":["../../../src/generated/programs/phygitalToken.ts"],"names":[],"mappings":"AAQA,OAAO,EAUL,KAAK,OAAO,EACZ,KAAK,aAAa,EAClB,KAAK,6BAA6B,EAClC,KAAK,4BAA4B,EACjC,KAAK,cAAc,EACnB,KAAK,iBAAiB,EACtB,KAAK,sBAAsB,EAC3B,KAAK,WAAW,EAChB,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACxB,MAAM,aAAa,CAAC;AACrB,OAAO,EAGL,KAAK,kBAAkB,EACvB,KAAK,wBAAwB,EAC9B,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,KAAK,KAAK,EAAE,KAAK,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjF,OAAO,EACL,
|
|
1
|
+
{"version":3,"file":"phygitalToken.d.ts","sourceRoot":"","sources":["../../../src/generated/programs/phygitalToken.ts"],"names":[],"mappings":"AAQA,OAAO,EAUL,KAAK,OAAO,EACZ,KAAK,aAAa,EAClB,KAAK,6BAA6B,EAClC,KAAK,4BAA4B,EACjC,KAAK,cAAc,EACnB,KAAK,iBAAiB,EACtB,KAAK,sBAAsB,EAC3B,KAAK,WAAW,EAChB,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACxB,MAAM,aAAa,CAAC;AACrB,OAAO,EAGL,KAAK,kBAAkB,EACvB,KAAK,wBAAwB,EAC9B,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,KAAK,KAAK,EAAE,KAAK,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjF,OAAO,EACL,wBAAwB,EACxB,6BAA6B,EAC7B,0BAA0B,EAC1B,+BAA+B,EAC/B,yBAAyB,EAMzB,KAAK,eAAe,EACpB,KAAK,2BAA2B,EAChC,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BAAgB,oBAAoB,KAC1B,CAAC,SAAS,+BAA+B,EAC/C,QAAQ,CAAC,KACR,cAAc,CAAC,CAAC,EAAE;IAAE,aAAa,EAAE,mBAAmB,CAAA;CAAE,CAAC,CAqC7D"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { assertIsInstructionWithAccounts, containsBytes, extendClient, fixEncoderSize, getBytesEncoder, SOLANA_ERROR__PROGRAM_CLIENTS__FAILED_TO_IDENTIFY_ACCOUNT, SOLANA_ERROR__PROGRAM_CLIENTS__FAILED_TO_IDENTIFY_INSTRUCTION, SOLANA_ERROR__PROGRAM_CLIENTS__UNRECOGNIZED_INSTRUCTION_TYPE, SolanaError, } from "@solana/kit";
|
|
2
2
|
import { addSelfFetchFunctions, addSelfPlanAndSendFunctions, } from "@solana/kit/program-client-core";
|
|
3
3
|
import { getAssetCodec } from "../accounts/index.js";
|
|
4
|
-
import {
|
|
4
|
+
import { getInitializeInstruction, getRemoveOwnershipInstruction, getSetLockStateInstruction, getTransferOwnershipInstruction, getVerifyAssetInstruction, parseInitializeInstruction, parseRemoveOwnershipInstruction, parseSetLockStateInstruction, parseTransferOwnershipInstruction, parseVerifyAssetInstruction, } from "../instructions/index.js";
|
|
5
5
|
export const PHYGITAL_TOKEN_PROGRAM_ADDRESS = "DuPpckdjjgVAnYok2aTMAt264ZPBXqq3JSazJjCUzTJQ";
|
|
6
6
|
export var PhygitalTokenAccount;
|
|
7
7
|
(function (PhygitalTokenAccount) {
|
|
@@ -16,17 +16,14 @@ export function identifyPhygitalTokenAccount(account) {
|
|
|
16
16
|
}
|
|
17
17
|
export var PhygitalTokenInstruction;
|
|
18
18
|
(function (PhygitalTokenInstruction) {
|
|
19
|
-
PhygitalTokenInstruction[PhygitalTokenInstruction["
|
|
20
|
-
PhygitalTokenInstruction[PhygitalTokenInstruction["
|
|
21
|
-
PhygitalTokenInstruction[PhygitalTokenInstruction["
|
|
22
|
-
PhygitalTokenInstruction[PhygitalTokenInstruction["
|
|
19
|
+
PhygitalTokenInstruction[PhygitalTokenInstruction["Initialize"] = 0] = "Initialize";
|
|
20
|
+
PhygitalTokenInstruction[PhygitalTokenInstruction["RemoveOwnership"] = 1] = "RemoveOwnership";
|
|
21
|
+
PhygitalTokenInstruction[PhygitalTokenInstruction["SetLockState"] = 2] = "SetLockState";
|
|
22
|
+
PhygitalTokenInstruction[PhygitalTokenInstruction["TransferOwnership"] = 3] = "TransferOwnership";
|
|
23
23
|
PhygitalTokenInstruction[PhygitalTokenInstruction["VerifyAsset"] = 4] = "VerifyAsset";
|
|
24
24
|
})(PhygitalTokenInstruction || (PhygitalTokenInstruction = {}));
|
|
25
25
|
export function identifyPhygitalTokenInstruction(instruction) {
|
|
26
26
|
const data = "data" in instruction ? instruction.data : instruction;
|
|
27
|
-
if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([233, 126, 160, 184, 235, 206, 31, 119])), 0)) {
|
|
28
|
-
return PhygitalTokenInstruction.ExecuteTransfer;
|
|
29
|
-
}
|
|
30
27
|
if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([175, 175, 109, 31, 13, 152, 155, 237])), 0)) {
|
|
31
28
|
return PhygitalTokenInstruction.Initialize;
|
|
32
29
|
}
|
|
@@ -36,6 +33,9 @@ export function identifyPhygitalTokenInstruction(instruction) {
|
|
|
36
33
|
if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([16, 40, 80, 140, 163, 156, 68, 120])), 0)) {
|
|
37
34
|
return PhygitalTokenInstruction.SetLockState;
|
|
38
35
|
}
|
|
36
|
+
if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([65, 177, 215, 73, 53, 45, 99, 47])), 0)) {
|
|
37
|
+
return PhygitalTokenInstruction.TransferOwnership;
|
|
38
|
+
}
|
|
39
39
|
if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([136, 51, 110, 228, 129, 94, 141, 179])), 0)) {
|
|
40
40
|
return PhygitalTokenInstruction.VerifyAsset;
|
|
41
41
|
}
|
|
@@ -44,13 +44,6 @@ export function identifyPhygitalTokenInstruction(instruction) {
|
|
|
44
44
|
export function parsePhygitalTokenInstruction(instruction) {
|
|
45
45
|
const instructionType = identifyPhygitalTokenInstruction(instruction);
|
|
46
46
|
switch (instructionType) {
|
|
47
|
-
case PhygitalTokenInstruction.ExecuteTransfer: {
|
|
48
|
-
assertIsInstructionWithAccounts(instruction);
|
|
49
|
-
return {
|
|
50
|
-
instructionType: PhygitalTokenInstruction.ExecuteTransfer,
|
|
51
|
-
...parseExecuteTransferInstruction(instruction),
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
47
|
case PhygitalTokenInstruction.Initialize: {
|
|
55
48
|
assertIsInstructionWithAccounts(instruction);
|
|
56
49
|
return {
|
|
@@ -72,6 +65,13 @@ export function parsePhygitalTokenInstruction(instruction) {
|
|
|
72
65
|
...parseSetLockStateInstruction(instruction),
|
|
73
66
|
};
|
|
74
67
|
}
|
|
68
|
+
case PhygitalTokenInstruction.TransferOwnership: {
|
|
69
|
+
assertIsInstructionWithAccounts(instruction);
|
|
70
|
+
return {
|
|
71
|
+
instructionType: PhygitalTokenInstruction.TransferOwnership,
|
|
72
|
+
...parseTransferOwnershipInstruction(instruction),
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
75
|
case PhygitalTokenInstruction.VerifyAsset: {
|
|
76
76
|
assertIsInstructionWithAccounts(instruction);
|
|
77
77
|
return {
|
|
@@ -92,10 +92,10 @@ export function phygitalTokenProgram() {
|
|
|
92
92
|
phygitalToken: {
|
|
93
93
|
accounts: { asset: addSelfFetchFunctions(client, getAssetCodec()) },
|
|
94
94
|
instructions: {
|
|
95
|
-
executeTransfer: (input) => addSelfPlanAndSendFunctions(client, getExecuteTransferInstruction(input)),
|
|
96
95
|
initialize: (input) => addSelfPlanAndSendFunctions(client, getInitializeInstruction(input)),
|
|
97
96
|
removeOwnership: (input) => addSelfPlanAndSendFunctions(client, getRemoveOwnershipInstruction(input)),
|
|
98
97
|
setLockState: (input) => addSelfPlanAndSendFunctions(client, getSetLockStateInstruction(input)),
|
|
98
|
+
transferOwnership: (input) => addSelfPlanAndSendFunctions(client, getTransferOwnershipInstruction(input)),
|
|
99
99
|
verifyAsset: (input) => addSelfPlanAndSendFunctions(client, getVerifyAssetInstruction(input)),
|
|
100
100
|
},
|
|
101
101
|
identifyAccount: identifyPhygitalTokenAccount,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"phygitalToken.js","sourceRoot":"","sources":["../../../src/generated/programs/phygitalToken.ts"],"names":[],"mappings":"AAQA,OAAO,EACL,+BAA+B,EAC/B,aAAa,EACb,YAAY,EACZ,cAAc,EACd,eAAe,EACf,yDAAyD,EACzD,6DAA6D,EAC7D,4DAA4D,EAC5D,WAAW,GAWZ,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,qBAAqB,EACrB,2BAA2B,GAG5B,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,aAAa,EAA8B,MAAM,sBAAsB,CAAC;AACjF,OAAO,EACL,
|
|
1
|
+
{"version":3,"file":"phygitalToken.js","sourceRoot":"","sources":["../../../src/generated/programs/phygitalToken.ts"],"names":[],"mappings":"AAQA,OAAO,EACL,+BAA+B,EAC/B,aAAa,EACb,YAAY,EACZ,cAAc,EACd,eAAe,EACf,yDAAyD,EACzD,6DAA6D,EAC7D,4DAA4D,EAC5D,WAAW,GAWZ,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,qBAAqB,EACrB,2BAA2B,GAG5B,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,aAAa,EAA8B,MAAM,sBAAsB,CAAC;AACjF,OAAO,EACL,wBAAwB,EACxB,6BAA6B,EAC7B,0BAA0B,EAC1B,+BAA+B,EAC/B,yBAAyB,EACzB,0BAA0B,EAC1B,+BAA+B,EAC/B,4BAA4B,EAC5B,iCAAiC,EACjC,2BAA2B,GAW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IACL,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type Address, type Instruction, type Rpc, type SolanaRpcApi } from "@solana/kit";
|
|
1
|
+
import { type Address, type Instruction, type Rpc, type SolanaRpcApi, type TransactionSigner } from "@solana/kit";
|
|
2
2
|
import { type AuthenticationResponseJSON } from "../utils/passkey/webauthn.js";
|
|
3
3
|
import { type Secp256r1VerifyEntry } from "../utils/passkey/secp256r1.js";
|
|
4
4
|
export type TransferSession = {
|
|
@@ -13,5 +13,5 @@ export declare function beginTransfer(input: {
|
|
|
13
13
|
asset: Address;
|
|
14
14
|
}): Promise<TransferSession>;
|
|
15
15
|
export declare function authenticatePasskeyForTransfer(session: TransferSession): Promise<AuthenticationResponseJSON>;
|
|
16
|
-
export declare function completeTransfer(session: TransferSession, response: AuthenticationResponseJSON, recipient:
|
|
16
|
+
export declare function completeTransfer(session: TransferSession, response: AuthenticationResponseJSON, recipient: TransactionSigner, existingSecp256r1VerifyInputs?: Secp256r1VerifyEntry[]): Promise<Instruction[]>;
|
|
17
17
|
//# sourceMappingURL=transfer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transfer.d.ts","sourceRoot":"","sources":["../../src/instructions/transfer.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,WAAW,EAChB,KAAK,GAAG,EACR,KAAK,YAAY,
|
|
1
|
+
{"version":3,"file":"transfer.d.ts","sourceRoot":"","sources":["../../src/instructions/transfer.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,WAAW,EAChB,KAAK,GAAG,EACR,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACvB,MAAM,aAAa,CAAC;AACrB,OAAO,EAIL,KAAK,0BAA0B,EAChC,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAGL,KAAK,oBAAoB,EAC1B,MAAM,+BAA+B,CAAC;AAKvC,MAAM,MAAM,eAAe,GAAG;IAC5B,GAAG,EAAE,GAAG,CAAC,YAAY,CAAC,CAAC;IACvB,KAAK,EAAE,OAAO,CAAC;IACf,QAAQ,EAAE,UAAU,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,UAAU,CAAC;CACvB,CAAC;AAQF,wBAAsB,aAAa,CAAC,KAAK,EAAE;IACzC,GAAG,EAAE,GAAG,CAAC,YAAY,CAAC,CAAC;IACvB,KAAK,EAAE,OAAO,CAAC;CAChB,GAAG,OAAO,CAAC,eAAe,CAAC,CAc3B;AAGD,wBAAsB,8BAA8B,CAClD,OAAO,EAAE,eAAe,GACvB,OAAO,CAAC,0BAA0B,CAAC,CAMrC;AAMD,wBAAsB,gBAAgB,CACpC,OAAO,EAAE,eAAe,EACxB,QAAQ,EAAE,0BAA0B,EACpC,SAAS,EAAE,iBAAiB,EAC5B,6BAA6B,CAAC,EAAE,oBAAoB,EAAE,GACrD,OAAO,CAAC,WAAW,EAAE,CAAC,CAoBxB"}
|
|
@@ -2,7 +2,7 @@ import {} from "@solana/kit";
|
|
|
2
2
|
import { bufferToBase64URLString, authenticateWithWebauthn, nfcWebAuthnRequestOptions, } from "../utils/passkey/webauthn.js";
|
|
3
3
|
import { buildSecp256r1VerifyInstructionFromWebAuthnResponse, buildTransferChallenge, } from "../utils/passkey/secp256r1.js";
|
|
4
4
|
import { getLatestSlotHash } from "../utils/slotHash.js";
|
|
5
|
-
import {
|
|
5
|
+
import { getTransferOwnershipInstruction } from "../generated/index.js";
|
|
6
6
|
import { parseSecp256r1Pubkey } from "./initialize.js";
|
|
7
7
|
export async function beginTransfer(input) {
|
|
8
8
|
const { slotHash, slotNumber } = await getLatestSlotHash(input.rpc);
|
|
@@ -27,7 +27,7 @@ export async function completeTransfer(session, response, recipient, existingSec
|
|
|
27
27
|
secp256r1PublicKey: parseSecp256r1Pubkey(response.id),
|
|
28
28
|
existingSecp256r1VerifyInputs,
|
|
29
29
|
});
|
|
30
|
-
const
|
|
30
|
+
const transferOwnership = getTransferOwnershipInstruction({
|
|
31
31
|
recipient,
|
|
32
32
|
asset: session.asset,
|
|
33
33
|
slotNumber: session.slotNumber,
|
|
@@ -37,6 +37,6 @@ export async function completeTransfer(session, response, recipient, existingSec
|
|
|
37
37
|
clientDataJson,
|
|
38
38
|
},
|
|
39
39
|
});
|
|
40
|
-
return [secp256r1Verify,
|
|
40
|
+
return [secp256r1Verify, transferOwnership];
|
|
41
41
|
}
|
|
42
42
|
//# sourceMappingURL=transfer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transfer.js","sourceRoot":"","sources":["../../src/instructions/transfer.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"transfer.js","sourceRoot":"","sources":["../../src/instructions/transfer.ts"],"names":[],"mappings":"AAAA,OAAO,EAMN,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,uBAAuB,EACvB,wBAAwB,EACxB,yBAAyB,GAE1B,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,mDAAmD,EACnD,sBAAsB,GAEvB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,+BAA+B,EAAE,MAAM,uBAAuB,CAAC;AACxE,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAgBvD,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,KAGnC;IACC,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,GAAG,MAAM,iBAAiB,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACpE,MAAM,SAAS,GAAG,MAAM,sBAAsB,CAAC;QAC7C,KAAK,EAAE,KAAK,CAAC,KAAK;QAClB,QAAQ;KACT,CAAC,CAAC;IAEH,OAAO;QACL,GAAG,EAAE,KAAK,CAAC,GAAG;QACd,KAAK,EAAE,KAAK,CAAC,KAAK;QAClB,QAAQ;QACR,UAA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