Connect Brand & Utility Provider

{
    requesterAddress: string, 
    issuerAddress: string,
    type: "sst"| "aat", 
    scope: "wallet" | "nft",
    label: "resell"|"repair"|..., 
    redirectTo: string 
    filter?: { 
	    serialNumber: string;
	  },
	  refresh?: { 
	    previousToken: string;
	  };
  } 

Parameter

Description

requesterAddress

Address of the requester. You must sign the payload with this address.

issuerAddress

Address of the brand that issued the digital passport.

type

Type of return you want:

  • sst
  • aat

scope

⚠️ For aat type only → Scope of the AAT.

  • wallet
  • nft

label

Information on your actions, useful to help a brand to display a better UX:

  • resell
  • repair

redirectTo

URL the brand connect should redirect to (need to include http(s)://).

filter

Filter used to display specific digital passports in the user's wallet.

refresh

Field used to refresh an SST. This provides the SST in previousToken.

  1. This payload needs to be converted to base64 then signed with the wallet specified in requesterAddress.
  2. You must end up with a payload that looks like this: ”base64payload”+.+”signedPayload”
  3. A redirection to the brand website is operated (e.g https://app.arianee.com), and passes the previous payload in the brandConnectRequest query param.
  4. The brand website will display the appropriate user interface to allow the user to choose the digital passport they want to sell\repair.
  5. After that, the brand will redirect to the URL specified in redirectTo with the signed payload in transferPermit query param.

Get the SST from the query params and you can get the digital passport content like this:

const core = Core.fromWallet(wallet as any);
const serviceProvider = new ServiceProvider(core);
// if AAT :
wallet.smartAsset.getFromArianeeAccessToken(aat)

// if SST :
const nft = await serviceProvider.getSmartAssetFromSST({sst:transferPermit});
// if you want to transfer the DPP :
const tx = await serviceProvider.transferSmartAsset({sst:transferPermit, to:receiverAddress})
await tx.wait();
console.log('transfer success')