Skip to content

Commit

Permalink
added styles parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
H34D committed May 25, 2023
1 parent 72c167c commit 2f08af5
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 14 deletions.
20 changes: 15 additions & 5 deletions src/identity/create.ts
Expand Up @@ -89,13 +89,15 @@ export const createIdentity = async (masa: Masa): Promise<BaseResult> => {
* @param soulNameLength
* @param duration
* @param paymentMethod
* @param style
*/
export const purchaseIdentityWithSoulName = async (
masa: Masa,
soulName: string,
soulNameLength: number,
duration: number,
paymentMethod: PaymentMethod
paymentMethod: PaymentMethod,
style?: string
): Promise<{ identityId?: string | BigNumber } & CreateSoulNameResult> => {
const result: CreateSoulNameResult = {
success: false,
Expand All @@ -112,7 +114,8 @@ export const purchaseIdentityWithSoulName = async (
const storeMetadataResponse = await masa.client.soulName.store(
`${soulName}${extension}`,
await masa.config.signer.getAddress(),
duration
duration,
style
);

if (storeMetadataResponse) {
Expand Down Expand Up @@ -201,13 +204,19 @@ export const purchaseIdentityWithSoulName = async (
* @param paymentMethod
* @param soulName
* @param duration
* @param style
*/
export const createIdentityWithSoulName = async (
masa: Masa,
paymentMethod: PaymentMethod,
soulName: string,
duration: number
): Promise<{ identityId?: string | BigNumber } & CreateSoulNameResult> => {
duration: number,
style?: string
): Promise<
{
identityId?: string | BigNumber;
} & CreateSoulNameResult
> => {
const result: CreateSoulNameResult = {
success: false,
errorCode: SoulNameErrorCodes.UnknownError,
Expand Down Expand Up @@ -255,7 +264,8 @@ export const createIdentityWithSoulName = async (
soulName,
length,
duration,
paymentMethod
paymentMethod,
style
);
} else {
result.message = Messages.NotLoggedIn();
Expand Down
12 changes: 10 additions & 2 deletions src/identity/identity.ts
Expand Up @@ -19,8 +19,16 @@ export class MasaIdentity extends MasaLinkable<SoulboundIdentity> {
createWithSoulName = (
paymentMethod: PaymentMethod,
soulName: string,
duration: number
) => createIdentityWithSoulName(this.masa, paymentMethod, soulName, duration);
duration: number,
style?: string
) =>
createIdentityWithSoulName(
this.masa,
paymentMethod,
soulName,
duration,
style
);
load = (address?: string) => loadIdentityByAddress(this.masa, address);
burn = () => burnIdentity(this.masa);
show = (address?: string) => showIdentity(this.masa, address);
Expand Down
12 changes: 8 additions & 4 deletions src/soul-name/create.ts
Expand Up @@ -16,7 +16,8 @@ const purchaseSoulName = async (
soulName: string,
soulNameLength: number,
duration: number,
receiver?: string
receiver?: string,
style?: string
): Promise<CreateSoulNameResult> => {
const result: CreateSoulNameResult = {
success: false,
Expand All @@ -38,7 +39,8 @@ const purchaseSoulName = async (
| undefined = await masa.client.soulName.store(
`${soulName}${extension}`,
receiver,
duration
duration,
style
);

if (storeMetadataResponse) {
Expand Down Expand Up @@ -112,7 +114,8 @@ export const createSoulName = async (
paymentMethod: PaymentMethod,
soulName: string,
duration: number,
receiver?: string
receiver?: string,
style?: string
): Promise<CreateSoulNameResult> => {
const result: CreateSoulNameResult = {
success: false,
Expand Down Expand Up @@ -157,7 +160,8 @@ export const createSoulName = async (
soulName,
length,
duration,
receiver
receiver,
style
);
} else {
result.message = Messages.NotLoggedIn();
Expand Down
14 changes: 12 additions & 2 deletions src/soul-name/soul-name.ts
Expand Up @@ -62,13 +62,23 @@ export class MasaSoulName extends MasaBase {
* @param soulName
* @param duration
* @param receiver
* @param style
*/
create = (
paymentMethod: PaymentMethod = "ETH",
soulName: string,
duration: number,
receiver?: string
) => createSoulName(this.masa, paymentMethod, soulName, duration, receiver);
receiver?: string,
style?: string
) =>
createSoulName(
this.masa,
paymentMethod,
soulName,
duration,
receiver,
style
);

/**
*
Expand Down
6 changes: 5 additions & 1 deletion src/utils/clients/masa-client.ts
Expand Up @@ -213,11 +213,13 @@ export class MasaClient extends MasaBase {
* @param soulName
* @param receiver
* @param duration
* @param style
*/
store: async (
soulName: string,
receiver: string,
duration: number
duration: number,
style?: string
): Promise<
SoulNameMetadataStoreResult | SoulNameResultBase | undefined
> => {
Expand All @@ -229,13 +231,15 @@ export class MasaClient extends MasaBase {
receiver: string;
duration: number;
network: NetworkName;
style?: string;
},
SoulNameMetadataStoreResult | SoulNameResultBase
>("/soul-name/store", {
soulName,
receiver,
duration,
network: this.masa.config.networkName,
style,
});
},
};
Expand Down

0 comments on commit 2f08af5

Please sign in to comment.